diff --git a/config/locales/en.yml b/config/locales/en.yml index 699cc7590dd8..c572f1d6d428 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1441,12 +1441,12 @@ en: edit: form_configuration: tab: "Form configuration" - label_group: "Group" - reset_to_defaults: "Reset to defaults" - add_attribute_group: "Add attribute group" - add_query_group: "Add table of related work packages" - delete_group: "Delete group" - remove_attribute: "Remove from group" + label_group: "Section" + reset_to_defaults: "Reset form" + add_attribute_group: "Section" + add_query_group: "Related work packages table" + delete_group: "Delete section" + remove_attribute: "Remove from section" drag_to_activate: "Drag fields from here to activate them" drag_to_reorder: "Drag to reorder" edit_query: "Edit query" @@ -1456,12 +1456,12 @@ en: no_inactive_attributes: "No inactive attributes" blankslate_title: "No groups yet" blankslate_description: "Add groups using the button above or drag attributes from the left panel." - group_actions: "Group actions" - rename_group: "Rename group" - confirm_delete_group: "Are you sure you want to delete this group? This action cannot be automatically reversed." - group_name_label: "Group name" + group_actions: "Section actions" + rename_group: "Rename section" + confirm_delete_group: "Are you sure you want to delete this section? This action cannot be automatically reversed." + group_name_label: "Section name" row_actions: "Row actions" - query_group_label: "Work packages table" + query_group_label: "Related work packages table" empty_group_hint: "Drag attributes here" invalid_attribute_groups: "The form configuration payload is invalid." invalid_query: "The embedded query configuration is invalid." diff --git a/spec/features/types/form_configuration_query_spec.rb b/spec/features/types/form_configuration_query_spec.rb index fc43620ce01c..744ae87f1ed4 100644 --- a/spec/features/types/form_configuration_query_spec.rb +++ b/spec/features/types/form_configuration_query_spec.rb @@ -97,7 +97,7 @@ form.expect_group("Empty test", "Empty test") end - it "can edit a query group by clicking the Work packages table link" do + it "can edit a query group by clicking the related work packages table link" do form.add_query_group("Link test", :children, expect: false) form.expect_group("Link test", "Link test") diff --git a/spec/features/types/form_configuration_spec.rb b/spec/features/types/form_configuration_spec.rb index 4d931dabc4b2..fb93b9075d07 100644 --- a/spec/features/types/form_configuration_spec.rb +++ b/spec/features/types/form_configuration_spec.rb @@ -156,7 +156,7 @@ def persisted_attribute_order(type, group_key) form.drag_and_drop(form.find_attribute_handle(:version), form.inactive_group) form.expect_inactive(:version) - # Rename group + # Rename section form.rename_group("Details", "Whatever") form.rename_group("People", "Cool Stuff") @@ -272,6 +272,10 @@ def persisted_attribute_order(type, group_key) initial_order = form.group_order form.add_button_dropdown.click + + expect(page).to have_text(I18n.t("types.edit.form_configuration.add_attribute_group")) + expect(page).to have_text(I18n.t("types.edit.form_configuration.add_query_group")) + click_on I18n.t("types.edit.form_configuration.add_attribute_group") expect(page.find_test_selector("type-form-configuration-group-name-input", wait: 10).value).to eq("") diff --git a/spec/support/components/admin/type_configuration_form.rb b/spec/support/components/admin/type_configuration_form.rb index 56fb2e1a7ed2..71aae9de6648 100644 --- a/spec/support/components/admin/type_configuration_form.rb +++ b/spec/support/components/admin/type_configuration_form.rb @@ -126,8 +126,7 @@ def drag_and_drop(handle, target) def add_query_group(name, relation_filter, expect: true) SeleniumHubWaiter.wait unless using_cuprite? - add_button_dropdown.click - click_on I18n.t("types.edit.form_configuration.add_query_group") + click_add_menu_item(I18n.t("types.edit.form_configuration.add_query_group")) modal = ::Components::WorkPackages::TableConfigurationModal.new expect(page).to have_css(".wp-table--configuration-modal", wait: 10) @@ -191,8 +190,7 @@ def edit_query_group_via_link(name) end def add_attribute_group(name, expect: true) - add_button_dropdown.click - click_on I18n.t("types.edit.form_configuration.add_attribute_group") + click_add_menu_item(I18n.t("types.edit.form_configuration.add_attribute_group")) fill_group_name(name) save_group @@ -343,6 +341,16 @@ def click_menu_action(open_menu_callback, label) end end + def click_add_menu_item(label) + menu_button = add_button_dropdown + menu_id = menu_button[:"aria-controls"] + menu_button.click + + page.find("##{menu_id}", visible: :all) + .first("[role='menuitem']", text: /\A#{Regexp.escape(label)}\z/, visible: :all) + .click + end + def save_group page.find_test_selector("type-form-configuration-group-save", wait: 10).click expect(page).to have_no_selector(page.test_selector("type-form-configuration-group-name-input"))