@coorpacademy/app-review 0.1.13 → 0.1.15
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/es/actions/api/fetch-slide.d.ts +3 -3
- package/es/actions/api/fetch-slide.js +22 -2
- package/es/actions/api/post-progression.js +1 -2
- package/es/actions/index.d.ts +1 -10
- package/es/actions/ui/is-fetching.js +0 -2
- package/es/actions/ui/slides.d.ts +26 -0
- package/es/actions/ui/slides.js +9 -0
- package/es/common/index.d.ts +3 -1
- package/es/common/index.js +3 -1
- package/es/fixtures/qcm-slide.d.ts +2 -2
- package/es/fixtures/temp-fixture.d.ts +2 -2
- package/es/helpers/map-api-slide-to-ui.d.ts +4 -1
- package/es/helpers/map-api-slide-to-ui.js +33 -15
- package/es/helpers/test/fixtures/free-text.d.ts +2 -3
- package/es/helpers/test/fixtures/free-text.js +10 -4
- package/es/helpers/test/fixtures/qcm-drag.d.ts +2 -3
- package/es/helpers/test/fixtures/qcm-drag.js +38 -32
- package/es/helpers/test/fixtures/qcm-graphic.d.ts +2 -3
- package/es/helpers/test/fixtures/qcm-graphic.js +20 -14
- package/es/helpers/test/fixtures/qcm.d.ts +2 -3
- package/es/helpers/test/fixtures/qcm.js +32 -26
- package/es/helpers/test/fixtures/select-template.d.ts +2 -3
- package/es/helpers/test/fixtures/select-template.js +38 -32
- package/es/helpers/test/fixtures/slider.d.ts +2 -3
- package/es/helpers/test/fixtures/slider.js +13 -7
- package/es/helpers/test/fixtures/text-template.d.ts +2 -3
- package/es/helpers/test/fixtures/text-template.js +16 -10
- package/es/index.js +14 -78
- package/es/reducers/data/index.d.ts +1 -1
- package/es/reducers/data/progression.d.ts +3 -16
- package/es/reducers/data/progression.js +3 -22
- package/es/reducers/data/slides.d.ts +5 -6
- package/es/reducers/data/slides.js +4 -107
- package/es/reducers/index.d.ts +3 -4
- package/es/reducers/ui/current-slide-ref.d.ts +4 -0
- package/es/reducers/ui/{review-status.js → current-slide-ref.js} +4 -4
- package/es/reducers/ui/index.d.ts +7 -10
- package/es/reducers/ui/index.js +4 -6
- package/es/reducers/ui/slides.d.ts +9 -0
- package/es/reducers/ui/slides.js +42 -0
- package/es/services/test/post-progression.test.js +6 -4
- package/es/test/util/services.mock.js +17 -5
- package/es/types/common.d.ts +40 -23
- package/es/types/common.js +0 -5
- package/es/types/slides.d.ts +0 -4
- package/es/types/views/slides.d.ts +41 -27
- package/es/types/views/slides.js +5 -0
- package/{lib/types/views/skills.d.ts → es/views/skills/index.d.ts} +2 -0
- package/es/views/skills/index.js +25 -0
- package/es/views/slides/index.d.ts +3 -0
- package/es/views/slides/index.js +85 -0
- package/lib/actions/api/fetch-slide.d.ts +3 -3
- package/lib/actions/api/fetch-slide.js +20 -2
- package/lib/actions/api/post-progression.js +1 -2
- package/lib/actions/index.d.ts +1 -10
- package/lib/actions/ui/is-fetching.js +0 -2
- package/lib/actions/ui/slides.d.ts +26 -0
- package/lib/actions/ui/slides.js +9 -0
- package/lib/common/index.d.ts +3 -1
- package/lib/common/index.js +3 -1
- package/lib/fixtures/qcm-slide.d.ts +2 -2
- package/lib/fixtures/temp-fixture.d.ts +2 -2
- package/lib/helpers/map-api-slide-to-ui.d.ts +4 -1
- package/lib/helpers/map-api-slide-to-ui.js +34 -14
- package/lib/helpers/test/fixtures/free-text.d.ts +2 -3
- package/lib/helpers/test/fixtures/free-text.js +10 -4
- package/lib/helpers/test/fixtures/qcm-drag.d.ts +2 -3
- package/lib/helpers/test/fixtures/qcm-drag.js +38 -32
- package/lib/helpers/test/fixtures/qcm-graphic.d.ts +2 -3
- package/lib/helpers/test/fixtures/qcm-graphic.js +20 -14
- package/lib/helpers/test/fixtures/qcm.d.ts +2 -3
- package/lib/helpers/test/fixtures/qcm.js +32 -26
- package/lib/helpers/test/fixtures/select-template.d.ts +2 -3
- package/lib/helpers/test/fixtures/select-template.js +38 -32
- package/lib/helpers/test/fixtures/slider.d.ts +2 -3
- package/lib/helpers/test/fixtures/slider.js +13 -7
- package/lib/helpers/test/fixtures/text-template.d.ts +2 -3
- package/lib/helpers/test/fixtures/text-template.js +16 -10
- package/lib/index.js +14 -78
- package/lib/reducers/data/index.d.ts +1 -1
- package/lib/reducers/data/progression.d.ts +3 -16
- package/lib/reducers/data/progression.js +3 -22
- package/lib/reducers/data/slides.d.ts +5 -6
- package/lib/reducers/data/slides.js +4 -113
- package/lib/reducers/index.d.ts +3 -4
- package/lib/reducers/ui/current-slide-ref.d.ts +4 -0
- package/lib/reducers/ui/{review-status.js → current-slide-ref.js} +4 -4
- package/lib/reducers/ui/index.d.ts +7 -10
- package/lib/reducers/ui/index.js +4 -6
- package/lib/reducers/ui/slides.d.ts +9 -0
- package/lib/reducers/ui/slides.js +43 -0
- package/lib/services/test/post-progression.test.js +6 -4
- package/lib/test/util/services.mock.js +17 -5
- package/lib/types/common.d.ts +40 -23
- package/lib/types/common.js +0 -5
- package/lib/types/slides.d.ts +0 -4
- package/lib/types/views/slides.d.ts +41 -27
- package/lib/types/views/slides.js +5 -0
- package/{es/types/views/skills.d.ts → lib/views/skills/index.d.ts} +2 -0
- package/lib/views/skills/index.js +25 -0
- package/lib/views/slides/index.d.ts +3 -0
- package/lib/views/slides/index.js +89 -0
- package/package.json +3 -3
- package/src/actions/api/fetch-slide.ts +26 -5
- package/src/actions/api/post-progression.ts +1 -2
- package/src/actions/index.ts +1 -10
- package/src/actions/ui/is-fetching.ts +0 -6
- package/src/actions/ui/slides.ts +35 -0
- package/src/common/index.ts +7 -1
- package/src/fixtures/qcm-slide.ts +2 -2
- package/src/fixtures/temp-fixture.ts +2 -2
- package/src/helpers/map-api-slide-to-ui.ts +43 -17
- package/src/helpers/test/fixtures/free-text.ts +12 -7
- package/src/helpers/test/fixtures/qcm-drag.ts +40 -35
- package/src/helpers/test/fixtures/qcm-graphic.ts +22 -17
- package/src/helpers/test/fixtures/qcm.ts +38 -32
- package/src/helpers/test/fixtures/select-template.ts +40 -35
- package/src/helpers/test/fixtures/slider.ts +15 -10
- package/src/helpers/test/fixtures/text-template.ts +18 -13
- package/src/helpers/test/map-api-slide-to-ui.test.ts +2 -11
- package/src/index.tsx +15 -84
- package/src/reducers/data/progression.ts +5 -40
- package/src/reducers/data/slides.ts +9 -126
- package/src/reducers/ui/current-slide-ref.ts +19 -0
- package/src/reducers/ui/index.ts +6 -9
- package/src/reducers/ui/slides.ts +58 -0
- package/src/services/test/post-progression.test.ts +6 -4
- package/src/test/util/services.mock.ts +17 -5
- package/src/types/common.ts +44 -27
- package/src/types/slides.ts +0 -5
- package/src/types/views/slides.ts +52 -27
- package/src/views/skills/index.ts +56 -0
- package/src/views/slides/index.ts +92 -0
- package/es/actions/data/slides.d.ts +0 -37
- package/es/actions/data/slides.js +0 -16
- package/es/actions/ui/finished-slides.d.ts +0 -10
- package/es/actions/ui/finished-slides.js +0 -8
- package/es/actions/ui/review-status.d.ts +0 -7
- package/es/actions/ui/review-status.js +0 -7
- package/es/actions/ui/step-items.d.ts +0 -24
- package/es/actions/ui/step-items.js +0 -11
- package/es/reducers/ui/finished-slides.d.ts +0 -7
- package/es/reducers/ui/finished-slides.js +0 -33
- package/es/reducers/ui/review-status.d.ts +0 -4
- package/es/reducers/ui/step-items.d.ts +0 -14
- package/es/reducers/ui/step-items.js +0 -74
- package/es/types/ui-progression.d.ts +0 -10
- package/es/types/ui-progression.js +0 -1
- package/es/types/views/skills.js +0 -1
- package/lib/actions/data/slides.d.ts +0 -37
- package/lib/actions/data/slides.js +0 -16
- package/lib/actions/ui/finished-slides.d.ts +0 -10
- package/lib/actions/ui/finished-slides.js +0 -8
- package/lib/actions/ui/review-status.d.ts +0 -7
- package/lib/actions/ui/review-status.js +0 -7
- package/lib/actions/ui/step-items.d.ts +0 -24
- package/lib/actions/ui/step-items.js +0 -11
- package/lib/reducers/ui/finished-slides.d.ts +0 -7
- package/lib/reducers/ui/finished-slides.js +0 -45
- package/lib/reducers/ui/review-status.d.ts +0 -4
- package/lib/reducers/ui/step-items.d.ts +0 -14
- package/lib/reducers/ui/step-items.js +0 -86
- package/lib/types/ui-progression.d.ts +0 -10
- package/lib/types/ui-progression.js +0 -1
- package/lib/types/views/skills.js +0 -1
- package/src/actions/data/slides.ts +0 -65
- package/src/actions/ui/finished-slides.ts +0 -21
- package/src/actions/ui/review-status.ts +0 -19
- package/src/actions/ui/step-items.ts +0 -45
- package/src/reducers/ui/finished-slides.ts +0 -52
- package/src/reducers/ui/review-status.ts +0 -19
- package/src/reducers/ui/step-items.ts +0 -116
- package/src/types/ui-progression.ts +0 -25
- package/src/types/views/skills.ts +0 -27
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const qcmDragSlide: SlideFromAPI;
|
|
4
|
-
export declare const qcmDragUISlide:
|
|
3
|
+
export declare const qcmDragUISlide: Partial<UISlide>;
|
|
@@ -70,37 +70,43 @@ export var qcmDragSlide = {
|
|
|
70
70
|
tips: 'sli_419IlQQnf.tips'
|
|
71
71
|
};
|
|
72
72
|
export var qcmDragUISlide = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
73
|
+
questionText: 'sli_419IlQQnf.header',
|
|
74
|
+
answerUI: {
|
|
75
|
+
help: 'sli_419IlQQnf.explanation',
|
|
76
|
+
model: {
|
|
77
|
+
type: 'qcmDrag',
|
|
78
|
+
answers: [
|
|
79
|
+
{
|
|
80
|
+
title: 'sli_419IlQQnf.choice_4kWwlQXhG',
|
|
81
|
+
selected: false,
|
|
82
|
+
order: -1,
|
|
83
|
+
onClick: noop
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'sli_419IlQQnf.choice_NJxbwgXm2G',
|
|
87
|
+
selected: false,
|
|
88
|
+
order: -1,
|
|
89
|
+
onClick: noop
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: 'sli_419IlQQnf.choice_41fwgQXnf',
|
|
93
|
+
selected: false,
|
|
94
|
+
order: -1,
|
|
95
|
+
onClick: noop
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: 'sli_419IlQQnf.choice_VJmweQ7nz',
|
|
99
|
+
selected: false,
|
|
100
|
+
order: -1,
|
|
101
|
+
onClick: noop
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: 'sli_419IlQQnf.choice_4kDDgXQhz',
|
|
105
|
+
selected: false,
|
|
106
|
+
order: -1,
|
|
107
|
+
onClick: noop
|
|
108
|
+
}
|
|
109
|
+
]
|
|
104
110
|
}
|
|
105
|
-
|
|
111
|
+
}
|
|
106
112
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const qcmGraphicSlide: SlideFromAPI;
|
|
4
|
-
export declare const qcmGraphicUISlide:
|
|
3
|
+
export declare const qcmGraphicUISlide: Partial<UISlide>;
|
|
@@ -52,19 +52,25 @@ export var qcmGraphicSlide = {
|
|
|
52
52
|
tips: 'sli_41~RSVclH.tips'
|
|
53
53
|
};
|
|
54
54
|
export var qcmGraphicUISlide = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
questionText: 'sli_41~RSVclH.header',
|
|
56
|
+
answerUI: {
|
|
57
|
+
help: 'sli_41~RSVclH.explanation',
|
|
58
|
+
model: {
|
|
59
|
+
type: 'qcmGraphic',
|
|
60
|
+
answers: [
|
|
61
|
+
{
|
|
62
|
+
title: 'sli_41~RSVclH.choice_V1gN0r4qgS',
|
|
63
|
+
image: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB',
|
|
64
|
+
selected: false,
|
|
65
|
+
onClick: noop
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: 'sli_41~RSVclH.choice_4JlLeLE5lS',
|
|
69
|
+
image: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH',
|
|
70
|
+
selected: false,
|
|
71
|
+
onClick: noop
|
|
72
|
+
}
|
|
73
|
+
]
|
|
68
74
|
}
|
|
69
|
-
|
|
75
|
+
}
|
|
70
76
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const qcmSlide: SlideFromAPI;
|
|
4
|
-
export declare const qcmUISlide:
|
|
3
|
+
export declare const qcmUISlide: Partial<UISlide>;
|
|
@@ -69,31 +69,37 @@ export var qcmSlide = {
|
|
|
69
69
|
id: 'sli_N1XACJobn'
|
|
70
70
|
};
|
|
71
71
|
export var qcmUISlide = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
72
|
+
questionText: "Après la vente d'un NFT, son créateur peut-il toucher de l'argent ?",
|
|
73
|
+
answerUI: {
|
|
74
|
+
help: 'Sélectionnez la bonne réponse.',
|
|
75
|
+
model: {
|
|
76
|
+
type: 'qcm',
|
|
77
|
+
answers: [
|
|
78
|
+
{
|
|
79
|
+
title: 'Le créateur peut fixer un pourcentage pour chaque transaction future',
|
|
80
|
+
selected: false,
|
|
81
|
+
onClick: noop,
|
|
82
|
+
ariaLabel: 'Le créateur peut fixer un pourcentage pour chaque transaction future'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: "Pour chaque transaction il existe un pourcentage fixe déterminé par le droit d'auteur du pays où se tient la vente",
|
|
86
|
+
selected: false,
|
|
87
|
+
onClick: noop,
|
|
88
|
+
ariaLabel: "Pour chaque transaction il existe un pourcentage fixe déterminé par le droit d'auteur du pays où se tient la vente"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: "Seule la galerie ou la plateforme peut toucher une commission sur la vente d'un NFT",
|
|
92
|
+
selected: false,
|
|
93
|
+
onClick: noop,
|
|
94
|
+
ariaLabel: "Seule la galerie ou la plateforme peut toucher une commission sur la vente d'un NFT"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
title: "Les NFT payés en ETH ne peuvent pas être soumis au paiement d'une commission",
|
|
98
|
+
selected: false,
|
|
99
|
+
onClick: noop,
|
|
100
|
+
ariaLabel: "Les NFT payés en ETH ne peuvent pas être soumis au paiement d'une commission"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
97
103
|
}
|
|
98
|
-
|
|
104
|
+
}
|
|
99
105
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const selectTemplateSlide: SlideFromAPI;
|
|
4
|
-
export declare const selectTemplateUISlide:
|
|
3
|
+
export declare const selectTemplateUISlide: Partial<UISlide>;
|
|
@@ -49,40 +49,46 @@ export var selectTemplateSlide = {
|
|
|
49
49
|
tips: 'sli_410xZQxrZ.tips'
|
|
50
50
|
};
|
|
51
51
|
export var selectTemplateUISlide = {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
type: '
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
options: [
|
|
60
|
-
{ name: 'Select an answer', value: '', validOption: false, selected: true },
|
|
61
|
-
{
|
|
62
|
-
name: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
|
|
63
|
-
value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
|
|
64
|
-
validOption: true,
|
|
65
|
-
selected: false
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
|
|
69
|
-
value: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
|
|
70
|
-
validOption: true,
|
|
71
|
-
selected: false
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'sli_410xZQxrZ.choice_VkaH~XgBb',
|
|
75
|
-
value: 'sli_410xZQxrZ.choice_VkaH~XgBb',
|
|
76
|
-
validOption: true,
|
|
77
|
-
selected: false
|
|
78
|
-
},
|
|
52
|
+
questionText: 'sli_410xZQxrZ.header',
|
|
53
|
+
answerUI: {
|
|
54
|
+
help: 'sli_410xZQxrZ.explanation',
|
|
55
|
+
model: {
|
|
56
|
+
type: 'template',
|
|
57
|
+
template: 'sli_410xZQxrZ.template',
|
|
58
|
+
answers: [
|
|
79
59
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
type: 'select',
|
|
61
|
+
name: 'sel36665',
|
|
62
|
+
onChange: noop,
|
|
63
|
+
options: [
|
|
64
|
+
{ name: 'Select an answer', value: '', validOption: false, selected: true },
|
|
65
|
+
{
|
|
66
|
+
name: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
|
|
67
|
+
value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
|
|
68
|
+
validOption: true,
|
|
69
|
+
selected: false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
|
|
73
|
+
value: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
|
|
74
|
+
validOption: true,
|
|
75
|
+
selected: false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'sli_410xZQxrZ.choice_VkaH~XgBb',
|
|
79
|
+
value: 'sli_410xZQxrZ.choice_VkaH~XgBb',
|
|
80
|
+
validOption: true,
|
|
81
|
+
selected: false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'sli_410xZQxrZ.choice_E1uUWXeBb',
|
|
85
|
+
value: 'sli_410xZQxrZ.choice_E1uUWXeBb',
|
|
86
|
+
validOption: true,
|
|
87
|
+
selected: false
|
|
88
|
+
}
|
|
89
|
+
]
|
|
84
90
|
}
|
|
85
91
|
]
|
|
86
92
|
}
|
|
87
|
-
|
|
93
|
+
}
|
|
88
94
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const sliderSlide: SlideFromAPI;
|
|
4
|
-
export declare const sliderUISlide:
|
|
3
|
+
export declare const sliderUISlide: Partial<UISlide>;
|
|
@@ -17,11 +17,17 @@ export var sliderSlide = {
|
|
|
17
17
|
tips: 'sli_41D5AovN~.tips'
|
|
18
18
|
};
|
|
19
19
|
export var sliderUISlide = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
questionText: 'sli_41D5AovN~.header',
|
|
21
|
+
answerUI: {
|
|
22
|
+
help: 'sli_41D5AovN~.explanation',
|
|
23
|
+
model: {
|
|
24
|
+
type: 'slider',
|
|
25
|
+
placeholder: 'sli_41D5AovN~.explanation',
|
|
26
|
+
minLabel: '1 undefined',
|
|
27
|
+
maxLabel: '10 undefined',
|
|
28
|
+
title: '0 sli_41D5AovN~.unitLabel',
|
|
29
|
+
value: -0.1111111111111111,
|
|
30
|
+
onChange: noop
|
|
31
|
+
}
|
|
32
|
+
}
|
|
27
33
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlideFromAPI } from '../../../types/common';
|
|
1
|
+
import { SlideFromAPI, UISlide } from '../../../types/common';
|
|
3
2
|
export declare const textTemplateSlide: SlideFromAPI;
|
|
4
|
-
export declare const textTemplateUISlide:
|
|
3
|
+
export declare const textTemplateUISlide: Partial<UISlide>;
|
|
@@ -34,15 +34,21 @@ export var textTemplateSlide = {
|
|
|
34
34
|
id: 'sli_VJKQonm2g'
|
|
35
35
|
};
|
|
36
36
|
export var textTemplateUISlide = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
type: '
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
questionText: 'Comment le protégé doit-il percevoir son mentor ?',
|
|
38
|
+
answerUI: {
|
|
39
|
+
help: 'Saisissez votre réponse (en anglais).',
|
|
40
|
+
model: {
|
|
41
|
+
type: 'template',
|
|
42
|
+
template: 'Un {{inp58402}} model.',
|
|
43
|
+
answers: [
|
|
44
|
+
{
|
|
45
|
+
type: 'text',
|
|
46
|
+
name: 'inp58402',
|
|
47
|
+
placeholder: 'Type here',
|
|
48
|
+
value: undefined,
|
|
49
|
+
onChange: noop
|
|
50
|
+
}
|
|
51
|
+
]
|
|
46
52
|
}
|
|
47
|
-
|
|
53
|
+
}
|
|
48
54
|
};
|
package/lib/index.js
CHANGED
|
@@ -5,82 +5,22 @@ import { TemplateContext } from '@coorpacademy/components/es/template/app-review
|
|
|
5
5
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
6
6
|
import get from 'lodash/fp/get';
|
|
7
7
|
import configureStore from './configure-store';
|
|
8
|
-
import {
|
|
9
|
-
import { updateSlidesOnNext, updateSlidesOnValidation, validateSlide } from './actions/data/slides';
|
|
8
|
+
import { validateSlide } from './actions/ui/slides';
|
|
10
9
|
import { navigateTo, navigateBack } from './actions/ui/navigation';
|
|
11
10
|
import { storeToken } from './actions/data/token';
|
|
12
|
-
import { updateFinishedSlides } from './actions/ui/finished-slides';
|
|
13
|
-
import { updateReviewStatus } from './actions/ui/review-status';
|
|
14
|
-
import { updateStepItemsOnValidation, updateStepItemsOnNext } from './actions/ui/step-items';
|
|
15
11
|
import { fetchSkills } from './actions/api/fetch-skills';
|
|
16
12
|
import { postProgression } from './actions/api/post-progression';
|
|
17
13
|
import { VIEWS } from './common';
|
|
14
|
+
import { mapStateToSlidesProps } from './views/slides';
|
|
15
|
+
import { mapStateToSkillsProps } from './views/skills';
|
|
18
16
|
var mapDispatchToProps = {
|
|
19
17
|
navigateTo: navigateTo,
|
|
20
18
|
navigateBack: navigateBack,
|
|
21
|
-
validateSlide: validateSlide
|
|
22
|
-
updateSlidesOnValidation: updateSlidesOnValidation,
|
|
23
|
-
updateSlidesOnNext: updateSlidesOnNext,
|
|
24
|
-
updateReviewStatus: updateReviewStatus,
|
|
25
|
-
updateStepItemsOnValidation: updateStepItemsOnValidation,
|
|
26
|
-
updateStepItemsOnNext: updateStepItemsOnNext,
|
|
27
|
-
updateFinishedSlides: updateFinishedSlides
|
|
19
|
+
validateSlide: validateSlide
|
|
28
20
|
};
|
|
29
21
|
var getCurrentViewName = function (storeState) {
|
|
30
22
|
return storeState.ui.navigation[storeState.ui.navigation.length - 1];
|
|
31
23
|
};
|
|
32
|
-
var mapStateToSkillsProps = function (state) {
|
|
33
|
-
if (!state.data.skills) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
title: '@todo title',
|
|
38
|
-
titleNoSkills: '@todo titleNoSkills',
|
|
39
|
-
textNoSkills: '@todo textNoSkills',
|
|
40
|
-
iconSkillAriaLabel: '@todo iconSkillAriaLabel',
|
|
41
|
-
isLoading: false,
|
|
42
|
-
isLoadingAriaLabel: '@todo loading',
|
|
43
|
-
listSkills: state.data.skills.map(function (skill) { return ({
|
|
44
|
-
'aria-label': '',
|
|
45
|
-
isCustom: skill.custom,
|
|
46
|
-
skillTitle: skill.name,
|
|
47
|
-
skillAriaLabel: '@todo skill aria label',
|
|
48
|
-
buttonLabel: '@todo button',
|
|
49
|
-
buttonAriaLabel: '@todo button aria label',
|
|
50
|
-
reviseLabel: '@todo revise',
|
|
51
|
-
reviseAriaLabel: '@todo revise aria label',
|
|
52
|
-
// eslint-disable-next-line no-console
|
|
53
|
-
onClick: function () { return console.log('@todo plug dispatcher select skill'); }
|
|
54
|
-
}); })
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
var mapStateToSlidesProps = function (state) {
|
|
58
|
-
if (!state.data.slides) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
headerProps: {
|
|
63
|
-
mode: '__revision_mode',
|
|
64
|
-
skillName: '__agility',
|
|
65
|
-
onQuitClick: function () {
|
|
66
|
-
// eslint-disable-next-line no-console
|
|
67
|
-
console.log('onQuitClick');
|
|
68
|
-
},
|
|
69
|
-
'aria-label': 'aria-header-wrapper',
|
|
70
|
-
closeButtonAriaLabel: 'aria-close-button'
|
|
71
|
-
},
|
|
72
|
-
slides: state.data.slides,
|
|
73
|
-
validate: {
|
|
74
|
-
label: '__validate'
|
|
75
|
-
},
|
|
76
|
-
finishedSlides: state.ui.finishedSlides,
|
|
77
|
-
stepItems: state.ui.stepItems,
|
|
78
|
-
reviewStatus: state.ui.reviewStatus,
|
|
79
|
-
correctionPopinProps: correctionPopinProps,
|
|
80
|
-
congratsProps: congratsProps,
|
|
81
|
-
progression: state.data.progression
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
24
|
var mapStateToProps = function (state) {
|
|
85
25
|
return {
|
|
86
26
|
viewName: getCurrentViewName(state),
|
|
@@ -92,7 +32,7 @@ var App = connect(mapStateToProps, mapDispatchToProps)(AppReviewTemplate);
|
|
|
92
32
|
var AppReview = function (_a) {
|
|
93
33
|
var options = _a.options;
|
|
94
34
|
var _b = useState(null), store = _b[0], setStore = _b[1];
|
|
95
|
-
var _c = useState(false),
|
|
35
|
+
var _c = useState(false), isProgressionCreated = _c[0], setIsProgressionCreated = _c[1];
|
|
96
36
|
useEffect(function () {
|
|
97
37
|
if (store)
|
|
98
38
|
return;
|
|
@@ -100,14 +40,13 @@ var AppReview = function (_a) {
|
|
|
100
40
|
setStore(newStore);
|
|
101
41
|
}, [options, store]);
|
|
102
42
|
useEffect(function () {
|
|
103
|
-
if (!store ||
|
|
43
|
+
if (!store || isProgressionCreated)
|
|
104
44
|
return;
|
|
105
45
|
return store.subscribe(function () {
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
}, [isSlideFetched, options, store]);
|
|
46
|
+
var isProgressionPresent = !isEmpty(store.getState().data.progression);
|
|
47
|
+
return isProgressionPresent && setIsProgressionCreated(isProgressionPresent);
|
|
48
|
+
});
|
|
49
|
+
}, [isProgressionCreated, options, store]);
|
|
111
50
|
useEffect(function () {
|
|
112
51
|
var token = get('token', options);
|
|
113
52
|
if (store === null || isEmpty(token))
|
|
@@ -119,8 +58,8 @@ var AppReview = function (_a) {
|
|
|
119
58
|
if (store === null || isEmpty(token))
|
|
120
59
|
return;
|
|
121
60
|
var skillRef = get('skillRef', options);
|
|
122
|
-
|
|
123
|
-
|
|
61
|
+
/* ThunkAction is not assignable to parameter of type 'AnyAction'
|
|
62
|
+
ts problem is described here = https://github.com/reduxjs/redux-thunk/issues/333 */
|
|
124
63
|
skillRef
|
|
125
64
|
? store.dispatch(postProgression(skillRef, token))
|
|
126
65
|
: store.dispatch(fetchSkills(token));
|
|
@@ -129,16 +68,13 @@ var AppReview = function (_a) {
|
|
|
129
68
|
if (store === null)
|
|
130
69
|
return;
|
|
131
70
|
var skillRef = options.skillRef;
|
|
132
|
-
if (skillRef && !
|
|
71
|
+
if (skillRef && !isProgressionCreated) {
|
|
133
72
|
store.dispatch(navigateTo('loader')); // use loader while posting progression
|
|
134
73
|
return;
|
|
135
74
|
}
|
|
136
|
-
// TODO: when slides state is refactored (data + mapping),
|
|
137
|
-
// use loader in case a skillRef is found && no slides from the API
|
|
138
|
-
// are found
|
|
139
75
|
var initialView = skillRef ? VIEWS.slides : VIEWS.skills;
|
|
140
76
|
store.dispatch(navigateTo(initialView));
|
|
141
|
-
}, [
|
|
77
|
+
}, [isProgressionCreated, options, store]);
|
|
142
78
|
if (!store)
|
|
143
79
|
return null;
|
|
144
80
|
var values = options.templateContext;
|
|
@@ -14,5 +14,5 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
14
14
|
skills: SkillsState;
|
|
15
15
|
slides: SlidesState;
|
|
16
16
|
token: TokenState;
|
|
17
|
-
}>, import("../../actions/
|
|
17
|
+
}>, import("../../actions/api/post-progression").ReceiveProgression | import("../../actions/api/fetch-skills").ReceivedSkills | import("./slides").SlidesAction | import("../../actions/data/token").StoreToken>;
|
|
18
18
|
export default _default;
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { ValidateSlide } from '../../actions/
|
|
1
|
+
import { ValidateSlide } from '../../actions/ui/slides';
|
|
2
2
|
import { ReceiveProgression } from '../../actions/api/post-progression';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
state: {
|
|
6
|
-
isCorrect: boolean;
|
|
7
|
-
nextContent: {
|
|
8
|
-
ref: 'successExitNode' | string;
|
|
9
|
-
type: 'success' | 'slide';
|
|
10
|
-
};
|
|
11
|
-
pendingSlides: string[];
|
|
12
|
-
step: {
|
|
13
|
-
current: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
slideNumber?: number;
|
|
17
|
-
} | null;
|
|
3
|
+
import { ProgressionFromAPI } from '../../types/common';
|
|
4
|
+
export declare type ProgressionState = ProgressionFromAPI | null;
|
|
18
5
|
declare const reducer: (state: ProgressionState | undefined, action: ValidateSlide | ReceiveProgression) => ProgressionState;
|
|
19
6
|
export default reducer;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VALIDATE_SLIDE } from '../../actions/data/slides';
|
|
1
|
+
import { VALIDATE_SLIDE } from '../../actions/ui/slides';
|
|
3
2
|
import { POST_PROGRESSION_SUCCESS } from '../../actions/api/post-progression';
|
|
4
3
|
var reducer = function (
|
|
5
4
|
// eslint-disable-next-line default-param-last
|
|
@@ -7,25 +6,8 @@ state, action) {
|
|
|
7
6
|
if (state === void 0) { state = null; }
|
|
8
7
|
switch (action.type) {
|
|
9
8
|
case VALIDATE_SLIDE: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// TODO: fix on VALIDATE ticket
|
|
13
|
-
return {
|
|
14
|
-
_id: '1234',
|
|
15
|
-
// virtual field
|
|
16
|
-
slideNumber: previousSlideNumber + 1,
|
|
17
|
-
state: {
|
|
18
|
-
pendingSlides: [],
|
|
19
|
-
step: {
|
|
20
|
-
current: Number.NaN
|
|
21
|
-
},
|
|
22
|
-
isCorrect: true,
|
|
23
|
-
nextContent: {
|
|
24
|
-
ref: 'sli_V1gKpYYZ2',
|
|
25
|
-
type: 'slide'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
9
|
+
// TODO: fix on VALIDATE ticket -> launch a POST PROGRESSION
|
|
10
|
+
return state;
|
|
29
11
|
}
|
|
30
12
|
case POST_PROGRESSION_SUCCESS: {
|
|
31
13
|
var progression = action.payload;
|
|
@@ -35,5 +17,4 @@ state, action) {
|
|
|
35
17
|
return state;
|
|
36
18
|
}
|
|
37
19
|
};
|
|
38
|
-
// -----------------------------------------------------------------------------
|
|
39
20
|
export default reducer;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
1
|
+
import { ValidateSlide } from '../../actions/ui/slides';
|
|
2
|
+
import { ReceivedSlide } from '../../actions/api/fetch-slide';
|
|
3
|
+
import { SlideFromAPI } from '../../types/common';
|
|
4
|
+
export declare type SlidesAction = ReceivedSlide | ValidateSlide;
|
|
5
|
+
export declare type SlidesState = Record<string, SlideFromAPI>;
|
|
7
6
|
export declare const initialState: SlidesState;
|
|
8
7
|
declare const reducer: (state: SlidesState | undefined, action: SlidesAction) => SlidesState;
|
|
9
8
|
export default reducer;
|