@coorpacademy/app-review 0.1.2 → 0.1.4
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/data/skills.d.ts +13 -0
- package/es/actions/data/skills.js +10 -0
- package/es/actions/data/slides.d.ts +54 -0
- package/es/actions/{slides.js → data/slides.js} +5 -0
- package/es/actions/index.d.ts +19 -5
- package/es/actions/ui/finished-slides.d.ts +10 -0
- package/es/actions/{finished-slides.js → ui/finished-slides.js} +1 -0
- package/es/actions/ui/is-fetching.d.ts +10 -0
- package/es/actions/ui/is-fetching.js +6 -0
- package/{lib/actions → es/actions/ui}/navigation.d.ts +2 -2
- package/es/actions/ui/review-status.d.ts +7 -0
- package/{lib/actions → es/actions/ui}/step-items.d.ts +17 -1
- package/es/actions/{step-items.js → ui/step-items.js} +5 -0
- package/es/common/index.d.ts +1 -1
- package/es/common/index.js +1 -1
- package/es/configure-store.d.ts +34 -4
- package/es/configure-store.js +1 -2
- package/es/fixtures/qcm-slide.js +7 -3
- package/es/fixtures/temp-fixture.d.ts +1 -1
- package/es/index.js +54 -36
- package/es/index.test.js +1 -1
- package/es/middlewares/on-start-app.d.ts +2 -3
- package/es/middlewares/on-start-app.js +18 -17
- package/es/reducers/data/index.d.ts +7 -0
- package/es/reducers/data/index.js +11 -0
- package/es/reducers/data/progression.d.ts +14 -0
- package/es/reducers/data/progression.js +78 -0
- package/es/reducers/data/skills.d.ts +6 -0
- package/es/reducers/{courses.js → data/skills.js} +3 -4
- package/es/reducers/data/slides.d.ts +8 -0
- package/es/reducers/{slides.js → data/slides.js} +4 -3
- package/es/reducers/data/token.d.ts +5 -0
- package/es/reducers/data/token.js +15 -0
- package/es/reducers/index.d.ts +11 -8
- package/es/reducers/index.js +3 -16
- package/es/reducers/ui/finished-slides.d.ts +8 -0
- package/es/reducers/{finished-slides.js → ui/finished-slides.js} +9 -6
- package/es/reducers/ui/index.d.ts +7 -0
- package/es/reducers/ui/index.js +11 -0
- package/es/reducers/ui/navigation.d.ts +5 -0
- package/es/reducers/{navigation.js → ui/navigation.js} +4 -7
- package/es/reducers/ui/review-status.d.ts +5 -0
- package/es/reducers/{review-status.js → ui/review-status.js} +3 -2
- package/es/reducers/ui/step-items.d.ts +14 -0
- package/es/reducers/{step-items.js → ui/step-items.js} +7 -7
- package/es/services/fetch-skills.d.ts +8 -0
- package/es/services/fetch-skills.js +23 -0
- package/es/services/fetch-skills.mock.d.ts +3 -0
- package/es/services/fetch-skills.mock.js +17 -0
- package/es/services/fetch-skills.test.js +22 -0
- package/es/services/tools/fetch-responses.d.ts +7 -0
- package/es/services/tools/fetch.mocks.d.ts +8 -0
- package/es/services/{fetch.mocks.js → tools/fetch.mocks.js} +1 -0
- package/es/types/common.d.ts +12 -0
- package/es/types/skills.d.ts +7 -0
- package/es/types/slides.d.ts +3 -21
- package/es/types/views/skills.d.ts +24 -0
- package/{lib/types/views.d.ts → es/types/views/slides.d.ts} +7 -11
- package/lib/actions/data/skills.d.ts +13 -0
- package/lib/actions/data/skills.js +10 -0
- package/lib/actions/data/slides.d.ts +54 -0
- package/lib/actions/{slides.js → data/slides.js} +5 -0
- package/lib/actions/index.d.ts +19 -5
- package/lib/actions/ui/finished-slides.d.ts +10 -0
- package/lib/actions/{finished-slides.js → ui/finished-slides.js} +1 -0
- package/lib/actions/ui/is-fetching.d.ts +10 -0
- package/lib/actions/ui/is-fetching.js +6 -0
- package/{es/actions → lib/actions/ui}/navigation.d.ts +2 -2
- package/lib/actions/ui/review-status.d.ts +7 -0
- package/{es/actions → lib/actions/ui}/step-items.d.ts +17 -1
- package/lib/actions/{step-items.js → ui/step-items.js} +5 -0
- package/lib/common/index.d.ts +1 -1
- package/lib/common/index.js +1 -1
- package/lib/configure-store.d.ts +34 -4
- package/lib/configure-store.js +1 -2
- package/lib/fixtures/qcm-slide.js +7 -3
- package/lib/fixtures/temp-fixture.d.ts +1 -1
- package/lib/index.js +57 -37
- package/lib/index.test.js +1 -1
- package/lib/middlewares/on-start-app.d.ts +2 -3
- package/lib/middlewares/on-start-app.js +18 -17
- package/lib/reducers/data/index.d.ts +7 -0
- package/lib/reducers/data/index.js +11 -0
- package/lib/reducers/data/progression.d.ts +14 -0
- package/lib/reducers/data/progression.js +79 -0
- package/lib/reducers/data/skills.d.ts +6 -0
- package/lib/reducers/data/skills.js +15 -0
- package/lib/reducers/data/slides.d.ts +8 -0
- package/lib/reducers/{slides.js → data/slides.js} +4 -3
- package/lib/reducers/data/token.d.ts +5 -0
- package/lib/reducers/data/token.js +16 -0
- package/lib/reducers/index.d.ts +11 -8
- package/lib/reducers/index.js +3 -16
- package/lib/reducers/ui/finished-slides.d.ts +8 -0
- package/lib/reducers/{finished-slides.js → ui/finished-slides.js} +9 -6
- package/lib/reducers/ui/index.d.ts +7 -0
- package/lib/reducers/ui/index.js +11 -0
- package/lib/reducers/ui/navigation.d.ts +5 -0
- package/lib/reducers/{courses.js → ui/navigation.js} +9 -3
- package/lib/reducers/ui/review-status.d.ts +5 -0
- package/lib/reducers/{review-status.js → ui/review-status.js} +3 -2
- package/lib/reducers/ui/step-items.d.ts +14 -0
- package/lib/reducers/{step-items.js → ui/step-items.js} +7 -7
- package/lib/services/fetch-skills.d.ts +8 -0
- package/lib/services/{fetch-demo.js → fetch-skills.js} +28 -35
- package/lib/services/fetch-skills.mock.d.ts +3 -0
- package/lib/services/fetch-skills.mock.js +17 -0
- package/lib/services/{fetch-demo.test.js → fetch-skills.test.js} +31 -12
- package/lib/services/tools/fetch-responses.d.ts +7 -0
- package/lib/services/tools/fetch.mocks.d.ts +8 -0
- package/lib/services/{fetch.mocks.js → tools/fetch.mocks.js} +1 -0
- package/lib/types/common.d.ts +12 -0
- package/lib/types/skills.d.ts +7 -0
- package/lib/types/slides.d.ts +3 -21
- package/lib/types/views/skills.d.ts +24 -0
- package/{es/types/views.d.ts → lib/types/views/slides.d.ts} +7 -11
- package/package.json +3 -3
- package/src/actions/data/skills.ts +24 -0
- package/src/actions/data/slides.ts +89 -0
- package/src/actions/index.ts +27 -5
- package/src/actions/{finished-slides.ts → ui/finished-slides.ts} +5 -5
- package/src/actions/ui/is-fetching.ts +19 -0
- package/src/actions/{navigation.ts → ui/navigation.ts} +2 -2
- package/src/actions/{review-status.ts → ui/review-status.ts} +4 -4
- package/src/actions/{step-items.ts → ui/step-items.ts} +22 -4
- package/src/common/index.ts +2 -2
- package/src/configure-store.ts +40 -8
- package/src/fixtures/qcm-slide.ts +7 -3
- package/src/fixtures/temp-fixture.ts +1 -1
- package/src/index.test.tsx +1 -1
- package/src/index.tsx +69 -44
- package/src/middlewares/on-start-app.ts +23 -26
- package/src/reducers/data/index.ts +13 -0
- package/src/reducers/data/progression.ts +106 -0
- package/src/reducers/data/skills.ts +21 -0
- package/src/reducers/{slides.ts → data/slides.ts} +24 -21
- package/src/reducers/{review-status.ts → data/token.ts} +8 -6
- package/src/reducers/index.ts +3 -17
- package/src/reducers/{finished-slides.ts → ui/finished-slides.ts} +24 -14
- package/src/reducers/ui/index.ts +13 -0
- package/src/reducers/ui/navigation.ts +36 -0
- package/src/reducers/ui/review-status.ts +26 -0
- package/src/reducers/{step-items.ts → ui/step-items.ts} +34 -21
- package/src/services/fetch-skills.mock.ts +21 -0
- package/src/services/fetch-skills.test.ts +32 -0
- package/src/services/fetch-skills.ts +40 -0
- package/src/services/{fetch-responses.ts → tools/fetch-responses.ts} +3 -16
- package/src/services/{fetch.mocks.ts → tools/fetch.mocks.ts} +10 -10
- package/src/types/common.ts +15 -0
- package/src/types/globals.d.ts +2 -0
- package/src/types/skills.ts +8 -0
- package/src/types/slides.ts +3 -26
- package/src/types/views/skills.ts +27 -0
- package/src/types/{views.tsx → views/slides.ts} +7 -11
- package/es/actions/courses.d.ts +0 -6
- package/es/actions/courses.js +0 -5
- package/es/actions/data/is-fetching.d.ts +0 -5
- package/es/actions/data/is-fetching.js +0 -4
- package/es/actions/data/validate-slide.d.ts +0 -5
- package/es/actions/data/validate-slide.js +0 -6
- package/es/actions/finished-slides.d.ts +0 -7
- package/es/actions/review-status.d.ts +0 -7
- package/es/actions/slides.d.ts +0 -20
- package/es/reducers/courses.d.ts +0 -5
- package/es/reducers/data.d.ts +0 -7
- package/es/reducers/data.js +0 -76
- package/es/reducers/finished-slides.d.ts +0 -6
- package/es/reducers/navigation.d.ts +0 -8
- package/es/reducers/review-status.d.ts +0 -5
- package/es/reducers/slides.d.ts +0 -6
- package/es/reducers/step-items.d.ts +0 -6
- package/es/reducers/token.d.ts +0 -5
- package/es/reducers/token.js +0 -8
- package/es/services/fetch-demo.d.ts +0 -11
- package/es/services/fetch-demo.js +0 -26
- package/es/services/fetch-demo.test.js +0 -12
- package/es/services/fetch-responses.d.ts +0 -19
- package/es/services/fetch.mocks.d.ts +0 -9
- package/es/types/data/index.d.ts +0 -14
- package/es/types/dispatchers.d.ts +0 -17
- package/es/types/finished-slides.d.ts +0 -9
- package/es/types/review-status.d.ts +0 -1
- package/es/types/states.d.ts +0 -6
- package/es/types/step-items.d.ts +0 -26
- package/es/types/step-items.js +0 -5
- package/es/types/store-state.d.ts +0 -12
- package/es/types/utils.d.ts +0 -3
- package/es/types/views.js +0 -1
- package/lib/actions/courses.d.ts +0 -6
- package/lib/actions/courses.js +0 -5
- package/lib/actions/data/is-fetching.d.ts +0 -5
- package/lib/actions/data/is-fetching.js +0 -4
- package/lib/actions/data/validate-slide.d.ts +0 -5
- package/lib/actions/data/validate-slide.js +0 -6
- package/lib/actions/finished-slides.d.ts +0 -7
- package/lib/actions/review-status.d.ts +0 -7
- package/lib/actions/slides.d.ts +0 -20
- package/lib/reducers/courses.d.ts +0 -5
- package/lib/reducers/data.d.ts +0 -7
- package/lib/reducers/data.js +0 -77
- package/lib/reducers/finished-slides.d.ts +0 -6
- package/lib/reducers/navigation.d.ts +0 -8
- package/lib/reducers/navigation.js +0 -36
- package/lib/reducers/review-status.d.ts +0 -5
- package/lib/reducers/slides.d.ts +0 -6
- package/lib/reducers/step-items.d.ts +0 -6
- package/lib/reducers/token.d.ts +0 -5
- package/lib/reducers/token.js +0 -8
- package/lib/services/fetch-demo.d.ts +0 -11
- package/lib/services/fetch-demo.test.d.ts +0 -1
- package/lib/services/fetch-responses.d.ts +0 -19
- package/lib/services/fetch.mocks.d.ts +0 -9
- package/lib/types/data/index.d.ts +0 -14
- package/lib/types/data/index.js +0 -1
- package/lib/types/dispatchers.d.ts +0 -17
- package/lib/types/dispatchers.js +0 -1
- package/lib/types/finished-slides.d.ts +0 -9
- package/lib/types/finished-slides.js +0 -1
- package/lib/types/review-status.d.ts +0 -1
- package/lib/types/review-status.js +0 -1
- package/lib/types/states.d.ts +0 -6
- package/lib/types/states.js +0 -1
- package/lib/types/step-items.d.ts +0 -26
- package/lib/types/step-items.js +0 -5
- package/lib/types/store-state.d.ts +0 -12
- package/lib/types/store-state.js +0 -1
- package/lib/types/utils.d.ts +0 -3
- package/lib/types/utils.js +0 -1
- package/lib/types/views.js +0 -1
- package/src/actions/courses.ts +0 -11
- package/src/actions/data/is-fetching.ts +0 -12
- package/src/actions/data/validate-slide.ts +0 -15
- package/src/actions/slides.ts +0 -45
- package/src/reducers/courses.ts +0 -23
- package/src/reducers/data.ts +0 -88
- package/src/reducers/navigation.ts +0 -36
- package/src/reducers/token.ts +0 -17
- package/src/services/fetch-demo.test.ts +0 -16
- package/src/services/fetch-demo.ts +0 -57
- package/src/types/data/index.ts +0 -16
- package/src/types/dispatchers.ts +0 -18
- package/src/types/finished-slides.ts +0 -9
- package/src/types/review-status.ts +0 -1
- package/src/types/states.ts +0 -6
- package/src/types/step-items.ts +0 -31
- package/src/types/store-state.ts +0 -20
- package/src/types/utils.ts +0 -4
- /package/es/actions/{token.d.ts → data/token.d.ts} +0 -0
- /package/es/actions/{token.js → data/token.js} +0 -0
- /package/es/actions/{navigation.js → ui/navigation.js} +0 -0
- /package/es/actions/{review-status.js → ui/review-status.js} +0 -0
- /package/es/services/{fetch-demo.test.d.ts → fetch-skills.test.d.ts} +0 -0
- /package/es/services/{fetch-responses.js → tools/fetch-responses.js} +0 -0
- /package/es/types/{data/index.js → skills.js} +0 -0
- /package/es/types/{dispatchers.js → views/skills.js} +0 -0
- /package/es/types/{finished-slides.js → views/slides.js} +0 -0
- /package/lib/actions/{token.d.ts → data/token.d.ts} +0 -0
- /package/lib/actions/{token.js → data/token.js} +0 -0
- /package/lib/actions/{navigation.js → ui/navigation.js} +0 -0
- /package/lib/actions/{review-status.js → ui/review-status.js} +0 -0
- /package/{es/types/review-status.js → lib/services/fetch-skills.test.d.ts} +0 -0
- /package/lib/services/{fetch-responses.js → tools/fetch-responses.js} +0 -0
- /package/{es/types/states.js → lib/types/skills.js} +0 -0
- /package/{es/types/store-state.js → lib/types/views/skills.js} +0 -0
- /package/{es/types/utils.js → lib/types/views/slides.js} +0 -0
- /package/src/actions/{token.ts → data/token.ts} +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Skills } from '../../types/skills';
|
|
2
|
+
export declare const RECEIVED_SKILLS = "@@data/skills/RECEIVED_SKILLS";
|
|
3
|
+
export declare const ERROR_FETCHING_SKILLS = "@@data/skills/ERROR_FETCHING_SKILLS";
|
|
4
|
+
export declare type ReceivedSkills = {
|
|
5
|
+
type: '@@data/skills/RECEIVED_SKILLS';
|
|
6
|
+
payload: Skills;
|
|
7
|
+
};
|
|
8
|
+
export declare type ErrorFetchingSkills = {
|
|
9
|
+
type: '@@data/skills/ERROR_FETCHING_SKILLS';
|
|
10
|
+
payload: Error;
|
|
11
|
+
};
|
|
12
|
+
export declare const receivedSkills: (skills: Skills) => ReceivedSkills;
|
|
13
|
+
export declare const errorFetchingSkills: (error: Error) => ErrorFetchingSkills;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const RECEIVED_SKILLS = '@@data/skills/RECEIVED_SKILLS';
|
|
2
|
+
export const ERROR_FETCHING_SKILLS = '@@data/skills/ERROR_FETCHING_SKILLS';
|
|
3
|
+
export const receivedSkills = (skills) => ({
|
|
4
|
+
type: RECEIVED_SKILLS,
|
|
5
|
+
payload: skills
|
|
6
|
+
});
|
|
7
|
+
export const errorFetchingSkills = (error) => ({
|
|
8
|
+
type: ERROR_FETCHING_SKILLS,
|
|
9
|
+
payload: error
|
|
10
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Slide as SlideFromAPI } from '../../types/slides';
|
|
2
|
+
export declare const STORE_FIRST_SLIDE = "@@slide/STORE_FIRST_SLIDE";
|
|
3
|
+
export declare const UPDATE_SLIDES_ON_VALIDATION = "@@slide/UPDATE_SLIDES_ON_VALIDATION";
|
|
4
|
+
export declare const UPDATE_SLIDES_ON_NEXT = "@@slide/UPDATE_SLIDES_ON_NEXT";
|
|
5
|
+
export declare const VALIDATE_SLIDE = "@@slide/VALIDATE";
|
|
6
|
+
export declare const FETCH_NEXT_CONTENT = "@@slide/FETCH_NEXT_CONTENT";
|
|
7
|
+
declare type SlideUIAnimations = 'unstack' | 'restack';
|
|
8
|
+
export declare type Slide = SlideFromAPI & {
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
position: number;
|
|
11
|
+
animationType?: SlideUIAnimations;
|
|
12
|
+
isCorrect?: boolean;
|
|
13
|
+
endReview?: boolean;
|
|
14
|
+
nextSlide?: Omit<Slide, 'endReview' | 'hidden' | 'position' | 'nextSlide'>;
|
|
15
|
+
};
|
|
16
|
+
export declare type ValidationPayload = {
|
|
17
|
+
slideNumber: number;
|
|
18
|
+
newSlideContent: Slide;
|
|
19
|
+
numberOfFinishedSlides: number;
|
|
20
|
+
nextSlide: Slide;
|
|
21
|
+
};
|
|
22
|
+
export declare type OnNextPayload = Omit<ValidationPayload, 'nextSlide'>;
|
|
23
|
+
export declare type FetchNextPayload = {
|
|
24
|
+
answer: string[];
|
|
25
|
+
content: {
|
|
26
|
+
ref: string;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare type StoreFirstSlide = {
|
|
31
|
+
type: typeof STORE_FIRST_SLIDE;
|
|
32
|
+
payload: SlideFromAPI;
|
|
33
|
+
};
|
|
34
|
+
export declare type UpdateSlidesOnValidation = {
|
|
35
|
+
type: typeof UPDATE_SLIDES_ON_VALIDATION;
|
|
36
|
+
payload: ValidationPayload;
|
|
37
|
+
};
|
|
38
|
+
export declare type UpdateSlidesOnNext = {
|
|
39
|
+
type: typeof UPDATE_SLIDES_ON_NEXT;
|
|
40
|
+
payload: OnNextPayload;
|
|
41
|
+
};
|
|
42
|
+
export declare type ValidateSlide = {
|
|
43
|
+
type: typeof VALIDATE_SLIDE;
|
|
44
|
+
};
|
|
45
|
+
export declare type FetchNextContent = {
|
|
46
|
+
type: typeof FETCH_NEXT_CONTENT;
|
|
47
|
+
payload: FetchNextPayload;
|
|
48
|
+
};
|
|
49
|
+
export declare type SlidesAction = StoreFirstSlide | UpdateSlidesOnValidation | UpdateSlidesOnNext;
|
|
50
|
+
export declare const storeFirstSlide: (slide: SlideFromAPI) => StoreFirstSlide;
|
|
51
|
+
export declare const updateSlidesOnValidation: (payload: ValidationPayload) => UpdateSlidesOnValidation;
|
|
52
|
+
export declare const updateSlidesOnNext: (payload: OnNextPayload) => UpdateSlidesOnNext;
|
|
53
|
+
export declare const validateSlide: () => ValidateSlide;
|
|
54
|
+
export {};
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export const STORE_FIRST_SLIDE = '@@slide/STORE_FIRST_SLIDE';
|
|
3
3
|
export const UPDATE_SLIDES_ON_VALIDATION = '@@slide/UPDATE_SLIDES_ON_VALIDATION';
|
|
4
4
|
export const UPDATE_SLIDES_ON_NEXT = '@@slide/UPDATE_SLIDES_ON_NEXT';
|
|
5
|
+
export const VALIDATE_SLIDE = '@@slide/VALIDATE';
|
|
6
|
+
export const FETCH_NEXT_CONTENT = '@@slide/FETCH_NEXT_CONTENT';
|
|
5
7
|
// -----------------------------------------------------------------------------
|
|
6
8
|
export const storeFirstSlide = (slide) => ({
|
|
7
9
|
type: STORE_FIRST_SLIDE,
|
|
@@ -15,3 +17,6 @@ export const updateSlidesOnNext = (payload) => ({
|
|
|
15
17
|
type: UPDATE_SLIDES_ON_NEXT,
|
|
16
18
|
payload
|
|
17
19
|
});
|
|
20
|
+
export const validateSlide = () => ({
|
|
21
|
+
type: VALIDATE_SLIDE
|
|
22
|
+
});
|
package/es/actions/index.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { StoreToken } from './token';
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { StoreFirstSlide, updateSlidesOnValidation, updateSlidesOnNext, validateSlide } from './data/slides';
|
|
2
|
+
import { ErrorFetchingSkills, ReceivedSkills } from './data/skills';
|
|
3
|
+
import { StoreToken } from './data/token';
|
|
4
|
+
import { updateFinishedSlides } from './ui/finished-slides';
|
|
5
|
+
import { navigateBack, navigateTo, NavigateBack, NavigateTo, StartApp } from './ui/navigation';
|
|
6
|
+
import { updateReviewStatus } from './ui/review-status';
|
|
7
|
+
import { updateStepItemsOnValidation, updateStepItemsOnNext } from './ui/step-items';
|
|
8
|
+
export declare type Action = NavigateBack | NavigateTo | ReceivedSkills | ErrorFetchingSkills | StartApp | StoreFirstSlide | StoreToken;
|
|
9
|
+
export declare type Dispatchers = {
|
|
10
|
+
navigateTo: typeof navigateTo;
|
|
11
|
+
navigateBack: typeof navigateBack;
|
|
12
|
+
validateSlide: typeof validateSlide;
|
|
13
|
+
updateSlidesOnValidation: typeof updateSlidesOnValidation;
|
|
14
|
+
updateSlidesOnNext: typeof updateSlidesOnNext;
|
|
15
|
+
updateReviewStatus: typeof updateReviewStatus;
|
|
16
|
+
updateStepItemsOnValidation: typeof updateStepItemsOnValidation;
|
|
17
|
+
updateStepItemsOnNext: typeof updateStepItemsOnNext;
|
|
18
|
+
updateFinishedSlides: typeof updateFinishedSlides;
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type FinishedSlide = {
|
|
2
|
+
slideNumber: number;
|
|
3
|
+
value: true;
|
|
4
|
+
};
|
|
5
|
+
export declare const UPDATE_FINISHED_SLIDES = "@@finished-slides/UPDATE_FINISHED_SLIDES";
|
|
6
|
+
export declare type UpdateFinishedSlides = {
|
|
7
|
+
type: typeof UPDATE_FINISHED_SLIDES;
|
|
8
|
+
payload: FinishedSlide;
|
|
9
|
+
};
|
|
10
|
+
export declare const updateFinishedSlides: (payload: FinishedSlide) => UpdateFinishedSlides;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Stores only successful slides
|
|
1
2
|
// -----------------------------------------------------------------------------
|
|
2
3
|
export const UPDATE_FINISHED_SLIDES = '@@finished-slides/UPDATE_FINISHED_SLIDES';
|
|
3
4
|
// -----------------------------------------------------------------------------
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
export const START_FETCHING = '@@ui/START_FETCHING';
|
|
3
|
+
export const STOP_FETCHING = '@@ui/STOP_FETCHING';
|
|
4
|
+
// -----------------------------------------------------------------------------
|
|
5
|
+
export const startFetching = () => ({ type: START_FETCHING });
|
|
6
|
+
export const stopFetching = () => ({ type: STOP_FETCHING });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AppOptions } from '
|
|
1
|
+
import { AppOptions } from '../../types/common';
|
|
2
2
|
export declare const NAVIGATE_TO = "@@navigation/NAVIGATE_TO";
|
|
3
3
|
export declare const NAVIGATE_BACK = "@@navigation/NAVIGATE_BACK";
|
|
4
4
|
export declare const START_APP = "@@navigation/START_APP";
|
|
5
|
-
export declare type ViewPath = '
|
|
5
|
+
export declare type ViewPath = 'skills' | 'onboarding' | 'slides';
|
|
6
6
|
export declare type NavigateTo = {
|
|
7
7
|
type: '@@navigation/NAVIGATE_TO';
|
|
8
8
|
payload: ViewPath;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const UPDATE_REVIEW_STATUS = "@@review-status/UPDATE_REVIEW_STATUS";
|
|
2
|
+
export declare type FinishedStatus = 'finished';
|
|
3
|
+
export declare type UpdateReviewStatus = {
|
|
4
|
+
type: typeof UPDATE_REVIEW_STATUS;
|
|
5
|
+
payload: FinishedStatus;
|
|
6
|
+
};
|
|
7
|
+
export declare const updateReviewStatus: (payload: FinishedStatus) => UpdateReviewStatus;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FinishedSlidesState } from '../../reducers/ui/finished-slides';
|
|
2
2
|
export declare const UPDATE_STEP_ITEMS_ON_VALIDATION = "@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION";
|
|
3
3
|
export declare const UPDATE_STEP_ITEMS_ON_NEXT = "@@step-items/UPDATE_STEP_ITEMS_ON_NEXT";
|
|
4
|
+
declare const ICON_VALUES: {
|
|
5
|
+
readonly right: "right";
|
|
6
|
+
readonly wrong: "wrong";
|
|
7
|
+
readonly 'no-answer': "no-answer";
|
|
8
|
+
};
|
|
9
|
+
export declare type IconValue = keyof typeof ICON_VALUES;
|
|
10
|
+
declare type UpdateStepItemsOnValidationClickPayload = {
|
|
11
|
+
stepNumber: number;
|
|
12
|
+
icon: IconValue;
|
|
13
|
+
};
|
|
14
|
+
declare type UpdateStepItemsOnNextClickPayload = {
|
|
15
|
+
stepNumber: number;
|
|
16
|
+
finishedSlides: FinishedSlidesState;
|
|
17
|
+
current: boolean;
|
|
18
|
+
};
|
|
4
19
|
export declare type UpdateStepItemsOnValidation = {
|
|
5
20
|
type: typeof UPDATE_STEP_ITEMS_ON_VALIDATION;
|
|
6
21
|
payload: UpdateStepItemsOnValidationClickPayload;
|
|
@@ -12,3 +27,4 @@ export declare type UpdateStepItemsOnNext = {
|
|
|
12
27
|
export declare type StepItemsAction = UpdateStepItemsOnValidation | UpdateStepItemsOnNext;
|
|
13
28
|
export declare const updateStepItemsOnValidation: (payload: UpdateStepItemsOnValidationClickPayload) => UpdateStepItemsOnValidation;
|
|
14
29
|
export declare const updateStepItemsOnNext: (payload: UpdateStepItemsOnNextClickPayload) => UpdateStepItemsOnNext;
|
|
30
|
+
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
export const UPDATE_STEP_ITEMS_ON_VALIDATION = '@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION';
|
|
3
3
|
export const UPDATE_STEP_ITEMS_ON_NEXT = '@@step-items/UPDATE_STEP_ITEMS_ON_NEXT';
|
|
4
|
+
const ICON_VALUES = {
|
|
5
|
+
right: 'right',
|
|
6
|
+
wrong: 'wrong',
|
|
7
|
+
'no-answer': 'no-answer'
|
|
8
|
+
};
|
|
4
9
|
// -----------------------------------------------------------------------------
|
|
5
10
|
export const updateStepItemsOnValidation = (payload) => ({
|
|
6
11
|
type: UPDATE_STEP_ITEMS_ON_VALIDATION,
|
package/es/common/index.d.ts
CHANGED
package/es/common/index.js
CHANGED
package/es/configure-store.d.ts
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
import { AnyAction,
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { AnyAction, Store } from 'redux';
|
|
2
|
+
import { SkillsState } from './reducers/data/skills';
|
|
3
|
+
import { SlidesState } from './reducers/data/slides';
|
|
4
|
+
import { TokenState } from './reducers/data/token';
|
|
5
|
+
import { NavigationState } from './reducers/ui/navigation';
|
|
6
|
+
import { ReviewStatusState } from './reducers/ui/review-status';
|
|
7
|
+
import { StepItemsState } from './reducers/ui/step-items';
|
|
8
|
+
import { FinishedSlidesState } from './reducers/ui/finished-slides';
|
|
9
|
+
import { AnswerUI } from './types/slides';
|
|
10
|
+
declare type DataState = {
|
|
11
|
+
isFetching?: boolean;
|
|
12
|
+
progression?: {
|
|
13
|
+
slideNumber: number;
|
|
14
|
+
isCorrect?: boolean;
|
|
15
|
+
exitNode?: 'successExitNode' | 'failExitNode';
|
|
16
|
+
nextSlide?: {
|
|
17
|
+
questionText?: string;
|
|
18
|
+
answerUI?: AnswerUI;
|
|
19
|
+
};
|
|
20
|
+
} | null;
|
|
21
|
+
skills: SkillsState;
|
|
22
|
+
slides: SlidesState;
|
|
23
|
+
token?: TokenState;
|
|
5
24
|
};
|
|
25
|
+
export declare type StoreState = {
|
|
26
|
+
ui: {
|
|
27
|
+
navigation: NavigationState;
|
|
28
|
+
stepItems: StepItemsState;
|
|
29
|
+
finishedSlides: FinishedSlidesState;
|
|
30
|
+
reviewStatus: ReviewStatusState;
|
|
31
|
+
};
|
|
32
|
+
data: DataState;
|
|
33
|
+
};
|
|
34
|
+
export default function configureStore(): Store<StoreState, AnyAction>;
|
|
35
|
+
export {};
|
package/es/configure-store.js
CHANGED
|
@@ -2,7 +2,6 @@ import { applyMiddleware, compose, createStore } from 'redux';
|
|
|
2
2
|
import thunk from 'redux-thunk';
|
|
3
3
|
import rootReducer from './reducers';
|
|
4
4
|
import onStartApp from './middlewares/on-start-app';
|
|
5
|
-
const preloadedState = undefined;
|
|
6
5
|
// -----------------------------------------------------------------------------
|
|
7
6
|
export default function configureStore() {
|
|
8
7
|
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
@@ -13,6 +12,6 @@ export default function configureStore() {
|
|
|
13
12
|
})
|
|
14
13
|
: compose;
|
|
15
14
|
const enhancer = _compose(applyMiddleware(thunk, onStartApp));
|
|
16
|
-
const store = createStore(rootReducer,
|
|
15
|
+
const store = createStore(rootReducer, undefined, enhancer);
|
|
17
16
|
return store;
|
|
18
17
|
}
|
package/es/fixtures/qcm-slide.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import noop from 'lodash/fp/noop';
|
|
1
2
|
export const slide = {
|
|
2
3
|
questionText: 'QCM',
|
|
3
4
|
answerUI: {
|
|
@@ -9,19 +10,22 @@ export const slide = {
|
|
|
9
10
|
selected: false,
|
|
10
11
|
title: 'choix1',
|
|
11
12
|
help: '(help choix1)',
|
|
12
|
-
ariaLabel: '__ariaLabel1'
|
|
13
|
+
ariaLabel: '__ariaLabel1',
|
|
14
|
+
onClick: noop
|
|
13
15
|
},
|
|
14
16
|
{
|
|
15
17
|
selected: false,
|
|
16
18
|
title: 'choix2',
|
|
17
19
|
help: '(help choix2)',
|
|
18
|
-
ariaLabel: '__ariaLabel2'
|
|
20
|
+
ariaLabel: '__ariaLabel2',
|
|
21
|
+
onClick: noop
|
|
19
22
|
},
|
|
20
23
|
{
|
|
21
24
|
selected: false,
|
|
22
25
|
title: 'choix3',
|
|
23
26
|
help: '(help choix3)',
|
|
24
|
-
ariaLabel: '__ariaLabel3'
|
|
27
|
+
ariaLabel: '__ariaLabel3',
|
|
28
|
+
onClick: noop
|
|
25
29
|
}
|
|
26
30
|
]
|
|
27
31
|
}
|
package/es/index.js
CHANGED
|
@@ -2,14 +2,12 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { connect, Provider } from 'react-redux';
|
|
3
3
|
import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
|
|
4
4
|
import configureStore from './configure-store';
|
|
5
|
-
import { navigateTo, navigateBack, startApp } from './actions/navigation';
|
|
6
|
-
import { updateSlidesOnNext, updateSlidesOnValidation } from './actions/slides';
|
|
7
|
-
import { getCurrentViewName } from './reducers/navigation';
|
|
8
5
|
import { congratsProps, correctionPopinProps } from './fixtures/temp-fixture';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { updateSlidesOnNext, updateSlidesOnValidation, validateSlide } from './actions/data/slides';
|
|
7
|
+
import { navigateTo, navigateBack, startApp } from './actions/ui/navigation';
|
|
8
|
+
import { updateFinishedSlides } from './actions/ui/finished-slides';
|
|
9
|
+
import { updateReviewStatus } from './actions/ui/review-status';
|
|
10
|
+
import { updateStepItemsOnValidation, updateStepItemsOnNext } from './actions/ui/step-items';
|
|
13
11
|
// -----------------------------------------------------------------------------
|
|
14
12
|
const mapDispatchToProps = {
|
|
15
13
|
navigateTo,
|
|
@@ -22,33 +20,53 @@ const mapDispatchToProps = {
|
|
|
22
20
|
updateStepItemsOnNext,
|
|
23
21
|
updateFinishedSlides
|
|
24
22
|
};
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
const getCurrentViewName = (storeState) => storeState.ui.navigation[storeState.ui.navigation.length - 1];
|
|
24
|
+
const mapStateToSkillsProps = (state) => ({
|
|
25
|
+
title: '@todo title',
|
|
26
|
+
titleNoSkills: '@todo titleNoSkills',
|
|
27
|
+
textNoSkills: '@todo textNoSkills',
|
|
28
|
+
iconSkillAriaLabel: '@todo iconSkillAriaLabel',
|
|
29
|
+
isLoading: false,
|
|
30
|
+
isLoadingAriaLabel: '@todo loading',
|
|
31
|
+
listSkills: state.data.skills.map(skill => ({
|
|
32
|
+
'aria-label': '',
|
|
33
|
+
isCustom: skill.custom,
|
|
34
|
+
skillTitle: skill.name,
|
|
35
|
+
skillAriaLabel: '@todo skill aria label',
|
|
36
|
+
buttonLabel: '@todo button',
|
|
37
|
+
buttonAriaLabel: '@todo button aria label',
|
|
38
|
+
reviseLabel: '@todo revise',
|
|
39
|
+
reviseAriaLabel: '@todo revise aria label',
|
|
40
|
+
// eslint-disable-next-line no-console
|
|
41
|
+
onClick: () => console.log('@todo plug dispatcher select skill')
|
|
42
|
+
}))
|
|
43
|
+
});
|
|
44
|
+
const mapStateToProps = (state) => ({
|
|
45
|
+
viewName: getCurrentViewName(state),
|
|
46
|
+
slides: {
|
|
47
|
+
headerProps: {
|
|
48
|
+
mode: '__revision_mode',
|
|
49
|
+
skillName: '__agility',
|
|
50
|
+
onQuitClick: () => {
|
|
51
|
+
// eslint-disable-next-line no-console
|
|
52
|
+
console.log('onQuitClick');
|
|
38
53
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
'aria-label': 'aria-header-wrapper',
|
|
55
|
+
closeButtonAriaLabel: 'aria-close-button'
|
|
56
|
+
},
|
|
57
|
+
slides: state.data.slides,
|
|
58
|
+
validate: {
|
|
59
|
+
label: '__validate'
|
|
60
|
+
},
|
|
61
|
+
finishedSlides: state.ui.finishedSlides,
|
|
62
|
+
stepItems: state.ui.stepItems,
|
|
63
|
+
reviewStatus: state.ui.reviewStatus,
|
|
64
|
+
correctionPopinProps,
|
|
65
|
+
congratsProps,
|
|
66
|
+
progression: state.data.progression
|
|
67
|
+
},
|
|
68
|
+
skills: mapStateToSkillsProps(state)
|
|
69
|
+
});
|
|
52
70
|
// Props = StaticProps && Dispatchers
|
|
53
71
|
const App = connect(mapStateToProps, mapDispatchToProps)(AppReviewTemplate);
|
|
54
72
|
// -----------------------------------------------------------------------------
|
|
@@ -62,14 +80,14 @@ const AppReview = ({ options }) => {
|
|
|
62
80
|
}
|
|
63
81
|
else {
|
|
64
82
|
const _configure = async () => {
|
|
65
|
-
const
|
|
66
|
-
setStore(
|
|
83
|
+
const newStore = await configureStore();
|
|
84
|
+
setStore(newStore);
|
|
67
85
|
};
|
|
68
86
|
_configure();
|
|
69
87
|
}
|
|
70
88
|
}, [options, store]);
|
|
71
89
|
if (!store || !appStarted)
|
|
72
|
-
return null;
|
|
90
|
+
return React.createElement("div", null);
|
|
73
91
|
return (React.createElement(Provider, { store: store },
|
|
74
92
|
React.createElement(App, null)));
|
|
75
93
|
};
|
package/es/index.test.js
CHANGED
|
@@ -45,7 +45,7 @@ test('should validate all the slides (all correct scenario)', async (t) => {
|
|
|
45
45
|
await waitForChanges(1000);
|
|
46
46
|
const wrapper = container.querySelector('[data-name="slides-revision-container"]');
|
|
47
47
|
t.truthy(wrapper);
|
|
48
|
-
const stackedSlidesContainer = wrapper
|
|
48
|
+
const stackedSlidesContainer = wrapper?.querySelector('[data-name="stacked-slides-container"]');
|
|
49
49
|
t.truthy(stackedSlidesContainer);
|
|
50
50
|
await clickAllSlides(t, container);
|
|
51
51
|
t.pass();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Middleware } from 'redux';
|
|
1
|
+
import type { Middleware, Store } from 'redux';
|
|
2
2
|
import { Dispatch } from 'redux';
|
|
3
3
|
import { Action } from '../actions';
|
|
4
|
-
|
|
5
|
-
declare const onStartApp: Middleware<{}, StoreState, Dispatch<Action>>;
|
|
4
|
+
declare const onStartApp: Middleware<{}, Store, Dispatch<Action>>;
|
|
6
5
|
export default onStartApp;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
// import fetchCourse from '../services/fetch-demo';
|
|
2
1
|
import { VIEWS } from '../common';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { storeFirstSlide } from '../actions/slides';
|
|
2
|
+
import { storeToken } from '../actions/data/token';
|
|
3
|
+
import { receivedSkills, errorFetchingSkills } from '../actions/data/skills';
|
|
4
|
+
import { storeFirstSlide } from '../actions/data/slides';
|
|
5
|
+
import { navigateTo, START_APP } from '../actions/ui/navigation';
|
|
6
|
+
// eslint-disable-next-line import/no-named-as-default
|
|
7
|
+
import fetchSkills from '../services/fetch-skills';
|
|
6
8
|
const onStartApp = ({ dispatch }) => next => (action) => {
|
|
7
9
|
if (action.type === START_APP) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const { slide } = action.payload;
|
|
10
|
+
const { slide, token } = action.payload;
|
|
11
|
+
dispatch(storeToken(token));
|
|
11
12
|
if (slide) {
|
|
12
|
-
const { token } = action.payload;
|
|
13
|
-
dispatch(storeToken(token));
|
|
14
13
|
dispatch(storeFirstSlide(slide));
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
else {
|
|
16
|
+
fetchSkills(token)
|
|
17
|
+
.then(skills => {
|
|
18
|
+
return dispatch(receivedSkills(skills));
|
|
19
|
+
})
|
|
20
|
+
.catch(err => {
|
|
21
|
+
return dispatch(errorFetchingSkills(err));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const initialView = slide ? VIEWS.slides : VIEWS.skills;
|
|
17
25
|
dispatch(navigateTo(initialView));
|
|
18
|
-
// --------------
|
|
19
|
-
// demo service
|
|
20
|
-
// const language = 'fr';
|
|
21
|
-
// const universalRef = 'dis_xxx15';
|
|
22
|
-
// fetchCourse(token, language, universalRef).then(course => {
|
|
23
|
-
// dispatch(receivedCourse(course));
|
|
24
|
-
// });
|
|
25
26
|
}
|
|
26
27
|
return next(action);
|
|
27
28
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
2
|
+
progression: import("./progression").ProgressionState;
|
|
3
|
+
skills: import("../../types/skills").Skills;
|
|
4
|
+
slides: import("./slides").SlidesState;
|
|
5
|
+
token: import("./token").TokenState;
|
|
6
|
+
}>, import("../../actions/data/slides").ValidateSlide | import("../../actions/data/slides").SlidesAction | import("../../actions/data/skills").ReceivedSkills | import("../../actions/data/token").StoreToken>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { combineReducers } from 'redux';
|
|
2
|
+
import progression from './progression';
|
|
3
|
+
import skills from './skills';
|
|
4
|
+
import slides from './slides';
|
|
5
|
+
import token from './token';
|
|
6
|
+
export default combineReducers({
|
|
7
|
+
progression,
|
|
8
|
+
skills,
|
|
9
|
+
slides,
|
|
10
|
+
token
|
|
11
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ValidateSlide } from '../../actions/data/slides';
|
|
2
|
+
import { AnswerUI } from '../../types/slides';
|
|
3
|
+
export declare type ProgressionState = {
|
|
4
|
+
slideNumber: number;
|
|
5
|
+
isCorrect?: boolean;
|
|
6
|
+
exitNode?: 'successExitNode' | 'failExitNode';
|
|
7
|
+
nextSlide?: {
|
|
8
|
+
questionText?: string;
|
|
9
|
+
answerUI?: AnswerUI;
|
|
10
|
+
};
|
|
11
|
+
} | null;
|
|
12
|
+
export declare const initialState: ProgressionState;
|
|
13
|
+
declare const reducer: (state: ProgressionState | undefined, action: ValidateSlide) => ProgressionState;
|
|
14
|
+
export default reducer;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { getOr, noop } from 'lodash/fp';
|
|
2
|
+
import { VALIDATE_SLIDE } from '../../actions/data/slides';
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const initialState = null;
|
|
5
|
+
// -----------------------------------------------------------------------------
|
|
6
|
+
const reducer = (
|
|
7
|
+
// eslint-disable-next-line default-param-last
|
|
8
|
+
state = initialState, action) => {
|
|
9
|
+
switch (action.type) {
|
|
10
|
+
case VALIDATE_SLIDE: {
|
|
11
|
+
const previousSlideNumber = getOr(-1, 'slideNumber', state);
|
|
12
|
+
// hard coded for now
|
|
13
|
+
return {
|
|
14
|
+
// virtual field
|
|
15
|
+
slideNumber: previousSlideNumber + 1,
|
|
16
|
+
isCorrect: true,
|
|
17
|
+
// exitNode
|
|
18
|
+
// TODO: create another action, to retrieve the next slide
|
|
19
|
+
// nextSlide should be corrected to nextContent, when this new action is created
|
|
20
|
+
// ex: nextContent: {ref: "sli_E1n2i2sBo", type: "slide"}
|
|
21
|
+
// the middleware should trigger a next content request once the result is
|
|
22
|
+
// received && update the state accordingly,
|
|
23
|
+
//
|
|
24
|
+
nextSlide: {
|
|
25
|
+
questionText: 'Test',
|
|
26
|
+
answerUI: {
|
|
27
|
+
model: {
|
|
28
|
+
answers: [
|
|
29
|
+
{
|
|
30
|
+
title: 'There is no need for a password',
|
|
31
|
+
// TODO: onClick of each answer should use a dispatcher to
|
|
32
|
+
// update selected answers (in order to use them on validation)
|
|
33
|
+
// in each retrieval, the answers of answerUI need to be augmented
|
|
34
|
+
// for the onClick prop to achieve this.
|
|
35
|
+
onClick: noop,
|
|
36
|
+
selected: false,
|
|
37
|
+
help: 'help'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'Lorem ipsum',
|
|
41
|
+
onClick: noop,
|
|
42
|
+
selected: false,
|
|
43
|
+
help: 'help'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: 'Lorem',
|
|
47
|
+
onClick: noop,
|
|
48
|
+
selected: true,
|
|
49
|
+
order: 1,
|
|
50
|
+
help: 'help'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: 'You need to have a password',
|
|
54
|
+
onClick: noop,
|
|
55
|
+
selected: false,
|
|
56
|
+
help: 'help'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: 'Pouet',
|
|
60
|
+
onClick: noop,
|
|
61
|
+
selected: true,
|
|
62
|
+
order: 0,
|
|
63
|
+
help: 'help'
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
type: 'qcmDrag'
|
|
67
|
+
},
|
|
68
|
+
help: 'Help text will appear here'
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
return state;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
// -----------------------------------------------------------------------------
|
|
78
|
+
export default reducer;
|