diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-29 03:14:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-29 03:14:30 +0300 |
commit | 3b11951c2439cae2a917f1ec736245f163be839e (patch) | |
tree | 82db5933590c99a034d677aef6b662329b5dd75f /app/assets/javascripts/packages_and_registries | |
parent | 8de745957a9c3c2a48ca47dd3bd69ee4db7424e0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/packages_and_registries')
-rw-r--r-- | app/assets/javascripts/packages_and_registries/package_registry/components/list/package_search.vue | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/app/assets/javascripts/packages_and_registries/package_registry/components/list/package_search.vue b/app/assets/javascripts/packages_and_registries/package_registry/components/list/package_search.vue index 3483d23e251..c27083261b5 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/components/list/package_search.vue +++ b/app/assets/javascripts/packages_and_registries/package_registry/components/list/package_search.vue @@ -9,6 +9,8 @@ import { FILTERED_SEARCH_TERM, FILTERED_SEARCH_TYPE, } from '~/packages_and_registries/shared/constants'; +import { LIST_KEY_CREATED_AT } from '~/packages_and_registries/package_registry/constants'; +import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import PackageTypeToken from './tokens/package_type_token.vue'; export default { @@ -22,13 +24,13 @@ export default { operators: OPERATOR_IS_ONLY, }, ], - components: { RegistrySearch, UrlSync }, + components: { RegistrySearch, UrlSync, LocalStorageSync }, inject: ['isGroupPage'], data() { return { filters: [], sorting: { - orderBy: 'name', + orderBy: LIST_KEY_CREATED_AT, sort: 'desc', }, mountRegistrySearch: false, @@ -94,19 +96,26 @@ export default { </script> <template> - <url-sync> - <template #default="{ updateQuery }"> - <registry-search - v-if="mountRegistrySearch" - :filter="filters" - :sorting="sorting" - :tokens="$options.tokens" - :sortable-fields="sortableFields" - @sorting:changed="updateSortingAndEmitUpdate" - @filter:changed="updateFilters" - @filter:submit="emitUpdate" - @query:changed="updateQuery" - /> - </template> - </url-sync> + <local-storage-sync + storage-key="package_registry_list_sorting" + :value="sorting" + as-json + @input="updateSorting" + > + <url-sync> + <template #default="{ updateQuery }"> + <registry-search + v-if="mountRegistrySearch" + :filter="filters" + :sorting="sorting" + :tokens="$options.tokens" + :sortable-fields="sortableFields" + @sorting:changed="updateSortingAndEmitUpdate" + @filter:changed="updateFilters" + @filter:submit="emitUpdate" + @query:changed="updateQuery" + /> + </template> + </url-sync> + </local-storage-sync> </template> |