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

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