@coorpacademy/app-review 0.4.4 → 0.5.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/es/actions/ui/next-slide.d.ts +4 -2
- package/es/actions/ui/next-slide.js +7 -4
- package/es/actions/ui/slides.d.ts +2 -3
- package/es/common/index.d.ts +2 -0
- package/es/common/index.js +9 -0
- package/es/reducers/index.d.ts +2 -1
- package/es/reducers/ui/answers.d.ts +2 -2
- package/es/reducers/ui/current-slide-ref.d.ts +3 -2
- package/es/reducers/ui/current-slide-ref.js +3 -0
- package/es/reducers/ui/index.d.ts +4 -1
- package/es/reducers/ui/index.js +3 -1
- package/es/reducers/ui/positions.d.ts +5 -0
- package/es/reducers/ui/positions.js +25 -0
- package/es/reducers/ui/slide.d.ts +2 -2
- package/es/views/slides/index.d.ts +2 -3
- package/es/views/slides/index.js +16 -24
- package/lib/actions/ui/next-slide.d.ts +4 -2
- package/lib/actions/ui/next-slide.js +7 -4
- package/lib/actions/ui/slides.d.ts +2 -3
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.js +9 -0
- package/lib/reducers/index.d.ts +2 -1
- package/lib/reducers/ui/answers.d.ts +2 -2
- package/lib/reducers/ui/current-slide-ref.d.ts +3 -2
- package/lib/reducers/ui/current-slide-ref.js +3 -0
- package/lib/reducers/ui/index.d.ts +4 -1
- package/lib/reducers/ui/index.js +3 -1
- package/lib/reducers/ui/positions.d.ts +5 -0
- package/lib/reducers/ui/positions.js +26 -0
- package/lib/reducers/ui/slide.d.ts +2 -2
- package/lib/views/slides/index.d.ts +2 -3
- package/lib/views/slides/index.js +16 -25
- package/package.json +7 -6
- package/src/actions/api/test/fetch-correction.test.ts +1 -0
- package/src/actions/api/test/fetch-rank.test.ts +1 -0
- package/src/actions/api/test/fetch-skills.test.ts +1 -0
- package/src/actions/api/test/fetch-slide.test.ts +1 -0
- package/src/actions/api/test/post-answer.test.ts +2 -0
- package/src/actions/api/test/post-progression.test.ts +1 -0
- package/src/actions/data/test/token.test.ts +1 -0
- package/src/actions/ui/next-slide.ts +15 -9
- package/src/actions/ui/slides.ts +2 -4
- package/src/actions/ui/test/answers.test.ts +1 -0
- package/src/actions/ui/test/next-slide.test.ts +7 -2
- package/src/actions/ui/test/slides.test.ts +1 -0
- package/src/common/index.ts +12 -0
- package/src/reducers/ui/answers.ts +2 -2
- package/src/reducers/ui/current-slide-ref.ts +5 -2
- package/src/reducers/ui/index.ts +4 -1
- package/src/reducers/ui/positions.ts +32 -0
- package/src/reducers/ui/slide.ts +7 -2
- package/src/reducers/ui/test/answers.test.ts +3 -1
- package/src/reducers/ui/test/current-slide-ref.test.ts +2 -2
- package/src/reducers/ui/test/positions.test.ts +68 -0
- package/src/reducers/ui/test/slide.test.ts +3 -1
- package/src/types/common.ts +0 -1
- package/src/views/skills/test/skills.test.ts +2 -0
- package/src/views/slides/index.ts +20 -31
- package/src/views/slides/test/index.test.ts +46 -40
- package/src/views/slides/test/slide.free-text.on-change.test.ts +1 -1
- package/src/views/slides/test/slide.next-slide.on-click.test.ts +8 -1
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.qcm.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.slider.on-change.test.ts +1 -1
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +15 -3
- package/src/views/slides/test/slide.template.on-change.test.ts +9 -10
- package/es/actions/ui/is-fetching.d.ts +0 -10
- package/es/actions/ui/is-fetching.js +0 -4
- package/lib/actions/ui/is-fetching.d.ts +0 -10
- package/lib/actions/ui/is-fetching.js +0 -4
- package/src/actions/ui/is-fetching.ts +0 -13
|
@@ -49,6 +49,7 @@ const initialState: StoreState = {
|
|
|
49
49
|
currentSlideRef: templateSlide._id,
|
|
50
50
|
navigation: ['skills', 'slides'],
|
|
51
51
|
answers: {},
|
|
52
|
+
positions: [0, 1, 2, 3, 4],
|
|
52
53
|
slide: {
|
|
53
54
|
[templateSlide._id]: {
|
|
54
55
|
validateButton: false,
|
|
@@ -73,17 +74,16 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
73
74
|
animationType: undefined,
|
|
74
75
|
animateCorrectionPopin: false,
|
|
75
76
|
showCorrectionPopin: false,
|
|
76
|
-
hidden: false,
|
|
77
77
|
position: 0,
|
|
78
78
|
loading: false,
|
|
79
79
|
parentContentTitle: 'From "Developing the review app" course',
|
|
80
80
|
questionText: 'Complétez la phrase ci-dessous.'
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
const
|
|
84
|
-
const onChangeText = get(['1', 'onChange'],
|
|
83
|
+
const slideProps = props.stack.slides['0'].answerUI?.model as Template;
|
|
84
|
+
const onChangeText = get(['1', 'onChange'], slideProps.answers);
|
|
85
85
|
onChangeText('test');
|
|
86
|
-
const onChangeSelect = get(['0', 'onChange'],
|
|
86
|
+
const onChangeSelect = get(['0', 'onChange'], slideProps.answers);
|
|
87
87
|
onChangeSelect('Catalogue');
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -105,21 +105,20 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
105
105
|
animationType: undefined,
|
|
106
106
|
animateCorrectionPopin: false,
|
|
107
107
|
showCorrectionPopin: false,
|
|
108
|
-
hidden: false,
|
|
109
108
|
position: 0,
|
|
110
109
|
loading: false,
|
|
111
110
|
parentContentTitle: 'From "Developing the review app" course',
|
|
112
111
|
questionText: 'Complétez la phrase ci-dessous.'
|
|
113
112
|
});
|
|
114
113
|
|
|
115
|
-
const
|
|
116
|
-
const textAnswerProps =
|
|
114
|
+
const slideProps = props.stack.slides['0'].answerUI?.model as Template;
|
|
115
|
+
const textAnswerProps = slideProps.answers[1] as TextTemplate;
|
|
117
116
|
t.is(textAnswerProps.value, 'Test');
|
|
118
|
-
const onChangeText = get(['1', 'onChange'],
|
|
117
|
+
const onChangeText = get(['1', 'onChange'], slideProps.answers);
|
|
119
118
|
onChangeText('');
|
|
120
119
|
|
|
121
120
|
const newProps = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
122
|
-
const
|
|
123
|
-
const textAnswerPropsAfterOnChange =
|
|
121
|
+
const slidePropsAfterOnChange = newProps.stack.slides['0'].answerUI?.model as Template;
|
|
122
|
+
const textAnswerPropsAfterOnChange = slidePropsAfterOnChange.answers[1] as TextTemplate;
|
|
124
123
|
t.is(textAnswerPropsAfterOnChange.value, '');
|
|
125
124
|
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const START_FETCHING = "@@ui/START_FETCHING";
|
|
2
|
-
export declare const STOP_FETCHING = "@@ui/STOP_FETCHING";
|
|
3
|
-
export declare type StartFetching = {
|
|
4
|
-
type: typeof START_FETCHING;
|
|
5
|
-
};
|
|
6
|
-
export declare type StopFetching = {
|
|
7
|
-
type: typeof STOP_FETCHING;
|
|
8
|
-
};
|
|
9
|
-
export declare const startFetching: () => StartFetching;
|
|
10
|
-
export declare const stopFetching: () => StopFetching;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const START_FETCHING = "@@ui/START_FETCHING";
|
|
2
|
-
export declare const STOP_FETCHING = "@@ui/STOP_FETCHING";
|
|
3
|
-
export declare type StartFetching = {
|
|
4
|
-
type: typeof START_FETCHING;
|
|
5
|
-
};
|
|
6
|
-
export declare type StopFetching = {
|
|
7
|
-
type: typeof STOP_FETCHING;
|
|
8
|
-
};
|
|
9
|
-
export declare const startFetching: () => StartFetching;
|
|
10
|
-
export declare const stopFetching: () => StopFetching;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const START_FETCHING = '@@ui/START_FETCHING';
|
|
2
|
-
export const STOP_FETCHING = '@@ui/STOP_FETCHING';
|
|
3
|
-
|
|
4
|
-
export type StartFetching = {
|
|
5
|
-
type: typeof START_FETCHING;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export type StopFetching = {
|
|
9
|
-
type: typeof STOP_FETCHING;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const startFetching = (): StartFetching => ({type: START_FETCHING});
|
|
13
|
-
export const stopFetching = (): StopFetching => ({type: STOP_FETCHING});
|