From 5a991fa30681db29222f46b1c7cebc8ac0215d66 Mon Sep 17 00:00:00 2001 From: dleadbetter Date: Tue, 3 Dec 2024 14:32:03 -0500 Subject: [PATCH] BASIRA #261 - Splitting value_lists "url_database_value" into "authorized_vocabulary_url" and "database_value" fields --- app/models/value_list.rb | 2 +- app/serializers/value_lists_serializer.rb | 8 ++++---- .../airtable_importer/models/value_list.rb | 2 +- client/src/components/ValueListModal.js | 17 ++++++++++++----- client/src/i18n/en.json | 5 +++-- client/src/transforms/ValueList.js | 3 ++- ...855_rename_value_lists_url_database_value.rb | 5 +++++ ...1203181033_add_value_lists_database_value.rb | 5 +++++ db/schema.rb | 5 +++-- 9 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20241203180855_rename_value_lists_url_database_value.rb create mode 100644 db/migrate/20241203181033_add_value_lists_database_value.rb diff --git a/app/models/value_list.rb b/app/models/value_list.rb index c2e72ae..419403d 100644 --- a/app/models/value_list.rb +++ b/app/models/value_list.rb @@ -6,7 +6,7 @@ class ValueList < ApplicationRecord has_many :qualifications # Resource params - allow_params :authorized_vocabulary, :comment, :object, :group, :human_name, :url_database_value + allow_params :authorized_vocabulary, :comment, :object, :group, :human_name, :authorized_vocabulary_url, :database_value # Scopes scope :entity_description, -> { where(object: 'Action', group: 'Characteristic') } diff --git a/app/serializers/value_lists_serializer.rb b/app/serializers/value_lists_serializer.rb index bfc5eab..1711588 100644 --- a/app/serializers/value_lists_serializer.rb +++ b/app/serializers/value_lists_serializer.rb @@ -1,7 +1,7 @@ class ValueListsSerializer < BaseSerializer - index_attributes :id, :object, :group, :human_name, :url_database_value, :authorized_vocabulary, - :comment, :qualifications_count + index_attributes :id, :object, :group, :human_name, :authorized_vocabulary, :authorized_vocabulary_url, + :database_value, :comment, :qualifications_count - show_attributes :id, :object, :group, :human_name, :url_database_value, :authorized_vocabulary, - :comment, :qualifications_count + show_attributes :id, :object, :group, :human_name, :authorized_vocabulary, :authorized_vocabulary_url, + :database_value, :comment, :qualifications_count end diff --git a/app/services/airtable_importer/models/value_list.rb b/app/services/airtable_importer/models/value_list.rb index 36d8eab..10da116 100644 --- a/app/services/airtable_importer/models/value_list.rb +++ b/app/services/airtable_importer/models/value_list.rb @@ -22,7 +22,7 @@ def columns attribute_name: :authorized_vocabulary, airtable_name: 'Authorized vocabulary' }, { - attribute_name: :url_database_value, + attribute_name: :authorized_vocabulary_url, airtable_name: 'URL/Database value (if applicable)' }, { attribute_name: :comment, diff --git a/client/src/components/ValueListModal.js b/client/src/components/ValueListModal.js index 47f3161..89925fa 100644 --- a/client/src/components/ValueListModal.js +++ b/client/src/components/ValueListModal.js @@ -78,11 +78,18 @@ const ValueListModal = (props: Props) => { /> +