fcad-core-dragon 2.0.0-beta.0 → 2.0.0-beta.1

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -9
  3. package/src/$locales/en.json +39 -15
  4. package/src/$locales/fr.json +48 -23
  5. package/src/components/AppBase.vue +245 -266
  6. package/src/components/AppBaseErrorDisplay.vue +29 -0
  7. package/src/components/AppBaseModule.vue +485 -232
  8. package/src/components/AppBasePage.vue +28 -54
  9. package/src/components/AppCompBif.vue +120 -0
  10. package/src/components/AppCompBranchButtons.vue +31 -30
  11. package/src/components/AppCompButtonProgress.vue +35 -46
  12. package/src/components/AppCompCarousel.vue +154 -247
  13. package/src/components/AppCompJauge.vue +1 -2
  14. package/src/components/AppCompMediaPlayer.vue +106 -74
  15. package/src/components/AppCompMenu.vue +87 -81
  16. package/src/components/AppCompMenuItem.vue +48 -90
  17. package/src/components/AppCompNavigation.vue +949 -0
  18. package/src/components/AppCompNoteCall.vue +126 -0
  19. package/src/components/AppCompNoteCredit.vue +164 -0
  20. package/src/components/AppCompPlayBar.vue +864 -1085
  21. package/src/components/AppCompPopUp.vue +26 -27
  22. package/src/components/AppCompPopover.vue +27 -0
  23. package/src/components/AppCompQuiz.vue +27 -36
  24. package/src/components/AppCompQuizRecall.vue +250 -0
  25. package/src/components/AppCompSVG.vue +309 -0
  26. package/src/components/AppCompSettingsMenu.vue +1 -0
  27. package/src/components/AppCompTableOfContent.vue +140 -85
  28. package/src/components/AppCompTranscript.vue +19 -0
  29. package/src/components/AppCompVideoPlayer.vue +336 -0
  30. package/src/components/BaseModule.vue +24 -105
  31. package/src/main.js +18 -9
  32. package/src/mixins/$pageMixins.js +106 -28
  33. package/src/mixins/timerMixin.js +31 -7
  34. package/src/module/store.js +33 -12
  35. package/src/module/xapi/Crypto/encoders/Hex.js +2 -1
  36. package/src/module/xapi/wrapper.js +4 -4
  37. package/src/plugins/gsap.js +4 -1
  38. package/src/plugins/helper.js +53 -18
  39. package/src/plugins/idb.js +1 -0
  40. package/src/public/index.html +1 -1
  41. package/src/router/index.js +41 -0
  42. package/src/router/routes.js +337 -0
  43. package/src/routes_bckp.js +313 -0
  44. package/src/routes_static.js +344 -0
  45. package/src/shared/generalfuncs.js +79 -4
  46. package/src/shared/validators.js +249 -0
  47. package/src/components/AppCompNavigationFull.vue +0 -1791
  48. package/src/components/AppCompToolTip.vue +0 -94
  49. package/src/routes.js +0 -734
@@ -10,53 +10,40 @@
10
10
  class="menu-section-activity"
11
11
  :aria-describedby="activity.id + '-subMenu'"
12
12
  >
13
- <app-base-button
13
+ <b-link
14
14
  :id="activity.id + '-subMenu'"
15
- v-b-toggle="'sidebar-submenu'"
16
15
  :title="activity.title"
17
- @click="activityInfo(activity)"
16
+ :to="{
17
+ name: createRoutes(activity.id)
18
+ }"
18
19
  >
19
20
  <div class="menu-card" tag="article">
20
21
  <b-row>
21
- <div v-show="activity.title" class="title">
22
- <h5>{{ activity.title || '' }}</h5>
22
+ <div v-if="activity.subtitle === undefined" class="title">
23
+ <h4 v-html="activity.title"></h4>
23
24
  </div>
24
- <div v-show="activity.subtitle" class="subtitle">
25
- <h4>{{ activity.subtitle || '' }}</h4>
25
+ <div v-else class="title">
26
+ <h4 v-html="`${activity.title} : ${activity.subtitle}`"></h4>
26
27
  </div>
28
+
27
29
  <div class="time">
28
30
  <p class="time">
29
- <svg
30
- xmlns="http://www.w3.org/2000/svg"
31
- viewBox="0 0 18 21.01"
32
- width="18 "
33
- height="21.01"
34
- :aria-label="$t('label.timer')"
35
- >
36
- <path
37
- id="Path_3904"
38
- d="M12,0H6v2h6V0z M8,13h2V7H8V13z M16.03,6.39l1.42-1.42c-0.43-0.51-0.9-0.98-1.41-1.41l-1.42,1.42
39
- c-3.88-3.1-9.55-2.47-12.65,1.41s-2.47,9.55,1.41,12.65s9.55,2.47,12.65-1.41C18.66,14.34,18.66,9.68,16.03,6.39z M9,19
40
- c-3.87,0-7-3.13-7-7s3.13-7,7-7s7,3.13,7,7c0,3.86-3.13,7-6.99,7C9.01,19,9,19,9,19z"
41
- />
31
+ <svg width="18" height="21.01" :aria-label="$t('label.timer')">
32
+ <use href="#clock-icon" />
42
33
  </svg>
43
34
  {{ activity.time || '00:00' }}
44
35
  </p>
45
36
  </div>
46
37
  <div class="box-gauge">
47
38
  <app-comp-jauge
48
- :state="getProgressStatus(activity.id)"
49
39
  :max-value="getActivitySize(activity.id)"
50
40
  :value="getPageComplete(activity.id)"
51
- :pourcent="getPourcentGauge"
52
- :fraction="getFractionGauge"
53
41
  />
54
42
  </div>
55
43
  </b-row>
56
44
  </div>
57
- </app-base-button>
45
+ </b-link>
58
46
  </b-col>
59
- <app-comp-table-of-content></app-comp-table-of-content>
60
47
  </b-row>
61
48
  </template>
62
49
  <script>
@@ -69,7 +56,7 @@ export default {
69
56
  },
70
57
  computed: {
71
58
  ...mapGetters([
72
- 'getIntroStatus',
59
+ 'getAllActivities',
73
60
  'getAllActivitiesState',
74
61
  'getAllCompleted',
75
62
  'getAppConfigs',
@@ -80,11 +67,13 @@ export default {
80
67
  // get the route of the page from the router to build the menu with its routes
81
68
  let count = 0
82
69
  const collection = []
83
- this.$store.getters.getAllActivities.list.forEach((value, key) => {
70
+
71
+ this.getAllActivities.list.forEach((value, key) => {
84
72
  let theActivity,
85
73
  activityTitle,
86
74
  activitySubTitle,
87
- activityTime = null
75
+ activityTime = null,
76
+ activityPath = ''
88
77
 
89
78
  if (this.menuInfo[key]) {
90
79
  const { title, subTitle, time } = this.menuInfo[key] //get time subTitle time from menu info
@@ -98,41 +87,34 @@ export default {
98
87
  // This is the Introduction
99
88
  if (key === 'A00') {
100
89
  activityTitle = activityTitle || this.$t('text.introduction')
101
- theActivity = {
102
- id: key,
103
- title: activityTitle,
104
- subtitle: activitySubTitle,
105
- time: activityTime,
106
- path: 'introduction',
107
- data: value
108
- }
109
- if (this.getIntroStatus) collection.push(theActivity) // include or not the Introduction in the collection
90
+ activityPath = 'introduction'
91
+ } else if (key === 'A99') {
92
+ activityTitle = activityTitle || this.$t('text.conclusion')
93
+ activityPath = 'conclusion'
110
94
  } else {
111
95
  count++
112
96
  activityTitle =
113
97
  activityTitle || `${this.$t('text.activity')} ${count}`
114
- theActivity = {
115
- id: key,
116
- title: activityTitle,
117
- subtitle: activitySubTitle,
118
- time: activityTime,
119
- path: `activite_${count}`,
120
- data: value
121
- }
122
- collection.push(theActivity) // push the activity in the collection
98
+ activityPath = `activite_${count}`
99
+ }
100
+
101
+ theActivity = {
102
+ id: key,
103
+ title: activityTitle,
104
+ subtitle: activitySubTitle,
105
+ time: activityTime,
106
+ path: activityPath,
107
+ data: value
123
108
  }
109
+
110
+ collection.push(theActivity) // push the activity in the collection
124
111
  })
112
+
125
113
  return collection
126
114
  },
127
115
  menuInfo() {
128
116
  let menuInfo = this.getMenuSettings
129
117
  return menuInfo
130
- },
131
- getFractionGauge() {
132
- return this.getAppConfigs.jauge.fraction
133
- },
134
- getPourcentGauge() {
135
- return this.getAppConfigs.jauge.pourcent
136
118
  }
137
119
  },
138
120
  mounted() {},
@@ -145,48 +127,14 @@ export default {
145
127
  getPageComplete(idActivity) {
146
128
  /// give all the page that are complete to the gauge
147
129
  if (idActivity) {
148
- //get the page which is defined as the menu
149
- const toIgnore = this.$helper
150
- .getRoutesFromVueRouter('A00')
151
- .all_routes.find((el) => el.name === 'menu').meta.id
152
-
153
130
  let completed = []
154
131
  if (this.getAllCompleted[idActivity]) {
155
132
  completed = this.getAllCompleted[idActivity] //get all completed page for the activity
156
-
157
- //for A00 return all completed pages except the menu page
158
- if (idActivity === 'A00')
159
- completed = completed.filter((c) => Object.keys(c)[0] !== toIgnore)
160
133
  }
161
- return completed.length
162
- }
163
- },
164
- /**
165
- * @description give a state of an activity. this available to change style but non mandatory
166
- * @param {String} activityID
167
- * @returns {String} [started|completed|incompleted]
168
- */
169
- getProgressStatus(activityID) {
170
- if (activityID !== 'ID') {
171
- let progress = 'incomplete'
172
- // if activity as a page to complete
173
- if (this.getAllCompleted[activityID]) {
174
- let activitySize = this.getActivitySize(activityID)
175
134
 
176
- // if all activity are in allCompleted give attriube complete if not started
177
- if (activitySize === this.getPageComplete(activityID)) {
178
- progress = 'completed'
179
- } else progress = 'started'
180
- }
181
- return progress
135
+ return completed.length
182
136
  }
183
137
  },
184
-
185
- activityInfo(activity) {
186
- //tell the toc which activity was click to fill the information
187
- this.$bus.$emit('info-activity', activity)
188
- },
189
-
190
138
  /**
191
139
  * @description give the size of the state of the activity
192
140
  * @param {String} activityID
@@ -206,10 +154,20 @@ export default {
206
154
  ? allActivitiesState[activityID].size
207
155
  : 0
208
156
 
209
- // reduce the size if in A00
210
- if (activityID === 'A00' && size > 0) size = size - 1
211
-
212
157
  return size
158
+ },
159
+ createRoutes(data) {
160
+ let activity
161
+
162
+ if (data.charAt(1) == '0' || data.charAt(1) == 0) {
163
+ activity = data.substr(2)
164
+ } else {
165
+ activity = data.substr(1)
166
+ }
167
+
168
+ if (activity == 0 && activity == '0') return `introduction`
169
+ if (activity == '99') return `conclusion`
170
+ else return `activite_${activity}`
213
171
  }
214
172
  }
215
173
  }