PluginProbe
The Innovative Form Builder – IvyForms / 0.3
The Innovative Form Builder – IvyForms v0.3
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.3, at frontend/src/router/index.ts

199 lines 5.7 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 SettingsPage from '../views/admin/settings/settings-page/SettingsPage.vue'
5 import GeneralSettingsPage from '../views/admin/settings/settings-page/section/general-settings/GeneralSettingsPage.vue'
6 import SecuritySettingsPage from '../views/admin/settings/settings-page/section/security-settings/SecuritySettingsPage.vue'
7 import FormsPage from '../views/admin/forms/forms-page/FormsPage.vue'
8 import FormBuilderPage from '../views/admin/form-builder/form-builder-page/FormBuilderPage.vue'
9 import FormBuilderSettingsPage from '../views/admin/form-builder/form-builder-page/FormBuilderSettingsPage.vue'
10 import FormBuilderManageNotification from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderManageNotification.vue'
11 import FormBuilderSettings from '../views/admin/form-builder/form-builder-page/form-settings/FormBuilderSettings.vue'
12 import FormBuilderNotificationTable from '../views/admin/form-builder/form-builder-page/form-settings-notification/FormBuilderNotificationTable.vue'
13 import FormBuilderConfirmation from '../views/admin/form-builder/form-builder-page/form-settings-confirmations/FormBuilderConfirmation.vue'
14 import EntriesPage from '@/views/admin/entries/entries-page/EntriesPage.vue'
15 import EntryPage from '@/views/admin/entries/entry-page/EntryPage.vue'
16 import FormBuilderResultsEntries from '@/views/admin/form-builder/form-builder-page/form-results/FormBuilderResultsEntries.vue'
17 import FormBuilderResultsPage from '@/views/admin/form-builder/form-builder-page/FormBuilderResultsPage.vue'
18 import {
19 IVYFORMS_FORM_BUILDER_PAGE,
20 IVYFORMS_ALLFORMS_PAGE,
21 IVYFORMS_DASHBOARD_PAGE,
22 IVYFORMS_SETTINGS,
23 IVYFORMS_DASHBOARD,
24 IVYFORMS_ALL_FORMS,
25 IVYFORMS_ADD_FORM,
26 IVYFORMS_EDIT_FORM,
27 IVYFORMS_FORM_SETTINGS,
28 IVYFORMS_FORM_SETTING,
29 IVYFORMS_FORM_NOTIFICATIONS,
30 IVYFORMS_NEW_NOTIFICATIONS,
31 IVYFORMS_EDIT_NOTIFICATIONS,
32 IVYFORMS_FORM_CONFIRMATION,
33 IVYFORMS_ENTRIES,
34 IVYFORMS_ENTRY_DETAILS,
35 IVYFORMS_RESULTS_ENTRY_DETAILS,
36 IVYFORMS_FORM_RESULTS,
37 IVYFORMS_RESULTS,
38 IVYFORMS_ENTRIES_PAGE,
39 IVYFORMS_SETTINGS_PAGE,
40 IVYFORMS_GLOBAL_SETTINGS,
41 IVYFORMS_GENERAL_SETTINGS,
42 IVYFORMS_SECURITY_SETTINGS,
43 } from '@/constants/pages.ts'
44
45 const currentPage = new URLSearchParams(window.location.search).get('page')
46
47 let routes: RouteRecordRaw[] = []
48
49 if (currentPage === IVYFORMS_DASHBOARD_PAGE) {
50 routes = [
51 {
52 path: '/',
53 name: IVYFORMS_DASHBOARD,
54 component: DashboardPage,
55 },
56 ]
57 }
58
59 if (currentPage === IVYFORMS_ALLFORMS_PAGE) {
60 routes = [
61 {
62 path: '/',
63 name: IVYFORMS_ALL_FORMS,
64 component: FormsPage,
65 },
66 ]
67 }
68
69 if (currentPage === IVYFORMS_FORM_BUILDER_PAGE) {
70 routes = [
71 {
72 path: '/',
73 name: IVYFORMS_ADD_FORM,
74 component: FormBuilderPage,
75 children: [
76 {
77 path: '/manage/:id(\\d+)',
78 name: IVYFORMS_EDIT_FORM,
79 component: FormBuilderPage,
80 },
81 ],
82 },
83 {
84 path: '/settings',
85 name: IVYFORMS_SETTINGS,
86 component: FormBuilderSettingsPage,
87 children: [
88 {
89 path: 'general',
90 name: IVYFORMS_FORM_SETTINGS,
91 component: FormBuilderSettings,
92 },
93 {
94 path: 'general/manage/:id(\\d+)',
95 name: IVYFORMS_FORM_SETTING,
96 component: FormBuilderSettings,
97 },
98 {
99 path: 'notification/:id(\\d+)',
100 name: IVYFORMS_FORM_NOTIFICATIONS,
101 component: FormBuilderNotificationTable,
102 },
103 {
104 path: 'notification/manage',
105 name: IVYFORMS_NEW_NOTIFICATIONS,
106 component: FormBuilderManageNotification,
107 },
108 {
109 path: 'notification/manage/:id(\\d+)?',
110 name: IVYFORMS_EDIT_NOTIFICATIONS,
111 component: FormBuilderManageNotification,
112 },
113 {
114 path: 'confirmation/manage/:id(\\d+)',
115 name: IVYFORMS_FORM_CONFIRMATION,
116 component: FormBuilderConfirmation,
117 },
118 ],
119 },
120 {
121 path: '/results',
122 name: IVYFORMS_RESULTS,
123 component: FormBuilderResultsPage,
124 children: [
125 {
126 path: 'entries/:id(\\d+)',
127 name: IVYFORMS_FORM_RESULTS,
128 component: FormBuilderResultsEntries,
129 },
130 ],
131 },
132 {
133 path: '/results/entries/:formId/manage/:entryId(\\d+)',
134 name: IVYFORMS_RESULTS_ENTRY_DETAILS,
135 component: EntryPage,
136 },
137 ]
138 }
139
140 if (currentPage === IVYFORMS_ENTRIES_PAGE) {
141 routes = [
142 {
143 path: '/',
144 name: IVYFORMS_ENTRIES,
145 component: EntriesPage,
146 },
147 {
148 path: '/manage/:id(\\d+)',
149 name: IVYFORMS_ENTRY_DETAILS,
150 component: EntryPage,
151 },
152 ]
153 }
154 if (currentPage === IVYFORMS_SETTINGS_PAGE) {
155 routes = [
156 {
157 path: '/',
158 name: IVYFORMS_GLOBAL_SETTINGS,
159 component: SettingsPage,
160 children: [
161 {
162 path: 'general',
163 name: IVYFORMS_GENERAL_SETTINGS,
164 component: GeneralSettingsPage,
165 },
166 {
167 path: 'security',
168 redirect: 'security/recaptcha',
169 },
170 {
171 path: 'security/:provider(recaptcha|hcaptcha|turnstile|honeypot)',
172 name: IVYFORMS_SECURITY_SETTINGS,
173 component: SecuritySettingsPage,
174 },
175 ],
176 },
177 ]
178 }
179 if (currentPage === IVYFORMS_ENTRIES_PAGE) {
180 routes = [
181 {
182 path: '/',
183 name: IVYFORMS_ENTRIES,
184 component: EntriesPage,
185 },
186 {
187 path: '/manage/:id(\\d+)',
188 name: IVYFORMS_ENTRY_DETAILS,
189 component: EntryPage,
190 },
191 ]
192 }
193
194 const router = createRouter({
195 history: createWebHashHistory(),
196 routes,
197 })
198 export default router
199