Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion spec/features/types/form_configuration_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 5 additions & 1 deletion spec/features/types/form_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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("")
Expand Down
16 changes: 12 additions & 4 deletions spec/support/components/admin/type_configuration_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"))
Expand Down
Loading