Create view state files for `settings` and `admin` This is the first step of creating all view states in the directory `models/views/`. Release-Notes: skip Google-Bug-Id: b/244279450 Change-Id: I48472e41b3ff24e01d6a9e2b19e95dfb429e5186
diff --git a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts index 0e88b06..fe298702 100644 --- a/polygerrit-ui/app/elements/core/gr-router/gr-router.ts +++ b/polygerrit-ui/app/elements/core/gr-router/gr-router.ts
@@ -61,6 +61,7 @@ LATEST_ATTEMPT, stringToAttemptChoice, } from '../../../models/checks/checks-util'; +import {AdminChildView} from '../../../models/views/admin'; const RoutePattern = { ROOT: '/', @@ -1201,7 +1202,7 @@ handleGroupListOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-admin-group-list', + adminView: AdminChildView.GROUPS, offset: data.params[1] || 0, filter: null, openCreateModal: data.hash === 'create', @@ -1211,7 +1212,7 @@ handleGroupListFilterOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-admin-group-list', + adminView: AdminChildView.GROUPS, offset: data.params['offset'], filter: data.params['filter'], }); @@ -1220,7 +1221,7 @@ handleGroupListFilterRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-admin-group-list', + adminView: AdminChildView.GROUPS, filter: data.params['filter'] || null, }); } @@ -1338,7 +1339,7 @@ handleRepoListOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-repo-list', + adminView: AdminChildView.REPOS, offset: data.params[1] || 0, filter: null, openCreateModal: data.hash === 'create', @@ -1348,7 +1349,7 @@ handleRepoListFilterOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-repo-list', + adminView: AdminChildView.REPOS, offset: data.params['offset'], filter: data.params['filter'], }); @@ -1357,7 +1358,7 @@ handleRepoListFilterRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-repo-list', + adminView: AdminChildView.REPOS, filter: data.params['filter'] || null, }); } @@ -1381,7 +1382,7 @@ handlePluginListOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-plugin-list', + adminView: AdminChildView.PLUGINS, offset: data.params[1] || 0, filter: null, }); @@ -1390,7 +1391,7 @@ handlePluginListFilterOffsetRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-plugin-list', + adminView: AdminChildView.PLUGINS, offset: data.params['offset'], filter: data.params['filter'], }); @@ -1399,7 +1400,7 @@ handlePluginListFilterRoute(data: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-plugin-list', + adminView: AdminChildView.PLUGINS, filter: data.params['filter'] || null, }); } @@ -1407,7 +1408,7 @@ handlePluginListRoute(_: PageContextWithQueryMap) { this.setParams({ view: GerritView.ADMIN, - adminView: 'gr-plugin-list', + adminView: AdminChildView.PLUGINS, }); }