Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
label: t("types.edit.form_configuration.add_query_group"),
tag: :button,
content_arguments: {
data: { action: "click->admin--type-form-configuration--main#addQueryGroup" }
data: { action: "click->admin--type-form-configuration--main#addQueryGroup",
test_selector: "admin--type-form-configuration--add-query-group" }
}
) do |item|
item.with_leading_visual_icon(icon: :table)
Expand Down
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
4 changes: 2 additions & 2 deletions spec/support/components/admin/type_configuration_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TypeConfigurationForm
include Rails.application.routes.url_helpers

def add_button_dropdown
page.find(:test_id, "type-form-configuration-add-button", text: /\A#{Regexp.escape(I18n.t(:button_add))}\z/)
page.find_test_selector("type-form-configuration-add-button")
end

def reset_button
Expand Down Expand Up @@ -127,7 +127,7 @@ 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")
page.find_test_selector("admin--type-form-configuration--add-query-group").click

modal = ::Components::WorkPackages::TableConfigurationModal.new
expect(page).to have_css(".wp-table--configuration-modal", wait: 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(container, project = nil)
end

def table_container
container.first(".work-package-table", wait: 10)
container.find("table.work-package-table", wait: 10)
end

def click_reference_inline_create
Expand Down
Loading