diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index 3967d117d3b..817140e8e89 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -4187,7 +4187,6 @@ RSpec/FeatureCategory: - 'spec/views/shared/_label_row.html.haml_spec.rb' - 'spec/views/shared/_milestones_sort_dropdown.html.haml_spec.rb' - 'spec/views/shared/gitlab_version/_security_patch_upgrade_alert.html.haml_spec.rb' - - 'spec/views/shared/groups/_dropdown.html.haml_spec.rb' - 'spec/views/shared/issuable/_sidebar.html.haml_spec.rb' - 'spec/views/shared/milestones/_issuable.html.haml_spec.rb' - 'spec/views/shared/milestones/_issuables.html.haml_spec.rb' diff --git a/app/assets/javascripts/admin/groups/components/filtered_search_and_sort.vue b/app/assets/javascripts/admin/groups/components/filtered_search_and_sort.vue new file mode 100644 index 00000000000..dbcc081461d --- /dev/null +++ b/app/assets/javascripts/admin/groups/components/filtered_search_and_sort.vue @@ -0,0 +1,102 @@ + + + diff --git a/app/assets/javascripts/admin/groups/constants.js b/app/assets/javascripts/admin/groups/constants.js new file mode 100644 index 00000000000..be10a8907eb --- /dev/null +++ b/app/assets/javascripts/admin/groups/constants.js @@ -0,0 +1,39 @@ +import { __ } from '~/locale'; + +export const FILTERED_SEARCH_NAMESPACE = 'admin-groups'; +export const FILTERED_SEARCH_TERM_KEY = 'name'; + +export const SORT_DIRECTION_ASC = 'asc'; +export const SORT_DIRECTION_DESC = 'desc'; + +const NAME = 'name'; +const CREATED = 'created'; +const LATEST_ACTIVITY = 'latest_activity'; +const STORAGE_SIZE = 'storage_size'; + +export const SORT_OPTION_NAME = { + text: __('Name'), + value: NAME, +}; + +export const SORT_OPTION_CREATED_DATE = { + text: __('Created date'), + value: CREATED, +}; + +export const SORT_OPTION_UPDATED_DATE = { + text: __('Updated date'), + value: LATEST_ACTIVITY, +}; + +export const SORT_OPTION_STORAGE_SIZE = { + text: __('Storage size'), + value: STORAGE_SIZE, +}; + +export const SORT_OPTIONS = [ + SORT_OPTION_NAME, + SORT_OPTION_CREATED_DATE, + SORT_OPTION_UPDATED_DATE, + SORT_OPTION_STORAGE_SIZE, +]; diff --git a/app/assets/javascripts/admin/groups/index.js b/app/assets/javascripts/admin/groups/index.js new file mode 100644 index 00000000000..1ceb105bdbf --- /dev/null +++ b/app/assets/javascripts/admin/groups/index.js @@ -0,0 +1,16 @@ +import Vue from 'vue'; +import FilteredSearchAndSort from './components/filtered_search_and_sort.vue'; + +export const initAdminGroupsFilteredSearchAndSort = () => { + const el = document.getElementById('js-admin-groups-filtered-search-and-sort'); + + if (!el) return false; + + return new Vue({ + el, + name: 'AdminGroupsFilteredSearchAndSort', + render(createElement) { + return createElement(FilteredSearchAndSort); + }, + }); +}; diff --git a/app/assets/javascripts/ci/runner/components/registration/gke_node_pool_group.vue b/app/assets/javascripts/ci/runner/components/registration/gke_node_pool_group.vue index 79c8528a8e5..8e7caf0a24b 100644 --- a/app/assets/javascripts/ci/runner/components/registration/gke_node_pool_group.vue +++ b/app/assets/javascripts/ci/runner/components/registration/gke_node_pool_group.vue @@ -199,7 +199,7 @@ export default { <name>_<type(optional)> diff --git a/app/assets/javascripts/merge_request_dashboard/components/app.vue b/app/assets/javascripts/merge_request_dashboard/components/app.vue index fb015556470..2eb3ffe5878 100644 --- a/app/assets/javascripts/merge_request_dashboard/components/app.vue +++ b/app/assets/javascripts/merge_request_dashboard/components/app.vue @@ -1,5 +1,6 @@ @@ -43,22 +50,24 @@ export default { +