fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +6 -31
- package/.prettierrc +11 -0
- package/.vscode/extensions.json +8 -0
- package/.vscode/settings.json +16 -0
- package/CHANGELOG +153 -0
- package/README.md +28 -43
- package/documentation/.vitepress/config.js +114 -0
- package/documentation/api-examples.md +49 -0
- package/documentation/composants/app-base-button.md +58 -0
- package/documentation/composants/app-base-error-display.md +59 -0
- package/documentation/composants/app-base-popover.md +68 -0
- package/documentation/composants/app-comp-audio.md +75 -0
- package/documentation/composants/app-comp-branch-buttons.md +111 -0
- package/documentation/composants/app-comp-button-progress.md +53 -0
- package/documentation/composants/app-comp-carousel.md +53 -0
- package/documentation/composants/app-comp-container.md +53 -0
- package/documentation/composants/app-comp-input-checkbox-next.md +42 -0
- package/documentation/composants/app-comp-input-dropdown-next.md +34 -0
- package/documentation/composants/app-comp-input-radio-next.md +39 -0
- package/documentation/composants/app-comp-input-text-next.md +35 -0
- package/documentation/composants/app-comp-input-text-table-next.md +34 -0
- package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -0
- package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -0
- package/documentation/composants/app-comp-jauge.md +31 -0
- package/documentation/composants/app-comp-menu-item.md +55 -0
- package/documentation/composants/app-comp-menu.md +29 -0
- package/documentation/composants/app-comp-navigation.md +41 -0
- package/documentation/composants/app-comp-note-call.md +53 -0
- package/documentation/composants/app-comp-note-credit.md +53 -0
- package/documentation/composants/app-comp-play-bar-next.md +53 -0
- package/documentation/composants/app-comp-pop-up-next.md +93 -0
- package/documentation/composants/app-comp-quiz-next.md +235 -0
- package/documentation/composants/app-comp-quiz-recall.md +53 -0
- package/documentation/composants/app-comp-svg-next.md +53 -0
- package/documentation/composants/app-comp-table-of-content.md +50 -0
- package/documentation/composants/app-comp-video-player.md +82 -0
- package/documentation/composants.md +46 -0
- package/documentation/composants_critiques/ModelPageComposant.md +53 -0
- package/documentation/composants_critiques/app-base-module.md +43 -0
- package/documentation/composants_critiques/app-base-page.md +48 -0
- package/documentation/composants_critiques/app-base.md +311 -0
- package/documentation/composants_critiques/main.md +15 -0
- package/documentation/demarrage.md +50 -0
- package/documentation/deploiement.md +58 -0
- package/documentation/index.md +33 -0
- package/documentation/markdown-examples.md +85 -0
- package/documentation/public/npm_version.png +0 -0
- package/documentation/public/vite.svg +15 -0
- package/documentation/public/vuejs.svg +2 -0
- package/documentation/public/vuetify.svg +6 -0
- package/eslint.config.js +60 -0
- package/package.json +43 -49
- package/src/$locales/en.json +94 -92
- package/src/$locales/fr.json +77 -113
- package/src/assets/data/onboardingMessages.json +1 -1
- package/src/components/AppBase.vue +971 -437
- package/src/components/AppBaseButton.test.js +21 -0
- package/src/components/AppBaseButton.vue +42 -10
- package/src/components/AppBaseErrorDisplay.vue +209 -162
- package/src/components/AppBaseFlipCard.vue +1 -0
- package/src/components/AppBaseModule.vue +1021 -976
- package/src/components/AppBasePage.vue +656 -128
- package/src/components/AppBasePopover.vue +41 -0
- package/src/components/AppBaseSkeleton.vue +66 -0
- package/src/components/AppCompAudio.vue +256 -0
- package/src/components/AppCompBranchButtons.vue +108 -181
- package/src/components/AppCompButtonProgress.vue +44 -70
- package/src/components/AppCompCarousel.vue +284 -233
- package/src/components/AppCompContainer.vue +29 -0
- package/src/components/AppCompInputCheckBoxNx.vue +323 -0
- package/src/components/AppCompInputDropdownNx.vue +299 -0
- package/src/components/AppCompInputRadioNx.vue +284 -0
- package/src/components/AppCompInputTextNx.vue +153 -0
- package/src/components/AppCompInputTextTableNx.vue +202 -0
- package/src/components/AppCompInputTextToFillDropdownNx.vue +340 -0
- package/src/components/AppCompInputTextToFillNx.vue +313 -0
- package/src/components/AppCompJauge.vue +36 -11
- package/src/components/AppCompMenu.vue +312 -92
- package/src/components/AppCompMenuItem.vue +129 -105
- package/src/components/AppCompNavigation.vue +972 -0
- package/src/components/AppCompNoteCall.vue +161 -0
- package/src/components/AppCompNoteCredit.vue +491 -0
- package/src/components/AppCompPlayBarNext.vue +2288 -0
- package/src/components/AppCompPopUpNext.vue +504 -0
- package/src/components/AppCompQuizNext.vue +510 -0
- package/src/components/AppCompQuizRecall.vue +350 -0
- package/src/components/AppCompSVGNext.vue +346 -0
- package/src/components/AppCompSettingsMenu.vue +18 -16
- package/src/components/AppCompTableOfContent.vue +340 -122
- package/src/components/AppCompVideoPlayer.vue +377 -0
- package/src/components/BaseModule.vue +24 -117
- package/src/components/tests__/AppBaseButton.spec.js +53 -0
- package/src/components/tests__/useTimer.spec.js +91 -0
- package/src/composables/useIdleDetector.js +56 -0
- package/src/composables/useQuiz.js +89 -0
- package/src/composables/useTimer.js +172 -0
- package/src/directives/nvdaFix.js +53 -0
- package/src/externalComps/ModuleView.vue +22 -0
- package/src/externalComps/SummaryView.vue +91 -0
- package/src/main.js +400 -142
- package/src/module/stores/appStore.js +947 -0
- package/src/module/xapi/ADL.js +241 -60
- package/src/module/xapi/Crypto/Hasher.js +8 -8
- package/src/module/xapi/Crypto/WordArray.js +6 -6
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
- package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
- package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
- package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
- package/src/module/xapi/Crypto/encoders/Base.js +7 -7
- package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
- package/src/module/xapi/Crypto/encoders/Hex.js +4 -3
- package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
- package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
- package/src/module/xapi/Statement/index.js +3 -3
- package/src/module/xapi/launch.js +10 -10
- package/src/module/xapi/utils.js +17 -17
- package/src/module/xapi/wrapper.js +223 -218
- package/src/module/xapi/xapiStatement.js +29 -29
- package/src/plugins/analytics.js +34 -0
- package/src/plugins/bus.js +7 -2
- package/src/plugins/gsap.js +9 -8
- package/src/plugins/helper.js +141 -43
- package/src/plugins/i18n.js +13 -18
- package/src/plugins/idb.js +46 -30
- package/src/plugins/save.js +1 -1
- package/src/plugins/scorm.js +15 -15
- package/src/plugins/xapi.js +2 -2
- package/src/public/index.html +23 -11
- package/src/router/index.js +57 -0
- package/src/router/routes.js +312 -0
- package/src/shared/generalfuncs.js +241 -10
- package/src/shared/validators.js +1018 -0
- package/vitest.config.js +19 -0
- package/.eslintignore +0 -29
- package/.eslintrc.js +0 -86
- package/.prettierrc.js +0 -5
- package/babel.config.js +0 -3
- package/src/components/AppBaseDragChoice.vue +0 -91
- package/src/components/AppBaseDropZone.vue +0 -112
- package/src/components/AppCompDragAndDrop.vue +0 -339
- package/src/components/AppCompInputAssociation.vue +0 -332
- package/src/components/AppCompInputCheckBox.vue +0 -227
- package/src/components/AppCompInputDropdown.vue +0 -184
- package/src/components/AppCompInputRadio.vue +0 -169
- package/src/components/AppCompInputTextBox.vue +0 -91
- package/src/components/AppCompInputTextTable.vue +0 -155
- package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
- package/src/components/AppCompInputTextToFillText.vue +0 -164
- package/src/components/AppCompMediaPlayer.vue +0 -365
- package/src/components/AppCompNavigationFull.vue +0 -1791
- package/src/components/AppCompPlayBar.vue +0 -1540
- package/src/components/AppCompPopUp.vue +0 -523
- package/src/components/AppCompQuiz.vue +0 -2998
- package/src/components/AppCompToolTip.vue +0 -94
- package/src/mixins/$pageMixins.js +0 -381
- package/src/mixins/$quizMixins.js +0 -456
- package/src/mixins/timerMixin.js +0 -132
- package/src/module/store.js +0 -874
- package/src/plugins/timeManager.js +0 -77
- package/src/routes.js +0 -734
- package/vue.config.js +0 -83
package/src/routes.js
DELETED
|
@@ -1,734 +0,0 @@
|
|
|
1
|
-
import Router from 'vue-router'
|
|
2
|
-
import AppCompViewDisplay from './components/AppCompViewDisplay.vue'
|
|
3
|
-
import store from './module/store'
|
|
4
|
-
import { fileAssets } from './shared/generalfuncs'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The router Module defines the routes of the App by:
|
|
8
|
-
* loading the required files for module and activities pages,
|
|
9
|
-
* dynamically creating the navigation route of module base on the file in VIEWS folder
|
|
10
|
-
* dynamically creating the navigation routes of activities and branchings base on the files contained in the MODULE
|
|
11
|
-
* Creating Redirection routes for navigation error
|
|
12
|
-
* Adding the pages for the module in the STORE
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const _routes = [] // routes of the app
|
|
16
|
-
let errorType = null
|
|
17
|
-
let newRoute = null // wrapper for module routes
|
|
18
|
-
const mappedFiles = new Map() // routes definitions
|
|
19
|
-
let menuCreated = false
|
|
20
|
-
/**
|
|
21
|
-
* 1- Preparing the router to catch failing navigation error from browser by
|
|
22
|
-
* Redefining the Router push method
|
|
23
|
-
* ref: https://stackoverflow.com/questions/57837758/ navigationduplicated-navigating-to-current-location-search-is-not-allowed
|
|
24
|
-
*/
|
|
25
|
-
const originalPush = Router.prototype.push
|
|
26
|
-
Router.prototype.push = function push(location) {
|
|
27
|
-
return originalPush.call(this, location).catch((err) => err)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Creating 1st route: redirection for none existing route to home(Module)
|
|
31
|
-
_routes.push({
|
|
32
|
-
path: '*',
|
|
33
|
-
redirect: {
|
|
34
|
-
name: '404'
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* 2 - Creating the 2nd route: The App module route
|
|
40
|
-
*/
|
|
41
|
-
// Load all the files in the VIEWS folder
|
|
42
|
-
if (fileAssets.getModule().length > 0) {
|
|
43
|
-
let moduleFile = null
|
|
44
|
-
const fileRef = fileAssets.getModule()[0].replace(/(\.\/)/g, '')
|
|
45
|
-
const splitted = fileRef.split('/')
|
|
46
|
-
const fileName = splitted[splitted.length - 1].replace(/(\.vue)/g, '')
|
|
47
|
-
const fileContent = fileAssets.fetchFileContent(`./${fileRef}`).default
|
|
48
|
-
moduleFile = true
|
|
49
|
-
|
|
50
|
-
if (moduleFile && fileContent.data) {
|
|
51
|
-
/* Defining the 1st depth of module navigation:
|
|
52
|
-
* Define abstract route
|
|
53
|
-
* The navigation route is the Module component
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
newRoute = {
|
|
57
|
-
path: '/',
|
|
58
|
-
component: AppCompViewDisplay,
|
|
59
|
-
children: []
|
|
60
|
-
}
|
|
61
|
-
//= ================= Route The MODULE ================//
|
|
62
|
-
const moduleRoute = {
|
|
63
|
-
path: '',
|
|
64
|
-
name: fileName.toLowerCase(),
|
|
65
|
-
component: () =>
|
|
66
|
-
import(
|
|
67
|
-
/* webpackChunkName: "home" */
|
|
68
|
-
`@/${fileRef}`
|
|
69
|
-
),
|
|
70
|
-
meta: {
|
|
71
|
-
id: () =>
|
|
72
|
-
fileContent.data.id
|
|
73
|
-
? fileContent.data.id
|
|
74
|
-
: `module_${Math.floor(Math.random() * 1001)}`,
|
|
75
|
-
type: 'pg_normal',
|
|
76
|
-
children: []
|
|
77
|
-
},
|
|
78
|
-
children: []
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Load files in Module folder
|
|
82
|
-
const _allFiles = fileAssets.getActivities()
|
|
83
|
-
// There is a file in the MODULE folder
|
|
84
|
-
if (_allFiles.length > 0) {
|
|
85
|
-
//const mappedFiles = new Map() // routes definitions
|
|
86
|
-
_allFiles.forEach((key) => {
|
|
87
|
-
const fileRef = key.replace(/(\.\/)/g, '')
|
|
88
|
-
const splitted = fileRef.split('/')
|
|
89
|
-
const activityName = splitted[1]
|
|
90
|
-
const fileName = splitted[splitted.length - 1].replace(/(\.vue)/g, '')
|
|
91
|
-
const fileContent = fileAssets.fetchFileContent(`./${fileRef}`).default
|
|
92
|
-
|
|
93
|
-
if (Object.keys(fileContent).includes('data')) {
|
|
94
|
-
// Handleling single page type
|
|
95
|
-
// adding the page in a map for the Pages
|
|
96
|
-
|
|
97
|
-
// Add the key in the map for the routes if it is not in the map, with its data as new Map;
|
|
98
|
-
if (!mappedFiles.get(activityName)) {
|
|
99
|
-
mappedFiles.set(activityName, new Map())
|
|
100
|
-
}
|
|
101
|
-
if (fileName.length === 3) {
|
|
102
|
-
mappedFiles.get(activityName).set(fileName, {
|
|
103
|
-
ref: fileRef,
|
|
104
|
-
content: fileContent.data()
|
|
105
|
-
}) // add entry for the page
|
|
106
|
-
}
|
|
107
|
-
// Handleling Groupe page type
|
|
108
|
-
else if (fileName.length > 3) {
|
|
109
|
-
const keyToFind = fileName.split('_', 1)[0] // Pxx
|
|
110
|
-
const KeyToAdd = fileName.split('_')[1] // Exx
|
|
111
|
-
|
|
112
|
-
// search for the page key in the map
|
|
113
|
-
if (mappedFiles.get(activityName).has(keyToFind)) {
|
|
114
|
-
// save a reference for the value of the key
|
|
115
|
-
const tempSave = mappedFiles.get(activityName).get(keyToFind)
|
|
116
|
-
// transform value of found key as a new map
|
|
117
|
-
if (!mappedFiles.get(activityName).get(keyToFind).size) {
|
|
118
|
-
mappedFiles.get(activityName).set(keyToFind, new Map())
|
|
119
|
-
// add reference of the previous key's value as new entry in the new map
|
|
120
|
-
mappedFiles
|
|
121
|
-
.get(activityName)
|
|
122
|
-
.get(keyToFind)
|
|
123
|
-
.set(keyToFind, tempSave)
|
|
124
|
-
}
|
|
125
|
-
// Create a entry for key Exx as a map
|
|
126
|
-
if (
|
|
127
|
-
!mappedFiles
|
|
128
|
-
.get(activityName)
|
|
129
|
-
.get(keyToFind)
|
|
130
|
-
.get(KeyToAdd)
|
|
131
|
-
)
|
|
132
|
-
mappedFiles
|
|
133
|
-
.get(activityName)
|
|
134
|
-
.get(keyToFind)
|
|
135
|
-
.set(KeyToAdd, new Map())
|
|
136
|
-
// Add page in the Map Exx
|
|
137
|
-
mappedFiles
|
|
138
|
-
.get(activityName)
|
|
139
|
-
.get(keyToFind)
|
|
140
|
-
.get(KeyToAdd)
|
|
141
|
-
.set(fileName, {
|
|
142
|
-
ref: fileRef,
|
|
143
|
-
content: fileContent.data()
|
|
144
|
-
})
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
if (mappedFiles.size > 0) {
|
|
151
|
-
/**
|
|
152
|
-
* Define a route for each Activity and its pages
|
|
153
|
-
* Set all nested routes in Activities
|
|
154
|
-
* Set the activies routes as children of module route
|
|
155
|
-
*/
|
|
156
|
-
let activityCount = 0
|
|
157
|
-
|
|
158
|
-
for (const [key, value] of mappedFiles) {
|
|
159
|
-
let activityPageCount = 0 // page counter
|
|
160
|
-
let abstractRouteForActivity
|
|
161
|
-
|
|
162
|
-
//= ============================== Routes for the Introduction =======================//
|
|
163
|
-
if (key === 'A00') {
|
|
164
|
-
// continue
|
|
165
|
-
let menuRoute
|
|
166
|
-
let menuMeta
|
|
167
|
-
// Build abstract route for the Introduction
|
|
168
|
-
abstractRouteForActivity = {
|
|
169
|
-
path: 'introduction',
|
|
170
|
-
component: AppCompViewDisplay,
|
|
171
|
-
meta: {
|
|
172
|
-
id: `${key}`,
|
|
173
|
-
children: []
|
|
174
|
-
},
|
|
175
|
-
children: []
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const mapToArray = Array.from(value) // convert the map of all route to array
|
|
179
|
-
|
|
180
|
-
mapToArray.forEach((el) => {
|
|
181
|
-
let activityRoute = {}
|
|
182
|
-
|
|
183
|
-
// build route for the menu
|
|
184
|
-
if (el[1].content.type && el[1].content.type === 'pg_menu') {
|
|
185
|
-
const componentName = el[1].ref
|
|
186
|
-
menuRoute = {
|
|
187
|
-
path: 'menu',
|
|
188
|
-
name: 'menu',
|
|
189
|
-
component: () =>
|
|
190
|
-
import(
|
|
191
|
-
/* webpackChunkName: "gpPage" */ `@/${componentName}`
|
|
192
|
-
),
|
|
193
|
-
meta: {
|
|
194
|
-
id: el[0],
|
|
195
|
-
type: 'menu',
|
|
196
|
-
activity_ref: `${key}`,
|
|
197
|
-
parent: {
|
|
198
|
-
_ref: fileContent.data.id,
|
|
199
|
-
_path: newRoute.path,
|
|
200
|
-
_namedRoute: `${fileName.toLowerCase()}`
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
menuMeta = {
|
|
205
|
-
_ref: el[0],
|
|
206
|
-
_path: menuRoute.path,
|
|
207
|
-
_namedRoute: menuRoute.name
|
|
208
|
-
}
|
|
209
|
-
menuCreated = true // menu has been created
|
|
210
|
-
|
|
211
|
-
abstractRouteForActivity.children.push(menuRoute)
|
|
212
|
-
abstractRouteForActivity.meta.children.push(menuMeta)
|
|
213
|
-
} else {
|
|
214
|
-
activityPageCount += 1
|
|
215
|
-
// build route for Introduction landing page(page-1)
|
|
216
|
-
if (activityPageCount === 1) {
|
|
217
|
-
const componentName = el[1].ref
|
|
218
|
-
activityRoute = {
|
|
219
|
-
path: `page-${activityPageCount}`,
|
|
220
|
-
name: `introduction`,
|
|
221
|
-
component: () =>
|
|
222
|
-
import(
|
|
223
|
-
/* webpackChunkName: "gpPage" */ `@/${componentName}`
|
|
224
|
-
),
|
|
225
|
-
meta: {
|
|
226
|
-
id: el[0], // P01
|
|
227
|
-
type: 'introduction',
|
|
228
|
-
activity_ref: `${key}`, // A00
|
|
229
|
-
parent: {
|
|
230
|
-
_ref: fileContent.data.id,
|
|
231
|
-
_path: newRoute.path,
|
|
232
|
-
_namedRoute: `${fileName.toLowerCase()}`
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
// build route for other pages of Introduction
|
|
238
|
-
else {
|
|
239
|
-
const componentName = el[1].ref
|
|
240
|
-
activityRoute = {
|
|
241
|
-
path: `page-${activityPageCount}`,
|
|
242
|
-
name: `introduction.page_${activityPageCount}`,
|
|
243
|
-
component: () =>
|
|
244
|
-
import(
|
|
245
|
-
/* webpackChunkName: "gpPage" */ `@/${componentName}`
|
|
246
|
-
),
|
|
247
|
-
meta: {
|
|
248
|
-
id: el[0], //PXX
|
|
249
|
-
type: 'introduction',
|
|
250
|
-
activity_ref: `${key}`, // A00
|
|
251
|
-
parent: {
|
|
252
|
-
_ref: fileContent.data.id,
|
|
253
|
-
_path: newRoute.path,
|
|
254
|
-
_namedRoute: `${fileName.toLowerCase()}`
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
// Add the route abstract route
|
|
260
|
-
abstractRouteForActivity.meta.children.push({
|
|
261
|
-
_ref: el[0],
|
|
262
|
-
_path: activityRoute.path,
|
|
263
|
-
_namedRoute: activityRoute.name
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
// Nest landing page to abstract route
|
|
267
|
-
abstractRouteForActivity.children.push(activityRoute)
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
// Menu route to collection as last entry
|
|
271
|
-
// abstractRouteForActivity.children.push(menuRoute)
|
|
272
|
-
// abstractRouteForActivity.meta.children.push(menuMeta)
|
|
273
|
-
|
|
274
|
-
// add activities reference in module meta information
|
|
275
|
-
moduleRoute.meta.children.push({
|
|
276
|
-
_ref: key,
|
|
277
|
-
_path: `introduction`,
|
|
278
|
-
_namedRoute: `introduction`
|
|
279
|
-
})
|
|
280
|
-
} else {
|
|
281
|
-
//= ============================== Routes for the activity ===========================//
|
|
282
|
-
// Build abstract route for the activity
|
|
283
|
-
activityCount += 1
|
|
284
|
-
abstractRouteForActivity = {
|
|
285
|
-
path: `activite-${activityCount}`,
|
|
286
|
-
component: AppCompViewDisplay,
|
|
287
|
-
meta: {
|
|
288
|
-
id: `${key}`,
|
|
289
|
-
children: []
|
|
290
|
-
},
|
|
291
|
-
children: []
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
let branchingCount = 0
|
|
295
|
-
// nested routes for abstract route
|
|
296
|
-
for (const [pKey, pValue] of value) {
|
|
297
|
-
let activityRoute = {}
|
|
298
|
-
activityPageCount += 1
|
|
299
|
-
|
|
300
|
-
// PO1.vue: is always landing page for an activity
|
|
301
|
-
if (pKey === 'P01') {
|
|
302
|
-
const componentName = pValue.ref
|
|
303
|
-
activityRoute = {
|
|
304
|
-
path: `page-${activityPageCount}`,
|
|
305
|
-
name: `activite_${activityCount}`,
|
|
306
|
-
component: () =>
|
|
307
|
-
import(
|
|
308
|
-
/* webpackChunkName: "gpPage" */ `@/${componentName}`
|
|
309
|
-
),
|
|
310
|
-
meta: {
|
|
311
|
-
id: pKey,
|
|
312
|
-
type: 'activity',
|
|
313
|
-
activity_ref: `${key}`,
|
|
314
|
-
parent: {
|
|
315
|
-
_ref: fileContent.data.id,
|
|
316
|
-
_path: newRoute.path,
|
|
317
|
-
_namedRoute: `${fileName.toLowerCase()}`
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
// Add landing page ref to abstract route meta
|
|
322
|
-
//= ==> P01 is not Branching Type. Build simple route//
|
|
323
|
-
if (!pValue.size) {
|
|
324
|
-
abstractRouteForActivity.meta.children.push({
|
|
325
|
-
_ref: pKey,
|
|
326
|
-
_path: activityRoute.path,
|
|
327
|
-
_namedRoute: activityRoute.name
|
|
328
|
-
})
|
|
329
|
-
// Nest landing page to abstract route
|
|
330
|
-
abstractRouteForActivity.children.push(activityRoute)
|
|
331
|
-
}
|
|
332
|
-
//= ===> P01 is Branching Type. Build complexe route//
|
|
333
|
-
else {
|
|
334
|
-
branchingCount += 1
|
|
335
|
-
let branchCount = 0 // branch counter
|
|
336
|
-
// build abstract route for branching
|
|
337
|
-
activityRoute = {
|
|
338
|
-
path: `page-${activityPageCount}`,
|
|
339
|
-
component: AppCompViewDisplay,
|
|
340
|
-
meta: {
|
|
341
|
-
id: `${key}_branching_${branchingCount}`
|
|
342
|
-
},
|
|
343
|
-
children: []
|
|
344
|
-
}
|
|
345
|
-
const mapToArray = Array.from(pValue) // convert the map of all route to array
|
|
346
|
-
const landingPageId = mapToArray[0][0] // get the fist element of the array (P01)
|
|
347
|
-
|
|
348
|
-
// build landing Page route for branching
|
|
349
|
-
// landing page for branching is P01
|
|
350
|
-
const componentName = mapToArray[0][1].ref
|
|
351
|
-
//const componentName = el[1].ref.replace("src/", "");
|
|
352
|
-
const landingPageForBranching = {
|
|
353
|
-
path: '',
|
|
354
|
-
name: `activite_${activityCount}`,
|
|
355
|
-
component: () =>
|
|
356
|
-
import(
|
|
357
|
-
/* webpackChunkName: "gpNested" */
|
|
358
|
-
`@/${componentName}`
|
|
359
|
-
),
|
|
360
|
-
meta: {
|
|
361
|
-
id: landingPageId,
|
|
362
|
-
type: 'branching',
|
|
363
|
-
activity_ref: key, // Axx
|
|
364
|
-
parent: {
|
|
365
|
-
_ref: landingPageId,
|
|
366
|
-
_path: `activite-${activityCount}`, // activite-xx
|
|
367
|
-
_namedRoute: `activite_${activityCount}` // activite_xx
|
|
368
|
-
},
|
|
369
|
-
children: []
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
// Nest landing page in activity route
|
|
373
|
-
activityRoute.children.push(landingPageForBranching)
|
|
374
|
-
|
|
375
|
-
// Build route for Branches of Branching
|
|
376
|
-
mapToArray.forEach((el, index) => {
|
|
377
|
-
// other than P01
|
|
378
|
-
if (index !== 0) {
|
|
379
|
-
branchCount += 1
|
|
380
|
-
const elMapToArray = Array.from(el[1])
|
|
381
|
-
// build abstract route for branch
|
|
382
|
-
const routeForBranch = {
|
|
383
|
-
path: `branch-${branchCount}`,
|
|
384
|
-
component: AppCompViewDisplay,
|
|
385
|
-
meta: {
|
|
386
|
-
id: `${landingPageId}-${el[0]}`,
|
|
387
|
-
type: 'branch_page',
|
|
388
|
-
children: []
|
|
389
|
-
},
|
|
390
|
-
children: []
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
let branchPageCount = 0
|
|
394
|
-
for (const el of elMapToArray) {
|
|
395
|
-
branchPageCount += 1
|
|
396
|
-
let routeForBranchPage = {}
|
|
397
|
-
// Config route for 1st page (P01-EXX-P01) of Branch
|
|
398
|
-
if (elMapToArray.indexOf(el) === 0) {
|
|
399
|
-
const componentName = el[1].ref.replace('src/', '')
|
|
400
|
-
|
|
401
|
-
routeForBranchPage = {
|
|
402
|
-
path: `page-${branchPageCount}`,
|
|
403
|
-
name: `${key}.branching_${branchingCount}.branch_${branchCount}.page_${branchPageCount}`,
|
|
404
|
-
component: () =>
|
|
405
|
-
import(
|
|
406
|
-
/* webpackChunkName: "gpNested" */
|
|
407
|
-
`@/${componentName}`
|
|
408
|
-
),
|
|
409
|
-
meta: {
|
|
410
|
-
id: el[0],
|
|
411
|
-
type: 'branch_page',
|
|
412
|
-
activity_ref: key,
|
|
413
|
-
branching_ref: `${key}_branching_${branchingCount}`,
|
|
414
|
-
branch_ref: `branch-${branchCount}`,
|
|
415
|
-
branching_root: landingPageForBranching.name,
|
|
416
|
-
parent: {
|
|
417
|
-
_ref: landingPageForBranching.meta.id,
|
|
418
|
-
_path: `branch-${branchCount}`,
|
|
419
|
-
_namedRoute: landingPageForBranching.name
|
|
420
|
-
},
|
|
421
|
-
children: []
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
// add route ref of landing page to branching meta
|
|
425
|
-
landingPageForBranching.meta.children.push({
|
|
426
|
-
_ref: routeForBranchPage.meta.id,
|
|
427
|
-
_path: `branch-${branchCount}`,
|
|
428
|
-
_namedRoute: routeForBranchPage.name
|
|
429
|
-
})
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// Config route for other pages ((P01-EXX-PXX)) of Branch
|
|
433
|
-
else {
|
|
434
|
-
const componentName = el[1].ref.replace('src/', '')
|
|
435
|
-
|
|
436
|
-
routeForBranchPage = {
|
|
437
|
-
path: `page-${branchPageCount}`,
|
|
438
|
-
name: `${key}.branching_${branchingCount}.branch_${branchCount}.page_${branchPageCount}`,
|
|
439
|
-
component: () =>
|
|
440
|
-
import(
|
|
441
|
-
/* webpackChunkName: "gpNested" */ `@/${componentName}`
|
|
442
|
-
),
|
|
443
|
-
meta: {
|
|
444
|
-
id: el[0],
|
|
445
|
-
type: 'branch_page',
|
|
446
|
-
activity_ref: key,
|
|
447
|
-
branching_ref: `${key}_branching_${branchingCount}`,
|
|
448
|
-
branch_ref: `branch-${branchCount}`,
|
|
449
|
-
branching_root: landingPageForBranching.name,
|
|
450
|
-
parent: {
|
|
451
|
-
_ref: routeForBranch.children[0].meta.id,
|
|
452
|
-
_path: `branch-${branchCount}`,
|
|
453
|
-
_namedRoute: routeForBranch.children[0].name
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
// add reference of branchPage to routeForBranch meta
|
|
459
|
-
routeForBranch.meta.children.push({
|
|
460
|
-
_ref: routeForBranchPage.meta.id,
|
|
461
|
-
_path: routeForBranchPage.path,
|
|
462
|
-
_namedRoute: routeForBranchPage.name
|
|
463
|
-
})
|
|
464
|
-
// Nest route for branch page to branch
|
|
465
|
-
routeForBranch.children.push(routeForBranchPage)
|
|
466
|
-
// add reference of route to branchpage landing meta
|
|
467
|
-
routeForBranch.children[0].meta.children.push({
|
|
468
|
-
_ref: routeForBranchPage.meta.id,
|
|
469
|
-
_path: routeForBranchPage.path,
|
|
470
|
-
_namedRoute: routeForBranchPage.name
|
|
471
|
-
})
|
|
472
|
-
}
|
|
473
|
-
// nest branching Routes to landing page for branching
|
|
474
|
-
activityRoute.children.push(routeForBranch)
|
|
475
|
-
}
|
|
476
|
-
})
|
|
477
|
-
// add landing page ref to abstract route meta
|
|
478
|
-
abstractRouteForActivity.meta.children.push({
|
|
479
|
-
_ref: landingPageForBranching.meta.id,
|
|
480
|
-
_path: activityRoute.path,
|
|
481
|
-
_namedRoute: landingPageForBranching.name
|
|
482
|
-
})
|
|
483
|
-
// Nest activity route for branch in abstract route
|
|
484
|
-
abstractRouteForActivity.children.push(activityRoute)
|
|
485
|
-
} // End Branching type
|
|
486
|
-
}
|
|
487
|
-
// Not P01.vue: Other page for an activity
|
|
488
|
-
else {
|
|
489
|
-
//= ===> PXX is Not Branching Type. Build simple route //
|
|
490
|
-
if (!pValue.size) {
|
|
491
|
-
const componentName = pValue.ref
|
|
492
|
-
|
|
493
|
-
activityRoute = {
|
|
494
|
-
path: `page-${activityPageCount}`,
|
|
495
|
-
name: `activite_${activityCount}.page_${activityPageCount}`,
|
|
496
|
-
component: () =>
|
|
497
|
-
import(
|
|
498
|
-
/* webpackChunkName: "gpPage" */ `@/${componentName}`
|
|
499
|
-
),
|
|
500
|
-
meta: {
|
|
501
|
-
id: pKey,
|
|
502
|
-
activity_ref: `${key}`,
|
|
503
|
-
type: 'pg_normal',
|
|
504
|
-
parent: {
|
|
505
|
-
_ref: key,
|
|
506
|
-
_path: `activite-${activityCount}`,
|
|
507
|
-
_namedRoute: `activite_${activityCount}`
|
|
508
|
-
}
|
|
509
|
-
},
|
|
510
|
-
children: []
|
|
511
|
-
}
|
|
512
|
-
// Add landing page ref to abstract route meta
|
|
513
|
-
abstractRouteForActivity.meta.children.push({
|
|
514
|
-
_ref: pKey,
|
|
515
|
-
_path: activityRoute.path,
|
|
516
|
-
_namedRoute: activityRoute.name
|
|
517
|
-
})
|
|
518
|
-
abstractRouteForActivity.children.push(activityRoute)
|
|
519
|
-
}
|
|
520
|
-
//= ====PXX Is Branching Type. Build complexe route====//
|
|
521
|
-
else {
|
|
522
|
-
branchingCount += 1
|
|
523
|
-
let branchCount = 0 // branch counter
|
|
524
|
-
|
|
525
|
-
// build activity route for branching
|
|
526
|
-
activityRoute = {
|
|
527
|
-
path: `page-${activityPageCount}`,
|
|
528
|
-
component: AppCompViewDisplay,
|
|
529
|
-
meta: {
|
|
530
|
-
id: `${key}_branching_${branchingCount}`
|
|
531
|
-
},
|
|
532
|
-
children: []
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const mapToArray = Array.from(pValue) // convert the map of all route to array
|
|
536
|
-
const landingPageId = mapToArray[0][0] // get the fist element of the array (P01)
|
|
537
|
-
|
|
538
|
-
// build landing Page route for branching
|
|
539
|
-
// landing page for branching is PXX
|
|
540
|
-
const componentName = mapToArray[0][1].ref
|
|
541
|
-
const landingPageForBranching = {
|
|
542
|
-
path: '',
|
|
543
|
-
name: `activite_${activityCount}.page_${activityPageCount}`,
|
|
544
|
-
component: () =>
|
|
545
|
-
import(
|
|
546
|
-
/* webpackChunkName: "gpNested" */ `@/${componentName}`
|
|
547
|
-
),
|
|
548
|
-
meta: {
|
|
549
|
-
id: landingPageId,
|
|
550
|
-
type: 'branching',
|
|
551
|
-
activity_ref: key, // Axx
|
|
552
|
-
parent: {
|
|
553
|
-
_ref: landingPageId,
|
|
554
|
-
_path: `activite-${activityCount}`, // activite-xx
|
|
555
|
-
_namedRoute: `activite_${activityCount}` // activite_xx
|
|
556
|
-
},
|
|
557
|
-
children: [
|
|
558
|
-
// get the info of Branch
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
// Nest landing page in activity route
|
|
563
|
-
activityRoute.children.push(landingPageForBranching)
|
|
564
|
-
|
|
565
|
-
// Build route for Branch of Branching
|
|
566
|
-
mapToArray.forEach((el, index) => {
|
|
567
|
-
if (index !== 0) {
|
|
568
|
-
branchCount += 1
|
|
569
|
-
const elMapToArray = Array.from(el[1])
|
|
570
|
-
|
|
571
|
-
// build abstract route for branch
|
|
572
|
-
const routeForBranch = {
|
|
573
|
-
path: `branch-${branchCount}`,
|
|
574
|
-
component: AppCompViewDisplay,
|
|
575
|
-
meta: {
|
|
576
|
-
id: `${landingPageId}-${el[0]}`,
|
|
577
|
-
children: []
|
|
578
|
-
},
|
|
579
|
-
children: [
|
|
580
|
-
// get the pages in a Branch
|
|
581
|
-
]
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
let branchPageCount = 0
|
|
585
|
-
for (const el of elMapToArray) {
|
|
586
|
-
branchPageCount += 1
|
|
587
|
-
let routeForBranchPage = {}
|
|
588
|
-
|
|
589
|
-
// Config route for 1st page of Branch
|
|
590
|
-
if (elMapToArray.indexOf(el) === 0) {
|
|
591
|
-
const componentName = el[1].ref.replace('src/', '')
|
|
592
|
-
|
|
593
|
-
routeForBranchPage = {
|
|
594
|
-
path: `page-${branchPageCount}`,
|
|
595
|
-
name: `${key}.branching_${branchingCount}.branch_${branchCount}.page_${branchPageCount}`,
|
|
596
|
-
component: () =>
|
|
597
|
-
import(
|
|
598
|
-
/* webpackChunkName: "gpNested" */ `@/${componentName}`
|
|
599
|
-
),
|
|
600
|
-
meta: {
|
|
601
|
-
id: el[0],
|
|
602
|
-
type: 'branch_page',
|
|
603
|
-
activity_ref: key,
|
|
604
|
-
branching_ref: `${key}_branching_${branchingCount}`,
|
|
605
|
-
branch_ref: `branch-${branchCount}`,
|
|
606
|
-
branching_root: landingPageForBranching.name,
|
|
607
|
-
parent: {
|
|
608
|
-
_ref: landingPageForBranching.meta.id,
|
|
609
|
-
_path: `branch-${branchCount}`,
|
|
610
|
-
_namedRoute: landingPageForBranching.name
|
|
611
|
-
},
|
|
612
|
-
children: []
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
// add route ref to landing page for branching meta
|
|
616
|
-
landingPageForBranching.meta.children.push({
|
|
617
|
-
_ref: routeForBranchPage.meta.id,
|
|
618
|
-
_path: `branch-${branchCount}`,
|
|
619
|
-
_namedRoute: routeForBranchPage.name
|
|
620
|
-
})
|
|
621
|
-
}
|
|
622
|
-
// Config route for other pages of Branch
|
|
623
|
-
else {
|
|
624
|
-
const componentName = el[1].ref.replace('src/', '')
|
|
625
|
-
|
|
626
|
-
routeForBranchPage = {
|
|
627
|
-
path: `page-${branchPageCount}`,
|
|
628
|
-
name: `${key}.branching_${branchingCount}.branch_${branchCount}.page_${branchPageCount}`,
|
|
629
|
-
component: () =>
|
|
630
|
-
import(
|
|
631
|
-
/* webpackChunkName: "gpNested" */ `@/${componentName}`
|
|
632
|
-
),
|
|
633
|
-
meta: {
|
|
634
|
-
id: el[0],
|
|
635
|
-
type: 'branch_page',
|
|
636
|
-
activity_ref: key,
|
|
637
|
-
branching_ref: `${key}_branching_${branchingCount}`,
|
|
638
|
-
branch_ref: `branch-${branchCount}`,
|
|
639
|
-
branching_root: landingPageForBranching.name,
|
|
640
|
-
parent: {
|
|
641
|
-
_ref: routeForBranch.children[0].meta.id,
|
|
642
|
-
_path: `branch-${branchCount}`,
|
|
643
|
-
_namedRoute: routeForBranch.children[0].name
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// add reference of branchPage to routeForBranch meta
|
|
650
|
-
routeForBranch.meta.children.push({
|
|
651
|
-
_ref: routeForBranchPage.meta.id,
|
|
652
|
-
_path: routeForBranchPage.path,
|
|
653
|
-
_namedRoute: routeForBranchPage.name
|
|
654
|
-
})
|
|
655
|
-
// add route to route for branch
|
|
656
|
-
routeForBranch.children.push(routeForBranchPage)
|
|
657
|
-
// add reference to branchpageLanding
|
|
658
|
-
routeForBranch.children[0].meta.children.push({
|
|
659
|
-
_ref: routeForBranchPage.meta.id,
|
|
660
|
-
_path: routeForBranchPage.path,
|
|
661
|
-
_namedRoute: routeForBranchPage.name
|
|
662
|
-
})
|
|
663
|
-
}
|
|
664
|
-
// nest branching Routes to landing page for branching
|
|
665
|
-
activityRoute.children.push(routeForBranch)
|
|
666
|
-
}
|
|
667
|
-
})
|
|
668
|
-
// add landing page ref to abstract route meta
|
|
669
|
-
abstractRouteForActivity.meta.children.push({
|
|
670
|
-
_ref: landingPageForBranching.meta.id,
|
|
671
|
-
_path: activityRoute.path,
|
|
672
|
-
_namedRoute: landingPageForBranching.name
|
|
673
|
-
})
|
|
674
|
-
// nest activity route for branch in abstract route
|
|
675
|
-
abstractRouteForActivity.children.push(activityRoute)
|
|
676
|
-
} // End Branching type
|
|
677
|
-
} // END creation of routes for abstract routes
|
|
678
|
-
}
|
|
679
|
-
// add activities reference in module meta information
|
|
680
|
-
moduleRoute.meta.children.push({
|
|
681
|
-
_ref: key,
|
|
682
|
-
_path: `activite-${activityCount}`,
|
|
683
|
-
_namedRoute: `activite_${activityCount}`
|
|
684
|
-
})
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
// add Activity routes to module as nested route
|
|
688
|
-
moduleRoute.children.push(abstractRouteForActivity)
|
|
689
|
-
}
|
|
690
|
-
} else errorType = 'errorPage'
|
|
691
|
-
if (!menuCreated) errorType = 'errorMenu'
|
|
692
|
-
} else errorType = 'errorPage'
|
|
693
|
-
// Add register Module pages to store
|
|
694
|
-
store.state.thisModule.activities = mappedFiles
|
|
695
|
-
|
|
696
|
-
// Set Module route as child of abstract route. Module will render inside abstract component
|
|
697
|
-
newRoute.children.push(moduleRoute)
|
|
698
|
-
} else errorType = 'errorModule'
|
|
699
|
-
} else errorType = 'errorModule'
|
|
700
|
-
|
|
701
|
-
if (!errorType) {
|
|
702
|
-
// add the newRoute to the routes array
|
|
703
|
-
_routes.push(newRoute)
|
|
704
|
-
} else {
|
|
705
|
-
// create Route for error non-existing files
|
|
706
|
-
_routes.push({
|
|
707
|
-
path: '/',
|
|
708
|
-
component: () =>
|
|
709
|
-
import(
|
|
710
|
-
/* webpackChunkName: "gpNested" */ `./components/AppBaseErrorDisplay.vue`
|
|
711
|
-
),
|
|
712
|
-
props: {
|
|
713
|
-
errorMessage: errorType
|
|
714
|
-
}
|
|
715
|
-
})
|
|
716
|
-
}
|
|
717
|
-
// Routes for errors : 404
|
|
718
|
-
_routes.push({
|
|
719
|
-
path: '/404',
|
|
720
|
-
name: '404',
|
|
721
|
-
component: () =>
|
|
722
|
-
import(
|
|
723
|
-
/* webpackChunkName: "gpNested" */ `./components/AppBaseErrorDisplay.vue`
|
|
724
|
-
),
|
|
725
|
-
props: {
|
|
726
|
-
errorMessage: '404'
|
|
727
|
-
}
|
|
728
|
-
})
|
|
729
|
-
|
|
730
|
-
// exporting routes object
|
|
731
|
-
export default {
|
|
732
|
-
base: process.env.BASE_URL,
|
|
733
|
-
routes: [..._routes]
|
|
734
|
-
}
|