@coorpacademy/app-review 0.14.5 → 0.15.0
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/slides.d.ts
CHANGED
|
@@ -163,13 +163,30 @@ const getAnswerUIModel = (question, answers, dispatch, translate) => {
|
|
|
163
163
|
throw new Error(`${type} is not an handled question.type`);
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
+
const getMedia = (media) => {
|
|
167
|
+
if (!media)
|
|
168
|
+
return;
|
|
169
|
+
const { type } = media;
|
|
170
|
+
const resource = get('src.0', media);
|
|
171
|
+
switch (type) {
|
|
172
|
+
case 'img':
|
|
173
|
+
case 'audio':
|
|
174
|
+
return {
|
|
175
|
+
...resource,
|
|
176
|
+
type,
|
|
177
|
+
url: get('url', resource)
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
};
|
|
166
181
|
export const mapApiSlideToUi = (dispatch, translate) => (slide, answers) => {
|
|
167
182
|
const questionText = getOr('', 'question.header', slide);
|
|
183
|
+
const media = get('question.medias.0', slide);
|
|
168
184
|
return {
|
|
169
185
|
questionText,
|
|
170
186
|
answerUI: {
|
|
171
187
|
model: getAnswerUIModel(slide.question, answers, dispatch, translate),
|
|
172
|
-
help: getHelp(slide)
|
|
188
|
+
help: getHelp(slide),
|
|
189
|
+
media: getMedia(media)
|
|
173
190
|
}
|
|
174
191
|
};
|
|
175
192
|
};
|
package/lib/types/slides.d.ts
CHANGED
|
@@ -167,13 +167,30 @@ const getAnswerUIModel = (question, answers, dispatch, translate) => {
|
|
|
167
167
|
throw new Error(`${type} is not an handled question.type`);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
|
+
const getMedia = (media) => {
|
|
171
|
+
if (!media)
|
|
172
|
+
return;
|
|
173
|
+
const { type } = media;
|
|
174
|
+
const resource = (0, fp_1.get)('src.0', media);
|
|
175
|
+
switch (type) {
|
|
176
|
+
case 'img':
|
|
177
|
+
case 'audio':
|
|
178
|
+
return {
|
|
179
|
+
...resource,
|
|
180
|
+
type,
|
|
181
|
+
url: (0, fp_1.get)('url', resource)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
};
|
|
170
185
|
const mapApiSlideToUi = (dispatch, translate) => (slide, answers) => {
|
|
171
186
|
const questionText = (0, fp_1.getOr)('', 'question.header', slide);
|
|
187
|
+
const media = (0, fp_1.get)('question.medias.0', slide);
|
|
172
188
|
return {
|
|
173
189
|
questionText,
|
|
174
190
|
answerUI: {
|
|
175
191
|
model: getAnswerUIModel(slide.question, answers, dispatch, translate),
|
|
176
|
-
help: getHelp(slide)
|
|
192
|
+
help: getHelp(slide),
|
|
193
|
+
media: getMedia(media)
|
|
177
194
|
}
|
|
178
195
|
};
|
|
179
196
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@coorpacademy/components": "11.4.3",
|
|
39
39
|
"@coorpacademy/progression-engine": "11.5.3",
|
|
40
40
|
"@coorpacademy/redux-task": "1.1.6",
|
|
41
|
-
"@coorpacademy/review-services": "1.
|
|
42
|
-
"@coorpacademy/review-services-mocks": "1.
|
|
41
|
+
"@coorpacademy/review-services": "1.2.0",
|
|
42
|
+
"@coorpacademy/review-services-mocks": "1.2.0",
|
|
43
43
|
"@coorpacademy/translate": "6.2.0",
|
|
44
44
|
"cross-fetch": "^3.1.5",
|
|
45
45
|
"jwt-decode": "^3.1.2",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"webpack-cli": "^4.10.0",
|
|
75
75
|
"webpack-dev-server": "^4.11.1"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "c27ccb6948548f93b8002440aeae923f171217c3"
|
|
78
78
|
}
|
package/locales/.mtslconfig.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"ignore_dirs":[]}
|