@coorpacademy/app-review 0.46.14-alpha.5 → 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,22 +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 corrections_1 = __importDefault(require("./corrections"));
|
|
8
|
-
const progression_1 = __importDefault(require("./progression"));
|
|
9
|
-
const slides_1 = __importDefault(require("./slides"));
|
|
10
|
-
const token_1 = __importDefault(require("./token"));
|
|
11
|
-
const rank_1 = __importDefault(require("./rank"));
|
|
12
|
-
const current_skill_1 = __importDefault(require("./current-skill"));
|
|
13
|
-
const videos_1 = __importDefault(require("./videos"));
|
|
14
|
-
exports.default = (0, redux_1.combineReducers)({
|
|
15
|
-
corrections: corrections_1.default,
|
|
16
|
-
progression: progression_1.default,
|
|
17
|
-
slides: slides_1.default,
|
|
18
|
-
token: token_1.default,
|
|
19
|
-
rank: rank_1.default,
|
|
20
|
-
currentSkill: current_skill_1.default,
|
|
21
|
-
videos: videos_1.default
|
|
22
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const post_answer_1 = require("../../actions/api/post-answer");
|
|
4
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
5
|
-
const initialState = null;
|
|
6
|
-
const reducer = (
|
|
7
|
-
// eslint-disable-next-line default-param-last
|
|
8
|
-
state = initialState, action) => {
|
|
9
|
-
switch (action.type) {
|
|
10
|
-
case post_answer_1.POST_ANSWER_SUCCESS:
|
|
11
|
-
case post_progression_1.POST_PROGRESSION_SUCCESS: {
|
|
12
|
-
const progression = action.payload;
|
|
13
|
-
return progression;
|
|
14
|
-
}
|
|
15
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
16
|
-
return initialState;
|
|
17
|
-
}
|
|
18
|
-
default:
|
|
19
|
-
return state;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.default = reducer;
|
|
@@ -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 set_1 = __importDefault(require("lodash/fp/set"));
|
|
7
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
8
|
-
const fetch_rank_1 = require("../../actions/api/fetch-rank");
|
|
9
|
-
const initialState = {
|
|
10
|
-
start: Number.NaN,
|
|
11
|
-
end: Number.NaN
|
|
12
|
-
};
|
|
13
|
-
const reducer = (
|
|
14
|
-
// eslint-disable-next-line default-param-last
|
|
15
|
-
state = initialState, action) => {
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
18
|
-
return initialState;
|
|
19
|
-
}
|
|
20
|
-
case fetch_rank_1.RANK_FETCH_START_SUCCESS: {
|
|
21
|
-
const { payload } = action;
|
|
22
|
-
return (0, set_1.default)('start', payload.rank, state);
|
|
23
|
-
}
|
|
24
|
-
case fetch_rank_1.RANK_FETCH_END_SUCCESS: {
|
|
25
|
-
const { payload } = action;
|
|
26
|
-
return (0, set_1.default)('end', payload.rank, state);
|
|
27
|
-
}
|
|
28
|
-
default:
|
|
29
|
-
return state;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.default = reducer;
|
|
@@ -1,26 +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.initialState = void 0;
|
|
7
|
-
const set_1 = __importDefault(require("lodash/fp/set"));
|
|
8
|
-
const fetch_slide_1 = require("../../actions/api/fetch-slide");
|
|
9
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
10
|
-
exports.initialState = {};
|
|
11
|
-
const reducer = (
|
|
12
|
-
// eslint-disable-next-line default-param-last
|
|
13
|
-
state = exports.initialState, action) => {
|
|
14
|
-
switch (action.type) {
|
|
15
|
-
case fetch_slide_1.SLIDE_FETCH_SUCCESS: {
|
|
16
|
-
const slide = action.payload;
|
|
17
|
-
return (0, set_1.default)([slide._id], slide, state);
|
|
18
|
-
}
|
|
19
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
20
|
-
return exports.initialState;
|
|
21
|
-
}
|
|
22
|
-
default:
|
|
23
|
-
return state;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.default = reducer;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const token_1 = require("../../actions/data/token");
|
|
4
|
-
// eslint-disable-next-line default-param-last
|
|
5
|
-
const reducer = (state = '', action) => {
|
|
6
|
-
switch (action.type) {
|
|
7
|
-
case token_1.STORE_TOKEN:
|
|
8
|
-
return action.payload;
|
|
9
|
-
default:
|
|
10
|
-
return state;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
exports.default = reducer;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialState = void 0;
|
|
4
|
-
const fp_1 = require("lodash/fp");
|
|
5
|
-
const fetch_video_props_1 = require("../../actions/api/fetch-video-props");
|
|
6
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
7
|
-
exports.initialState = {};
|
|
8
|
-
const reducer = (
|
|
9
|
-
// eslint-disable-next-line default-param-last
|
|
10
|
-
state = exports.initialState, action) => {
|
|
11
|
-
switch (action.type) {
|
|
12
|
-
case fetch_video_props_1.SET_VIDEO_PROPS: {
|
|
13
|
-
const { slideId, props } = action.payload;
|
|
14
|
-
return (0, fp_1.set)(slideId, props, state);
|
|
15
|
-
}
|
|
16
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
17
|
-
const { currentSlideRef } = action.payload;
|
|
18
|
-
const isMediaVideo = (0, fp_1.get)(currentSlideRef, state);
|
|
19
|
-
if (isMediaVideo) {
|
|
20
|
-
return (0, fp_1.set)([currentSlideRef, 'src', '0', 'loading'], true, state);
|
|
21
|
-
}
|
|
22
|
-
return state;
|
|
23
|
-
}
|
|
24
|
-
case fetch_video_props_1.SHOW_VIDEO: {
|
|
25
|
-
const { slideId } = action.payload;
|
|
26
|
-
const isMediaVideo = (0, fp_1.get)(slideId, state);
|
|
27
|
-
if (isMediaVideo) {
|
|
28
|
-
return (0, fp_1.set)([slideId, 'src', '0', 'loading'], false, state);
|
|
29
|
-
}
|
|
30
|
-
return state;
|
|
31
|
-
}
|
|
32
|
-
default:
|
|
33
|
-
return state;
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.default = reducer;
|
package/lib/reducers/index.js
DELETED
|
@@ -1,12 +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 data_1 = __importDefault(require("./data"));
|
|
8
|
-
const ui_1 = __importDefault(require("./ui"));
|
|
9
|
-
exports.default = (0, redux_1.combineReducers)({
|
|
10
|
-
data: data_1.default,
|
|
11
|
-
ui: ui_1.default
|
|
12
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialState = void 0;
|
|
4
|
-
const fp_1 = require("lodash/fp");
|
|
5
|
-
const answers_1 = require("../../actions/ui/answers");
|
|
6
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
7
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
8
|
-
exports.initialState = {};
|
|
9
|
-
const reducer = (
|
|
10
|
-
// eslint-disable-next-line default-param-last
|
|
11
|
-
state = exports.initialState, action) => {
|
|
12
|
-
switch (action.type) {
|
|
13
|
-
case answers_1.EDIT_QCM:
|
|
14
|
-
case answers_1.EDIT_QCM_GRAPHIC:
|
|
15
|
-
case answers_1.EDIT_QCM_DRAG:
|
|
16
|
-
case answers_1.EDIT_TEMPLATE:
|
|
17
|
-
case answers_1.EDIT_BASIC:
|
|
18
|
-
case answers_1.EDIT_SLIDER: {
|
|
19
|
-
return (0, fp_1.set)([action.meta.slideRef], action.payload, exports.initialState);
|
|
20
|
-
}
|
|
21
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
22
|
-
return (0, fp_1.set)([action.payload.nextSlideRef], [], state);
|
|
23
|
-
}
|
|
24
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
25
|
-
return exports.initialState;
|
|
26
|
-
}
|
|
27
|
-
default:
|
|
28
|
-
return state;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.default = reducer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
4
|
-
const slides_1 = require("../../actions/ui/slides");
|
|
5
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
6
|
-
const reducer = (
|
|
7
|
-
// eslint-disable-next-line default-param-last
|
|
8
|
-
state = '', action) => {
|
|
9
|
-
switch (action.type) {
|
|
10
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
11
|
-
return action.payload.nextSlideRef;
|
|
12
|
-
}
|
|
13
|
-
case slides_1.SET_CURRENT_SLIDE: {
|
|
14
|
-
return action.payload._id;
|
|
15
|
-
}
|
|
16
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
17
|
-
return '';
|
|
18
|
-
}
|
|
19
|
-
default:
|
|
20
|
-
return state;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
exports.default = reducer;
|
package/lib/reducers/ui/index.js
DELETED
|
@@ -1,24 +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 current_slide_ref_1 = __importDefault(require("./current-slide-ref"));
|
|
8
|
-
const navigation_1 = __importDefault(require("./navigation"));
|
|
9
|
-
const answers_1 = __importDefault(require("./answers"));
|
|
10
|
-
const positions_1 = __importDefault(require("./positions"));
|
|
11
|
-
const slide_1 = __importDefault(require("./slide"));
|
|
12
|
-
const quit_popin_1 = __importDefault(require("./quit-popin"));
|
|
13
|
-
const show_button_revising_1 = __importDefault(require("./show-button-revising"));
|
|
14
|
-
const show_congrats_1 = __importDefault(require("./show-congrats"));
|
|
15
|
-
exports.default = (0, redux_1.combineReducers)({
|
|
16
|
-
currentSlideRef: current_slide_ref_1.default,
|
|
17
|
-
navigation: navigation_1.default,
|
|
18
|
-
answers: answers_1.default,
|
|
19
|
-
slide: slide_1.default,
|
|
20
|
-
positions: positions_1.default,
|
|
21
|
-
showQuitPopin: quit_popin_1.default,
|
|
22
|
-
showButtonRevising: show_button_revising_1.default,
|
|
23
|
-
showCongrats: show_congrats_1.default
|
|
24
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const navigation_1 = require("../../actions/ui/navigation");
|
|
4
|
-
const reducer = (
|
|
5
|
-
// eslint-disable-next-line default-param-last
|
|
6
|
-
state = [], action) => {
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case navigation_1.NAVIGATE_TO: {
|
|
9
|
-
return [...state, action.payload];
|
|
10
|
-
}
|
|
11
|
-
case navigation_1.NAVIGATE_BACK: {
|
|
12
|
-
const newState = [...state];
|
|
13
|
-
newState.pop();
|
|
14
|
-
return newState;
|
|
15
|
-
}
|
|
16
|
-
default:
|
|
17
|
-
return state;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
exports.default = reducer;
|
|
@@ -1,35 +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 findIndex_1 = __importDefault(require("lodash/fp/findIndex"));
|
|
7
|
-
const map_1 = __importDefault(require("lodash/fp/map"));
|
|
8
|
-
const set_1 = __importDefault(require("lodash/fp/set"));
|
|
9
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
10
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
11
|
-
const initialState = [0, 1, 2, 3, 4];
|
|
12
|
-
const reducer = (
|
|
13
|
-
// eslint-disable-next-line default-param-last
|
|
14
|
-
state = initialState, action) => {
|
|
15
|
-
switch (action.type) {
|
|
16
|
-
case post_progression_1.POST_PROGRESSION_SUCCESS: {
|
|
17
|
-
return initialState;
|
|
18
|
-
}
|
|
19
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
20
|
-
const { totalCorrectAnswers, answeredSlides, currentSlideRef, animationType, nextSlideRef } = action.payload;
|
|
21
|
-
if (nextSlideRef === 'successExitNode')
|
|
22
|
-
return state;
|
|
23
|
-
const nextCurrentSlidePosition = animationType === 'unstack' ? -1 : 4 - totalCorrectAnswers;
|
|
24
|
-
const currentSlideIndex = (0, findIndex_1.default)(ref => ref === currentSlideRef, answeredSlides);
|
|
25
|
-
const newState = (0, map_1.default)(position => (position === -1 ? position : position - 1), state);
|
|
26
|
-
return (0, set_1.default)([`${currentSlideIndex}`], nextCurrentSlidePosition)(newState);
|
|
27
|
-
}
|
|
28
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
29
|
-
return initialState;
|
|
30
|
-
}
|
|
31
|
-
default:
|
|
32
|
-
return state;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.default = reducer;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const quit_popin_1 = require("../../actions/ui/quit-popin");
|
|
4
|
-
const reducer = (
|
|
5
|
-
// eslint-disable-next-line default-param-last
|
|
6
|
-
state = false, action) => {
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case quit_popin_1.OPEN_POPIN: {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
case quit_popin_1.CLOSE_POPIN: {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
default:
|
|
15
|
-
return state;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
exports.default = reducer;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const show_button_revising_1 = require("../../actions/ui/show-button-revising");
|
|
4
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
5
|
-
const reducer = (
|
|
6
|
-
// eslint-disable-next-line default-param-last
|
|
7
|
-
state = false, action) => {
|
|
8
|
-
switch (action.type) {
|
|
9
|
-
case show_button_revising_1.SHOW_BUTTON_REVISING: {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
default:
|
|
16
|
-
return state;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
exports.default = reducer;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
4
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
5
|
-
const reducer = (
|
|
6
|
-
// eslint-disable-next-line default-param-last
|
|
7
|
-
state = false, action) => {
|
|
8
|
-
switch (action.type) {
|
|
9
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
13
|
-
const { nextSlideRef } = action.payload;
|
|
14
|
-
if (nextSlideRef === 'successExitNode')
|
|
15
|
-
return true;
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
default:
|
|
19
|
-
return state;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.default = reducer;
|
package/lib/reducers/ui/slide.js
DELETED
|
@@ -1,58 +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.initialState = void 0;
|
|
7
|
-
const compact_1 = __importDefault(require("lodash/fp/compact"));
|
|
8
|
-
const isEmpty_1 = __importDefault(require("lodash/fp/isEmpty"));
|
|
9
|
-
const pipe_1 = __importDefault(require("lodash/fp/pipe"));
|
|
10
|
-
const set_1 = __importDefault(require("lodash/fp/set"));
|
|
11
|
-
const unset_1 = __importDefault(require("lodash/fp/unset"));
|
|
12
|
-
const answers_1 = require("../../actions/ui/answers");
|
|
13
|
-
const post_answer_1 = require("../../actions/api/post-answer");
|
|
14
|
-
const fetch_correction_1 = require("../../actions/api/fetch-correction");
|
|
15
|
-
const post_progression_1 = require("../../actions/api/post-progression");
|
|
16
|
-
const fetch_slide_1 = require("../../actions/api/fetch-slide");
|
|
17
|
-
const next_slide_1 = require("../../actions/ui/next-slide");
|
|
18
|
-
exports.initialState = {};
|
|
19
|
-
const reducer = (
|
|
20
|
-
// eslint-disable-next-line default-param-last
|
|
21
|
-
state = exports.initialState, action) => {
|
|
22
|
-
switch (action.type) {
|
|
23
|
-
case fetch_slide_1.SLIDE_FETCH_REQUEST: {
|
|
24
|
-
return (0, pipe_1.default)((0, unset_1.default)([action.meta.slideRef, 'animationType']), (0, set_1.default)([action.meta.slideRef], {
|
|
25
|
-
validateButton: false,
|
|
26
|
-
animateCorrectionPopin: false,
|
|
27
|
-
showCorrectionPopin: false,
|
|
28
|
-
pendingAnswerRequest: false
|
|
29
|
-
}))(state);
|
|
30
|
-
}
|
|
31
|
-
case answers_1.EDIT_QCM:
|
|
32
|
-
case answers_1.EDIT_QCM_GRAPHIC:
|
|
33
|
-
case answers_1.EDIT_QCM_DRAG:
|
|
34
|
-
case answers_1.EDIT_TEMPLATE:
|
|
35
|
-
case answers_1.EDIT_BASIC:
|
|
36
|
-
case answers_1.EDIT_SLIDER: {
|
|
37
|
-
return (0, set_1.default)([action.meta.slideRef, 'validateButton'], !(0, pipe_1.default)(compact_1.default, isEmpty_1.default)(action.payload), state);
|
|
38
|
-
}
|
|
39
|
-
case post_answer_1.POST_ANSWER_REQUEST: {
|
|
40
|
-
return (0, pipe_1.default)((0, set_1.default)([action.meta.slideRef, 'validateButton'], false), (0, set_1.default)([action.meta.slideRef, 'pendingAnswerRequest'], true))(state);
|
|
41
|
-
}
|
|
42
|
-
case fetch_correction_1.CORRECTION_FETCH_SUCCESS: {
|
|
43
|
-
return (0, pipe_1.default)((0, set_1.default)([action.meta.slideRef, 'animateCorrectionPopin'], true), (0, set_1.default)([action.meta.slideRef, 'showCorrectionPopin'], true))(state);
|
|
44
|
-
}
|
|
45
|
-
case next_slide_1.NEXT_SLIDE: {
|
|
46
|
-
const { currentSlideRef, nextSlideRef } = action.payload;
|
|
47
|
-
if (nextSlideRef === 'successExitNode')
|
|
48
|
-
return state;
|
|
49
|
-
return (0, pipe_1.default)((0, set_1.default)([currentSlideRef, 'animateCorrectionPopin'], false), (0, set_1.default)([currentSlideRef, 'animationType'], action.payload.animationType), (0, set_1.default)([currentSlideRef, 'showCorrectionPopin'], false))(state);
|
|
50
|
-
}
|
|
51
|
-
case post_progression_1.POST_PROGRESSION_REQUEST: {
|
|
52
|
-
return exports.initialState;
|
|
53
|
-
}
|
|
54
|
-
default:
|
|
55
|
-
return state;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
exports.default = reducer;
|
package/lib/types/common.js
DELETED
package/lib/types/slides.js
DELETED