Skip to content

Commit

Permalink
(RST-6337) Updated dependencies including form builder and govuk-fron…
Browse files Browse the repository at this point in the history
…tend
  • Loading branch information
garytaylor committed Apr 11, 2024
1 parent 201821b commit 4ded271
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Expand Up @@ -14,8 +14,8 @@ GIT
PATH
remote: .
specs:
et_gds_design_system (5.4.3)
govuk_design_system_formbuilder (~> 4.0)
et_gds_design_system (5.5.0)
govuk_design_system_formbuilder (= 5.3.0)
rack
rails (>= 6.0)
typhoeus (~> 1.4)
Expand Down Expand Up @@ -137,7 +137,7 @@ GEM
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
govuk_design_system_formbuilder (4.1.1)
govuk_design_system_formbuilder (5.3.0)
actionview (>= 6.1)
activemodel (>= 6.1)
activesupport (>= 6.1)
Expand Down
2 changes: 1 addition & 1 deletion et_gds_design_system.gemspec
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|

spec.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']

spec.add_dependency 'govuk_design_system_formbuilder', '~> 4.0'
spec.add_dependency 'govuk_design_system_formbuilder', '5.3.0'
spec.add_dependency 'rails', '>= 6.0'
spec.add_dependency 'typhoeus', '~> 1.4'
spec.add_dependency 'webpacker', '~> 5.0'
Expand Down
1 change: 0 additions & 1 deletion index.js
@@ -1,7 +1,6 @@
import RevealOnRadioButton from "./app/javascript/components/RevealOnRadioButton";

const GOVUKFrontend = require("govuk-frontend/govuk/all")
require.context('govuk-frontend/govuk/assets/images', true)
require('turbolinks').start();
import './stylesheet'
import Components from './app/javascript/components'
Expand Down
8 changes: 8 additions & 0 deletions lib/et_gds_design_system/deprecator.rb
@@ -0,0 +1,8 @@
module EtGdsDesignSystem
class Deprecator
def deprecation_warning(deprecated_method_name, message, caller_backtrace = nil)
message = "#{deprecated_method_name} is deprecated and will be removed from et-gds-design-system | #{message}"
Kernel.warn message
end
end
end
21 changes: 11 additions & 10 deletions lib/et_gds_design_system/form/builder.rb
Expand Up @@ -3,6 +3,7 @@
require 'govuk_design_system_formbuilder'
require 'et_gds_design_system/elements/date'
require 'et_gds_design_system/elements/file_dropzone'
require 'et_gds_design_system/deprecator'
module EtGdsDesignSystem
module Form
class Builder < SimpleDelegator
Expand All @@ -20,7 +21,7 @@ def initialize(object_name, object, template, options)
def govuk_date_field(*args, label:, **kw_args)
super(*args, legend: label, **kw_args)
end
deprecate govuk_date_field: 'govuk_date_field is deprecated - please use date_field instead and read the documentation as it makes your code simpler'
deprecate govuk_date_field: 'govuk_date_field is deprecated - please use date_field instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def date_field(attribute, *_args, label: true, hint: true, optional: false, caption: {}, date_of_birth: false,
omit_day: false, form_group: {}, wildcards: false, maxlength_enabled: false, **kw_args, &block)
Expand All @@ -31,7 +32,7 @@ def date_field(attribute, *_args, label: true, hint: true, optional: false, capt
def govuk_collection_radio_buttons(*args, label:, **kw_args)
super(*args, legend: label, **kw_args)
end
deprecate govuk_collection_radio_buttons: 'govuk_collection_radio_buttons is deprecated - please use collection_radio_buttons instead and read the documentation as it makes your code simpler'
deprecate govuk_collection_radio_buttons: 'govuk_collection_radio_buttons is deprecated - please use collection_radio_buttons instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def collection_radio_buttons(attribute, collection = i18n_options_for(attribute), key_method = :first,
value_method = :last, *args, label: true, hint: true, optional: false, include_hidden: false, **kw_args)
Expand All @@ -44,12 +45,12 @@ def collection_select(attribute, collection = i18n_options_for(attribute), key_m
__getobj__.govuk_collection_select(attribute, collection, key_method, value_method, *args,
label: normalize_label(attribute, label, optional), hint: normalize_hint(attribute, hint), class: 'govuk-!-width-two-thirds', **kw_args)
end
deprecate govuk_collection_select: 'govuk_collection_select is deprecated - please use collection_select instead and read the documentation as it makes your code simpler'
deprecate govuk_collection_select: 'govuk_collection_select is deprecated - please use collection_select instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def govuk_collection_check_boxes(*args, label:, **kw_args)
super(*args, legend: label, **kw_args)
end
deprecate govuk_collection_check_boxes: 'govuk_collection_check_boxes is deprecated - please use collection_check_boxes instead and read the documentation as it makes your code simpler'
deprecate govuk_collection_check_boxes: 'govuk_collection_check_boxes is deprecated - please use collection_check_boxes instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def collection_check_boxes(attribute, collection = i18n_options_for(attribute), key_method = :first,
value_method = :last, *args, label: true, hint: true, optional: false, **kw_args)
Expand Down Expand Up @@ -86,7 +87,7 @@ def fieldset(*args, label:, **kw_args, &block)
def govuk_email_field(*args, **kw_args)
super(*args, spellcheck: false, **kw_args)
end
deprecate govuk_email_field: 'govuk_email_field is deprecated - please use email_field instead and read the documentation as it makes your code simpler'
deprecate govuk_email_field: 'govuk_email_field is deprecated - please use email_field instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def email_field(attribute, *args, label: true, hint: true, width: 'two-thirds', optional: false, **kw_args)
__getobj__.govuk_email_field(attribute, *args, label: normalize_label(attribute, label, optional),
Expand All @@ -96,7 +97,7 @@ def email_field(attribute, *args, label: true, hint: true, width: 'two-thirds',
def govuk_phone_field(*args, **kw_args)
super(*args, autocomplete: 'tel', **kw_args)
end
deprecate govuk_phone_field: 'govuk_phone_field is deprecated - please use phone_field instead and read the documentation as it makes your code simpler'
deprecate govuk_phone_field: 'govuk_phone_field is deprecated - please use phone_field instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def phone_field(attribute, *args, label: true, hint: true, width: 'two-thirds', optional: false, **kw_args)
__getobj__.govuk_phone_field(attribute, *args, label: normalize_label(attribute, label, optional),
Expand All @@ -108,7 +109,7 @@ def govuk_text_field(attribute, *args, label: true, hint: true, width: 'two-thir
optional), hint: normalize_hint(attribute,
hint), width: width, **kw_args)
end
deprecate govuk_text_field: 'govuk_text_field is deprecated - please use text_field instead and read the documentation as it makes your code simpler'
deprecate govuk_text_field: 'govuk_text_field is deprecated - please use text_field instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def text_field(attribute, *args, label: true, hint: true, width: 'two-thirds', optional: false, **kw_args)
__getobj__.govuk_text_field(attribute, *args, label: normalize_label(attribute, label, optional),
Expand All @@ -119,13 +120,13 @@ def text_area(attribute, *args, label: true, hint: true, optional: false, **kw_a
__getobj__.govuk_text_area(attribute, *args, label: normalize_label(attribute, label, optional),
hint: normalize_hint(attribute, hint), **kw_args)
end
deprecate govuk_text_area: 'govuk_text_area is deprecated - please use text_area instead and read the documentation as it makes your code simpler'
deprecate govuk_text_area: 'govuk_text_area is deprecated - please use text_area instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def file_field(attribute, *args, label: true, hint: true, optional: false, **kw_args)
__getobj__.govuk_file_field(attribute, *args, label: normalize_label(attribute, label, optional),
hint: normalize_hint(attribute, hint), **kw_args)
end
deprecate govuk_file_field: 'govuk_file_field is deprecated - please use file_field instead and read the documentation as it makes your code simpler'
deprecate govuk_file_field: 'govuk_file_field is deprecated - please use file_field instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def file_dropzone_field(attribute, *_args, label: true, hint: true, optional: false, upload_button: true,
remove_file_button: true, file_selected_text: true, caption: {}, form_group: {}, accepted_files: nil, type: 'text/csv', **kw_args)
Expand All @@ -148,7 +149,7 @@ def check_box(attribute, *args, label: true, hint: true, optional: false, **kw_a
__getobj__.govuk_check_box(attribute, *args, label: normalize_check_box_label(attribute, label, optional),
hint: normalize_hint(attribute, hint), **kw_args)
end
deprecate govuk_check_box: 'govuk_check_box is deprecated - please use check_box instead and read the documentation as it makes your code simpler'
deprecate govuk_check_box: 'govuk_check_box is deprecated - please use check_box instead and read the documentation as it makes your code simpler', deprecator: EtGdsDesignSystem::Deprecator

def submit(*args, **kw_args)
__getobj__.govuk_submit(*args, **kw_args)
Expand Down
2 changes: 1 addition & 1 deletion lib/et_gds_design_system/version.rb
@@ -1,3 +1,3 @@
module EtGdsDesignSystem
VERSION = '5.4.3'
VERSION = '5.5.0'
end
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -6,13 +6,13 @@
"@rails/webpacker": "^5.4.3",
"axios": "^0.25.0",
"dropzone": "^6.0.0-beta.2",
"govuk-frontend": "^4.7.0",
"govuk-frontend": "^5.3.0",
"prop-types": "^15.7.2",
"spark-md5": "^3.0.2",
"turbolinks": "^5.2.0",
"uuid": "^8.3.2"
},
"version": "5.4.1",
"version": "5.5.0",
"main": "index.js",
"devDependencies": {
"webpack-dev-server": "^3.10.3"
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/application.rb
Expand Up @@ -18,7 +18,7 @@
Bundler.require(*Rails.groups)
require "et_gds_design_system"
require "dotenv-rails"
Dotenv::Railtie.load
Dotenv::Rails.load
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -3374,10 +3374,10 @@ gopd@^1.0.1:
dependencies:
get-intrinsic "^1.1.3"

govuk-frontend@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-4.7.0.tgz#69950b6c2e69f435ffe9aa60d8dee232dac977de"
integrity sha512-0OsdCusF5qvLWwKziU8zqxiC0nq6WP0ZQuw51ymZ/1V0tO71oIKMlSLN2S9bm8RcEGSoidPt2A34gKxePrLjvg==
govuk-frontend@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-5.3.0.tgz#f9a2b405925beada90d074e17939f9d8ddcd256e"
integrity sha512-w6yaaDU3nqhVmWJFnOuJKRIUEB/2RrTFGzoA3z5n4cTG9h292EseT/q+JJA/LYTf5IYzeTIVAUbE5fFjUxefiQ==

graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
version "4.2.11"
Expand Down

0 comments on commit 4ded271

Please sign in to comment.