PluginProbe
The Innovative Form Builder – IvyForms / 0.2
The Innovative Form Builder – IvyForms v0.2
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / router / index.ts

index.ts in The Innovative Form Builder – IvyForms 0.2, at frontend/src/router/index.ts

107 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import type { RouteRecordRaw } from 'vue-router'
2 import { createWebHashHistory, createRouter } from 'vue-router'
3 import DashboardPage from '../views/admin/dashboard/dashboard-page/DashboardPage.vue'
4 import FormsPage from '../views/admin/forms/forms-page/FormsPage.vue'
5 import FormBuilderPage from '../views/admin/form-builder/form-builder-page/FormBuilderPage.vue'
6 import FormBuilderSettingsPage from '../views/admin/form-builder/form-builder-page/FormBuilderSettingsPage.vue'
7 import FormBuilderManageNotification from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderManageNotification.vue'
8 import FormBuilderSettings from '../views/admin/form-builder/form-builder-page/form-settings/FormBuilderSettings.vue'
9 import FormBuilderNotificationTable from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderNotificationTable.vue'
10 import FormBuilderConfirmation from '../views/admin/form-builder/form-builder-page/form-settings-confirmations/FormBuilderConfirmation.vue'
11 import { IVYFORMS_FORM_BUILDER_PAGE } from '@/constants/pages.ts'
12 import { IVYFORMS_ALLFORMS_PAGE } from '@/constants/pages.ts'
13 import { IVYFORMS_DASHBOARD_PAGE } from '@/constants/pages.ts'
14
15 const currentPage = new URLSearchParams(window.location.search).get('page')
16
17 let routes: RouteRecordRaw[] = []
18
19 if (currentPage === IVYFORMS_DASHBOARD_PAGE) {
20 routes = [
21 {
22 path: '/',
23 name: 'Dashboard',
24 component: DashboardPage,
25 },
26 ]
27 }
28
29 if (currentPage === IVYFORMS_ALLFORMS_PAGE) {
30 routes = [
31 {
32 path: '/',
33 name: 'AllForms',
34 component: FormsPage,
35 },
36 ]
37 }
38
39 if (currentPage === IVYFORMS_FORM_BUILDER_PAGE) {
40 routes = [
41 {
42 path: '/',
43 name: 'AddForm',
44 component: FormBuilderPage,
45 children: [
46 {
47 path: '/manage/:id(\\d+)',
48 name: 'EditForm',
49 component: FormBuilderPage,
50 },
51 ],
52 },
53
54 {
55 path: '/settings',
56 name: 'Settings',
57 component: FormBuilderSettingsPage,
58 children: [
59 {
60 path: 'general',
61 name: 'FormSettings',
62 component: FormBuilderSettings,
63 },
64 {
65 path: 'general/manage/:id(\\d+)',
66 name: 'FormSetting',
67 component: FormBuilderSettings,
68 },
69 {
70 path: 'notification/:id(\\d+)',
71 name: 'FormNotifications',
72 component: FormBuilderNotificationTable,
73 },
74 {
75 path: 'notification/manage',
76 name: 'NewNotifications',
77 component: FormBuilderManageNotification,
78 },
79 {
80 path: 'notification/manage/:id(\\d+)?',
81 name: 'EditNotifications',
82 component: FormBuilderManageNotification,
83 },
84 {
85 path: 'confirmation/manage/:id(\\d+)',
86 name: 'FormConfirmation',
87 component: FormBuilderConfirmation,
88 },
89 ],
90 },
91 ]
92 }
93
94 // if (currentPage === 'ivyforms-settings') {
95 // routes = [{ path: '/', name: 'Settings', component: SettingsPage }]
96 // }
97 //
98 // if (currentPage === 'ivyforms-testing') {
99 // routes = [{ path: '/', name: 'Testing', component: TestingPage }]
100 // }
101
102 const router = createRouter({
103 history: createWebHashHistory(),
104 routes,
105 })
106 export default router
107