@coorpacademy/app-review 0.8.7-alpha.4 → 0.8.8-alpha.2
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/types/common.d.ts +4 -1
- package/es/views/slides/index.js +5 -4
- package/es/views/slides/map-api-slide-to-ui.d.ts +2 -2
- package/lib/types/common.d.ts +4 -1
- package/lib/views/slides/index.js +5 -4
- package/lib/views/slides/map-api-slide-to-ui.d.ts +2 -2
- package/locales/en/review.json +1 -0
- package/package.json +3 -3
package/es/types/common.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
|
|
2
|
+
export interface Translate {
|
|
3
|
+
(key: string, data?: Record<string, string>): string;
|
|
4
|
+
}
|
|
2
5
|
export declare type ChoiceFromAPI = {
|
|
3
6
|
_id: string;
|
|
4
7
|
id?: string;
|
|
@@ -146,7 +149,7 @@ export declare type Options = {
|
|
|
146
149
|
services: Services;
|
|
147
150
|
};
|
|
148
151
|
export declare type ConnectedOptions = {
|
|
149
|
-
translate:
|
|
152
|
+
translate: Translate;
|
|
150
153
|
onQuitClick: () => void;
|
|
151
154
|
};
|
|
152
155
|
export declare type AppOptions = ConnectedOptions & {
|
package/es/views/slides/index.js
CHANGED
|
@@ -177,7 +177,8 @@ export const buildStepItems = (state) => {
|
|
|
177
177
|
});
|
|
178
178
|
return steps;
|
|
179
179
|
};
|
|
180
|
-
const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, translate) => {
|
|
180
|
+
const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, translate, endReview) => {
|
|
181
|
+
const nextLabel = endReview ? translate('Continue') : translate('Next Question');
|
|
181
182
|
return {
|
|
182
183
|
klf: isCorrect
|
|
183
184
|
? undefined
|
|
@@ -191,8 +192,8 @@ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, tr
|
|
|
191
192
|
message: isCorrect ? klf : join(', ', correctAnswer)
|
|
192
193
|
},
|
|
193
194
|
next: {
|
|
194
|
-
'aria-label':
|
|
195
|
-
label:
|
|
195
|
+
'aria-label': nextLabel,
|
|
196
|
+
label: nextLabel,
|
|
196
197
|
onClick: () => {
|
|
197
198
|
dispatch(nextSlide);
|
|
198
199
|
}
|
|
@@ -340,7 +341,7 @@ export const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
|
340
341
|
}
|
|
341
342
|
},
|
|
342
343
|
correctionPopinProps: correction &&
|
|
343
|
-
getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate),
|
|
344
|
+
getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate, endReview),
|
|
344
345
|
endReview: endReview && state.ui.showCongrats
|
|
345
346
|
},
|
|
346
347
|
congrats: buildCongratsProps(state, dispatch, options),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dispatch } from 'redux';
|
|
2
2
|
import { AnswerUI } from '../../types/slides';
|
|
3
|
-
import { Question, SlideFromAPI } from '../../types/common';
|
|
3
|
+
import { Question, SlideFromAPI, Translate } from '../../types/common';
|
|
4
4
|
export declare const getQuestionType: (question: Question) => Question['type'];
|
|
5
|
-
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate:
|
|
5
|
+
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[]) => {
|
|
6
6
|
questionText: string;
|
|
7
7
|
answerUI: AnswerUI;
|
|
8
8
|
};
|
package/lib/types/common.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
|
|
2
|
+
export interface Translate {
|
|
3
|
+
(key: string, data?: Record<string, string>): string;
|
|
4
|
+
}
|
|
2
5
|
export declare type ChoiceFromAPI = {
|
|
3
6
|
_id: string;
|
|
4
7
|
id?: string;
|
|
@@ -146,7 +149,7 @@ export declare type Options = {
|
|
|
146
149
|
services: Services;
|
|
147
150
|
};
|
|
148
151
|
export declare type ConnectedOptions = {
|
|
149
|
-
translate:
|
|
152
|
+
translate: Translate;
|
|
150
153
|
onQuitClick: () => void;
|
|
151
154
|
};
|
|
152
155
|
export declare type AppOptions = ConnectedOptions & {
|
|
@@ -184,7 +184,8 @@ const buildStepItems = (state) => {
|
|
|
184
184
|
return steps;
|
|
185
185
|
};
|
|
186
186
|
exports.buildStepItems = buildStepItems;
|
|
187
|
-
const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, translate) => {
|
|
187
|
+
const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, translate, endReview) => {
|
|
188
|
+
const nextLabel = endReview ? translate('Continue') : translate('Next Question');
|
|
188
189
|
return {
|
|
189
190
|
klf: isCorrect
|
|
190
191
|
? undefined
|
|
@@ -198,8 +199,8 @@ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, tr
|
|
|
198
199
|
message: isCorrect ? klf : (0, join_1.default)(', ', correctAnswer)
|
|
199
200
|
},
|
|
200
201
|
next: {
|
|
201
|
-
'aria-label':
|
|
202
|
-
label:
|
|
202
|
+
'aria-label': nextLabel,
|
|
203
|
+
label: nextLabel,
|
|
203
204
|
onClick: () => {
|
|
204
205
|
dispatch(next_slide_1.nextSlide);
|
|
205
206
|
}
|
|
@@ -347,7 +348,7 @@ const mapStateToSlidesProps = (state, dispatch, options) => {
|
|
|
347
348
|
}
|
|
348
349
|
},
|
|
349
350
|
correctionPopinProps: correction &&
|
|
350
|
-
getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate),
|
|
351
|
+
getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, translate, endReview),
|
|
351
352
|
endReview: endReview && state.ui.showCongrats
|
|
352
353
|
},
|
|
353
354
|
congrats: buildCongratsProps(state, dispatch, options),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Dispatch } from 'redux';
|
|
2
2
|
import { AnswerUI } from '../../types/slides';
|
|
3
|
-
import { Question, SlideFromAPI } from '../../types/common';
|
|
3
|
+
import { Question, SlideFromAPI, Translate } from '../../types/common';
|
|
4
4
|
export declare const getQuestionType: (question: Question) => Question['type'];
|
|
5
|
-
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate:
|
|
5
|
+
export declare const mapApiSlideToUi: (dispatch: Dispatch, translate: Translate) => (slide: SlideFromAPI, answers: string[]) => {
|
|
6
6
|
questionText: string;
|
|
7
7
|
answerUI: AnswerUI;
|
|
8
8
|
};
|
package/locales/en/review.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"Quit Description Text": "You’re right on track! If you quit now, you’ll lose your progress.",
|
|
17
17
|
"Stop learning": "End session",
|
|
18
18
|
"Continue learning": "Continue learning",
|
|
19
|
+
"Continue": "Continue",
|
|
19
20
|
"Type here": "Type here",
|
|
20
21
|
"Select an answer": "Select an answer",
|
|
21
22
|
"presentation": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.8-alpha.2+4c0c3cb28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"main": "lib/index.js",
|
|
36
36
|
"module": "es/index.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@coorpacademy/components": "10.28.
|
|
38
|
+
"@coorpacademy/components": "10.28.7-alpha.2+4c0c3cb28",
|
|
39
39
|
"@coorpacademy/redux-task": "1.1.6",
|
|
40
40
|
"@coorpacademy/translate": "6.1.5",
|
|
41
41
|
"cross-fetch": "^3.1.5",
|
|
@@ -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": "4c0c3cb28da91db525c993cb92bbbc78d3e35870"
|
|
75
75
|
}
|