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'
|
2020-07-27 19:53:19 +02:00
|
|
|
import LoadingComponent from '../components/misc/loading'
|
|
|
|
import ErrorComponent from '../components/misc/error'
|
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'
|
2020-11-21 17:38:40 +01:00
|
|
|
import OpenIdAuth from '@/views/user/OpenIdAuth'
|
2020-09-05 22:35:52 +02:00
|
|
|
// 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'
|
|
|
|
import ListNamespaces from '../views/namespaces/ListNamespaces'
|
|
|
|
// Team Handling
|
|
|
|
import ListTeamsComponent from '../views/teams/ListTeams'
|
|
|
|
// Label Handling
|
|
|
|
import ListLabelsComponent from '../views/labels/ListLabels'
|
2020-12-30 18:55:54 +01:00
|
|
|
import NewLabelComponent from '../views/labels/NewLabel'
|
2020-09-05 22:35:52 +02:00
|
|
|
// Migration
|
|
|
|
import MigrationComponent from '../views/migrator/Migrate'
|
|
|
|
import MigrateServiceComponent from '../views/migrator/MigrateService'
|
|
|
|
// List Views
|
|
|
|
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'
|
2020-09-26 23:02:37 +02:00
|
|
|
// Saved Filters
|
|
|
|
import CreateSavedFilter from '@/views/filters/CreateSavedFilter'
|
2020-07-27 19:53:19 +02:00
|
|
|
|
|
|
|
const PasswordResetComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "user-settings" */'../views/user/PasswordReset'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
const GetPasswordResetComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "user-settings" */'../views/user/RequestPasswordReset'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
const UserSettingsComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "user-settings" */'../views/user/Settings'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
2018-09-08 23:33:23 +02:00
|
|
|
// List Handling
|
2020-07-27 19:53:19 +02:00
|
|
|
const NewListComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/list/NewList'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
const EditListComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/list/EditListView'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
2018-09-11 19:20:07 +02:00
|
|
|
// Namespace Handling
|
2020-07-27 19:53:19 +02:00
|
|
|
const NewNamespaceComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/namespaces/NewNamespace'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
const EditNamespaceComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/namespaces/EditNamespace'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
|
|
|
|
const EditTeamComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/teams/EditTeam'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
|
|
|
const NewTeamComponent = () => ({
|
2020-11-02 21:47:31 +01:00
|
|
|
component: import(/* webpackChunkName: "settings" */'../views/teams/NewTeam'),
|
2020-07-27 19:53:19 +02:00
|
|
|
loading: LoadingComponent,
|
|
|
|
error: ErrorComponent,
|
|
|
|
timeout: 60000,
|
|
|
|
})
|
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 {
|
2020-09-05 22:35:52 +02:00
|
|
|
selector: to.hash,
|
2019-10-20 21:40:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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',
|
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
|
|
|
{
|
|
|
|
path: '*',
|
|
|
|
name: '404',
|
|
|
|
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,
|
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,
|
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,
|
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,
|
2019-03-07 20:48:40 +01:00
|
|
|
},
|
2020-06-17 22:24:37 +02:00
|
|
|
{
|
|
|
|
path: '/user/settings',
|
|
|
|
name: 'user.settings',
|
|
|
|
component: UserSettingsComponent,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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/edit',
|
|
|
|
name: 'namespace.edit',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: EditNamespaceComponent,
|
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,
|
|
|
|
}
|
2020-06-17 22:24:37 +02:00
|
|
|
},
|
2019-03-07 20:48:40 +01:00
|
|
|
{
|
|
|
|
path: '/lists/:id/edit',
|
2020-06-17 22:24:37 +02:00
|
|
|
name: 'list.edit',
|
2020-09-05 22:35:52 +02:00
|
|
|
component: EditListComponent,
|
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,
|
|
|
|
},
|
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,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
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: {
|
|
|
|
popup: CreateSavedFilter,
|
|
|
|
},
|
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,
|
|
|
|
},
|
2020-09-05 22:35:52 +02:00
|
|
|
],
|
2018-09-06 19:46:09 +02:00
|
|
|
})
|