fcad-core-dragon 2.3.0-test.5 → 2.3.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # [2.3.0](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/compare/v2.2.0...v2.3.0) (2026-05-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **ci-config:** fixed the rule for npm deployment on granches beta, apha and test ([38923e7](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/38923e7ad775795f2ea27f0d304915a740185892))
7
+ * **ci-config:** fixed the rule for npm deployment on granches beta, apha and test ([808d3de](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/808d3de37bf1d03d420e05fa13412ce17ca72ad1))
8
+ * **dependencies:** fixed depentencies conflicts causing npm ci to fail ([469918e](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/469918e24d0b2948adf7d2f0135d80aeba2b35a8))
9
+ * **Git Page:** Application ne ce lance pas correctement lorsque le projet est deployé sur serveur non cegepadistance. ([2683336](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/2683336bd0928c2550f7d1266675beda8465d580))
10
+ * **quiz:** correction du formatage du message précédent ([6985f51](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/6985f51dee569ec7cfeaba18bf4ee19089f6b5e2))
11
+ * remaning release config file to .releaserc ([2a746d0](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/2a746d0b294577128937a22fae8f556984e97fda))
12
+ * **server connection:** remote parameter prevent production build to connect to LRS when deployed on Moodle ([994e702](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/994e702ce0ed69633798adec8830d33b87680e92))
13
+ * **texttofill:** Remove debug code ([fff8de2](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/fff8de288cadde9469c7f6debb8f320e6751c96d))
14
+ * **ui:** corrige la mise à jour du document.title avec le bon titre lors de la navigation ([7155180](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/7155180447c710d53c752b6a1080ec6be053194f))
15
+
16
+
17
+ ### Features
18
+
19
+ * **core:** expose app-store and app-router via provide for to external plugins and libraries ([42e776f](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/42e776f9af103490d58d067389d28223c61d7ee8))
20
+
21
+ # [2.3.0-test.6](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/compare/v2.3.0-test.5...v2.3.0-test.6) (2026-05-01)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **Git Page:** Application ne ce lance pas correctement lorsque le projet est deployé sur serveur non cegepadistance. ([2683336](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/commit/2683336bd0928c2550f7d1266675beda8465d580))
27
+
1
28
  # [2.3.0-test.5](https://git.crosemont.qc.ca/fcad/core/fcad-core-2/compare/v2.3.0-test.4...v2.3.0-test.5) (2026-04-20)
2
29
 
3
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fcad-core-dragon",
3
- "version": "2.3.0-test.5",
3
+ "version": "2.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./src/main.js",
@@ -524,11 +524,11 @@ export default {
524
524
  completePage() {
525
525
  if (
526
526
  ['pg_menu', 'pg_branch'].includes(this.type) ||
527
- this.state == 'completed' ||
528
- this.isBranchingPage
527
+ this.state == 'completed'
529
528
  )
530
529
  return
531
530
 
531
+
532
532
  this.state = 'completed'
533
533
  this.userInteraction.state = this.state
534
534
  },
@@ -35,6 +35,7 @@ Si la composante est appelée sans prop, les boutons par défaut seront génér
35
35
  :error-text="`Vous avez une/des erreur(s) lors de la création des
36
36
  ${(() => (isCard ? 'cartes' : `boutons`))()} d'embranchments.`"
37
37
  />
38
+
38
39
  <v-row v-else>
39
40
  <v-col
40
41
  v-for="branch of branchsStateData"
@@ -42,6 +43,7 @@ Si la composante est appelée sans prop, les boutons par défaut seront génér
42
43
  :key="branch.id"
43
44
  class="branch-btn"
44
45
  >
46
+ <!-- {{ branchsStateData }} -->
45
47
  <div
46
48
  v-if="isCustomButton"
47
49
  :id="getMatchingElement(branch.id).name"
@@ -55,7 +57,6 @@ Si la composante est appelée sans prop, les boutons par défaut seront génér
55
57
 
56
58
  <app-comp-button-progress
57
59
  :set-target="sidebar"
58
- :percent="branch.progression ? branch.progression : 0"
59
60
  :branch-data="branch"
60
61
  :btn-title="getMatchingElement(branch.id).btnTitle"
61
62
  no-interaction
@@ -69,7 +70,6 @@ Si la composante est appelée sans prop, les boutons par défaut seront génér
69
70
  <v-card-title v-html="branch.title"></v-card-title>
70
71
  <app-comp-button-progress
71
72
  :set-target="sidebar"
72
- :percent="branch.progression ? branch.progression : 0"
73
73
  :branch-data="branch"
74
74
  :btn-title="getMatchingElement(branch.id).btnTitle"
75
75
  ></app-comp-button-progress>
@@ -80,7 +80,6 @@ Si la composante est appelée sans prop, les boutons par défaut seront génér
80
80
  <div v-else class="branch-btn-wrapper">
81
81
  <app-comp-button-progress
82
82
  :set-target="sidebar"
83
- :percent="branch.progression ? branch.progression : 0"
84
83
  :branch-data="branch"
85
84
  :btn-title="branch.text"
86
85
  ></app-comp-button-progress>
@@ -99,10 +98,6 @@ export default {
99
98
  AppCompButtonProgress
100
99
  },
101
100
  props: {
102
- consigne: {
103
- type: Boolean,
104
- default: false
105
- },
106
101
  sidebar: {
107
102
  type: String,
108
103
  default: 'branch-viewer'
@@ -202,7 +197,7 @@ export default {
202
197
  radius: svgRadius,
203
198
  circumference: svgRadius * 2 * Math.PI,
204
199
  branchs: null,
205
- branchsStateData: null,
200
+ branchsStateData: [],
206
201
  idActivity: null,
207
202
  isCustomButton: false,
208
203
  isCard: false,
@@ -237,11 +232,12 @@ export default {
237
232
  deep: true,
238
233
  //watch the completions to update the branches progression
239
234
  handler() {
235
+
240
236
  if (
241
237
  this.getAllCompleted[this.idActivity] &&
242
238
  this.getAllCompleted[this.idActivity].length
243
239
  )
244
- this.getbranchsData()
240
+ this.UpdateBranchProgress()
245
241
  }
246
242
  }
247
243
  },
@@ -251,102 +247,77 @@ export default {
251
247
  this.idActivity = this.$router.currentRoute.value.meta.activity_ref
252
248
  this.branchs = this.$router.currentRoute.value.meta.children
253
249
 
254
- this.getbranchsData()
250
+ this.WhatToLoad()
255
251
  },
256
252
  methods: {
257
253
  /**
258
- * @description Method to get the progression for a branch
259
- *
254
+ * @description Method used to sort according to input type
260
255
  */
261
- getbranchsData() {
262
- this.branchsStateData = []
263
- this.branchs.forEach((branch, index) => {
264
- let branchData = {}
265
- branchData.id = branch._ref
266
- branchData.route = branch._namedRoute
267
- let { state = 'new', progression = 0 } = this.getBranchProgression(
268
- branchData.id
269
- )
256
+ WhatToLoad(){
270
257
 
271
- branchData.state = state
272
- branchData.progression = progression
273
- if (isNaN(branchData.progression)) branchData.progression = 0
274
-
275
- if (this.isCard && this.getMatchingElement(branchData.id)) {
276
- const { title, text, imgFile, imgAlt, btnTitle } =
277
- this.getMatchingElement(branchData.id)
278
-
279
- branchData = {
280
- ...branchData,
281
- text,
282
- title,
283
- imgFile,
284
- imgAlt,
285
- btnTitle
286
- }
258
+ if(this.cards){
259
+ this.cards.forEach((e)=>{
260
+ this.ColletBranchData(e)
261
+ })
262
+ }
287
263
 
288
- if (
289
- typeof branchData.imgAlt === 'undefined' &&
290
- branchData.imgFile === 'undefined' &&
291
- import.meta.env.DEV
292
- ) {
293
- branchData.imgAlt = ''
294
- console.warn(
295
- `Bouton d’embranchement: ALT image sans valeur définie pour ${branchData.id}`
296
- )
297
- }
298
- }
299
- this.branchsStateData[index] = branchData
300
- })
264
+ if(this.customButtons){
265
+ this.customButtons.forEach((e)=>{
266
+ this.ColletBranchData(e)
267
+ })
268
+ }
301
269
  },
302
-
303
270
  /**
304
- * @description Method to get the progression for a branch
305
- * @param {String} idBranch the id of the branch ex: "P01_E01"
306
- * @return {Number} Return the percentage of completion (from 0 to 100) and the current state of a specific branch
271
+ * @description Method responsible for gathering all the information used to build the card or button
272
+ * @param {object} DataCard
273
+ * @return {Array} branchsStateData collection of all card or button to create
307
274
  */
308
- getBranchProgression(idBranch) {
309
- let result = { state: null, progression: null }
275
+ ColletBranchData(DataCard){
276
+ let branchData = {}
310
277
 
311
- if (!this.getAllCompleted[this.idActivity]) return result // no progression found for this activity return result
278
+ let options = ['text','title','imgFile','imgAlt']
312
279
 
313
- const total = this.getBranchPagesCount(idBranch) // get all pages for in this branch
314
- //get all completed branches pages
315
- const completedPages = this.getAllCompleted[this.idActivity].filter(
316
- (page) => {
317
- return Object.keys(page)[0].search(idBranch) !== -1
318
- }
319
- )
320
- result.progression = Math.floor((completedPages.length / total) * 100)
280
+ branchData = options.reduce((acc, opt)=>{
281
+ acc[opt] = opt in DataCard ? DataCard[opt]: null;
282
+ return acc
283
+ }, {})
284
+
285
+ branchData.id = DataCard.brchName
286
+
287
+ this.branchs.forEach((e)=>{
288
+ if(e._ref == branchData.id )
289
+ branchData.route = e._namedRoute
290
+ })
321
291
 
322
- if (isNaN(result.progression)) result.progression = 0
323
292
 
324
- if (result.progression === 0) {
325
- result.state = this.status.NEW
326
- } else if (result.progression === 100) {
327
- result.state = this.status.COMPLETE
328
- } else {
329
- result.state = this.status.STARTED
293
+ if(!this.branchsStateData.length) this.branchsStateData.push(branchData)
294
+ else{
295
+ this.branchsStateData.forEach((e)=>{
296
+ if(!this.branchsStateData.find(({ id }) => id === branchData.id)){
297
+ this.branchsStateData.push(branchData)
298
+ }
299
+ })
330
300
  }
331
- return result
332
- },
333
301
 
302
+ },
334
303
  /**
335
- * @description Method to get the numbers of pages in a branch
336
- * @param {String} idBranch the id of the branch ex: "A02_E01_P01"
337
- * @return {Array} /Return the total of pages in a specific branch
304
+ * @description Method that updates the progression state of a branch
305
+ * @param N/A
306
+ * @return {String} Update State
338
307
  */
339
- getBranchPagesCount(idBranch) {
340
- if (this.$router.currentRoute.value.meta.type !== 'branching') return
341
-
342
- const allPages = this.getAllActivities()
343
- .list.get(this.idActivity)
344
- .get(this.$router.currentRoute.value.meta.id)
345
- .get(idBranch)
308
+ UpdateBranchProgress(){
309
+ if(!this.branchsStateData.length) return
310
+ let act = this.getAllCompleted[this.idActivity]
311
+ let t
312
+ this.branchsStateData.forEach((e)=>{
313
+ t = e.id
314
+
315
+ act.forEach((a)=>{
316
+ if(a.hasOwnProperty(t)) e.state = a[t]
317
+ })
318
+ })
346
319
 
347
- return allPages.size ? allPages.size : 1
348
320
  },
349
-
350
321
  /**
351
322
  * @description Method to validate data in the prop card|customButton.
352
323
  * @param {String} propName The name of the property card|customButton
@@ -356,14 +327,14 @@ export default {
356
327
  let isValid = true
357
328
  let errMsg = false
358
329
 
359
- switch (propName) {
330
+ switch (propName) {
360
331
  case 'cards': {
361
332
  // verify that numbers of element is equal to number
362
333
  //card must have at least 2 elements
363
334
  if (
364
335
  this.cards.constructor !== Array ||
365
- this.cards.length !== this.branchs.length
366
- ) {
336
+ this.cards.length < 1
337
+ ) {
367
338
  isValid = false
368
339
  errMsg = `La propriété cards doit être un tableau contenant ${this.branchs.length} elements`
369
340
  } else {
@@ -387,6 +358,7 @@ export default {
387
358
  b._ref.includes(el.brchName)
388
359
  )
389
360
 
361
+
390
362
  if (!searchEl) {
391
363
  errMsg = `Aucune branch correspondante avec le nom ${el.brchName} pour la carte ${
392
364
  index + 1
@@ -404,7 +376,7 @@ export default {
404
376
  case 'customButtons': {
405
377
  if (
406
378
  this.customButtons.constructor !== Array ||
407
- this.customButtons.length !== this.branchs.length
379
+ this.customButtons.length < 1
408
380
  ) {
409
381
  isValid = false
410
382
  errMsg = `La propriété customButtons doit être un tableau contenant ${this.branchs.length} elements`
@@ -470,7 +442,6 @@ export default {
470
442
 
471
443
  return errMsg
472
444
  },
473
-
474
445
  /**
475
446
  * @description methode to retive matching data of branch in the prop card| customButton
476
447
  * @param {String} id The id of the branch
@@ -41,11 +41,6 @@ export default {
41
41
  type: Boolean,
42
42
  default: false
43
43
  },
44
- percent: {
45
- type: [Number],
46
- default: 0,
47
- required: true
48
- },
49
44
  branchData: {
50
45
  type: Object,
51
46
  required: true
@@ -72,7 +67,7 @@ export default {
72
67
  status: {
73
68
  NEW: 'new',
74
69
  STARTED: 'started',
75
- COMPLETE: 'complete'
70
+ COMPLETE: 'completed'
76
71
  },
77
72
  withRouter: false, //Only for demo purpose. Remove after demo
78
73
  isActive: false,
@@ -136,7 +136,6 @@ export default {
136
136
  disabled: true,
137
137
  selected: true,
138
138
  text: this.$t('message.first_option_dropdown')
139
- // text: 'choisir une option'
140
139
  },
141
140
  ...values.map((el) => ({
142
141
  value: el,
@@ -202,7 +201,6 @@ export default {
202
201
  * @Return a collection of item representing the options for a the selectables
203
202
  */
204
203
  getItemOptions(index) {
205
- console.log(Object.values(this.mappedOptions[index])[0])
206
204
  return Object.values(this.mappedOptions[index])[0]
207
205
  },
208
206
  /**
@@ -284,10 +284,12 @@ export default {
284
284
  let tabcomplete = []
285
285
 
286
286
  if (nextIndex < menuInfo[this.activity].anchors.length) {
287
+ //console.log('dans le premier if')
287
288
  nextSec = menuInfo[this.activity].anchors[nextIndex].pageRef
288
289
  }
289
290
 
290
291
  if (nextSec != undefined) {
292
+ // console.log('dans le Deuxieme if')
291
293
  nb = parseInt(nextSec.substring(1))
292
294
 
293
295
  while (nb > parseInt(curSec.substring(1))) {
@@ -300,14 +302,20 @@ export default {
300
302
  let numPage = this.getAllActivitiesState[this.activity].size
301
303
 
302
304
  for (let g = 1; g == numPage; g++) {
303
- tabPageSec.push(`P${g}`)
305
+ if(g<10){
306
+ tabPageSec.push(`P0${g}`)
307
+ }else{
308
+ tabPageSec.push(`P${g}`)
309
+ }
304
310
  }
311
+
305
312
  if (
306
313
  typeof this.getAllCompleted[this.activity] !== 'undefined' &&
307
314
  this.getAllCompleted[this.activity].length !==
308
315
  this.getAllActivitiesState[this.activity].size
309
316
  )
310
- return false
317
+ return
318
+
311
319
  }
312
320
  tabPageSec.push(curSec)
313
321
  }
package/src/main.js CHANGED
@@ -131,6 +131,7 @@ export default {
131
131
  if (name !== 'initializeApp') return
132
132
  let { appConfigs } = appStore.$state
133
133
  let { remote = false, specification } = appConfigs
134
+
134
135
  const c = await configConnection(appConfigs)
135
136
  store.lrsConfig = c
136
137
  const { $scorm, $xapi, $idb } = app.config.globalProperties
@@ -139,21 +140,22 @@ export default {
139
140
  auth,
140
141
  endpoint,
141
142
  registration = $xapi.ruuid()
142
- } = store.lrsConfig
143
-
144
- const config = {
145
- auth,
146
- endpoint,
147
- registration,
148
- activity_platform: `SIPI_organizationId`
143
+ } = store?.lrsConfig ?? {}
144
+
145
+ if (auth && endpoint) {
146
+ const config = {
147
+ auth,
148
+ endpoint,
149
+ registration,
150
+ activity_platform: `SIPI_organizationId`
151
+ }
152
+ // configure and launch LRS
153
+ $xapi._configLRS(config)
149
154
  }
150
-
151
- $xapi._configLRS(config) // configure and launch LRS
152
155
  }
153
156
 
154
157
  //Configure connection with the Data from appBase
155
158
  //===================================================
156
-
157
159
  const activity_id = c ? c.activity_id : null
158
160
 
159
161
  //Redefine actor with value from connection informtion
@@ -191,6 +193,9 @@ export default {
191
193
  if (lessonPosition) appStore.setLessonPosition([lessonPosition])
192
194
  if (completedState) appStore.setCompletionState(completedState)
193
195
  }
196
+
197
+ if (window.location.hostname !== 'localhost') remote = false
198
+
194
199
  //Open Connection to IDB and Save the store state to localDB
195
200
  let dbStoreActive =
196
201
  !window.location.hostname.includes('cegepadistance.ca') && !remote
@@ -334,6 +339,8 @@ export default {
334
339
  }
335
340
  break
336
341
  }
342
+ default:
343
+ connectionInfo = null
337
344
  }
338
345
 
339
346
  return connectionInfo
@@ -346,7 +353,6 @@ export default {
346
353
  $idb,
347
354
  actor,
348
355
  activity_id,
349
- crs_id,
350
356
  idb_id,
351
357
  specification,
352
358
  remote
@@ -80,32 +80,6 @@ describe('AppCompBranchButtons.vue', () => {
80
80
  vi.clearAllMocks()
81
81
  })
82
82
 
83
- it('Renders ErrorDisplay when cards has errors', async () => {
84
- const wrapper = mount(AppCompBranchButtons, {
85
- global: globalConfig,
86
- props: {
87
- cards: [dummyProps.cards[0], dummyProps.cards[1]] // Only 2 cards passed instead of 3
88
- }
89
- })
90
-
91
- await wrapper.vm.$nextTick() // Must wait for DOM updates to display AppBaseErrorDisplay
92
-
93
- if (wrapper.vm.hasErrors) {
94
- const cards = wrapper.vm.cards
95
- console.log(colors.green, `\n ✅ Current cards: ${JSON.stringify(cards)}`)
96
- console.log(
97
- '✅ wrapper.vm.hasErrors:',
98
- wrapper.vm.hasErrors,
99
- colors.reset
100
- )
101
- }
102
- // Error should be displayed
103
- expect(wrapper.vm.hasErrors.length).toBeGreaterThan(0)
104
- expect(
105
- wrapper.findComponent({ name: 'AppBaseErrorDisplay' }).exists()
106
- ).toBe(true)
107
- })
108
-
109
83
  it('Renders ErrorDisplay when customButtons has errors', async () => {
110
84
  const wrapper = mount(AppCompBranchButtons, {
111
85
  global: globalConfig,
@@ -166,7 +140,6 @@ describe('AppCompBranchButtons.vue', () => {
166
140
  ).not.toBe(true)
167
141
  // element to rendered correctly in DOM
168
142
  expect(wrapper.find('#branch-buttons-component').exists()).toBe(true)
169
- //should display 3 buttons
170
- expect(wrapper.findAll('.branch-btn').length).toBe(3)
143
+
171
144
  })
172
145
  })