@coorpacademy/app-review 0.7.5-alpha.27 → 0.7.5-alpha.32
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/index.js +5 -7
- package/es/reducers/index.d.ts +2 -1
- package/es/reducers/ui/index.d.ts +4 -1
- package/es/reducers/ui/index.js +2 -0
- package/es/reducers/ui/show-button-revising.d.ts +4 -0
- package/es/reducers/ui/show-button-revising.js +13 -0
- package/es/types/common.d.ts +5 -1
- package/es/views/slides/index.js +4 -2
- package/lib/index.js +5 -7
- package/lib/reducers/index.d.ts +2 -1
- package/lib/reducers/ui/index.d.ts +4 -1
- package/lib/reducers/ui/index.js +2 -0
- package/lib/reducers/ui/show-button-revising.d.ts +4 -0
- package/lib/reducers/ui/show-button-revising.js +15 -0
- package/lib/types/common.d.ts +5 -1
- package/lib/views/slides/index.js +4 -2
- package/locales/bs/review.json +12 -12
- package/locales/hy/review.json +12 -12
- package/locales/zh_TW/review.json +12 -12
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const ConnectedApp = (options) => {
|
|
|
24
24
|
const AppReview = ({ options }) => {
|
|
25
25
|
const [store, setStore] = useState(null);
|
|
26
26
|
const [isProgressionCreated, setIsProgressionCreated] = useState(false);
|
|
27
|
-
const { translate, onQuitClick } = options;
|
|
27
|
+
const { translate, onQuitClick, skill } = options;
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
if (store)
|
|
30
30
|
return;
|
|
@@ -49,25 +49,23 @@ const AppReview = ({ options }) => {
|
|
|
49
49
|
const token = get('token', options);
|
|
50
50
|
if (store === null || isEmpty(token))
|
|
51
51
|
return;
|
|
52
|
-
const skillRef = get('skillRef', options);
|
|
53
52
|
/* ThunkAction is not assignable to parameter of type 'AnyAction'
|
|
54
53
|
ts problem is described here = https://github.com/reduxjs/redux-thunk/issues/333 */
|
|
55
|
-
|
|
54
|
+
skill.ref ? store.dispatch(postProgression(skill.ref)) : store.dispatch(fetchSkills);
|
|
56
55
|
}, [options, store]);
|
|
57
56
|
useEffect(() => {
|
|
58
57
|
if (store === null)
|
|
59
58
|
return;
|
|
60
|
-
|
|
61
|
-
if (skillRef && !isProgressionCreated) {
|
|
59
|
+
if (skill.ref && !isProgressionCreated) {
|
|
62
60
|
store.dispatch(navigateTo('loader')); // use loader while posting progression
|
|
63
61
|
return;
|
|
64
62
|
}
|
|
65
|
-
const initialView =
|
|
63
|
+
const initialView = skill.ref ? 'slides' : 'skills';
|
|
66
64
|
store.dispatch(navigateTo(initialView));
|
|
67
65
|
}, [isProgressionCreated, options, store]);
|
|
68
66
|
if (!store)
|
|
69
67
|
return null;
|
|
70
68
|
return (React.createElement(Provider, { store: store },
|
|
71
|
-
React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate })));
|
|
69
|
+
React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skill: skill })));
|
|
72
70
|
};
|
|
73
71
|
export default AppReview;
|
package/es/reducers/index.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
20
20
|
slide: import("./ui/slide").UISlideState;
|
|
21
21
|
positions: import("./ui/positions").UIPositionState;
|
|
22
22
|
showQuitPopin: boolean;
|
|
23
|
+
showButtonRevising: boolean;
|
|
23
24
|
showCongrats: boolean;
|
|
24
25
|
}>;
|
|
25
|
-
}>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
|
|
26
|
+
}>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
|
|
26
27
|
type: "@@ui/OPEN_POPIN";
|
|
27
28
|
} | {
|
|
28
29
|
type: "@@ui/CLOSE_POPIN";
|
|
@@ -4,6 +4,7 @@ import { UIAnswerState } from './answers';
|
|
|
4
4
|
import { UIPositionState } from './positions';
|
|
5
5
|
import { UISlideState } from './slide';
|
|
6
6
|
import { type ShowQuitPopinState } from './quit-popin';
|
|
7
|
+
import { UIShowButtonRevisingState } from './show-button-revising';
|
|
7
8
|
import { UIShowCongratsState } from './show-congrats';
|
|
8
9
|
export declare type UIState = {
|
|
9
10
|
currentSlideRef: CurrentSlideRefState;
|
|
@@ -12,6 +13,7 @@ export declare type UIState = {
|
|
|
12
13
|
slide: UISlideState;
|
|
13
14
|
positions: UIPositionState;
|
|
14
15
|
showQuitPopin: ShowQuitPopinState;
|
|
16
|
+
showButtonRevising: UIShowButtonRevisingState;
|
|
15
17
|
showCongrats: UIShowCongratsState;
|
|
16
18
|
};
|
|
17
19
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
@@ -21,8 +23,9 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
21
23
|
slide: UISlideState;
|
|
22
24
|
positions: UIPositionState;
|
|
23
25
|
showQuitPopin: boolean;
|
|
26
|
+
showButtonRevising: boolean;
|
|
24
27
|
showCongrats: boolean;
|
|
25
|
-
}>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateToAction | import("../../actions/ui/navigation").NavigateBackAction | import("../../actions/ui/answers").EditAnswerAction | {
|
|
28
|
+
}>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateToAction | import("../../actions/ui/navigation").NavigateBackAction | import("../../actions/ui/answers").EditAnswerAction | {
|
|
26
29
|
type: "@@ui/OPEN_POPIN";
|
|
27
30
|
} | {
|
|
28
31
|
type: "@@ui/CLOSE_POPIN";
|
package/es/reducers/ui/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import answers from './answers';
|
|
|
5
5
|
import positions from './positions';
|
|
6
6
|
import slide from './slide';
|
|
7
7
|
import showQuitPopin from './quit-popin';
|
|
8
|
+
import showButtonRevising from './show-button-revising';
|
|
8
9
|
import showCongrats from './show-congrats';
|
|
9
10
|
export default combineReducers({
|
|
10
11
|
currentSlideRef,
|
|
@@ -13,5 +14,6 @@ export default combineReducers({
|
|
|
13
14
|
slide,
|
|
14
15
|
positions,
|
|
15
16
|
showQuitPopin,
|
|
17
|
+
showButtonRevising,
|
|
16
18
|
showCongrats
|
|
17
19
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReceivedSlidesToReviewBySkillRef } from '../../actions/api/fetch-slides-to-review-by-skill-ref';
|
|
2
|
+
export declare type UIShowButtonRevisingState = boolean;
|
|
3
|
+
declare const reducer: (state: boolean | undefined, action: ReceivedSlidesToReviewBySkillRef) => UIShowButtonRevisingState;
|
|
4
|
+
export default reducer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SLIDES_TO_REVIEW_FETCH_SUCCESS } from '../../actions/api/fetch-slides-to-review-by-skill-ref';
|
|
2
|
+
const reducer = (
|
|
3
|
+
// eslint-disable-next-line default-param-last
|
|
4
|
+
state = false, action) => {
|
|
5
|
+
switch (action.type) {
|
|
6
|
+
case SLIDES_TO_REVIEW_FETCH_SUCCESS: {
|
|
7
|
+
return action.payload.length === 5;
|
|
8
|
+
}
|
|
9
|
+
default:
|
|
10
|
+
return state;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default reducer;
|
package/es/types/common.d.ts
CHANGED
|
@@ -128,6 +128,10 @@ export declare type Skill = {
|
|
|
128
128
|
custom: boolean;
|
|
129
129
|
name: string;
|
|
130
130
|
};
|
|
131
|
+
export declare type SkillOptions = {
|
|
132
|
+
name: string;
|
|
133
|
+
ref: string;
|
|
134
|
+
};
|
|
131
135
|
export declare type Services = {
|
|
132
136
|
fetchSkills(token: string): Promise<Skill[]>;
|
|
133
137
|
fetchSlide(slideRef: string, token: string): Promise<SlideFromAPI | void>;
|
|
@@ -143,10 +147,10 @@ export declare type Options = {
|
|
|
143
147
|
export declare type ConnectedOptions = {
|
|
144
148
|
translate: (key: string, data?: unknown) => string;
|
|
145
149
|
onQuitClick: () => void;
|
|
150
|
+
skill: SkillOptions;
|
|
146
151
|
};
|
|
147
152
|
export declare type AppOptions = ConnectedOptions & {
|
|
148
153
|
token: string;
|
|
149
|
-
skillRef?: string;
|
|
150
154
|
services: Services;
|
|
151
155
|
callbackOnViewChanged?: (viewName: ViewName) => void;
|
|
152
156
|
};
|
package/es/views/slides/index.js
CHANGED
|
@@ -282,7 +282,7 @@ const isEndOfProgression = (progression) => {
|
|
|
282
282
|
return progression.state.nextContent.ref === 'successExitNode';
|
|
283
283
|
};
|
|
284
284
|
export const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
285
|
-
const { translate, onQuitClick } = options;
|
|
285
|
+
const { translate, onQuitClick, skill } = options;
|
|
286
286
|
const currentSlideRef = getCurrentSlideRef(state);
|
|
287
287
|
const endReview = isEndOfProgression(state.data.progression);
|
|
288
288
|
const correction = get(['data', 'corrections', currentSlideRef], state);
|
|
@@ -290,10 +290,12 @@ export const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
|
290
290
|
const klf = getOr('', ['data', 'slides', currentSlideRef, 'klf'], state);
|
|
291
291
|
const showQuitPopin = get(['ui', 'showQuitPopin'], state);
|
|
292
292
|
const showCongrats = get(['ui', 'showCongrats'], state);
|
|
293
|
+
// eslint-disable-next-line no-console
|
|
294
|
+
console.log(skill.name);
|
|
293
295
|
return {
|
|
294
296
|
header: {
|
|
295
297
|
mode: translate('Review Title'),
|
|
296
|
-
skillName:
|
|
298
|
+
skillName: skill.name,
|
|
297
299
|
onQuitClick: () => dispatch(openQuitPopin),
|
|
298
300
|
'aria-label': 'aria-header-wrapper',
|
|
299
301
|
closeButtonAriaLabel: 'aria-close-button',
|
package/lib/index.js
CHANGED
|
@@ -52,7 +52,7 @@ const ConnectedApp = (options) => {
|
|
|
52
52
|
const AppReview = ({ options }) => {
|
|
53
53
|
const [store, setStore] = (0, react_1.useState)(null);
|
|
54
54
|
const [isProgressionCreated, setIsProgressionCreated] = (0, react_1.useState)(false);
|
|
55
|
-
const { translate, onQuitClick } = options;
|
|
55
|
+
const { translate, onQuitClick, skill } = options;
|
|
56
56
|
(0, react_1.useEffect)(() => {
|
|
57
57
|
if (store)
|
|
58
58
|
return;
|
|
@@ -77,25 +77,23 @@ const AppReview = ({ options }) => {
|
|
|
77
77
|
const token = (0, get_1.default)('token', options);
|
|
78
78
|
if (store === null || (0, isEmpty_1.default)(token))
|
|
79
79
|
return;
|
|
80
|
-
const skillRef = (0, get_1.default)('skillRef', options);
|
|
81
80
|
/* ThunkAction is not assignable to parameter of type 'AnyAction'
|
|
82
81
|
ts problem is described here = https://github.com/reduxjs/redux-thunk/issues/333 */
|
|
83
|
-
|
|
82
|
+
skill.ref ? store.dispatch((0, post_progression_1.postProgression)(skill.ref)) : store.dispatch(fetch_skills_1.fetchSkills);
|
|
84
83
|
}, [options, store]);
|
|
85
84
|
(0, react_1.useEffect)(() => {
|
|
86
85
|
if (store === null)
|
|
87
86
|
return;
|
|
88
|
-
|
|
89
|
-
if (skillRef && !isProgressionCreated) {
|
|
87
|
+
if (skill.ref && !isProgressionCreated) {
|
|
90
88
|
store.dispatch((0, navigation_1.navigateTo)('loader')); // use loader while posting progression
|
|
91
89
|
return;
|
|
92
90
|
}
|
|
93
|
-
const initialView =
|
|
91
|
+
const initialView = skill.ref ? 'slides' : 'skills';
|
|
94
92
|
store.dispatch((0, navigation_1.navigateTo)(initialView));
|
|
95
93
|
}, [isProgressionCreated, options, store]);
|
|
96
94
|
if (!store)
|
|
97
95
|
return null;
|
|
98
96
|
return (react_1.default.createElement(react_redux_1.Provider, { store: store },
|
|
99
|
-
react_1.default.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate })));
|
|
97
|
+
react_1.default.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate, skill: skill })));
|
|
100
98
|
};
|
|
101
99
|
exports.default = AppReview;
|
package/lib/reducers/index.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
20
20
|
slide: import("./ui/slide").UISlideState;
|
|
21
21
|
positions: import("./ui/positions").UIPositionState;
|
|
22
22
|
showQuitPopin: boolean;
|
|
23
|
+
showButtonRevising: boolean;
|
|
23
24
|
showCongrats: boolean;
|
|
24
25
|
}>;
|
|
25
|
-
}>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
|
|
26
|
+
}>, import("./data/corrections").CorrectionsAction | import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/post-progression").ReceivedProgression | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
|
|
26
27
|
type: "@@ui/OPEN_POPIN";
|
|
27
28
|
} | {
|
|
28
29
|
type: "@@ui/CLOSE_POPIN";
|
|
@@ -4,6 +4,7 @@ import { UIAnswerState } from './answers';
|
|
|
4
4
|
import { UIPositionState } from './positions';
|
|
5
5
|
import { UISlideState } from './slide';
|
|
6
6
|
import { type ShowQuitPopinState } from './quit-popin';
|
|
7
|
+
import { UIShowButtonRevisingState } from './show-button-revising';
|
|
7
8
|
import { UIShowCongratsState } from './show-congrats';
|
|
8
9
|
export declare type UIState = {
|
|
9
10
|
currentSlideRef: CurrentSlideRefState;
|
|
@@ -12,6 +13,7 @@ export declare type UIState = {
|
|
|
12
13
|
slide: UISlideState;
|
|
13
14
|
positions: UIPositionState;
|
|
14
15
|
showQuitPopin: ShowQuitPopinState;
|
|
16
|
+
showButtonRevising: UIShowButtonRevisingState;
|
|
15
17
|
showCongrats: UIShowCongratsState;
|
|
16
18
|
};
|
|
17
19
|
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
@@ -21,8 +23,9 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
21
23
|
slide: UISlideState;
|
|
22
24
|
positions: UIPositionState;
|
|
23
25
|
showQuitPopin: boolean;
|
|
26
|
+
showButtonRevising: boolean;
|
|
24
27
|
showCongrats: boolean;
|
|
25
|
-
}>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateToAction | import("../../actions/ui/navigation").NavigateBackAction | import("../../actions/ui/answers").EditAnswerAction | {
|
|
28
|
+
}>, import("../../actions/api/fetch-correction").ReceivedCorrection | import("../../actions/ui/slides").SetCurrentSlideAction | import("../../actions/api/fetch-slide").FetchSlide | import("../../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../../actions/api/post-answer").PostAnswerRequestAction | import("../../actions/api/post-progression").ReceivedProgression | import("../../actions/ui/next-slide").NextSlideAction | import("../../actions/ui/navigation").NavigateToAction | import("../../actions/ui/navigation").NavigateBackAction | import("../../actions/ui/answers").EditAnswerAction | {
|
|
26
29
|
type: "@@ui/OPEN_POPIN";
|
|
27
30
|
} | {
|
|
28
31
|
type: "@@ui/CLOSE_POPIN";
|
package/lib/reducers/ui/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const answers_1 = __importDefault(require("./answers"));
|
|
|
10
10
|
const positions_1 = __importDefault(require("./positions"));
|
|
11
11
|
const slide_1 = __importDefault(require("./slide"));
|
|
12
12
|
const quit_popin_1 = __importDefault(require("./quit-popin"));
|
|
13
|
+
const show_button_revising_1 = __importDefault(require("./show-button-revising"));
|
|
13
14
|
const show_congrats_1 = __importDefault(require("./show-congrats"));
|
|
14
15
|
exports.default = (0, redux_1.combineReducers)({
|
|
15
16
|
currentSlideRef: current_slide_ref_1.default,
|
|
@@ -18,5 +19,6 @@ exports.default = (0, redux_1.combineReducers)({
|
|
|
18
19
|
slide: slide_1.default,
|
|
19
20
|
positions: positions_1.default,
|
|
20
21
|
showQuitPopin: quit_popin_1.default,
|
|
22
|
+
showButtonRevising: show_button_revising_1.default,
|
|
21
23
|
showCongrats: show_congrats_1.default
|
|
22
24
|
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReceivedSlidesToReviewBySkillRef } from '../../actions/api/fetch-slides-to-review-by-skill-ref';
|
|
2
|
+
export declare type UIShowButtonRevisingState = boolean;
|
|
3
|
+
declare const reducer: (state: boolean | undefined, action: ReceivedSlidesToReviewBySkillRef) => UIShowButtonRevisingState;
|
|
4
|
+
export default reducer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fetch_slides_to_review_by_skill_ref_1 = require("../../actions/api/fetch-slides-to-review-by-skill-ref");
|
|
4
|
+
const reducer = (
|
|
5
|
+
// eslint-disable-next-line default-param-last
|
|
6
|
+
state = false, action) => {
|
|
7
|
+
switch (action.type) {
|
|
8
|
+
case fetch_slides_to_review_by_skill_ref_1.SLIDES_TO_REVIEW_FETCH_SUCCESS: {
|
|
9
|
+
return action.payload.length === 5;
|
|
10
|
+
}
|
|
11
|
+
default:
|
|
12
|
+
return state;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.default = reducer;
|
package/lib/types/common.d.ts
CHANGED
|
@@ -128,6 +128,10 @@ export declare type Skill = {
|
|
|
128
128
|
custom: boolean;
|
|
129
129
|
name: string;
|
|
130
130
|
};
|
|
131
|
+
export declare type SkillOptions = {
|
|
132
|
+
name: string;
|
|
133
|
+
ref: string;
|
|
134
|
+
};
|
|
131
135
|
export declare type Services = {
|
|
132
136
|
fetchSkills(token: string): Promise<Skill[]>;
|
|
133
137
|
fetchSlide(slideRef: string, token: string): Promise<SlideFromAPI | void>;
|
|
@@ -143,10 +147,10 @@ export declare type Options = {
|
|
|
143
147
|
export declare type ConnectedOptions = {
|
|
144
148
|
translate: (key: string, data?: unknown) => string;
|
|
145
149
|
onQuitClick: () => void;
|
|
150
|
+
skill: SkillOptions;
|
|
146
151
|
};
|
|
147
152
|
export declare type AppOptions = ConnectedOptions & {
|
|
148
153
|
token: string;
|
|
149
|
-
skillRef?: string;
|
|
150
154
|
services: Services;
|
|
151
155
|
callbackOnViewChanged?: (viewName: ViewName) => void;
|
|
152
156
|
};
|
|
@@ -289,7 +289,7 @@ const isEndOfProgression = (progression) => {
|
|
|
289
289
|
return progression.state.nextContent.ref === 'successExitNode';
|
|
290
290
|
};
|
|
291
291
|
const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
292
|
-
const { translate, onQuitClick } = options;
|
|
292
|
+
const { translate, onQuitClick, skill } = options;
|
|
293
293
|
const currentSlideRef = getCurrentSlideRef(state);
|
|
294
294
|
const endReview = isEndOfProgression(state.data.progression);
|
|
295
295
|
const correction = (0, get_1.default)(['data', 'corrections', currentSlideRef], state);
|
|
@@ -297,10 +297,12 @@ const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
|
297
297
|
const klf = (0, getOr_1.default)('', ['data', 'slides', currentSlideRef, 'klf'], state);
|
|
298
298
|
const showQuitPopin = (0, get_1.default)(['ui', 'showQuitPopin'], state);
|
|
299
299
|
const showCongrats = (0, get_1.default)(['ui', 'showCongrats'], state);
|
|
300
|
+
// eslint-disable-next-line no-console
|
|
301
|
+
console.log(skill.name);
|
|
300
302
|
return {
|
|
301
303
|
header: {
|
|
302
304
|
mode: translate('Review Title'),
|
|
303
|
-
skillName:
|
|
305
|
+
skillName: skill.name,
|
|
304
306
|
onQuitClick: () => dispatch(quit_popin_1.openQuitPopin),
|
|
305
307
|
'aria-label': 'aria-header-wrapper',
|
|
306
308
|
closeButtonAriaLabel: 'aria-close-button',
|
package/locales/bs/review.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Review Title": "
|
|
3
|
-
"Content Parent Title": "
|
|
4
|
-
"Validate": "
|
|
5
|
-
"Next
|
|
6
|
-
"KLF": "
|
|
7
|
-
"Correct Answer": "
|
|
8
|
-
"Wrong Answer": "
|
|
9
|
-
"You have won": "
|
|
10
|
-
"You are now": "
|
|
11
|
-
"Revise another skill": "
|
|
12
|
-
"Continue reviewing": "
|
|
13
|
-
"Congratulations!": "
|
|
2
|
+
"Review Title": "Recenzija Mode",
|
|
3
|
+
"Content Parent Title": "Od `{{contentTitle}}` `{{contentType}}`",
|
|
4
|
+
"Validate": "Potvrdi",
|
|
5
|
+
"Next question": "Sljedeće pitanje",
|
|
6
|
+
"KLF": "Ključni faktor učenja",
|
|
7
|
+
"Correct Answer": "Tačan odgovor",
|
|
8
|
+
"Wrong Answer": "Pogrešan odgovor",
|
|
9
|
+
"You have won": "Pobijedio si",
|
|
10
|
+
"You are now": "Sada jesi",
|
|
11
|
+
"Revise another skill": "Revidirajte drugu vještinu",
|
|
12
|
+
"Continue reviewing": "Nastavite sa pregledom",
|
|
13
|
+
"Congratulations!": "Čestitamo!",
|
|
14
14
|
"Quit Title": "Are you sure you want to quit ?",
|
|
15
15
|
"Quit Description Text": "You’re right on track! If you quit now, you’ll lose your progress.",
|
|
16
16
|
"Stop learning": "End session",
|
package/locales/hy/review.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Review Title": "
|
|
3
|
-
"Content Parent Title": "
|
|
4
|
-
"Validate": "
|
|
5
|
-
"Next
|
|
6
|
-
"KLF": "
|
|
7
|
-
"Correct Answer": "
|
|
8
|
-
"Wrong Answer": "
|
|
9
|
-
"You have won": "
|
|
10
|
-
"You are now": "
|
|
11
|
-
"Revise another skill": "
|
|
12
|
-
"Continue reviewing": "
|
|
13
|
-
"Congratulations!": "
|
|
2
|
+
"Review Title": "Վերանայման ռեժիմ",
|
|
3
|
+
"Content Parent Title": "'{{contentTitle}}՝ ՝{{contentType}}՝-ից",
|
|
4
|
+
"Validate": "Վավերացնել",
|
|
5
|
+
"Next question": "Հաջորդ Հարցը",
|
|
6
|
+
"KLF": "Հիմնական ուսուցման գործոնը",
|
|
7
|
+
"Correct Answer": "Ճիշտ պատասխան",
|
|
8
|
+
"Wrong Answer": "Սխալ պատասխանը",
|
|
9
|
+
"You have won": "Դու հաղթել ես",
|
|
10
|
+
"You are now": "Դուք հիմա եք",
|
|
11
|
+
"Revise another skill": "Վերանայեք մեկ այլ հմտություն",
|
|
12
|
+
"Continue reviewing": "Շարունակեք վերանայել",
|
|
13
|
+
"Congratulations!": "Շնորհավորում եմ:",
|
|
14
14
|
"Quit Title": "Are you sure you want to quit ?",
|
|
15
15
|
"Quit Description Text": "You’re right on track! If you quit now, you’ll lose your progress.",
|
|
16
16
|
"Stop learning": "End session",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Review Title": "
|
|
3
|
-
"Content Parent Title": "
|
|
4
|
-
"Validate": "
|
|
5
|
-
"Next
|
|
6
|
-
"KLF": "
|
|
7
|
-
"Correct Answer": "
|
|
8
|
-
"Wrong Answer": "
|
|
9
|
-
"You have won": "
|
|
10
|
-
"You are now": "
|
|
11
|
-
"Revise another skill": "
|
|
12
|
-
"Continue reviewing": "
|
|
13
|
-
"Congratulations!": "
|
|
2
|
+
"Review Title": "檢閱模式",
|
|
3
|
+
"Content Parent Title": "來自 `{{contentTitle}}` `{{contentType}}`",
|
|
4
|
+
"Validate": "驗證",
|
|
5
|
+
"Next question": "下個問題",
|
|
6
|
+
"KLF": "關鍵學習因素",
|
|
7
|
+
"Correct Answer": "正確答案",
|
|
8
|
+
"Wrong Answer": "錯誤答案",
|
|
9
|
+
"You have won": "你贏了",
|
|
10
|
+
"You are now": "您現在是",
|
|
11
|
+
"Revise another skill": "修正其他技能",
|
|
12
|
+
"Continue reviewing": "繼續檢閱",
|
|
13
|
+
"Congratulations!": "恭喜!",
|
|
14
14
|
"Quit Title": "Are you sure you want to quit ?",
|
|
15
15
|
"Quit Description Text": "You’re right on track! If you quit now, you’ll lose your progress.",
|
|
16
16
|
"Stop learning": "End session",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.7.5-alpha.
|
|
3
|
+
"version": "0.7.5-alpha.32+5269cf70f",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"webpack-cli": "^4.10.0",
|
|
72
72
|
"webpack-dev-server": "^4.11.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "5269cf70fada105f2d8d4a9089b10458fff3a132"
|
|
75
75
|
}
|