From 3233ea0f60e19c861a4ebda8ed2e558e6de068c2 Mon Sep 17 00:00:00 2001 From: _Bastler Date: Sat, 4 Dec 2021 00:21:24 +0100 Subject: [PATCH] change view path --- src/app/app-routing.module.ts | 10 +++++----- src/app/pages/view/edit/edit.page.html | 2 +- src/app/pages/view/edit/edit.page.ts | 3 +-- src/app/pages/view/view.page.html | 2 +- src/app/pages/view/view.page.ts | 2 +- src/app/ui/viewmenu/viewmenu.ui.html | 4 ++-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3b476e5..a6c362d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -25,7 +25,7 @@ import { UiMain } from './ui/main/main.ui'; const routes: Routes = [ { path: '', component: UiMain, children: [ - { path: '', redirectTo: "/p/TOP", pathMatch: 'full' }, + { path: '', redirectTo: "/v/TOP", pathMatch: 'full' }, { path: 'login', component: PageLogin, canActivate: [ AnonymousGuard ] }, { path: 'search', component: PageSearch, canActivate: [ AuthenticatedGuard ] }, { path: 'moderation/comments', component: PageModerationComments, canActivate: [ AuthenticatedGuard ] }, @@ -40,10 +40,10 @@ const routes: Routes = [ { path: 'u/c/:username', component: PageUserComments, canActivate: [ AuthenticatedGuard ] }, { path: 'u/e/:username', component: PageUserEntries, canActivate: [ AuthenticatedGuard ] }, { path: 'unavailable', component: PageUnavailable }, - { path: 'p', component: PageViewEdit, canActivate: [ AuthenticatedGuard ] }, - { path: 'p/:name', component: PageView, canActivate: [ AuthenticatedGuard ] }, - { path: 'p/:name/edit', component: PageViewEdit, canActivate: [ AuthenticatedGuard ] }, - { path: 'p/:name/:username', component: PageView, canActivate: [ AuthenticatedGuard ] }, + { path: 'v', component: PageViewEdit, canActivate: [ AuthenticatedGuard ] }, + { path: 'v/:name', component: PageView, canActivate: [ AuthenticatedGuard ] }, + { path: 'v/:name/edit', component: PageViewEdit, canActivate: [ AuthenticatedGuard ] }, + { path: 'v/:name/:username', component: PageView, canActivate: [ AuthenticatedGuard ] }, { path: '**', component: PageNotFound, pathMatch: 'full', canActivate: [ AuthUpdateGuard ] }, ] }, diff --git a/src/app/pages/view/edit/edit.page.html b/src/app/pages/view/edit/edit.page.html index 8d259bd..b961851 100644 --- a/src/app/pages/view/edit/edit.page.html +++ b/src/app/pages/view/edit/edit.page.html @@ -69,7 +69,7 @@ - {{ 'views.goTo' | + {{ 'views.goTo' | i18n}} diff --git a/src/app/pages/view/edit/edit.page.ts b/src/app/pages/view/edit/edit.page.ts index 065966a..68c4da3 100644 --- a/src/app/pages/view/edit/edit.page.ts +++ b/src/app/pages/view/edit/edit.page.ts @@ -98,7 +98,6 @@ export class PageViewEdit implements OnInit, OnDestroy { this.view.tags = []; this.view.excludedTags = []; this.view.index = 99; - this.form.get("name").setValue(this.view.name); this.form.get("entryType").setValue(this.view.entryType); this.form.get("sorting").setValue(this.view.sorting); this.form.get("index").setValue(this.view.index); @@ -128,7 +127,7 @@ export class PageViewEdit implements OnInit, OnDestroy { this.snackBar.open(this.i18n.get('views.success', []), this.i18n.get("close", []), { duration: 3000 }); - this.router.navigateByUrl('/p/' + this.view.name); + this.router.navigateByUrl('/v/' + this.view.name); this.viewService.getViews(); }, (error) => { this.working = false; diff --git a/src/app/pages/view/view.page.html b/src/app/pages/view/view.page.html index d040f9b..82baf47 100644 --- a/src/app/pages/view/view.page.html +++ b/src/app/pages/view/view.page.html @@ -1,5 +1,5 @@
- + edit diff --git a/src/app/pages/view/view.page.ts b/src/app/pages/view/view.page.ts index eb98495..463f1b5 100644 --- a/src/app/pages/view/view.page.ts +++ b/src/app/pages/view/view.page.ts @@ -36,7 +36,7 @@ export class PageView implements OnInit, OnDestroy { this.entries.refresh(); } }, (error) => { - this.router.navigate([ '/p' ], { queryParams: { name: this.name }, queryParamsHandling: 'merge' }); + this.router.navigate([ '/v' ], { queryParams: { name: this.name }, queryParamsHandling: 'merge' }); }) }); this.boundFetch = this.fetch.bind(this); diff --git a/src/app/ui/viewmenu/viewmenu.ui.html b/src/app/ui/viewmenu/viewmenu.ui.html index f3ee191..c9bd3cd 100644 --- a/src/app/ui/viewmenu/viewmenu.ui.html +++ b/src/app/ui/viewmenu/viewmenu.ui.html @@ -1,12 +1,12 @@ - + {{'sorting.' + view.sorting + '.icon' | i18n}} {{'sorting.' + view.name | i18nEmpty}} - add