diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/assets/javascripts/import_projects/index.js | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/assets/javascripts/import_projects/index.js')
-rw-r--r-- | app/assets/javascripts/import_projects/index.js | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/app/assets/javascripts/import_projects/index.js b/app/assets/javascripts/import_projects/index.js index 68ba04aa9dd..79fbd58e355 100644 --- a/app/assets/javascripts/import_projects/index.js +++ b/app/assets/javascripts/import_projects/index.js @@ -2,28 +2,44 @@ import Vue from 'vue'; import Translate from '../vue_shared/translate'; import ImportProjectsTable from './components/import_projects_table.vue'; import { parseBoolean } from '../lib/utils/common_utils'; +import { queryToObject } from '../lib/utils/url_utility'; import createStore from './store'; Vue.use(Translate); export function initStoreFromElement(element) { const { - reposPath, - provider, + ciCdOnly, canSelectNamespace, + provider, + + reposPath, jobsPath, importPath, - ciCdOnly, + namespacesPath, + paginatable, } = element.dataset; + const params = queryToObject(document.location.search); + const page = parseInt(params.page ?? 1, 10); + return createStore({ - reposPath, - provider, - jobsPath, - importPath, - defaultTargetNamespace: gon.current_username, - ciCdOnly: parseBoolean(ciCdOnly), - canSelectNamespace: parseBoolean(canSelectNamespace), + initialState: { + defaultTargetNamespace: gon.current_username, + ciCdOnly: parseBoolean(ciCdOnly), + canSelectNamespace: parseBoolean(canSelectNamespace), + provider, + pageInfo: { + page, + }, + }, + endpoints: { + reposPath, + jobsPath, + importPath, + namespacesPath, + }, + hasPagination: parseBoolean(paginatable), }); } @@ -31,6 +47,7 @@ export function initPropsFromElement(element) { return { providerTitle: element.dataset.providerTitle, filterable: parseBoolean(element.dataset.filterable), + paginatable: parseBoolean(element.dataset.paginatable), }; } |