From 31979cb3238a9993bd9834ff3cf4099f43257816 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 3 Aug 2020 15:09:44 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../filtered_search_bar/constants.js | 2 + .../filtered_search_bar_root.vue | 17 ++ .../tokens/label_token.vue | 128 +++++++++++++ app/assets/stylesheets/framework/buttons.scss | 2 - app/assets/stylesheets/framework/images.scss | 8 + app/assets/stylesheets/pages/projects.scss | 2 +- app/assets/stylesheets/pages/tree.scss | 6 - app/finders/todos_finder.rb | 10 +- app/graphql/resolvers/todo_resolver.rb | 16 +- .../types/alert_management/alert_type.rb | 6 + app/helpers/icons_helper.rb | 6 +- app/helpers/todos_helper.rb | 3 +- app/views/projects/_home_panel.html.haml | 2 +- .../unreleased/graphql-get-alert-todo.yml | 5 + doc/administration/auth/ldap/index.md | 2 +- .../reference_architectures/index.md | 85 +-------- .../graphql/reference/gitlab_schema.graphql | 55 ++++++ doc/api/graphql/reference/gitlab_schema.json | 161 +++++++++++++++++ .../multi_version_compatibility.md | 99 ++++++++++ doc/user/group/index.md | 2 +- doc/user/group/saml_sso/index.md | 2 +- doc/user/permissions.md | 2 +- locale/gitlab.pot | 12 ++ package.json | 2 +- spec/finders/todos_finder_spec.rb | 24 ++- .../filtered_search_bar_root_spec.js | 39 +++- .../filtered_search_bar/mock_data.js | 23 ++- .../tokens/label_token_spec.js | 171 ++++++++++++++++++ spec/graphql/resolvers/todo_resolver_spec.rb | 14 +- .../types/alert_management/alert_type_spec.rb | 1 + spec/helpers/icons_helper_spec.rb | 7 +- .../alert_management/alert/todos_spec.rb | 51 ++++++ yarn.lock | 8 +- 33 files changed, 854 insertions(+), 119 deletions(-) create mode 100644 app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/label_token.vue create mode 100644 changelogs/unreleased/graphql-get-alert-todo.yml create mode 100644 spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js create mode 100644 spec/requests/api/graphql/project/alert_management/alert/todos_spec.rb diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js index 6665a5754b3..59401c34c48 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js @@ -1,5 +1,7 @@ export const ANY_AUTHOR = 'Any'; +export const NO_LABEL = 'No label'; + export const DEBOUNCE_DELAY = 200; export const SortDirection = { diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue index 04090213218..aa96f33bbc1 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue @@ -184,6 +184,21 @@ export default { this.recentSearches = resultantSearches; }); }, + /** + * When user hits Enter/Return key while typing tokens, we emit `onFilter` + * event immediately so at that time, we don't want to keep tokens dropdown + * visible on UI so this is essentially a hack which allows us to do that + * until `GlFilteredSearch` natively supports this. + * See this discussion https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36421#note_385729546 + */ + blurSearchInput() { + const searchInputEl = this.$refs.filteredSearchInput.$el.querySelector( + '.gl-filtered-search-token-segment-input', + ); + if (searchInputEl) { + searchInputEl.blur(); + } + }, handleSortOptionClick(sortBy) { this.selectedSortOption = sortBy; this.$emit('onSort', sortBy.sortDirection[this.selectedSortDirection]); @@ -217,6 +232,7 @@ export default { // https://gitlab.com/gitlab-org/gitlab-foss/issues/30821 }); } + this.blurSearchInput(); this.$emit('onFilter', filters); }, }, @@ -226,6 +242,7 @@ export default {