2021-12-21 09:02:03 +01:00
|
|
|
import { createRouter, createWebHistory, RouteLocation } from 'vue-router'
|
|
|
|
import {saveLastVisited} from '@/helpers/saveLastVisited'
|
|
|
|
import {store} from '@/store'
|
2018-09-06 19:46:09 +02:00
|
|
|
|
2022-01-05 11:05:44 +01:00
|
|
|
import HomeComponent from '../views/Home.vue'
|
|
|
|
import NotFoundComponent from '../views/404.vue'
|
|
|
|
import About from '../views/About.vue'
|
2018-09-08 22:27:13 +02:00
|
|
|
// User Handling
|
2022-01-05 11:05:44 +01:00
|
|
|
import LoginComponent from '../views/user/Login.vue'
|
|
|
|
import RegisterComponent from '../views/user/Register.vue'
|
|
|
|
import OpenIdAuth from '../views/user/OpenIdAuth.vue'
|
|
|
|
import DataExportDownload from '../views/user/DataExportDownload.vue'
|
2020-09-05 22:35:52 +02:00
|
|
|
// Tasks
|
2022-01-05 11:05:44 +01:00
|
|
|
import ShowTasksInRangeComponent from '../views/tasks/ShowTasksInRange.vue'
|
|
|
|
import LinkShareAuthComponent from '../views/sharing/LinkSharingAuth.vue'
|
|
|
|
import TaskDetailViewModal from '../views/tasks/TaskDetailViewModal.vue'
|
|
|
|
import TaskDetailView from '../views/tasks/TaskDetailView.vue'
|
|
|
|
import ListNamespaces from '../views/namespaces/ListNamespaces.vue'
|
2020-09-05 22:35:52 +02:00
|
|
|
// Team Handling
|
2022-01-05 11:05:44 +01:00
|
|
|
import ListTeamsComponent from '../views/teams/ListTeams.vue'
|
2020-09-05 22:35:52 +02:00
|
|
|
// Label Handling
|
2022-01-05 11:05:44 +01:00
|
|
|
import ListLabelsComponent from '../views/labels/ListLabels.vue'
|
|
|
|
import NewLabelComponent from '../views/labels/NewLabel.vue'
|
2020-09-05 22:35:52 +02:00
|
|
|
// Migration
|
2022-01-05 11:05:44 +01:00
|
|
|
import MigrationComponent from '../views/migrator/Migrate.vue'
|
|
|
|
import MigrateServiceComponent from '../views/migrator/MigrateService.vue'
|
2020-09-05 22:35:52 +02:00
|
|
|
// List Views
|
2022-01-05 11:05:44 +01:00
|
|
|
import ShowListComponent from '../views/list/ShowList.vue'
|
|
|
|
import Kanban from '../views/list/views/Kanban.vue'
|
|
|
|
import List from '../views/list/views/List.vue'
|
|
|
|
import Gantt from '../views/list/views/Gantt.vue'
|
|
|
|
import Table from '../views/list/views/Table.vue'
|
2021-01-30 17:17:04 +01:00
|
|
|
// List Settings
|
2022-01-05 11:05:44 +01:00
|
|
|
import ListSettingEdit from '../views/list/settings/edit.vue'
|
|
|
|
import ListSettingBackground from '../views/list/settings/background.vue'
|
|
|
|
import ListSettingDuplicate from '../views/list/settings/duplicate.vue'
|
|
|
|
import ListSettingShare from '../views/list/settings/share.vue'
|
|
|
|
import ListSettingDelete from '../views/list/settings/delete.vue'
|
|
|
|
import ListSettingArchive from '../views/list/settings/archive.vue'
|
2021-11-14 16:56:52 +01:00
|
|
|
|
2021-01-30 17:17:04 +01:00
|
|
|
// Namespace Settings
|
2022-01-05 11:05:44 +01:00
|
|
|
import NamespaceSettingEdit from '../views/namespaces/settings/edit.vue'
|
|
|
|
import NamespaceSettingShare from '../views/namespaces/settings/share.vue'
|
|
|
|
import NamespaceSettingArchive from '../views/namespaces/settings/archive.vue'
|
|
|
|
import NamespaceSettingDelete from '../views/namespaces/settings/delete.vue'
|
2021-11-14 16:56:52 +01:00
|
|
|
|
2020-09-26 23:02:37 +02:00
|
|
|
// Saved Filters
|
2022-01-05 11:05:44 +01:00
|
|
|
import FilterNew from '@/views/filters/FilterNew.vue'
|
|
|
|
import FilterEdit from '@/views/filters/FilterEdit.vue'
|
|
|
|
import FilterDelete from '@/views/filters/FilterDelete.vue'
|
2020-07-27 19:53:19 +02:00
|
|
|
|
2022-01-05 11:05:44 +01:00
|
|
|
const PasswordResetComponent = () => import('../views/user/PasswordReset.vue')
|
|
|
|
const GetPasswordResetComponent = () => import('../views/user/RequestPasswordReset.vue')
|
|
|
|
const UserSettingsComponent = () => import('../views/user/Settings.vue')
|
|
|
|
const UserSettingsAvatarComponent = () => import('../views/user/settings/Avatar.vue')
|
|
|
|
const UserSettingsCaldavComponent = () => import('../views/user/settings/Caldav.vue')
|
|
|
|
const UserSettingsDataExportComponent = () => import('../views/user/settings/DataExport.vue')
|
|
|
|
const UserSettingsDeletionComponent = () => import('../views/user/settings/Deletion.vue')
|
|
|
|
const UserSettingsEmailUpdateComponent = () => import('../views/user/settings/EmailUpdate.vue')
|
|
|
|
const UserSettingsGeneralComponent = () => import('../views/user/settings/General.vue')
|
|
|
|
const UserSettingsPasswordUpdateComponent = () => import('../views/user/settings/PasswordUpdate.vue')
|
|
|
|
const UserSettingsTOTPComponent = () => import('../views/user/settings/TOTP.vue')
|
2021-08-23 21:15:04 +02:00
|
|
|
|
2018-09-08 23:33:23 +02:00
|
|
|
// List Handling
|
2022-01-05 11:05:44 +01:00
|
|
|
const NewListComponent = () => import('../views/list/NewList.vue')
|
2021-08-23 21:15:04 +02:00
|
|
|
|
2018-09-11 19:20:07 +02:00
|
|
|
// Namespace Handling
|
2022-01-05 11:05:44 +01:00
|
|
|
const NewNamespaceComponent = () => import('../views/namespaces/NewNamespace.vue')
|
2020-07-27 19:53:19 +02:00
|
|
|
|
2022-01-05 11:05:44 +01:00
|
|
|
const EditTeamComponent = () => import('../views/teams/EditTeam.vue')
|
|
|
|
const NewTeamComponent = () => import('../views/teams/NewTeam.vue')
|
2018-09-06 19:46:09 +02:00
|
|
|
|
2021-08-20 15:17:19 +02:00
|
|
|
const router = createRouter({
|
|
|
|
history: createWebHistory(),
|
2020-04-26 01:11:34 +02:00
|
|
|
scrollBehavior(to, from, savedPosition) {
|
2019-10-20 21:40:44 +02:00
|
|
|
// If the user is using their forward/backward keys to navigate, we want to restore the scroll view
|
2020-04-26 01:11:34 +02:00
|
|
|
if (savedPosition) {
|
2019-10-20 21:40:44 +02:00
|
|
|
return savedPosition
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scroll to anchor should still work
|
2020-04-26 01:11:34 +02:00
|
|
|
if (to.hash) {
|
2021-08-20 15:17:19 +02:00
|
|
|
return {el: document.getElementById(to.hash.slice(1))}
|
2019-10-20 21:40:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Otherwise just scroll to the top
|
2021-08-20 15:17:19 +02:00
|
|
|
return {left: 0, top: 0}
|
2019-10-20 21:40:44 +02:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'home',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: HomeComponent,
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
2020-03-02 20:30:49 +01:00
|
|
|
{
|
2021-08-20 15:17:19 +02:00
|
|
|
path: '/:pathMatch(.*)*',
|
|
|
|
name: 'not-found',
|
|
|
|
component: NotFoundComponent,
|
|
|
|
},
|
|
|
|
// if you omit the last `*`, the `/` character in params will be encoded when resolving or pushing
|
|
|
|
{
|
|
|
|
path: '/:pathMatch(.*)',
|
|
|
|
name: 'bad-not-found',
|
2020-03-02 20:30:49 +01:00
|
|
|
component: NotFoundComponent,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/login',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'user.login',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: LoginComponent,
|
2021-12-12 17:40:13 +01:00
|
|
|
meta: {
|
|
|
|
title: 'user.auth.login',
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/get-password-reset',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'user.password-reset.request',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: GetPasswordResetComponent,
|
2021-12-12 17:40:13 +01:00
|
|
|
meta: {
|
|
|
|
title: 'user.auth.resetPassword',
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'user.password-reset.reset',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: PasswordResetComponent,
|
2021-12-12 17:40:13 +01:00
|
|
|
meta: {
|
|
|
|
title: 'user.auth.resetPassword',
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/register',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'user.register',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: RegisterComponent,
|
2021-12-12 17:40:13 +01:00
|
|
|
meta: {
|
|
|
|
title: 'user.auth.register',
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
{
|
|
|
|
path: '/user/settings',
|
|
|
|
name: 'user.settings',
|
|
|
|
component: UserSettingsComponent,
|
2021-11-14 22:12:18 +01:00
|
|
|
redirect: {name: 'user.settings.general'},
|
2021-10-26 22:58:02 +02:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/user/settings/avatar',
|
|
|
|
name: 'user.settings.avatar',
|
|
|
|
component: UserSettingsAvatarComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/caldav',
|
|
|
|
name: 'user.settings.caldav',
|
|
|
|
component: UserSettingsCaldavComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/data-export',
|
|
|
|
name: 'user.settings.data-export',
|
|
|
|
component: UserSettingsDataExportComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/deletion',
|
|
|
|
name: 'user.settings.deletion',
|
|
|
|
component: UserSettingsDeletionComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/email-update',
|
|
|
|
name: 'user.settings.email-update',
|
|
|
|
component: UserSettingsEmailUpdateComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/general',
|
|
|
|
name: 'user.settings.general',
|
|
|
|
component: UserSettingsGeneralComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/password-update',
|
|
|
|
name: 'user.settings.password-update',
|
|
|
|
component: UserSettingsPasswordUpdateComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/user/settings/totp',
|
|
|
|
name: 'user.settings.totp',
|
|
|
|
component: UserSettingsTOTPComponent,
|
|
|
|
},
|
|
|
|
],
|
2020-06-17 22:24:37 +02:00
|
|
|
},
|
2021-09-04 21:26:38 +02:00
|
|
|
{
|
|
|
|
path: '/user/export/download',
|
|
|
|
name: 'user.export.download',
|
|
|
|
component: DataExportDownload,
|
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
{
|
|
|
|
path: '/share/:share/auth',
|
|
|
|
name: 'link-share.auth',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: LinkShareAuthComponent,
|
2020-06-17 22:24:37 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces',
|
|
|
|
name: 'namespaces.index',
|
|
|
|
component: ListNamespaces,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/new',
|
|
|
|
name: 'namespace.create',
|
2021-01-21 23:33:16 +01:00
|
|
|
components: {
|
|
|
|
popup: NewNamespaceComponent,
|
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/:id/list',
|
|
|
|
name: 'list.create',
|
2021-01-21 23:33:16 +01:00
|
|
|
components: {
|
|
|
|
popup: NewListComponent,
|
2021-07-17 23:21:46 +02:00
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
2021-01-30 17:17:04 +01:00
|
|
|
path: '/namespaces/:id/settings/edit',
|
|
|
|
name: 'namespace.settings.edit',
|
|
|
|
components: {
|
|
|
|
popup: NamespaceSettingEdit,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/:id/settings/share',
|
|
|
|
name: 'namespace.settings.share',
|
|
|
|
components: {
|
|
|
|
popup: NamespaceSettingShare,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/:id/settings/archive',
|
|
|
|
name: 'namespace.settings.archive',
|
|
|
|
components: {
|
|
|
|
popup: NamespaceSettingArchive,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/:id/settings/delete',
|
|
|
|
name: 'namespace.settings.delete',
|
|
|
|
components: {
|
|
|
|
popup: NamespaceSettingDelete,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
2020-05-09 19:19:06 +02:00
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.detail',
|
|
|
|
component: TaskDetailView,
|
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
{
|
2020-11-22 18:05:25 +01:00
|
|
|
path: '/tasks/by/upcoming',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'tasks.range',
|
|
|
|
component: ShowTasksInRangeComponent,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'list.settings.edit',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingEdit,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/background',
|
|
|
|
name: 'list.settings.background',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingBackground,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/duplicate',
|
|
|
|
name: 'list.settings.duplicate',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingDuplicate,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/share',
|
|
|
|
name: 'list.settings.share',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingShare,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'list.settings.delete',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingDelete,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/archive',
|
|
|
|
name: 'list.settings.archive',
|
|
|
|
components: {
|
|
|
|
popup: ListSettingArchive,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'filter.settings.edit',
|
|
|
|
components: {
|
2021-11-14 16:56:52 +01:00
|
|
|
popup: FilterEdit,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'filter.settings.delete',
|
|
|
|
components: {
|
2021-11-14 16:56:52 +01:00
|
|
|
popup: FilterDelete,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
},
|
2019-04-29 23:41:39 +02:00
|
|
|
{
|
2020-04-26 01:11:34 +02:00
|
|
|
path: '/lists/:listId',
|
2020-04-30 12:49:42 +02:00
|
|
|
name: 'list.index',
|
2019-04-29 23:41:39 +02:00
|
|
|
component: ShowListComponent,
|
2020-04-26 01:11:34 +02:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/list',
|
|
|
|
name: 'list.list',
|
|
|
|
component: List,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.list.detail',
|
|
|
|
component: TaskDetailViewModal,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'list.list.settings.edit',
|
|
|
|
component: ListSettingEdit,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/background',
|
|
|
|
name: 'list.list.settings.background',
|
|
|
|
component: ListSettingBackground,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/duplicate',
|
|
|
|
name: 'list.list.settings.duplicate',
|
|
|
|
component: ListSettingDuplicate,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/share',
|
|
|
|
name: 'list.list.settings.share',
|
|
|
|
component: ListSettingShare,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'list.list.settings.delete',
|
|
|
|
component: ListSettingDelete,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/archive',
|
|
|
|
name: 'list.list.settings.archive',
|
|
|
|
component: ListSettingArchive,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'filter.list.settings.edit',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterEdit,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'filter.list.settings.delete',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterDelete,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
2020-04-26 01:11:34 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/gantt',
|
|
|
|
name: 'list.gantt',
|
|
|
|
component: Gantt,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.gantt.detail',
|
|
|
|
component: TaskDetailViewModal,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'list.gantt.settings.edit',
|
|
|
|
component: ListSettingEdit,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/background',
|
|
|
|
name: 'list.gantt.settings.background',
|
|
|
|
component: ListSettingBackground,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/duplicate',
|
|
|
|
name: 'list.gantt.settings.duplicate',
|
|
|
|
component: ListSettingDuplicate,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/share',
|
|
|
|
name: 'list.gantt.settings.share',
|
|
|
|
component: ListSettingShare,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'list.gantt.settings.delete',
|
|
|
|
component: ListSettingDelete,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/archive',
|
|
|
|
name: 'list.gantt.settings.archive',
|
|
|
|
component: ListSettingArchive,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'filter.gantt.settings.edit',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterEdit,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'filter.gantt.settings.delete',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterDelete,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
2020-04-26 01:11:34 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/table',
|
|
|
|
name: 'list.table',
|
|
|
|
component: Table,
|
2021-01-30 17:17:04 +01:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'list.table.settings.edit',
|
|
|
|
component: ListSettingEdit,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/background',
|
|
|
|
name: 'list.table.settings.background',
|
|
|
|
component: ListSettingBackground,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/duplicate',
|
|
|
|
name: 'list.table.settings.duplicate',
|
|
|
|
component: ListSettingDuplicate,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/share',
|
|
|
|
name: 'list.table.settings.share',
|
|
|
|
component: ListSettingShare,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'list.table.settings.delete',
|
|
|
|
component: ListSettingDelete,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/archive',
|
|
|
|
name: 'list.table.settings.archive',
|
|
|
|
component: ListSettingArchive,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'filter.table.settings.edit',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterEdit,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'filter.table.settings.delete',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterDelete,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
],
|
2020-04-26 01:11:34 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/kanban',
|
|
|
|
name: 'list.kanban',
|
|
|
|
component: Kanban,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.kanban.detail',
|
|
|
|
component: TaskDetailViewModal,
|
|
|
|
},
|
2021-01-30 17:17:04 +01:00
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'list.kanban.settings.edit',
|
|
|
|
component: ListSettingEdit,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/background',
|
|
|
|
name: 'list.kanban.settings.background',
|
|
|
|
component: ListSettingBackground,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/duplicate',
|
|
|
|
name: 'list.kanban.settings.duplicate',
|
|
|
|
component: ListSettingDuplicate,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/share',
|
|
|
|
name: 'list.kanban.settings.share',
|
|
|
|
component: ListSettingShare,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'list.kanban.settings.delete',
|
|
|
|
component: ListSettingDelete,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/archive',
|
|
|
|
name: 'list.kanban.settings.archive',
|
|
|
|
component: ListSettingArchive,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/edit',
|
|
|
|
name: 'filter.kanban.settings.edit',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterEdit,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/settings/delete',
|
|
|
|
name: 'filter.kanban.settings.delete',
|
2021-11-14 16:56:52 +01:00
|
|
|
component: FilterDelete,
|
2021-01-30 17:17:04 +01:00
|
|
|
},
|
2020-04-26 01:11:34 +02:00
|
|
|
],
|
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
],
|
2019-04-29 23:41:39 +02:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/teams',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'teams.index',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: ListTeamsComponent,
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/teams/new',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'teams.create',
|
2021-01-21 23:33:16 +01:00
|
|
|
components: {
|
|
|
|
popup: NewTeamComponent,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/teams/:id/edit',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'teams.edit',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: EditTeamComponent,
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/labels',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'labels.index',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: ListLabelsComponent,
|
2019-09-09 19:55:43 +02:00
|
|
|
},
|
2020-12-30 18:55:54 +01:00
|
|
|
{
|
|
|
|
path: '/labels/new',
|
|
|
|
name: 'labels.create',
|
2021-01-21 23:33:16 +01:00
|
|
|
components: {
|
|
|
|
popup: NewLabelComponent,
|
|
|
|
},
|
2020-12-30 18:55:54 +01:00
|
|
|
},
|
2020-01-19 20:23:06 +01:00
|
|
|
{
|
|
|
|
path: '/migrate',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'migrate.start',
|
2020-01-19 20:23:06 +01:00
|
|
|
component: MigrationComponent,
|
|
|
|
},
|
|
|
|
{
|
2020-05-24 15:31:27 +02:00
|
|
|
path: '/migrate/:service',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'migrate.service',
|
2020-05-24 15:31:27 +02:00
|
|
|
component: MigrateServiceComponent,
|
2020-01-19 20:23:06 +01:00
|
|
|
},
|
2020-09-26 23:02:37 +02:00
|
|
|
{
|
|
|
|
path: '/filters/new',
|
|
|
|
name: 'filters.create',
|
2021-01-21 23:33:16 +01:00
|
|
|
components: {
|
2021-11-14 16:56:52 +01:00
|
|
|
popup: FilterNew,
|
2021-01-21 23:33:16 +01:00
|
|
|
},
|
2020-09-26 23:02:37 +02:00
|
|
|
},
|
2020-11-21 17:38:40 +01:00
|
|
|
{
|
|
|
|
path: '/auth/openid/:provider',
|
|
|
|
name: 'openid.auth',
|
|
|
|
component: OpenIdAuth,
|
|
|
|
},
|
2021-07-06 17:05:35 +02:00
|
|
|
{
|
|
|
|
path: '/about',
|
|
|
|
name: 'about',
|
|
|
|
component: About,
|
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
],
|
2021-08-20 15:17:19 +02:00
|
|
|
})
|
|
|
|
|
2021-12-21 09:02:03 +01:00
|
|
|
router.beforeEach((to) => {
|
|
|
|
return checkAuth(to)
|
|
|
|
})
|
|
|
|
|
|
|
|
function checkAuth(route: RouteLocation) {
|
|
|
|
const authUser = store.getters['auth/authUser']
|
|
|
|
const authLinkShare = store.getters['auth/authLinkShare']
|
|
|
|
|
|
|
|
if (authUser || authLinkShare) {
|
|
|
|
return
|
|
|
|
}
|
2021-08-20 15:17:19 +02:00
|
|
|
|
2021-12-21 09:02:03 +01:00
|
|
|
// Check if the user is already logged in and redirect them to the home page if not
|
|
|
|
if (
|
|
|
|
![
|
|
|
|
'user.login',
|
|
|
|
'user.password-reset.request',
|
|
|
|
'user.password-reset.reset',
|
|
|
|
'user.register',
|
|
|
|
'link-share.auth',
|
|
|
|
'openid.auth',
|
|
|
|
].includes(route.name as string) &&
|
|
|
|
localStorage.getItem('passwordResetToken') === null &&
|
|
|
|
localStorage.getItem('emailConfirmToken') === null
|
|
|
|
) {
|
|
|
|
saveLastVisited(route.name as string, route.params)
|
|
|
|
return {name: 'user.login'}
|
|
|
|
}
|
|
|
|
}
|
2021-08-20 15:17:19 +02:00
|
|
|
|
|
|
|
export default router
|