@coorpacademy/app-review 0.46.14-alpha.9 → 0.46.14-react18.79
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/reducers/data/corrections.d.ts +1 -1
- package/es/reducers/data/current-skill.d.ts +1 -1
- package/es/reducers/data/index.d.ts +3 -3
- package/es/reducers/data/progression.d.ts +1 -1
- package/es/reducers/data/rank.d.ts +1 -1
- package/es/reducers/data/slides.d.ts +1 -1
- package/es/reducers/data/token.d.ts +1 -1
- package/es/reducers/data/videos.d.ts +1 -1
- package/es/reducers/index.d.ts +3 -7
- package/es/reducers/ui/answers.d.ts +1 -1
- package/es/reducers/ui/current-slide-ref.d.ts +1 -1
- package/es/reducers/ui/index.d.ts +1 -5
- package/es/reducers/ui/navigation.d.ts +1 -1
- package/es/reducers/ui/positions.d.ts +1 -1
- package/es/reducers/ui/quit-popin.d.ts +1 -1
- package/es/reducers/ui/show-button-revising.d.ts +1 -1
- package/es/reducers/ui/show-congrats.d.ts +1 -1
- package/es/reducers/ui/slide.d.ts +1 -1
- package/lib/reducers/data/corrections.d.ts +1 -1
- package/lib/reducers/data/current-skill.d.ts +1 -1
- package/lib/reducers/data/index.d.ts +3 -3
- package/lib/reducers/data/progression.d.ts +1 -1
- package/lib/reducers/data/rank.d.ts +1 -1
- package/lib/reducers/data/slides.d.ts +1 -1
- package/lib/reducers/data/token.d.ts +1 -1
- package/lib/reducers/data/videos.d.ts +1 -1
- package/lib/reducers/index.d.ts +3 -7
- package/lib/reducers/ui/answers.d.ts +1 -1
- package/lib/reducers/ui/current-slide-ref.d.ts +1 -1
- package/lib/reducers/ui/index.d.ts +1 -5
- package/lib/reducers/ui/navigation.d.ts +1 -1
- package/lib/reducers/ui/positions.d.ts +1 -1
- package/lib/reducers/ui/quit-popin.d.ts +1 -1
- package/lib/reducers/ui/show-button-revising.d.ts +1 -1
- package/lib/reducers/ui/show-congrats.d.ts +1 -1
- package/lib/reducers/ui/slide.d.ts +1 -1
- package/package.json +19 -10
- package/es/actions/api/fetch-correction.js +0 -18
- package/es/actions/api/fetch-rank.js +0 -34
- package/es/actions/api/fetch-skill.js +0 -16
- package/es/actions/api/fetch-slide.js +0 -31
- package/es/actions/api/fetch-slides-to-review-by-skill-ref.js +0 -32
- package/es/actions/api/fetch-video-props.js +0 -34
- package/es/actions/api/post-answer.js +0 -36
- package/es/actions/api/post-progression.js +0 -25
- package/es/actions/data/token.js +0 -5
- package/es/actions/ui/answers.js +0 -54
- package/es/actions/ui/navigation.js +0 -26
- package/es/actions/ui/next-slide.js +0 -33
- package/es/actions/ui/quit-popin.js +0 -8
- package/es/actions/ui/show-button-revising.js +0 -6
- package/es/actions/ui/slides.js +0 -10
- package/es/common/index.js +0 -10
- package/es/configure-store.js +0 -26
- package/es/helpers/css-register.js +0 -2
- package/es/index.js +0 -48
- package/es/reducers/data/corrections.js +0 -25
- package/es/reducers/data/current-skill.js +0 -13
- package/es/reducers/data/index.js +0 -17
- package/es/reducers/data/progression.js +0 -20
- package/es/reducers/data/rank.js +0 -27
- package/es/reducers/data/slides.js +0 -20
- package/es/reducers/data/token.js +0 -11
- package/es/reducers/data/videos.js +0 -33
- package/es/reducers/index.js +0 -7
- package/es/reducers/ui/answers.js +0 -28
- package/es/reducers/ui/current-slide-ref.js +0 -21
- package/es/reducers/ui/index.js +0 -19
- package/es/reducers/ui/navigation.js +0 -18
- package/es/reducers/ui/positions.js +0 -30
- package/es/reducers/ui/quit-popin.js +0 -16
- package/es/reducers/ui/show-button-revising.js +0 -17
- package/es/reducers/ui/show-congrats.js +0 -20
- package/es/reducers/ui/slide.js +0 -52
- package/es/types/common.js +0 -1
- package/es/types/slides.js +0 -1
- package/es/views/slides/index.js +0 -387
- package/es/views/slides/map-api-slide-to-ui.js +0 -177
- package/lib/actions/api/fetch-correction.js +0 -25
- package/lib/actions/api/fetch-rank.js +0 -43
- package/lib/actions/api/fetch-skill.js +0 -23
- package/lib/actions/api/fetch-slide.js +0 -38
- package/lib/actions/api/fetch-slides-to-review-by-skill-ref.js +0 -39
- package/lib/actions/api/fetch-video-props.js +0 -43
- package/lib/actions/api/post-answer.js +0 -43
- package/lib/actions/api/post-progression.js +0 -32
- package/lib/actions/data/token.js +0 -9
- package/lib/actions/ui/answers.js +0 -61
- package/lib/actions/ui/navigation.js +0 -31
- package/lib/actions/ui/next-slide.js +0 -40
- package/lib/actions/ui/quit-popin.js +0 -11
- package/lib/actions/ui/show-button-revising.js +0 -10
- package/lib/actions/ui/slides.js +0 -14
- package/lib/common/index.js +0 -17
- package/lib/configure-store.js +0 -32
- package/lib/helpers/css-register.js +0 -7
- package/lib/index.js +0 -76
- package/lib/reducers/data/corrections.js +0 -30
- package/lib/reducers/data/current-skill.js +0 -15
- package/lib/reducers/data/index.js +0 -22
- package/lib/reducers/data/progression.js +0 -22
- package/lib/reducers/data/rank.js +0 -32
- package/lib/reducers/data/slides.js +0 -26
- package/lib/reducers/data/token.js +0 -13
- package/lib/reducers/data/videos.js +0 -36
- package/lib/reducers/index.js +0 -12
- package/lib/reducers/ui/answers.js +0 -31
- package/lib/reducers/ui/current-slide-ref.js +0 -23
- package/lib/reducers/ui/index.js +0 -24
- package/lib/reducers/ui/navigation.js +0 -20
- package/lib/reducers/ui/positions.js +0 -35
- package/lib/reducers/ui/quit-popin.js +0 -18
- package/lib/reducers/ui/show-button-revising.js +0 -19
- package/lib/reducers/ui/show-congrats.js +0 -22
- package/lib/reducers/ui/slide.js +0 -58
- package/lib/types/common.js +0 -2
- package/lib/types/slides.js +0 -2
- package/lib/views/slides/index.js +0 -395
- package/lib/views/slides/map-api-slide-to-ui.js +0 -182
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchEndRank = exports.fetchStartRank = exports.fetchRank = exports.RANK_FETCH_END_FAILURE = exports.RANK_FETCH_END_SUCCESS = exports.RANK_FETCH_END_REQUEST = exports.RANK_FETCH_START_FAILURE = exports.RANK_FETCH_START_SUCCESS = exports.RANK_FETCH_START_REQUEST = void 0;
|
|
7
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
exports.RANK_FETCH_START_REQUEST = '@@rank/FETCH_START_REQUEST';
|
|
10
|
-
exports.RANK_FETCH_START_SUCCESS = '@@rank/FETCH_START_SUCCESS';
|
|
11
|
-
exports.RANK_FETCH_START_FAILURE = '@@rank/FETCH_START_FAILURE';
|
|
12
|
-
exports.RANK_FETCH_END_REQUEST = '@@rank/FETCH_END_REQUEST';
|
|
13
|
-
exports.RANK_FETCH_END_SUCCESS = '@@rank/FETCH_END_SUCCESS';
|
|
14
|
-
exports.RANK_FETCH_END_FAILURE = '@@rank/FETCH_END_FAILURE';
|
|
15
|
-
const bailout = (path) => (state) => {
|
|
16
|
-
const value = (0, get_1.default)(path, state);
|
|
17
|
-
return !Number.isNaN(value);
|
|
18
|
-
};
|
|
19
|
-
const fetchRank = (dispatch, getState, services, types, path) => {
|
|
20
|
-
const action = (0, redux_task_1.default)({
|
|
21
|
-
types,
|
|
22
|
-
task: () => {
|
|
23
|
-
const state = getState();
|
|
24
|
-
const token = (0, get_1.default)(['data', 'token'], state);
|
|
25
|
-
return services.fetchRank(token);
|
|
26
|
-
},
|
|
27
|
-
bailout: path ? bailout(path) : undefined
|
|
28
|
-
});
|
|
29
|
-
return dispatch(action);
|
|
30
|
-
};
|
|
31
|
-
exports.fetchRank = fetchRank;
|
|
32
|
-
const fetchStartRank = (dispatch, getState, { services }) => {
|
|
33
|
-
return (0, exports.fetchRank)(dispatch, getState, services, [exports.RANK_FETCH_START_REQUEST, exports.RANK_FETCH_START_SUCCESS, exports.RANK_FETCH_START_FAILURE], 'data.rank.start');
|
|
34
|
-
};
|
|
35
|
-
exports.fetchStartRank = fetchStartRank;
|
|
36
|
-
const fetchEndRank = (dispatch, getState, { services }) => {
|
|
37
|
-
return (0, exports.fetchRank)(dispatch, getState, services, [
|
|
38
|
-
exports.RANK_FETCH_END_REQUEST,
|
|
39
|
-
exports.RANK_FETCH_END_SUCCESS,
|
|
40
|
-
exports.RANK_FETCH_END_FAILURE
|
|
41
|
-
]);
|
|
42
|
-
};
|
|
43
|
-
exports.fetchEndRank = fetchEndRank;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchSkill = exports.SKILL_FETCH_FAILURE = exports.SKILL_FETCH_SUCCESS = exports.SKILL_FETCH_REQUEST = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
8
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
9
|
-
exports.SKILL_FETCH_REQUEST = '@@skill/FETCH_REQUEST';
|
|
10
|
-
exports.SKILL_FETCH_SUCCESS = '@@skill/FETCH_SUCCESS';
|
|
11
|
-
exports.SKILL_FETCH_FAILURE = '@@skill/FETCH_FAILURE';
|
|
12
|
-
const fetchSkill = (skillRef) => (dispatch, getState, { services }) => {
|
|
13
|
-
const action = (0, redux_task_1.default)({
|
|
14
|
-
types: [exports.SKILL_FETCH_REQUEST, exports.SKILL_FETCH_SUCCESS, exports.SKILL_FETCH_FAILURE],
|
|
15
|
-
task: () => {
|
|
16
|
-
const state = getState();
|
|
17
|
-
const token = (0, get_1.default)(['data', 'token'], state);
|
|
18
|
-
return services.fetchSkill(skillRef, token);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
return dispatch(action);
|
|
22
|
-
};
|
|
23
|
-
exports.fetchSkill = fetchSkill;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchSlide = exports.SLIDE_FETCH_FAILURE = exports.SLIDE_FETCH_SUCCESS = exports.SLIDE_FETCH_REQUEST = void 0;
|
|
7
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
const has_1 = __importDefault(require("lodash/fp/has"));
|
|
10
|
-
const isEmpty_1 = __importDefault(require("lodash/fp/isEmpty"));
|
|
11
|
-
const slides_1 = require("../ui/slides");
|
|
12
|
-
exports.SLIDE_FETCH_REQUEST = '@@slides/FETCH_REQUEST';
|
|
13
|
-
exports.SLIDE_FETCH_SUCCESS = '@@slides/FETCH_SUCCESS';
|
|
14
|
-
exports.SLIDE_FETCH_FAILURE = '@@slides/FETCH_FAILURE';
|
|
15
|
-
const fetchSlide = (slideRef) => async (dispatch, getState, { services }) => {
|
|
16
|
-
const action = (0, redux_task_1.default)({
|
|
17
|
-
types: [exports.SLIDE_FETCH_REQUEST, exports.SLIDE_FETCH_SUCCESS, exports.SLIDE_FETCH_FAILURE],
|
|
18
|
-
bailout: (state) => {
|
|
19
|
-
return (0, has_1.default)(`data.slides.${slideRef}`, state);
|
|
20
|
-
},
|
|
21
|
-
task: () => {
|
|
22
|
-
const state = getState();
|
|
23
|
-
const token = (0, get_1.default)(['data', 'token'], state);
|
|
24
|
-
return services.fetchSlide(slideRef, token);
|
|
25
|
-
},
|
|
26
|
-
meta: { slideRef }
|
|
27
|
-
});
|
|
28
|
-
const response = await dispatch(action);
|
|
29
|
-
if (response.type === exports.SLIDE_FETCH_SUCCESS) {
|
|
30
|
-
const slideFromAPI = response.payload;
|
|
31
|
-
const state = getState();
|
|
32
|
-
const slides = (0, get_1.default)('data.progression.state.slides', state);
|
|
33
|
-
if ((0, isEmpty_1.default)(slides)) {
|
|
34
|
-
dispatch((0, slides_1.setCurrentSlide)(slideFromAPI));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.fetchSlide = fetchSlide;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchSlidesToReviewBySkillRef = exports.SLIDES_TO_REVIEW_FETCH_FAILURE = exports.SLIDES_TO_REVIEW_FETCH_SUCCESS = exports.SLIDES_TO_REVIEW_FETCH_REQUEST = void 0;
|
|
7
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
8
|
-
const difference_1 = __importDefault(require("lodash/fp/difference"));
|
|
9
|
-
const map_1 = __importDefault(require("lodash/fp/map"));
|
|
10
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
11
|
-
const show_button_revising_1 = require("../ui/show-button-revising");
|
|
12
|
-
exports.SLIDES_TO_REVIEW_FETCH_REQUEST = '@@slidesToReview/FETCH_REQUEST';
|
|
13
|
-
exports.SLIDES_TO_REVIEW_FETCH_SUCCESS = '@@slidesToReview/FETCH_SUCCESS';
|
|
14
|
-
exports.SLIDES_TO_REVIEW_FETCH_FAILURE = '@@slidesToReview/FETCH_FAILURE';
|
|
15
|
-
const fetchSlidesToReviewBySkillRef = async (dispatch, getState, { services }) => {
|
|
16
|
-
const state = getState();
|
|
17
|
-
const action = (0, redux_task_1.default)({
|
|
18
|
-
types: [
|
|
19
|
-
exports.SLIDES_TO_REVIEW_FETCH_REQUEST,
|
|
20
|
-
exports.SLIDES_TO_REVIEW_FETCH_SUCCESS,
|
|
21
|
-
exports.SLIDES_TO_REVIEW_FETCH_FAILURE
|
|
22
|
-
],
|
|
23
|
-
task: () => {
|
|
24
|
-
const token = state.data.token;
|
|
25
|
-
const progression = state.data.progression;
|
|
26
|
-
const skillRef = progression.content.ref;
|
|
27
|
-
return services.fetchSlidesToReviewBySkillRef(token, skillRef, 10);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const response = await dispatch(action);
|
|
31
|
-
if (response.type === exports.SLIDES_TO_REVIEW_FETCH_SUCCESS) {
|
|
32
|
-
const answeredSlidesRef = (0, get_1.default)(['data', 'progression', 'state', 'slides'], state);
|
|
33
|
-
const slidesToReview = (0, map_1.default)(({ slideId }) => slideId, response.payload);
|
|
34
|
-
if ((0, difference_1.default)(slidesToReview, answeredSlidesRef).length >= 5) {
|
|
35
|
-
dispatch(show_button_revising_1.showButtonRevising);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
exports.fetchSlidesToReviewBySkillRef = fetchSlidesToReviewBySkillRef;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchPropsVideo = exports.showVideo = exports.setVideoProps = exports.SHOW_VIDEO = exports.SET_VIDEO_PROPS = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
8
|
-
exports.SET_VIDEO_PROPS = '@@slide/SET_VIDEO_PROPS';
|
|
9
|
-
exports.SHOW_VIDEO = '@@slide/SHOW_VIDEO';
|
|
10
|
-
const setVideoProps = (payload) => ({
|
|
11
|
-
type: exports.SET_VIDEO_PROPS,
|
|
12
|
-
payload
|
|
13
|
-
});
|
|
14
|
-
exports.setVideoProps = setVideoProps;
|
|
15
|
-
const showVideo = (slideId) => ({
|
|
16
|
-
type: exports.SHOW_VIDEO,
|
|
17
|
-
payload: { slideId }
|
|
18
|
-
});
|
|
19
|
-
exports.showVideo = showVideo;
|
|
20
|
-
const fetchPropsVideo = (slideId) => async (dispatch, getState, { appendVideoOptions }) => {
|
|
21
|
-
const state = getState();
|
|
22
|
-
const slideFromAPI = (0, get_1.default)(['data', 'slides', slideId], state);
|
|
23
|
-
if (!slideFromAPI) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const slideMedia = (0, get_1.default)(['question', 'medias', '0'], slideFromAPI);
|
|
27
|
-
if (slideMedia && slideMedia.type === 'video') {
|
|
28
|
-
const videoProps = (0, get_1.default)(['data', 'videos', slideId], state);
|
|
29
|
-
if (videoProps) {
|
|
30
|
-
dispatch((0, exports.showVideo)(slideId));
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const props = await appendVideoOptions(slideMedia);
|
|
34
|
-
props.src[0].loading = false; // set to false to not show it until the next slide is unstack
|
|
35
|
-
props.src[0].type = 'video';
|
|
36
|
-
dispatch((0, exports.setVideoProps)({
|
|
37
|
-
slideId,
|
|
38
|
-
props
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
return;
|
|
42
|
-
};
|
|
43
|
-
exports.fetchPropsVideo = fetchPropsVideo;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postAnswer = exports.POST_ANSWER_FAILURE = exports.POST_ANSWER_SUCCESS = exports.POST_ANSWER_REQUEST = void 0;
|
|
7
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
const fetch_correction_1 = require("./fetch-correction");
|
|
10
|
-
const fetch_slide_1 = require("./fetch-slide");
|
|
11
|
-
const fetch_rank_1 = require("./fetch-rank");
|
|
12
|
-
exports.POST_ANSWER_REQUEST = '@@answer/POST_REQUEST';
|
|
13
|
-
exports.POST_ANSWER_SUCCESS = '@@answer/POST_SUCCESS';
|
|
14
|
-
exports.POST_ANSWER_FAILURE = '@@answer/POST_FAILURE';
|
|
15
|
-
const postAnswer = async (dispatch, getState, { services, onEndProgression }) => {
|
|
16
|
-
const state = getState();
|
|
17
|
-
const currentSlideRef = (0, get_1.default)(['ui', 'currentSlideRef'], state);
|
|
18
|
-
const token = (0, get_1.default)(['data', 'token'], state);
|
|
19
|
-
const answer = (0, get_1.default)(['ui', 'answers', currentSlideRef], state);
|
|
20
|
-
const progression = (0, get_1.default)(['data', 'progression'], state);
|
|
21
|
-
if (!progression)
|
|
22
|
-
throw new Error('Cannot answer a question of an inexistent progression');
|
|
23
|
-
const action = (0, redux_task_1.default)({
|
|
24
|
-
types: [exports.POST_ANSWER_REQUEST, exports.POST_ANSWER_SUCCESS, exports.POST_ANSWER_FAILURE],
|
|
25
|
-
meta: { slideRef: currentSlideRef },
|
|
26
|
-
task: () => services.postAnswer(progression, token, answer)
|
|
27
|
-
});
|
|
28
|
-
const response = await dispatch(action);
|
|
29
|
-
if (response.type === exports.POST_ANSWER_SUCCESS) {
|
|
30
|
-
const updatedProgression = response.payload;
|
|
31
|
-
const slideRef = updatedProgression.state.nextContent.ref;
|
|
32
|
-
if (slideRef !== 'successExitNode') {
|
|
33
|
-
await dispatch((0, fetch_slide_1.fetchSlide)(slideRef));
|
|
34
|
-
await dispatch(fetch_correction_1.fetchCorrection);
|
|
35
|
-
await dispatch(fetch_rank_1.fetchStartRank);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
onEndProgression(updatedProgression);
|
|
39
|
-
await dispatch(fetch_correction_1.fetchCorrection);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.postAnswer = postAnswer;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProgression = exports.POST_PROGRESSION_FAILURE = exports.POST_PROGRESSION_SUCCESS = exports.POST_PROGRESSION_REQUEST = void 0;
|
|
7
|
-
const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
const fetch_slide_1 = require("./fetch-slide");
|
|
10
|
-
const fetch_skill_1 = require("./fetch-skill");
|
|
11
|
-
exports.POST_PROGRESSION_REQUEST = '@@progression/POST_REQUEST';
|
|
12
|
-
exports.POST_PROGRESSION_SUCCESS = '@@progression/POST_SUCCESS';
|
|
13
|
-
exports.POST_PROGRESSION_FAILURE = '@@progression/POST_FAILURE';
|
|
14
|
-
const postProgression = (skillRef, testingSlideRef) => async (dispatch, getState, { services, onStartProgression }) => {
|
|
15
|
-
const state = getState();
|
|
16
|
-
const token = (0, get_1.default)(['data', 'token'], state);
|
|
17
|
-
const action = (0, redux_task_1.default)({
|
|
18
|
-
types: [exports.POST_PROGRESSION_REQUEST, exports.POST_PROGRESSION_SUCCESS, exports.POST_PROGRESSION_FAILURE],
|
|
19
|
-
task: () => testingSlideRef
|
|
20
|
-
? services.postSandboxProgression(testingSlideRef, skillRef, token)
|
|
21
|
-
: services.postProgression(skillRef, token)
|
|
22
|
-
});
|
|
23
|
-
const response = await dispatch(action);
|
|
24
|
-
if (response.type === exports.POST_PROGRESSION_SUCCESS) {
|
|
25
|
-
const progression = response.payload;
|
|
26
|
-
const slideRef = progression.state.nextContent.ref;
|
|
27
|
-
onStartProgression(progression);
|
|
28
|
-
await dispatch((0, fetch_slide_1.fetchSlide)(slideRef));
|
|
29
|
-
await dispatch((0, fetch_skill_1.fetchSkill)(skillRef));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.postProgression = postProgression;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.storeToken = exports.STORE_TOKEN = void 0;
|
|
4
|
-
exports.STORE_TOKEN = '@@data/token/STORE_TOKEN';
|
|
5
|
-
const storeToken = (token) => ({
|
|
6
|
-
type: exports.STORE_TOKEN,
|
|
7
|
-
payload: token
|
|
8
|
-
});
|
|
9
|
-
exports.storeToken = storeToken;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.editAnswer = exports.ANSWER_EDIT = exports.EDIT_SLIDER = exports.EDIT_BASIC = exports.EDIT_TEMPLATE = exports.EDIT_QCM_DRAG = exports.EDIT_QCM_GRAPHIC = exports.EDIT_QCM = void 0;
|
|
7
|
-
const flatten_1 = __importDefault(require("lodash/fp/flatten"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
const getOr_1 = __importDefault(require("lodash/fp/getOr"));
|
|
10
|
-
const includes_1 = __importDefault(require("lodash/fp/includes"));
|
|
11
|
-
const pull_1 = __importDefault(require("lodash/fp/pull"));
|
|
12
|
-
exports.EDIT_QCM = '@@answer/EDIT_QCM';
|
|
13
|
-
exports.EDIT_QCM_GRAPHIC = '@@answer/EDIT_QCM_GRAPHIC';
|
|
14
|
-
exports.EDIT_QCM_DRAG = '@@answer/EDIT_QCM_DRAG';
|
|
15
|
-
exports.EDIT_TEMPLATE = '@@answer/EDIT_TEMPLATE';
|
|
16
|
-
exports.EDIT_BASIC = '@@answer/EDIT_BASIC';
|
|
17
|
-
exports.EDIT_SLIDER = '@@answer/EDIT_SLIDER';
|
|
18
|
-
exports.ANSWER_EDIT = {
|
|
19
|
-
qcm: exports.EDIT_QCM,
|
|
20
|
-
qcmGraphic: exports.EDIT_QCM_GRAPHIC,
|
|
21
|
-
qcmDrag: exports.EDIT_QCM_DRAG,
|
|
22
|
-
template: exports.EDIT_TEMPLATE,
|
|
23
|
-
basic: exports.EDIT_BASIC,
|
|
24
|
-
slider: exports.EDIT_SLIDER
|
|
25
|
-
};
|
|
26
|
-
const buildAnswer = (userAnswers, questionType, newValue) => {
|
|
27
|
-
switch (questionType) {
|
|
28
|
-
case 'qcm':
|
|
29
|
-
case 'qcmGraphic':
|
|
30
|
-
case 'qcmDrag': {
|
|
31
|
-
const firstValue = newValue[0];
|
|
32
|
-
return (0, includes_1.default)(firstValue, userAnswers)
|
|
33
|
-
? (0, pull_1.default)(firstValue, userAnswers)
|
|
34
|
-
: (0, flatten_1.default)([...userAnswers, firstValue]);
|
|
35
|
-
}
|
|
36
|
-
case 'basic':
|
|
37
|
-
case 'slider':
|
|
38
|
-
case 'template':
|
|
39
|
-
return newValue;
|
|
40
|
-
/* istanbul ignore next */ default:
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const editAnswer = (answer) => (dispatch, getState) => {
|
|
45
|
-
const state = getState();
|
|
46
|
-
const currentSlideRef = (0, get_1.default)(['ui', 'currentSlideRef'], state);
|
|
47
|
-
const userAnswers = (0, getOr_1.default)([], ['ui', 'answers', currentSlideRef], state);
|
|
48
|
-
const slide = (0, get_1.default)(['data', 'slides', currentSlideRef], state);
|
|
49
|
-
if (!slide)
|
|
50
|
-
throw new Error('No slide was found');
|
|
51
|
-
const questionType = (0, get_1.default)(['question', 'type'], slide);
|
|
52
|
-
const type = (0, get_1.default)(questionType, exports.ANSWER_EDIT);
|
|
53
|
-
if (!type)
|
|
54
|
-
throw new Error(`Question type ${questionType} is not supported`);
|
|
55
|
-
return dispatch({
|
|
56
|
-
type,
|
|
57
|
-
meta: { slideRef: currentSlideRef },
|
|
58
|
-
payload: buildAnswer(userAnswers, questionType, answer)
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
exports.editAnswer = editAnswer;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.navigateBack = exports.navigateTo = exports.START_APP = exports.NAVIGATE_BACK = exports.NAVIGATE_TO = void 0;
|
|
4
|
-
exports.NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
|
|
5
|
-
exports.NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
6
|
-
exports.START_APP = '@@navigation/START_APP';
|
|
7
|
-
const navigateTo = (newViewName) => async (dispatch, getState, { callbackOnViewChanged }) => {
|
|
8
|
-
const action = {
|
|
9
|
-
type: exports.NAVIGATE_TO,
|
|
10
|
-
payload: newViewName
|
|
11
|
-
};
|
|
12
|
-
const res = await dispatch(action);
|
|
13
|
-
if (callbackOnViewChanged) {
|
|
14
|
-
callbackOnViewChanged(newViewName);
|
|
15
|
-
}
|
|
16
|
-
return res;
|
|
17
|
-
};
|
|
18
|
-
exports.navigateTo = navigateTo;
|
|
19
|
-
const navigateBack = async (dispatch, getState, { callbackOnViewChanged }) => {
|
|
20
|
-
const action = {
|
|
21
|
-
type: exports.NAVIGATE_BACK
|
|
22
|
-
};
|
|
23
|
-
const res = await dispatch(action);
|
|
24
|
-
if (callbackOnViewChanged) {
|
|
25
|
-
const storeState = getState();
|
|
26
|
-
const viewName = storeState.ui.navigation[storeState.ui.navigation.length - 1];
|
|
27
|
-
callbackOnViewChanged(viewName);
|
|
28
|
-
}
|
|
29
|
-
return res;
|
|
30
|
-
};
|
|
31
|
-
exports.navigateBack = navigateBack;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.nextSlide = exports.NEXT_SLIDE = void 0;
|
|
7
|
-
const filter_1 = __importDefault(require("lodash/fp/filter"));
|
|
8
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
9
|
-
const fetch_rank_1 = require("../api/fetch-rank");
|
|
10
|
-
const fetch_slides_to_review_by_skill_ref_1 = require("../api/fetch-slides-to-review-by-skill-ref");
|
|
11
|
-
const fetch_video_props_1 = require("../api/fetch-video-props");
|
|
12
|
-
exports.NEXT_SLIDE = '@@slide/NEXT_SLIDE';
|
|
13
|
-
const nextSlide = async (dispatch, getState) => {
|
|
14
|
-
const state = getState();
|
|
15
|
-
const progression = state.data.progression;
|
|
16
|
-
const { isCorrect, allAnswers, slides } = progression.state;
|
|
17
|
-
const correctAnswers = (0, filter_1.default)((answer) => answer.isCorrect, allAnswers);
|
|
18
|
-
const nextSlideRef = (0, get_1.default)(['state', 'nextContent', 'ref'], state.data.progression);
|
|
19
|
-
const payload = {
|
|
20
|
-
currentSlideRef: (0, get_1.default)(['ui', 'currentSlideRef'], state),
|
|
21
|
-
nextSlideRef,
|
|
22
|
-
animationType: isCorrect ? 'unstack' : 'restack',
|
|
23
|
-
totalCorrectAnswers: correctAnswers.length,
|
|
24
|
-
answeredSlides: slides
|
|
25
|
-
};
|
|
26
|
-
const action = {
|
|
27
|
-
type: exports.NEXT_SLIDE,
|
|
28
|
-
payload
|
|
29
|
-
};
|
|
30
|
-
if (nextSlideRef === 'successExitNode') {
|
|
31
|
-
await dispatch(fetch_rank_1.fetchEndRank);
|
|
32
|
-
await dispatch(fetch_slides_to_review_by_skill_ref_1.fetchSlidesToReviewBySkillRef);
|
|
33
|
-
dispatch(action);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
dispatch(action);
|
|
37
|
-
await dispatch((0, fetch_video_props_1.fetchPropsVideo)(payload.nextSlideRef));
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.nextSlide = nextSlide;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.closeQuitPopin = exports.openQuitPopin = exports.CLOSE_POPIN = exports.OPEN_POPIN = void 0;
|
|
4
|
-
exports.OPEN_POPIN = '@@ui/OPEN_POPIN';
|
|
5
|
-
exports.CLOSE_POPIN = '@@ui/CLOSE_POPIN';
|
|
6
|
-
exports.openQuitPopin = {
|
|
7
|
-
type: exports.OPEN_POPIN
|
|
8
|
-
};
|
|
9
|
-
exports.closeQuitPopin = {
|
|
10
|
-
type: exports.CLOSE_POPIN
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.showButtonRevising = exports.SHOW_BUTTON_REVISING = void 0;
|
|
4
|
-
exports.SHOW_BUTTON_REVISING = '@@button/SHOW_BUTTON_REVISING';
|
|
5
|
-
const showButtonRevising = (dispatch) => {
|
|
6
|
-
return dispatch({
|
|
7
|
-
type: exports.SHOW_BUTTON_REVISING
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
exports.showButtonRevising = showButtonRevising;
|
package/lib/actions/ui/slides.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setCurrentSlide = exports.SET_CURRENT_SLIDE = void 0;
|
|
4
|
-
const fetch_video_props_1 = require("../api/fetch-video-props");
|
|
5
|
-
exports.SET_CURRENT_SLIDE = '@@slide/SET_CURRENT_SLIDE';
|
|
6
|
-
const setCurrentSlide = (slideFromAPI) => async (dispatch) => {
|
|
7
|
-
dispatch({
|
|
8
|
-
type: exports.SET_CURRENT_SLIDE,
|
|
9
|
-
payload: slideFromAPI
|
|
10
|
-
});
|
|
11
|
-
await dispatch((0, fetch_video_props_1.fetchPropsVideo)(slideFromAPI._id));
|
|
12
|
-
return;
|
|
13
|
-
};
|
|
14
|
-
exports.setCurrentSlide = setCurrentSlide;
|
package/lib/common/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getProgressionSlidesRefs = exports.slideIndexes = void 0;
|
|
7
|
-
const concat_1 = __importDefault(require("lodash/fp/concat"));
|
|
8
|
-
const slice_1 = __importDefault(require("lodash/fp/slice"));
|
|
9
|
-
exports.slideIndexes = ['0', '1', '2', '3', '4'];
|
|
10
|
-
const getProgressionSlidesRefs = (progression) => {
|
|
11
|
-
if (progression.state.step.current <= 5) {
|
|
12
|
-
const slideRef = progression.state.nextContent.ref;
|
|
13
|
-
return (0, concat_1.default)(progression.state.slides, [slideRef]);
|
|
14
|
-
}
|
|
15
|
-
return (0, slice_1.default)(0, 5, progression.state.slides);
|
|
16
|
-
};
|
|
17
|
-
exports.getProgressionSlidesRefs = getProgressionSlidesRefs;
|
package/lib/configure-store.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const redux_1 = require("redux");
|
|
7
|
-
const redux_thunk_1 = __importDefault(require("redux-thunk"));
|
|
8
|
-
const review_services_1 = require("@coorpacademy/review-services");
|
|
9
|
-
const fp_1 = require("lodash/fp");
|
|
10
|
-
const reducers_1 = __importDefault(require("./reducers"));
|
|
11
|
-
function configureStore(options) {
|
|
12
|
-
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
13
|
-
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
|
|
14
|
-
name: 'app-review',
|
|
15
|
-
trace: true,
|
|
16
|
-
traceLimit: 25
|
|
17
|
-
})
|
|
18
|
-
: redux_1.compose;
|
|
19
|
-
const locale = options.locale;
|
|
20
|
-
const thunkOptions = {
|
|
21
|
-
services: options.services || (0, review_services_1.getServices)(locale),
|
|
22
|
-
callbackOnViewChanged: options.callbackOnViewChanged,
|
|
23
|
-
appendVideoOptions: options.appendVideoOptions,
|
|
24
|
-
onStartProgression: options.onStartProgression || fp_1.identity,
|
|
25
|
-
onEndProgression: options.onEndProgression || fp_1.identity
|
|
26
|
-
};
|
|
27
|
-
const thunkMiddleware = redux_thunk_1.default.withExtraArgument(thunkOptions);
|
|
28
|
-
const enhancer = _compose((0, redux_1.applyMiddleware)(thunkMiddleware));
|
|
29
|
-
const store = (0, redux_1.createStore)(reducers_1.default, undefined, enhancer);
|
|
30
|
-
return store;
|
|
31
|
-
}
|
|
32
|
-
exports.default = configureStore;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const css_modules_require_hook_1 = __importDefault(require("@coorpacademy/css-modules-require-hook"));
|
|
7
|
-
(0, css_modules_require_hook_1.default)();
|
package/lib/index.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const react_redux_1 = require("react-redux");
|
|
31
|
-
const app_review_1 = __importDefault(require("@coorpacademy/components/es/template/app-review"));
|
|
32
|
-
const isEmpty_1 = __importDefault(require("lodash/fp/isEmpty"));
|
|
33
|
-
const get_1 = __importDefault(require("lodash/fp/get"));
|
|
34
|
-
const configure_store_1 = __importDefault(require("./configure-store"));
|
|
35
|
-
const navigation_1 = require("./actions/ui/navigation");
|
|
36
|
-
const token_1 = require("./actions/data/token");
|
|
37
|
-
const post_progression_1 = require("./actions/api/post-progression");
|
|
38
|
-
const slides_1 = require("./views/slides");
|
|
39
|
-
const ConnectedApp = (options) => {
|
|
40
|
-
const dispatch = (0, react_redux_1.useDispatch)();
|
|
41
|
-
const props = {
|
|
42
|
-
viewName: (0, react_redux_1.useSelector)((state) => state.ui.navigation[state.ui.navigation.length - 1]),
|
|
43
|
-
slides: (0, react_redux_1.useSelector)((state) => (0, slides_1.mapStateToSlidesProps)(state, dispatch, options)),
|
|
44
|
-
navigateBack: () => dispatch(navigation_1.navigateBack)
|
|
45
|
-
};
|
|
46
|
-
return react_1.default.createElement(app_review_1.default, { ...props });
|
|
47
|
-
};
|
|
48
|
-
const storeTokenAndCreateProgression = async (store, options) => {
|
|
49
|
-
const token = (0, get_1.default)('token', options);
|
|
50
|
-
if (store === null || (0, isEmpty_1.default)(token))
|
|
51
|
-
return;
|
|
52
|
-
store.dispatch((0, token_1.storeToken)(token));
|
|
53
|
-
const skillRef = (0, get_1.default)('skillRef', options);
|
|
54
|
-
const testingSlideRef = (0, get_1.default)('testingSlideRef', options);
|
|
55
|
-
if (skillRef) {
|
|
56
|
-
store.dispatch((0, navigation_1.navigateTo)('loader'));
|
|
57
|
-
await store.dispatch((0, post_progression_1.postProgression)(skillRef, testingSlideRef));
|
|
58
|
-
store.dispatch((0, navigation_1.navigateTo)('slides'));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
const AppReview = ({ options }) => {
|
|
62
|
-
const [store, setStore] = (0, react_1.useState)(null);
|
|
63
|
-
const { translate, onQuitClick, onStartProgression, onEndProgression, skin, backgroundImage } = options;
|
|
64
|
-
(0, react_1.useEffect)(() => {
|
|
65
|
-
const newStore = (0, configure_store_1.default)(options);
|
|
66
|
-
setStore(newStore);
|
|
67
|
-
storeTokenAndCreateProgression(newStore, options);
|
|
68
|
-
// should create store, store token and create progression only once on mount
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
-
}, []);
|
|
71
|
-
if (!store)
|
|
72
|
-
return null;
|
|
73
|
-
return (react_1.default.createElement(react_redux_1.Provider, { store: store },
|
|
74
|
-
react_1.default.createElement(ConnectedApp, { onQuitClick: onQuitClick, onStartProgression: onStartProgression, onEndProgression: onEndProgression, translate: translate, skin: skin, backgroundImage: backgroundImage })));
|
|
75
|
-
};
|
|
76
|
-
exports.default = AppReview;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const set_1 = __importDefault(require("lodash/fp/set"));
|
|
7
|
-
const fetch_correction_1 = require("../../actions/api/fetch-correction");
|
|
8
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
9
|
-
const initialState = {};
|
|
10
|
-
const reducer = (
|
|
11
|
-
// eslint-disable-next-line default-param-last
|
|
12
|
-
state = initialState, action) => {
|
|
13
|
-
switch (action.type) {
|
|
14
|
-
case fetch_correction_1.CORRECTION_FETCH_REQUEST: {
|
|
15
|
-
const { meta } = action;
|
|
16
|
-
return (0, set_1.default)([meta.slideRef], null, state);
|
|
17
|
-
}
|
|
18
|
-
case fetch_correction_1.CORRECTION_FETCH_SUCCESS: {
|
|
19
|
-
const { meta } = action;
|
|
20
|
-
const correction = action.payload;
|
|
21
|
-
return (0, set_1.default)([meta.slideRef], correction, state);
|
|
22
|
-
}
|
|
23
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
24
|
-
return initialState;
|
|
25
|
-
}
|
|
26
|
-
default:
|
|
27
|
-
return state;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.default = reducer;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fetch_skill_1 = require("../../actions/api/fetch-skill");
|
|
4
|
-
const initialState = null;
|
|
5
|
-
const reducer = (
|
|
6
|
-
// eslint-disable-next-line default-param-last
|
|
7
|
-
state = initialState, action) => {
|
|
8
|
-
switch (action.type) {
|
|
9
|
-
case fetch_skill_1.SKILL_FETCH_SUCCESS:
|
|
10
|
-
return action.payload;
|
|
11
|
-
default:
|
|
12
|
-
return state;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.default = reducer;
|