@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.
Files changed (72) hide show
  1. package/es/actions/ui/next-slide.d.ts +4 -2
  2. package/es/actions/ui/next-slide.js +7 -4
  3. package/es/actions/ui/slides.d.ts +2 -3
  4. package/es/common/index.d.ts +2 -0
  5. package/es/common/index.js +9 -0
  6. package/es/reducers/index.d.ts +2 -1
  7. package/es/reducers/ui/answers.d.ts +2 -2
  8. package/es/reducers/ui/current-slide-ref.d.ts +3 -2
  9. package/es/reducers/ui/current-slide-ref.js +3 -0
  10. package/es/reducers/ui/index.d.ts +4 -1
  11. package/es/reducers/ui/index.js +3 -1
  12. package/es/reducers/ui/positions.d.ts +5 -0
  13. package/es/reducers/ui/positions.js +25 -0
  14. package/es/reducers/ui/slide.d.ts +2 -2
  15. package/es/views/slides/index.d.ts +2 -3
  16. package/es/views/slides/index.js +16 -24
  17. package/lib/actions/ui/next-slide.d.ts +4 -2
  18. package/lib/actions/ui/next-slide.js +7 -4
  19. package/lib/actions/ui/slides.d.ts +2 -3
  20. package/lib/common/index.d.ts +2 -0
  21. package/lib/common/index.js +9 -0
  22. package/lib/reducers/index.d.ts +2 -1
  23. package/lib/reducers/ui/answers.d.ts +2 -2
  24. package/lib/reducers/ui/current-slide-ref.d.ts +3 -2
  25. package/lib/reducers/ui/current-slide-ref.js +3 -0
  26. package/lib/reducers/ui/index.d.ts +4 -1
  27. package/lib/reducers/ui/index.js +3 -1
  28. package/lib/reducers/ui/positions.d.ts +5 -0
  29. package/lib/reducers/ui/positions.js +26 -0
  30. package/lib/reducers/ui/slide.d.ts +2 -2
  31. package/lib/views/slides/index.d.ts +2 -3
  32. package/lib/views/slides/index.js +16 -25
  33. package/package.json +7 -6
  34. package/src/actions/api/test/fetch-correction.test.ts +1 -0
  35. package/src/actions/api/test/fetch-rank.test.ts +1 -0
  36. package/src/actions/api/test/fetch-skills.test.ts +1 -0
  37. package/src/actions/api/test/fetch-slide.test.ts +1 -0
  38. package/src/actions/api/test/post-answer.test.ts +2 -0
  39. package/src/actions/api/test/post-progression.test.ts +1 -0
  40. package/src/actions/data/test/token.test.ts +1 -0
  41. package/src/actions/ui/next-slide.ts +15 -9
  42. package/src/actions/ui/slides.ts +2 -4
  43. package/src/actions/ui/test/answers.test.ts +1 -0
  44. package/src/actions/ui/test/next-slide.test.ts +7 -2
  45. package/src/actions/ui/test/slides.test.ts +1 -0
  46. package/src/common/index.ts +12 -0
  47. package/src/reducers/ui/answers.ts +2 -2
  48. package/src/reducers/ui/current-slide-ref.ts +5 -2
  49. package/src/reducers/ui/index.ts +4 -1
  50. package/src/reducers/ui/positions.ts +32 -0
  51. package/src/reducers/ui/slide.ts +7 -2
  52. package/src/reducers/ui/test/answers.test.ts +3 -1
  53. package/src/reducers/ui/test/current-slide-ref.test.ts +2 -2
  54. package/src/reducers/ui/test/positions.test.ts +68 -0
  55. package/src/reducers/ui/test/slide.test.ts +3 -1
  56. package/src/types/common.ts +0 -1
  57. package/src/views/skills/test/skills.test.ts +2 -0
  58. package/src/views/slides/index.ts +20 -31
  59. package/src/views/slides/test/index.test.ts +46 -40
  60. package/src/views/slides/test/slide.free-text.on-change.test.ts +1 -1
  61. package/src/views/slides/test/slide.next-slide.on-click.test.ts +8 -1
  62. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +1 -1
  63. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +1 -1
  64. package/src/views/slides/test/slide.qcm.on-click.test.ts +1 -1
  65. package/src/views/slides/test/slide.slider.on-change.test.ts +1 -1
  66. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +15 -3
  67. package/src/views/slides/test/slide.template.on-change.test.ts +9 -10
  68. package/es/actions/ui/is-fetching.d.ts +0 -10
  69. package/es/actions/ui/is-fetching.js +0 -4
  70. package/lib/actions/ui/is-fetching.d.ts +0 -10
  71. package/lib/actions/ui/is-fetching.js +0 -4
  72. 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 SlideProps = props.stack.slides['0'].answerUI?.model as Template;
84
- const onChangeText = get(['1', 'onChange'], SlideProps.answers);
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'], SlideProps.answers);
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 SlideProps = props.stack.slides['0'].answerUI?.model as Template;
116
- const textAnswerProps = SlideProps.answers[1] as TextTemplate;
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'], SlideProps.answers);
117
+ const onChangeText = get(['1', 'onChange'], slideProps.answers);
119
118
  onChangeText('');
120
119
 
121
120
  const newProps = mapStateToSlidesProps(getState(), dispatch, identity);
122
- const SlidePropsAfterOnChange = newProps.stack.slides['0'].answerUI?.model as Template;
123
- const textAnswerPropsAfterOnChange = SlidePropsAfterOnChange.answers[1] as TextTemplate;
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,4 +0,0 @@
1
- export const START_FETCHING = '@@ui/START_FETCHING';
2
- export const STOP_FETCHING = '@@ui/STOP_FETCHING';
3
- export const startFetching = () => ({ type: START_FETCHING });
4
- export const stopFetching = () => ({ type: STOP_FETCHING });
@@ -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,4 +0,0 @@
1
- export var START_FETCHING = '@@ui/START_FETCHING';
2
- export var STOP_FETCHING = '@@ui/STOP_FETCHING';
3
- export var startFetching = function () { return ({ type: START_FETCHING }); };
4
- export var stopFetching = function () { return ({ type: STOP_FETCHING }); };
@@ -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});