FEATURE: Add dropdown to filter by selected in edit nav menu modal (#22251)

What does this change do?

This change adds a dropdown filter that allows a user to filter by
selected or unselected categories/tags in the edit navigation menu
modal.

For the categories modal, parent categories that do not match the
dropdown filter will be displayed as disabled since those parent
categories need to be displayed to maintain the hieracy of the child
child categories.
This commit is contained in:
Alan Guo Xiang Tan
2023-06-23 10:29:00 +08:00
committed by GitHub
parent 2dd9ac6277
commit 303fcf303c
12 changed files with 295 additions and 31 deletions

View File

@@ -60,6 +60,12 @@ module PageObjects
self
end
def has_checkbox?(category, disabled: false)
has_selector?(
".sidebar-categories-form-modal .sidebar-categories-form__category-row[data-category-id='#{category.id}'] .sidebar-categories-form__input#{disabled ? "[disabled]" : ""}",
)
end
end
end
end

View File

@@ -31,6 +31,38 @@ module PageObjects
click_button(I18n.t("js.sidebar.edit_navigation_modal_form.deselect_button_text"))
self
end
def filter_by_selected
dropdown_filter.select_row_by_name(
I18n.t("js.sidebar.edit_navigation_modal_form.filter_dropdown.selected"),
)
self
end
def filter_by_unselected
dropdown_filter.select_row_by_name(
I18n.t("js.sidebar.edit_navigation_modal_form.filter_dropdown.unselected"),
)
self
end
def filter_by_all
dropdown_filter.select_row_by_name(
I18n.t("js.sidebar.edit_navigation_modal_form.filter_dropdown.all"),
)
self
end
private
def dropdown_filter
PageObjects::Components::SelectKit.new(
".sidebar__edit-navigation-modal-form__filter-dropdown",
)
end
end
end
end