@coorpacademy/app-review 0.0.21-alpha.4 → 0.1.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.
- package/es/actions/courses.d.ts +2 -3
- package/es/actions/data/is-fetching.d.ts +5 -0
- package/es/actions/data/is-fetching.js +4 -0
- package/es/actions/data/validate-slide.d.ts +5 -0
- package/es/actions/data/validate-slide.js +6 -0
- package/es/actions/finished-slides.d.ts +7 -0
- package/es/actions/finished-slides.js +7 -0
- package/es/actions/index.d.ts +2 -5
- package/es/actions/index.js +1 -3
- package/es/actions/navigation.d.ts +5 -6
- package/es/actions/review-status.d.ts +7 -0
- package/es/actions/review-status.js +7 -0
- package/es/actions/slides.d.ts +20 -0
- package/es/actions/slides.js +17 -0
- package/es/actions/step-items.d.ts +14 -0
- package/es/actions/step-items.js +12 -0
- package/es/actions/token.d.ts +0 -1
- package/es/common/index.d.ts +8 -0
- package/es/common/index.js +8 -0
- package/es/configure-store.d.ts +3 -12
- package/es/configure-store.js +5 -7
- package/es/fixtures/qcm-slide.d.ts +2 -0
- package/es/fixtures/qcm-slide.js +29 -0
- package/es/fixtures/temp-fixture.d.ts +3 -0
- package/es/fixtures/temp-fixture.js +84 -0
- package/es/helpers/css-register.d.ts +1 -0
- package/es/helpers/css-register.js +2 -0
- package/es/index.d.ts +5 -12
- package/es/index.js +62 -14
- package/es/index.test.d.ts +1 -0
- package/es/index.test.js +52 -0
- package/es/middlewares/on-start-app.d.ts +1 -2
- package/es/middlewares/on-start-app.js +20 -9
- package/es/reducers/courses.d.ts +2 -3
- package/es/reducers/courses.js +2 -1
- package/es/reducers/data.d.ts +7 -0
- package/es/reducers/data.js +76 -0
- package/es/reducers/finished-slides.d.ts +6 -0
- package/es/reducers/finished-slides.js +32 -0
- package/es/reducers/index.d.ts +11 -6
- package/es/reducers/index.js +14 -4
- package/es/reducers/navigation.d.ts +4 -3
- package/es/reducers/navigation.js +4 -1
- package/es/reducers/review-status.d.ts +5 -0
- package/es/reducers/review-status.js +15 -0
- package/es/reducers/slides.d.ts +6 -0
- package/es/reducers/slides.js +112 -0
- package/es/reducers/step-items.d.ts +6 -0
- package/es/reducers/step-items.js +75 -0
- package/es/reducers/token.d.ts +5 -7
- package/es/reducers/token.js +4 -12
- package/es/services/fetch-demo.d.ts +0 -1
- package/es/services/fetch-demo.test.d.ts +0 -1
- package/es/services/fetch-responses.d.ts +6 -7
- package/es/services/fetch-responses.js +2 -2
- package/es/services/fetch.mocks.d.ts +3 -4
- package/es/services/fetch.mocks.js +3 -3
- package/es/types/common.d.ts +7 -0
- package/es/types/common.js +1 -0
- package/es/types/data/index.d.ts +14 -0
- package/es/types/data/index.js +1 -0
- package/es/types/dispatchers.d.ts +17 -0
- package/es/types/dispatchers.js +1 -0
- package/es/types/finished-slides.d.ts +9 -0
- package/es/types/finished-slides.js +1 -0
- package/es/types/review-status.d.ts +1 -0
- package/es/types/review-status.js +1 -0
- package/es/types/slides.d.ts +87 -0
- package/es/types/slides.js +1 -0
- package/es/types/states.d.ts +6 -0
- package/es/types/states.js +1 -0
- package/es/types/step-items.d.ts +26 -0
- package/es/types/step-items.js +5 -0
- package/es/types/store-state.d.ts +12 -0
- package/es/types/store-state.js +1 -0
- package/es/types/utils.d.ts +3 -0
- package/es/types/utils.js +1 -0
- package/es/types/views.d.ts +64 -0
- package/es/types/views.js +1 -0
- package/lib/actions/courses.d.ts +2 -3
- package/lib/actions/data/is-fetching.d.ts +5 -0
- package/lib/actions/data/is-fetching.js +4 -0
- package/lib/actions/data/validate-slide.d.ts +5 -0
- package/lib/actions/data/validate-slide.js +6 -0
- package/lib/actions/finished-slides.d.ts +7 -0
- package/lib/actions/finished-slides.js +7 -0
- package/lib/actions/index.d.ts +2 -5
- package/lib/actions/index.js +1 -3
- package/lib/actions/navigation.d.ts +5 -6
- package/lib/actions/review-status.d.ts +7 -0
- package/lib/actions/review-status.js +7 -0
- package/lib/actions/slides.d.ts +20 -0
- package/lib/actions/slides.js +17 -0
- package/lib/actions/step-items.d.ts +14 -0
- package/lib/actions/step-items.js +12 -0
- package/lib/actions/token.d.ts +0 -1
- package/lib/common/index.d.ts +8 -0
- package/lib/common/index.js +8 -0
- package/lib/configure-store.d.ts +3 -12
- package/lib/configure-store.js +10 -59
- package/lib/fixtures/qcm-slide.d.ts +2 -0
- package/lib/fixtures/qcm-slide.js +29 -0
- package/lib/fixtures/temp-fixture.d.ts +3 -0
- package/lib/fixtures/temp-fixture.js +84 -0
- package/lib/helpers/css-register.d.ts +1 -0
- package/lib/helpers/css-register.js +2 -0
- package/lib/index.d.ts +5 -12
- package/lib/index.js +71 -34
- package/lib/index.test.d.ts +1 -0
- package/lib/index.test.js +160 -0
- package/lib/middlewares/on-start-app.d.ts +1 -2
- package/lib/middlewares/on-start-app.js +29 -16
- package/lib/reducers/courses.d.ts +2 -3
- package/lib/reducers/courses.js +2 -1
- package/lib/reducers/data.d.ts +7 -0
- package/lib/reducers/data.js +77 -0
- package/lib/reducers/finished-slides.d.ts +6 -0
- package/lib/reducers/finished-slides.js +44 -0
- package/lib/reducers/index.d.ts +11 -6
- package/lib/reducers/index.js +14 -4
- package/lib/reducers/navigation.d.ts +4 -3
- package/lib/reducers/navigation.js +6 -1
- package/lib/reducers/review-status.d.ts +5 -0
- package/lib/reducers/review-status.js +16 -0
- package/lib/reducers/slides.d.ts +6 -0
- package/lib/reducers/slides.js +119 -0
- package/lib/reducers/step-items.d.ts +6 -0
- package/lib/reducers/step-items.js +87 -0
- package/lib/reducers/token.d.ts +5 -7
- package/lib/reducers/token.js +4 -13
- package/lib/services/fetch-demo.d.ts +0 -1
- package/lib/services/fetch-demo.js +25 -23
- package/lib/services/fetch-demo.test.d.ts +0 -1
- package/lib/services/fetch-responses.d.ts +6 -7
- package/lib/services/fetch-responses.js +2 -2
- package/lib/services/fetch.mocks.d.ts +3 -4
- package/lib/services/fetch.mocks.js +28 -16
- package/lib/types/common.d.ts +7 -0
- package/lib/types/common.js +1 -0
- package/lib/types/data/index.d.ts +14 -0
- package/lib/types/data/index.js +1 -0
- package/lib/types/dispatchers.d.ts +17 -0
- package/lib/types/dispatchers.js +1 -0
- package/lib/types/finished-slides.d.ts +9 -0
- package/lib/types/finished-slides.js +1 -0
- package/lib/types/review-status.d.ts +1 -0
- package/lib/types/review-status.js +1 -0
- package/lib/types/slides.d.ts +87 -0
- package/lib/types/slides.js +1 -0
- package/lib/types/states.d.ts +6 -0
- package/lib/types/states.js +1 -0
- package/lib/types/step-items.d.ts +26 -0
- package/lib/types/step-items.js +5 -0
- package/lib/types/store-state.d.ts +12 -0
- package/lib/types/store-state.js +1 -0
- package/lib/types/utils.d.ts +3 -0
- package/lib/types/utils.js +1 -0
- package/lib/types/views.d.ts +64 -0
- package/lib/types/views.js +1 -0
- package/package.json +21 -7
- package/src/actions/courses.ts +2 -2
- package/src/actions/data/is-fetching.ts +12 -0
- package/src/actions/data/validate-slide.ts +15 -0
- package/src/actions/finished-slides.ts +21 -0
- package/src/actions/index.ts +8 -5
- package/src/actions/navigation.ts +6 -5
- package/src/actions/review-status.ts +19 -0
- package/src/actions/slides.ts +45 -0
- package/src/actions/step-items.ts +39 -0
- package/src/common/index.ts +14 -0
- package/src/configure-store.ts +14 -22
- package/src/fixtures/qcm-slide.ts +31 -0
- package/src/fixtures/temp-fixture.ts +94 -0
- package/src/helpers/css-modules-require-hook.d.ts +4 -0
- package/src/helpers/css-register.ts +3 -0
- package/src/index.test.tsx +82 -0
- package/src/index.tsx +75 -22
- package/src/middlewares/on-start-app.ts +35 -20
- package/src/reducers/courses.ts +3 -2
- package/src/reducers/data.ts +88 -0
- package/src/reducers/finished-slides.ts +48 -0
- package/src/reducers/index.ts +14 -4
- package/src/reducers/navigation.ts +7 -3
- package/src/reducers/review-status.ts +23 -0
- package/src/reducers/slides.ts +136 -0
- package/src/reducers/step-items.ts +112 -0
- package/src/reducers/token.ts +6 -15
- package/src/services/fetch-demo.ts +17 -15
- package/src/services/fetch-responses.ts +7 -7
- package/src/services/fetch.mocks.ts +29 -14
- package/src/types/common.ts +8 -0
- package/src/types/data/index.ts +16 -0
- package/src/types/dispatchers.ts +18 -0
- package/src/types/finished-slides.ts +9 -0
- package/src/types/globals.d.ts +6 -0
- package/src/types/review-status.ts +1 -0
- package/src/types/slides.ts +107 -0
- package/src/types/states.ts +6 -0
- package/src/types/step-items.ts +31 -0
- package/src/types/store-state.ts +20 -0
- package/src/types/utils.ts +4 -0
- package/src/types/views.tsx +69 -0
- package/es/actions/courses.d.ts.map +0 -1
- package/es/actions/index.d.ts.map +0 -1
- package/es/actions/navigation.d.ts.map +0 -1
- package/es/actions/token.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
- package/es/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.js +0 -83
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -57
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
- package/es/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -120
- package/es/configure-store.d.ts.map +0 -1
- package/es/index.d.ts.map +0 -1
- package/es/middlewares/on-start-app.d.ts.map +0 -1
- package/es/reducers/courses.d.ts.map +0 -1
- package/es/reducers/index.d.ts.map +0 -1
- package/es/reducers/navigation.d.ts.map +0 -1
- package/es/reducers/token.d.ts.map +0 -1
- package/es/services/fetch-demo.d.ts.map +0 -1
- package/es/services/fetch-demo.test.d.ts.map +0 -1
- package/es/services/fetch-responses.d.ts.map +0 -1
- package/es/services/fetch.mocks.d.ts.map +0 -1
- package/lib/actions/courses.d.ts.map +0 -1
- package/lib/actions/index.d.ts.map +0 -1
- package/lib/actions/navigation.d.ts.map +0 -1
- package/lib/actions/token.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts +0 -10
- package/lib/components/__tmp-backup-vues-mobile/revision-home.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.js +0 -98
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-home.stories.js +0 -14
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts +0 -4
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-onboarding.js +0 -60
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts +0 -19
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.d.ts.map +0 -1
- package/lib/components/__tmp-backup-vues-mobile/revision-quizzer.js +0 -128
- package/lib/configure-store.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/middlewares/on-start-app.d.ts.map +0 -1
- package/lib/reducers/courses.d.ts.map +0 -1
- package/lib/reducers/index.d.ts.map +0 -1
- package/lib/reducers/navigation.d.ts.map +0 -1
- package/lib/reducers/token.d.ts.map +0 -1
- package/lib/services/fetch-demo.d.ts.map +0 -1
- package/lib/services/fetch-demo.test.d.ts.map +0 -1
- package/lib/services/fetch-responses.d.ts.map +0 -1
- package/lib/services/fetch.mocks.d.ts.map +0 -1
- package/src/components/__tmp-backup-vues-mobile/revision-home.stories.tsx +0 -16
- package/src/components/__tmp-backup-vues-mobile/revision-home.tsx +0 -125
- package/src/components/__tmp-backup-vues-mobile/revision-onboarding.tsx +0 -84
- package/src/components/__tmp-backup-vues-mobile/revision-quizzer.tsx +0 -176
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { WithRequired } from './utils';
|
|
2
|
+
export declare type Choice = {
|
|
3
|
+
order?: number;
|
|
4
|
+
selected: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
help: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type QcmDrag = {
|
|
9
|
+
type: 'qcmDrag';
|
|
10
|
+
choices: Choice[];
|
|
11
|
+
help: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type Qcm = {
|
|
14
|
+
type: 'qcm';
|
|
15
|
+
choices: (Choice & {
|
|
16
|
+
ariaLabel: string;
|
|
17
|
+
})[];
|
|
18
|
+
};
|
|
19
|
+
export declare type QcmGraphic = {
|
|
20
|
+
type: 'qcmGraphic';
|
|
21
|
+
choices: (Choice & {
|
|
22
|
+
image: string;
|
|
23
|
+
})[];
|
|
24
|
+
};
|
|
25
|
+
export declare type FreeText = {
|
|
26
|
+
type: 'freeText';
|
|
27
|
+
placeholder: string;
|
|
28
|
+
value: string;
|
|
29
|
+
onChange: Function;
|
|
30
|
+
ariaLabel: string;
|
|
31
|
+
};
|
|
32
|
+
export declare type DropDownOption = {
|
|
33
|
+
name: string;
|
|
34
|
+
value: string | number;
|
|
35
|
+
selected: boolean;
|
|
36
|
+
validOption: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare type DropDown = {
|
|
39
|
+
type: 'dropDown';
|
|
40
|
+
onChange: Function;
|
|
41
|
+
options: DropDownOption[];
|
|
42
|
+
theme: 'filter' | 'invalid' | 'header' | 'mooc' | 'question' | 'sort' | 'thematiques' | 'player' | 'template' | 'coorpmanager';
|
|
43
|
+
};
|
|
44
|
+
export declare type QuestionRange = {
|
|
45
|
+
type: 'slider';
|
|
46
|
+
onChange: Function;
|
|
47
|
+
onChangeEnd: Function;
|
|
48
|
+
multi: boolean;
|
|
49
|
+
value: number | number[];
|
|
50
|
+
title: string;
|
|
51
|
+
minLabel: string;
|
|
52
|
+
maxLabel: string;
|
|
53
|
+
};
|
|
54
|
+
export declare type Template = {
|
|
55
|
+
type: 'template';
|
|
56
|
+
template: string;
|
|
57
|
+
choices: (DropDown & {
|
|
58
|
+
type?: string;
|
|
59
|
+
})[];
|
|
60
|
+
};
|
|
61
|
+
export declare type AnswerUI = {
|
|
62
|
+
model: QcmDrag | Qcm | QcmGraphic | FreeText | DropDown | QuestionRange | Template;
|
|
63
|
+
help: string;
|
|
64
|
+
};
|
|
65
|
+
export declare type SlideNumber = number;
|
|
66
|
+
export declare type SlideUIAnimations = 'unstack' | 'restack';
|
|
67
|
+
export declare type Slide = {
|
|
68
|
+
hidden?: boolean;
|
|
69
|
+
position?: number;
|
|
70
|
+
animationType?: SlideUIAnimations;
|
|
71
|
+
validationResult?: 'success' | 'failure';
|
|
72
|
+
endReview?: boolean;
|
|
73
|
+
questionText?: string;
|
|
74
|
+
answerUI?: AnswerUI;
|
|
75
|
+
nextSlide?: Omit<Slide, 'endReview' | 'hidden' | 'position' | 'nextSlide'>;
|
|
76
|
+
};
|
|
77
|
+
export declare type Slides = {
|
|
78
|
+
slideNumbers: SlideNumber[];
|
|
79
|
+
[key: SlideNumber]: Slide;
|
|
80
|
+
};
|
|
81
|
+
export declare type UpdateSlidesOnValidationPayload = {
|
|
82
|
+
slideNumber: SlideNumber;
|
|
83
|
+
newSlideContent: Slide;
|
|
84
|
+
numberOfFinishedSlides: number;
|
|
85
|
+
nextSlide: WithRequired<Slide['nextSlide'], 'answerUI' | 'questionText'>;
|
|
86
|
+
};
|
|
87
|
+
export declare type UpdateSlidesOnNextPayload = Omit<UpdateSlidesOnValidationPayload, 'nextSlide'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Slides as SlidesState } from './slides';
|
|
2
|
+
export { DataState } from './data';
|
|
3
|
+
export { StepItems as StepItemsState } from './step-items';
|
|
4
|
+
export { FinishedSlides as FinishedSlidesState } from './finished-slides';
|
|
5
|
+
export { State as ReviewStatusState } from '../reducers/review-status';
|
|
6
|
+
export declare type NavigationState = Array<'home' | 'onboarding' | 'slides'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SlideNumber } from './slides';
|
|
2
|
+
import { FinishedSlides } from './finished-slides';
|
|
3
|
+
declare const ICON_VALUES: {
|
|
4
|
+
readonly right: "right";
|
|
5
|
+
readonly wrong: "wrong";
|
|
6
|
+
};
|
|
7
|
+
declare type IconValue = keyof typeof ICON_VALUES;
|
|
8
|
+
export declare type StepItem = {
|
|
9
|
+
current: boolean;
|
|
10
|
+
icon: IconValue;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
export declare type StepItems = {
|
|
14
|
+
slideNumbers: SlideNumber[];
|
|
15
|
+
[key: SlideNumber]: StepItem;
|
|
16
|
+
};
|
|
17
|
+
export declare type UpdateStepItemsOnValidationClickPayload = {
|
|
18
|
+
stepNumber: SlideNumber;
|
|
19
|
+
icon: IconValue;
|
|
20
|
+
};
|
|
21
|
+
export declare type UpdateStepItemsOnNextClickPayload = {
|
|
22
|
+
stepNumber: SlideNumber;
|
|
23
|
+
finishedSlides: FinishedSlides;
|
|
24
|
+
current: boolean;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataState, FinishedSlidesState, NavigationState, ReviewStatusState, SlidesState, StepItemsState } from './states';
|
|
2
|
+
export declare type StoreState = {
|
|
3
|
+
ui: {
|
|
4
|
+
courses: unknown;
|
|
5
|
+
navigation: NavigationState;
|
|
6
|
+
slides: SlidesState;
|
|
7
|
+
stepItems: StepItemsState;
|
|
8
|
+
finishedSlides: FinishedSlidesState;
|
|
9
|
+
reviewStatus: ReviewStatusState;
|
|
10
|
+
};
|
|
11
|
+
data: DataState;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { State as ReviewStatus } from '../reducers/review-status';
|
|
2
|
+
import { DataState } from './data';
|
|
3
|
+
import { Dispatchers } from './dispatchers';
|
|
4
|
+
import { FinishedSlides } from './finished-slides';
|
|
5
|
+
import { Slides } from './slides';
|
|
6
|
+
import { StepItems } from './step-items';
|
|
7
|
+
declare type SlidesViewStaticProps = {
|
|
8
|
+
slides: Slides;
|
|
9
|
+
headerProps: {
|
|
10
|
+
mode: string;
|
|
11
|
+
skillName: string;
|
|
12
|
+
onQuitClick: Function;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
closeButtonAriaLabel: string;
|
|
15
|
+
};
|
|
16
|
+
finishedSlides: FinishedSlides;
|
|
17
|
+
stepItems: StepItems;
|
|
18
|
+
reviewStatus: ReviewStatus;
|
|
19
|
+
validate: {
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
congratsProps?: {
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
'data-name'?: string;
|
|
25
|
+
animationLottie: any;
|
|
26
|
+
title: string;
|
|
27
|
+
cardCongratsStar: any;
|
|
28
|
+
cardCongratsRank: any;
|
|
29
|
+
buttonRevising: {
|
|
30
|
+
'aria-label'?: string;
|
|
31
|
+
label: string;
|
|
32
|
+
onClick: Function;
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
buttonRevisingSkill: {
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
label: string;
|
|
38
|
+
onClick: Function;
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
correctionPopinProps?: {
|
|
43
|
+
klf: {
|
|
44
|
+
label: string;
|
|
45
|
+
onClick: Function;
|
|
46
|
+
tooltip: string;
|
|
47
|
+
};
|
|
48
|
+
information: {
|
|
49
|
+
label: string;
|
|
50
|
+
message: string;
|
|
51
|
+
};
|
|
52
|
+
next: {
|
|
53
|
+
label: string;
|
|
54
|
+
ariaLabel: string;
|
|
55
|
+
};
|
|
56
|
+
successLabel: string;
|
|
57
|
+
failureLabel: string;
|
|
58
|
+
};
|
|
59
|
+
reviewBackgroundAriaLabel?: string;
|
|
60
|
+
slideValidationResult: DataState['slideValidationResult'];
|
|
61
|
+
};
|
|
62
|
+
declare type SlidesViewDispatcherProps = Omit<Dispatchers, 'navigateTo' | 'navigateBack'>;
|
|
63
|
+
declare type SlidesViewProps = SlidesViewStaticProps & SlidesViewDispatcherProps;
|
|
64
|
+
export { SlidesViewStaticProps, SlidesViewDispatcherProps, SlidesViewProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
"clean:commonjs": "rm -rf lib",
|
|
18
18
|
"clean:es": "rm -rf es",
|
|
19
19
|
"clean": "concurrently \"npm run clean:commonjs\" \"npm run clean:es\"",
|
|
20
|
-
"
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"test:unit": "ava",
|
|
22
|
+
"lint": "eslint '**/*' --cache --ext .js --ext .jsx --ext .ts --ext .tsx --ext .json",
|
|
23
|
+
"lint:fix": "npm run lint -- --fix",
|
|
24
|
+
"test": "npm run lint && npm run typecheck && npm run test:unit"
|
|
21
25
|
},
|
|
22
26
|
"author": "CoorpAcademy",
|
|
23
27
|
"files": [
|
|
@@ -36,19 +40,27 @@
|
|
|
36
40
|
"./package.json": "./package.json"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@coorpacademy/components": "10.
|
|
43
|
+
"@coorpacademy/components": "10.21.0",
|
|
40
44
|
"cross-fetch": "^3.1.5",
|
|
41
45
|
"jwt-decode": "^3.1.2",
|
|
42
46
|
"react-redux": "^8.0.1",
|
|
43
47
|
"redux": "^4.2.0",
|
|
44
|
-
"redux-
|
|
48
|
+
"redux-thunk": "^2.4.1"
|
|
45
49
|
},
|
|
46
50
|
"peerDependencies": {
|
|
51
|
+
"lodash": "^4.17.21",
|
|
47
52
|
"react": "^17.0.2",
|
|
48
53
|
"react-native": "0.68.1"
|
|
49
54
|
},
|
|
50
55
|
"devDependencies": {
|
|
51
|
-
"
|
|
56
|
+
"@coorpacademy/css-modules-require-hook": "2.1.5",
|
|
57
|
+
"@coorpacademy/eslint-plugin-coorpacademy": "^11.0.0",
|
|
58
|
+
"@testing-library/react": "^12.1.5",
|
|
59
|
+
"@types/lodash": "^4.14.182",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.28.0",
|
|
62
|
+
"ava": "^4.3.0",
|
|
63
|
+
"browser-env": "^3.3.0",
|
|
52
64
|
"chalk": "^4.1.2",
|
|
53
65
|
"concurrently": "^5.2.0",
|
|
54
66
|
"connect-history-api-fallback": "^1.6.0",
|
|
@@ -56,11 +68,13 @@
|
|
|
56
68
|
"esbuild": "^0.14.39",
|
|
57
69
|
"esbuild-css-modules-plugin": "https://github.com/chrisdugne/esbuild-css-modules-plugin#main",
|
|
58
70
|
"esbuild-plugin-svgr": "^1.0.1",
|
|
71
|
+
"eslint": "^8.18.0",
|
|
72
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
59
73
|
"live-server": "^1.2.2",
|
|
60
74
|
"postcss-modules-values-replace": "^3.4.0",
|
|
61
75
|
"react-dom": "^17.0.2",
|
|
62
76
|
"ts-node": "^10.8.1",
|
|
63
|
-
"typescript": "^4.
|
|
77
|
+
"typescript": "^4.7.4"
|
|
64
78
|
},
|
|
65
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "fd256574b0fba67126be17e1498830eac1278c32"
|
|
66
80
|
}
|
package/src/actions/courses.ts
CHANGED
|
@@ -2,10 +2,10 @@ export const RECEIVED_COURSE = '@@api/RECEIVED_COURSE';
|
|
|
2
2
|
|
|
3
3
|
export type ReceivedCourse = {
|
|
4
4
|
type: '@@api/RECEIVED_COURSE';
|
|
5
|
-
payload:
|
|
5
|
+
payload: unknown;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
export const receivedCourse = (course:
|
|
8
|
+
export const receivedCourse = (course: unknown): ReceivedCourse => ({
|
|
9
9
|
type: RECEIVED_COURSE,
|
|
10
10
|
payload: course
|
|
11
11
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
export const IS_FETCHING_TRUE = '@@is-fetching/TRUE';
|
|
4
|
+
|
|
5
|
+
// -----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
export type IsFetching = {
|
|
8
|
+
type: typeof IS_FETCHING_TRUE;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
export const setIsFetching = (): IsFetching => ({type: IS_FETCHING_TRUE});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
export const VALIDATE_SLIDE = '@@api/VALIDATE_SLIDE';
|
|
4
|
+
|
|
5
|
+
// -----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
export type ValidateSlide = {
|
|
8
|
+
type: typeof VALIDATE_SLIDE;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
export const validateSlide = (): ValidateSlide => ({
|
|
14
|
+
type: VALIDATE_SLIDE
|
|
15
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {UpdateFinishedSlidesPayload} from '../types/finished-slides';
|
|
2
|
+
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
export const UPDATE_FINISHED_SLIDES = '@@finished-slides/UPDATE_FINISHED_SLIDES';
|
|
6
|
+
|
|
7
|
+
// -----------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
export type UpdateFinishedSlides = {
|
|
10
|
+
type: typeof UPDATE_FINISHED_SLIDES;
|
|
11
|
+
payload: UpdateFinishedSlidesPayload;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
export const updateFinishedSlides = (
|
|
17
|
+
payload: UpdateFinishedSlidesPayload
|
|
18
|
+
): UpdateFinishedSlides => ({
|
|
19
|
+
type: UPDATE_FINISHED_SLIDES,
|
|
20
|
+
payload
|
|
21
|
+
});
|
package/src/actions/index.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {ReceivedCourse} from './courses';
|
|
2
2
|
import {NavigateBack, NavigateTo, StartApp} from './navigation';
|
|
3
3
|
import {StoreToken} from './token';
|
|
4
|
+
import {StoreFirstSlide} from './slides';
|
|
4
5
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export type Action =
|
|
7
|
+
| NavigateBack
|
|
8
|
+
| NavigateTo
|
|
9
|
+
| ReceivedCourse
|
|
10
|
+
| StartApp
|
|
11
|
+
| StoreFirstSlide
|
|
12
|
+
| StoreToken;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {AppOptions} from '..';
|
|
1
|
+
import {AppOptions} from '../types/common';
|
|
3
2
|
|
|
4
3
|
export const NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
|
|
5
4
|
export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
6
5
|
export const START_APP = '@@navigation/START_APP';
|
|
7
6
|
|
|
7
|
+
export type ViewPath = 'home' | 'onboarding' | 'slides';
|
|
8
|
+
|
|
8
9
|
export type NavigateTo = {
|
|
9
10
|
type: '@@navigation/NAVIGATE_TO';
|
|
10
|
-
payload:
|
|
11
|
+
payload: ViewPath;
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type NavigateBack = {
|
|
@@ -19,12 +20,12 @@ export type StartApp = {
|
|
|
19
20
|
payload: AppOptions;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
export const navigateTo
|
|
23
|
+
export const navigateTo = (newPath: ViewPath): NavigateTo => ({
|
|
23
24
|
type: NAVIGATE_TO,
|
|
24
25
|
payload: newPath
|
|
25
26
|
});
|
|
26
27
|
|
|
27
|
-
export const navigateBack
|
|
28
|
+
export const navigateBack = (): NavigateBack => ({
|
|
28
29
|
type: NAVIGATE_BACK
|
|
29
30
|
});
|
|
30
31
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {UpdateReviewStatusPayload} from '../types/review-status';
|
|
2
|
+
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
export const UPDATE_REVIEW_STATUS = '@@review-status/UPDATE_REVIEW_STATUS';
|
|
6
|
+
|
|
7
|
+
// -----------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
export type UpdateReviewStatus = {
|
|
10
|
+
type: typeof UPDATE_REVIEW_STATUS;
|
|
11
|
+
payload: UpdateReviewStatusPayload;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// -----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
export const updateReviewStatus = (payload: UpdateReviewStatusPayload): UpdateReviewStatus => ({
|
|
17
|
+
type: UPDATE_REVIEW_STATUS,
|
|
18
|
+
payload
|
|
19
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {Slide, UpdateSlidesOnNextPayload, UpdateSlidesOnValidationPayload} from '../types/slides';
|
|
2
|
+
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
export const STORE_FIRST_SLIDE = '@@slide/STORE_FIRST_SLIDE';
|
|
6
|
+
export const UPDATE_SLIDES_ON_VALIDATION = '@@slide/UPDATE_SLIDES_ON_VALIDATION';
|
|
7
|
+
export const UPDATE_SLIDES_ON_NEXT = '@@slide/UPDATE_SLIDES_ON_NEXT';
|
|
8
|
+
|
|
9
|
+
// -----------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
export type StoreFirstSlide = {
|
|
12
|
+
type: typeof STORE_FIRST_SLIDE;
|
|
13
|
+
payload: Slide;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type UpdateSlidesOnValidation = {
|
|
17
|
+
type: typeof UPDATE_SLIDES_ON_VALIDATION;
|
|
18
|
+
payload: UpdateSlidesOnValidationPayload;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type UpdateSlidesOnNext = {
|
|
22
|
+
type: typeof UPDATE_SLIDES_ON_NEXT;
|
|
23
|
+
payload: UpdateSlidesOnNextPayload;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type SlidesAction = StoreFirstSlide | UpdateSlidesOnValidation | UpdateSlidesOnNext;
|
|
27
|
+
|
|
28
|
+
// -----------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
export const storeFirstSlide = (slide: Slide): StoreFirstSlide => ({
|
|
31
|
+
type: STORE_FIRST_SLIDE,
|
|
32
|
+
payload: slide
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const updateSlidesOnValidation = (
|
|
36
|
+
payload: UpdateSlidesOnValidationPayload
|
|
37
|
+
): UpdateSlidesOnValidation => ({
|
|
38
|
+
type: UPDATE_SLIDES_ON_VALIDATION,
|
|
39
|
+
payload
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const updateSlidesOnNext = (payload: UpdateSlidesOnNextPayload): UpdateSlidesOnNext => ({
|
|
43
|
+
type: UPDATE_SLIDES_ON_NEXT,
|
|
44
|
+
payload
|
|
45
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UpdateStepItemsOnNextClickPayload,
|
|
3
|
+
UpdateStepItemsOnValidationClickPayload
|
|
4
|
+
} from '../types/step-items';
|
|
5
|
+
|
|
6
|
+
// -----------------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
export const UPDATE_STEP_ITEMS_ON_VALIDATION = '@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION';
|
|
9
|
+
export const UPDATE_STEP_ITEMS_ON_NEXT = '@@step-items/UPDATE_STEP_ITEMS_ON_NEXT';
|
|
10
|
+
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
export type UpdateStepItemsOnValidation = {
|
|
14
|
+
type: typeof UPDATE_STEP_ITEMS_ON_VALIDATION;
|
|
15
|
+
payload: UpdateStepItemsOnValidationClickPayload;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type UpdateStepItemsOnNext = {
|
|
19
|
+
type: typeof UPDATE_STEP_ITEMS_ON_NEXT;
|
|
20
|
+
payload: UpdateStepItemsOnNextClickPayload;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type StepItemsAction = UpdateStepItemsOnValidation | UpdateStepItemsOnNext;
|
|
24
|
+
|
|
25
|
+
// -----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
export const updateStepItemsOnValidation = (
|
|
28
|
+
payload: UpdateStepItemsOnValidationClickPayload
|
|
29
|
+
): UpdateStepItemsOnValidation => ({
|
|
30
|
+
type: UPDATE_STEP_ITEMS_ON_VALIDATION,
|
|
31
|
+
payload
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const updateStepItemsOnNext = (
|
|
35
|
+
payload: UpdateStepItemsOnNextClickPayload
|
|
36
|
+
): UpdateStepItemsOnNext => ({
|
|
37
|
+
type: UPDATE_STEP_ITEMS_ON_NEXT,
|
|
38
|
+
payload
|
|
39
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const TOTAL_SLIDES_STACK = 5;
|
|
2
|
+
export const HIGHEST_INDEX = TOTAL_SLIDES_STACK - 1;
|
|
3
|
+
|
|
4
|
+
export const VIEWS: {
|
|
5
|
+
readonly home: 'home';
|
|
6
|
+
readonly onboarding: 'onboarding';
|
|
7
|
+
readonly slides: 'slides';
|
|
8
|
+
} = {
|
|
9
|
+
home: 'home',
|
|
10
|
+
onboarding: 'onboarding',
|
|
11
|
+
slides: 'slides'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const slideNumbers: number[] = [0, 1, 2, 3, 4];
|
package/src/configure-store.ts
CHANGED
|
@@ -1,37 +1,29 @@
|
|
|
1
|
-
import {applyMiddleware, compose, createStore} from 'redux';
|
|
1
|
+
import {AnyAction, applyMiddleware, compose, createStore, EmptyObject, Store} from 'redux';
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
3
|
|
|
4
4
|
import rootReducer from './reducers';
|
|
5
5
|
|
|
6
|
-
import {State as NavigationState} from './reducers/navigation';
|
|
7
|
-
import {State as TokenState} from './reducers/token';
|
|
8
6
|
import onStartApp from './middlewares/on-start-app';
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
import {StoreState} from './types/store-state';
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
const preloadedState: unknown = undefined;
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
let _compose = compose;
|
|
12
|
+
// -----------------------------------------------------------------------------
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
export default function configureStore(): Store<EmptyObject & StoreState, AnyAction> & {
|
|
15
|
+
dispatch: {};
|
|
16
|
+
} {
|
|
17
|
+
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
18
|
+
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
|
|
19
|
+
name: 'app-review',
|
|
20
|
+
trace: true,
|
|
21
|
+
traceLimit: 25
|
|
22
|
+
})
|
|
23
|
+
: compose;
|
|
25
24
|
|
|
26
25
|
const enhancer = _compose(applyMiddleware(thunk, onStartApp));
|
|
27
26
|
const store = createStore(rootReducer, preloadedState, enhancer);
|
|
28
27
|
|
|
29
28
|
return store;
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
// -----------------------------------------------------------------------------
|
|
33
|
-
|
|
34
|
-
export type StoreState = {
|
|
35
|
-
navigation: NavigationState;
|
|
36
|
-
token: TokenState;
|
|
37
|
-
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {Slide} from '../types/slides';
|
|
2
|
+
|
|
3
|
+
export const slide: Slide = {
|
|
4
|
+
questionText: 'QCM',
|
|
5
|
+
answerUI: {
|
|
6
|
+
help: '__help',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'qcm',
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
selected: false,
|
|
12
|
+
title: 'choix1',
|
|
13
|
+
help: '(help choix1)',
|
|
14
|
+
ariaLabel: '__ariaLabel1'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
selected: false,
|
|
18
|
+
title: 'choix2',
|
|
19
|
+
help: '(help choix2)',
|
|
20
|
+
ariaLabel: '__ariaLabel2'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
selected: false,
|
|
24
|
+
title: 'choix3',
|
|
25
|
+
help: '(help choix3)',
|
|
26
|
+
ariaLabel: '__ariaLabel3'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|