From 853bce2abc9e2c0f0fb37cf80461e3267da6e64c Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Thu, 8 Jun 2023 13:54:51 +0900 Subject: [PATCH] UX: Allow users to filter categories in edit sidebar categories modal (#21996) What does this change do? This change is a continuation of 2191b879c693f898bf7602b4f9ab6780b1eead67 and adds an input filter to the edit sidebar categories modal which the user can use to filter through the list of categories by the category's name. Note that if a child category is being shown, all of its ancestors will be shown even if the names of the ancestors do not match the given filter. This is to ensure that we continue to display the hierarchy of a child category even if the parent category does not match the filter. --- .../sidebar/categories-form-modal.hbs | 87 ++++++++++------- .../sidebar/categories-form-modal.js | 47 +++++++++ app/assets/stylesheets/common/base/modal.scss | 2 +- .../components/sidebar-categories-form.scss | 37 ++++++- .../desktop/components/_index.scss | 1 + .../components/sidebar-categories-form.scss | 5 + .../stylesheets/mobile/components/_index.scss | 1 + .../components/sidebar-categories-form.scss | 5 + config/locales/client.en.yml | 4 +- ...ting_sidebar_categories_navigation_spec.rb | 97 ++++++++++++++++--- .../modals/sidebar_edit_categories.rb | 53 ++++++++-- 11 files changed, 281 insertions(+), 58 deletions(-) create mode 100644 app/assets/stylesheets/desktop/components/sidebar-categories-form.scss create mode 100644 app/assets/stylesheets/mobile/components/sidebar-categories-form.scss diff --git a/app/assets/javascripts/discourse/app/components/sidebar/categories-form-modal.hbs b/app/assets/javascripts/discourse/app/components/sidebar/categories-form-modal.hbs index 8a158491509..a1052778657 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/categories-form-modal.hbs +++ b/app/assets/javascripts/discourse/app/components/sidebar/categories-form-modal.hbs @@ -3,44 +3,65 @@ @class="sidebar-categories-form-modal" >