From 9dc53bd0bd9ac3e7597cd4da4360cef82735f81e Mon Sep 17 00:00:00 2001 From: Marthym Date: Sat, 13 Jan 2024 14:19:01 +0100 Subject: [PATCH] chore(seaside): #195 refactor security domain with pages and router --- seaside/src/App.vue | 4 +- .../src/{services => common}/model/Page.ts | 0 .../components/feedslist/FeedsList.vue | 2 +- .../components/profile/ProfileTab.vue | 4 +- .../src/configuration/services/FeedService.ts | 2 +- .../src/layout/components/sidenav/SideNav.vue | 4 +- .../components/sidenav/SideNavManagement.vue | 2 +- .../components/sidenav/SideNavUserInfo.vue | 4 +- seaside/src/router.ts | 38 ++---------------- .../components/CreateAccountComponent.vue | 4 +- .../src/{ => security}/pages/LoginPage.vue | 2 +- seaside/src/security/router/index.ts | 40 +++++++++++++++++++ seaside/src/security/services/UserService.ts | 2 +- .../user => security/store}/UserConstants.ts | 0 .../{store/user => security/store}/user.ts | 2 +- seaside/src/store.ts | 12 +++--- seaside/src/teams/pages/TeamsPage.vue | 2 +- seaside/src/teams/services/Teams.service.ts | 4 +- .../components/newslist/NewsList.vue | 2 +- 19 files changed, 69 insertions(+), 61 deletions(-) rename seaside/src/{services => common}/model/Page.ts (100%) rename seaside/src/{ => security}/pages/LoginPage.vue (97%) create mode 100644 seaside/src/security/router/index.ts rename seaside/src/{store/user => security/store}/UserConstants.ts (100%) rename seaside/src/{store/user => security/store}/user.ts (98%) diff --git a/seaside/src/App.vue b/seaside/src/App.vue index 5d17596c..92dcd78f 100644 --- a/seaside/src/App.vue +++ b/seaside/src/App.vue @@ -27,8 +27,8 @@ import { registerNotificationListener, unregisterNotificationListener } from '@/ import notificationService from '@/services/notification/NotificationService'; import { Store, useStore } from 'vuex'; import { UPDATE_MUTATION as STATS_UPDATE_MUTATION } from '@/techwatch/store/statistics/StatisticsConstants'; -import { HAS_ROLE_USER_GETTER } from '@/store/user/UserConstants'; -import { UserState } from '@/store/user/user'; +import { HAS_ROLE_USER_GETTER } from '@/security/store/UserConstants'; +import { UserState } from '@/security/store/user'; import { defineAsyncComponent } from 'vue'; const CreateAccountComponent = defineAsyncComponent(() => import('@/security/components/CreateAccountComponent.vue')); diff --git a/seaside/src/services/model/Page.ts b/seaside/src/common/model/Page.ts similarity index 100% rename from seaside/src/services/model/Page.ts rename to seaside/src/common/model/Page.ts diff --git a/seaside/src/configuration/components/feedslist/FeedsList.vue b/seaside/src/configuration/components/feedslist/FeedsList.vue index 77ee6b04..62bd189d 100644 --- a/seaside/src/configuration/components/feedslist/FeedsList.vue +++ b/seaside/src/configuration/components/feedslist/FeedsList.vue @@ -88,7 +88,7 @@ import { defineAsyncComponent } from 'vue'; import { AlertResponse, AlertType } from '@/common/components/alertdialog/AlertDialog.types'; import FeedActions from '@/configuration/components/feedslist/FeedActions.vue'; import { Store, useStore } from 'vuex'; -import { UserState } from '@/store/user/user'; +import { UserState } from '@/security/store/user'; import { NEWS_FILTER_FEED_MUTATION } from '@/common/model/store/NewsStore.type'; import { Router, useRouter } from 'vue-router'; diff --git a/seaside/src/configuration/components/profile/ProfileTab.vue b/seaside/src/configuration/components/profile/ProfileTab.vue index 9ee32459..0aedd1d8 100644 --- a/seaside/src/configuration/components/profile/ProfileTab.vue +++ b/seaside/src/configuration/components/profile/ProfileTab.vue @@ -45,10 +45,10 @@ import { Component, Vue } from 'vue-facing-decorator'; import { Store, useStore } from 'vuex'; import { MD5 } from 'md5-js-tools'; -import { UserState } from '@/store/user/user'; +import { UserState } from '@/security/store/user'; import ChangePasswordModal from '@/configuration/components/profile/ChangePasswordModal.vue'; import { userUpdate } from '@/security/services/UserService'; -import { UPDATE_MUTATION as USER_UPDATE_MUTATION } from '@/store/user/UserConstants'; +import { UPDATE_MUTATION as USER_UPDATE_MUTATION } from '@/security/store/UserConstants'; import notificationService from '@/services/notification/NotificationService'; import { User } from '@/security/model/User'; diff --git a/seaside/src/configuration/services/FeedService.ts b/seaside/src/configuration/services/FeedService.ts index d146a024..f9552fd9 100644 --- a/seaside/src/configuration/services/FeedService.ts +++ b/seaside/src/configuration/services/FeedService.ts @@ -1,7 +1,7 @@ import { map, switchMap, take } from 'rxjs/operators'; import { HttpStatusError } from '@/common/errors/HttpStatusError'; import { Feed } from '@/configuration/model/Feed.type'; -import { Page } from '@/services/model/Page'; +import { Page } from '@/common/model/Page'; import { from, Observable, of, throwError } from 'rxjs'; import rest from '@/common/services/RestWrapper'; import { OpPatch } from 'json-patch'; diff --git a/seaside/src/layout/components/sidenav/SideNav.vue b/seaside/src/layout/components/sidenav/SideNav.vue index 103c504c..b5a9d7a8 100644 --- a/seaside/src/layout/components/sidenav/SideNav.vue +++ b/seaside/src/layout/components/sidenav/SideNav.vue @@ -19,11 +19,11 @@ import {Component, Vue} from 'vue-facing-decorator'; import SideNavHeader from "./SideNavHeader.vue"; import SideNavManagement from './SideNavManagement.vue'; -import {LOGOUT_MUTATION} from "@/store/user/UserConstants"; +import {LOGOUT_MUTATION} from "@/security/store/UserConstants"; import {SidenavState} from "@/store/sidenav/sidenav"; import SideNavUserInfo from "@/layout/components/sidenav/SideNavUserInfo.vue"; import SideNavFilters from "@/layout/components/sidenav/SideNavFilters.vue"; -import {UserState} from "@/store/user/user"; +import {UserState} from "@/security/store/user"; import {useStore} from "vuex"; import {switchMap} from "rxjs/operators"; import {Router, useRouter} from "vue-router"; diff --git a/seaside/src/layout/components/sidenav/SideNavManagement.vue b/seaside/src/layout/components/sidenav/SideNavManagement.vue index ad477014..3ccc5f98 100644 --- a/seaside/src/layout/components/sidenav/SideNavManagement.vue +++ b/seaside/src/layout/components/sidenav/SideNavManagement.vue @@ -41,7 +41,7 @@