2018-09-06 19:46:09 +02:00
|
|
|
import Vue from 'vue'
|
|
|
|
import Router from 'vue-router'
|
|
|
|
|
2020-06-17 22:15:59 +02:00
|
|
|
import HomeComponent from '../views/Home'
|
|
|
|
import NotFoundComponent from '../views/404'
|
2018-09-08 22:27:13 +02:00
|
|
|
// User Handling
|
2020-06-17 22:15:59 +02:00
|
|
|
import LoginComponent from '../views/user/Login'
|
|
|
|
import RegisterComponent from '../views/user/Register'
|
|
|
|
import PasswordResetComponent from '../views/user/PasswordReset'
|
|
|
|
import GetPasswordResetComponent from '../views/user/RequestPasswordReset'
|
|
|
|
import UserSettingsComponent from '../views/user/Settings'
|
2018-09-08 23:33:23 +02:00
|
|
|
// List Handling
|
2020-06-17 22:15:59 +02:00
|
|
|
import NewListComponent from '../views/list/NewList'
|
|
|
|
import EditListComponent from '../views/list/EditList'
|
|
|
|
// Tasks
|
|
|
|
import ShowTasksInRangeComponent from '../views/tasks/ShowTasksInRange'
|
|
|
|
import LinkShareAuthComponent from '../views/sharing/LinkSharingAuth'
|
|
|
|
import TaskDetailViewModal from '../views/tasks/TaskDetailViewModal'
|
|
|
|
import TaskDetailView from '../views/tasks/TaskDetailView'
|
2018-09-11 19:20:07 +02:00
|
|
|
// Namespace Handling
|
2020-06-17 22:15:59 +02:00
|
|
|
import NewNamespaceComponent from '../views/namespaces/NewNamespace'
|
|
|
|
import EditNamespaceComponent from '../views/namespaces/EditNamespace'
|
|
|
|
import ListNamespaces from '../views/namespaces/ListNamespaces'
|
2018-09-14 07:23:25 +02:00
|
|
|
// Team Handling
|
2020-06-17 22:15:59 +02:00
|
|
|
import ListTeamsComponent from '../views/teams/ListTeams'
|
|
|
|
import EditTeamComponent from '../views/teams/EditTeam'
|
|
|
|
import NewTeamComponent from '../views/teams/NewTeam'
|
2019-03-07 20:48:40 +01:00
|
|
|
// Label Handling
|
2020-06-17 22:15:59 +02:00
|
|
|
import ListLabelsComponent from '../views/labels/ListLabels'
|
2020-01-19 20:23:06 +01:00
|
|
|
// Migration
|
2020-06-17 22:15:59 +02:00
|
|
|
import MigrationComponent from '../views/migrator/Migrate'
|
|
|
|
import MigrateServiceComponent from '../views/migrator/MigrateService'
|
2020-04-26 01:11:34 +02:00
|
|
|
// List Views
|
2020-06-17 22:15:59 +02:00
|
|
|
import ShowListComponent from '../views/list/ShowList'
|
|
|
|
import Kanban from '../views/list/views/Kanban'
|
|
|
|
import List from '../views/list/views/List'
|
|
|
|
import Gantt from '../views/list/views/Gantt'
|
|
|
|
import Table from '../views/list/views/Table'
|
2018-09-06 19:46:09 +02:00
|
|
|
|
|
|
|
Vue.use(Router)
|
|
|
|
|
|
|
|
export default new Router({
|
2019-03-07 20:48:40 +01:00
|
|
|
mode: 'history',
|
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) {
|
2019-10-20 21:40:44 +02:00
|
|
|
return {
|
|
|
|
selector: to.hash
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Otherwise just scroll to the top
|
2020-04-26 01:11:34 +02:00
|
|
|
return {x: 0, y: 0}
|
2019-10-20 21:40:44 +02:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
name: 'home',
|
|
|
|
component: HomeComponent
|
|
|
|
},
|
2020-03-02 20:30:49 +01:00
|
|
|
{
|
|
|
|
path: '*',
|
|
|
|
name: '404',
|
|
|
|
component: NotFoundComponent,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
name: 'login',
|
|
|
|
component: LoginComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/get-password-reset',
|
|
|
|
name: 'getPasswordReset',
|
|
|
|
component: GetPasswordResetComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/password-reset',
|
|
|
|
name: 'passwordReset',
|
|
|
|
component: PasswordResetComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/register',
|
|
|
|
name: 'register',
|
|
|
|
component: RegisterComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:id/edit',
|
|
|
|
name: 'editList',
|
|
|
|
component: EditListComponent
|
|
|
|
},
|
2020-05-09 19:19:06 +02:00
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.detail',
|
|
|
|
component: TaskDetailView,
|
|
|
|
},
|
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,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/gantt',
|
|
|
|
name: 'list.gantt',
|
|
|
|
component: Gantt,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.gantt.detail',
|
|
|
|
component: TaskDetailViewModal,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/table',
|
|
|
|
name: 'list.table',
|
|
|
|
component: Table,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/lists/:listId/kanban',
|
|
|
|
name: 'list.kanban',
|
|
|
|
component: Kanban,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/tasks/:id',
|
|
|
|
name: 'task.kanban.detail',
|
|
|
|
component: TaskDetailViewModal,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
2019-04-29 23:41:39 +02:00
|
|
|
},
|
2020-06-17 00:20:37 +02:00
|
|
|
{
|
|
|
|
path: '/namespaces',
|
|
|
|
name: 'namespaces.index',
|
|
|
|
component: ListNamespaces,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/namespaces/:id/list',
|
|
|
|
name: 'newList',
|
|
|
|
component: NewListComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/new',
|
|
|
|
name: 'newNamespace',
|
|
|
|
component: NewNamespaceComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/namespaces/:id/edit',
|
|
|
|
name: 'editNamespace',
|
|
|
|
component: EditNamespaceComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/teams',
|
|
|
|
name: 'listTeams',
|
|
|
|
component: ListTeamsComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/teams/new',
|
|
|
|
name: 'newTeam',
|
|
|
|
component: NewTeamComponent
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/teams/:id/edit',
|
|
|
|
name: 'editTeam',
|
|
|
|
component: EditTeamComponent
|
|
|
|
},
|
|
|
|
{
|
2019-11-24 14:16:24 +01:00
|
|
|
path: '/tasks/by/:type',
|
2019-03-07 20:48:40 +01:00
|
|
|
name: 'showTasksInRange',
|
2020-04-26 01:11:34 +02:00
|
|
|
component: ShowTasksInRangeComponent,
|
2019-11-24 14:16:24 +01:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/labels',
|
|
|
|
name: 'listLabels',
|
|
|
|
component: ListLabelsComponent
|
2019-09-09 19:55:43 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/share/:share/auth',
|
|
|
|
name: 'linkShareAuth',
|
|
|
|
component: LinkShareAuthComponent
|
|
|
|
},
|
2020-01-19 20:23:06 +01:00
|
|
|
{
|
|
|
|
path: '/migrate',
|
|
|
|
name: 'migrateStart',
|
|
|
|
component: MigrationComponent,
|
|
|
|
},
|
|
|
|
{
|
2020-05-24 15:31:27 +02:00
|
|
|
path: '/migrate/:service',
|
|
|
|
name: 'migrate',
|
|
|
|
component: MigrateServiceComponent,
|
2020-01-19 20:23:06 +01:00
|
|
|
},
|
2020-04-17 22:46:50 +02:00
|
|
|
{
|
|
|
|
path: '/user/settings',
|
|
|
|
name: 'userSettings',
|
|
|
|
component: UserSettingsComponent,
|
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
]
|
2018-09-06 19:46:09 +02:00
|
|
|
})
|