@coorpacademy/app-review 0.5.6-alpha.9 → 0.5.6

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.
Files changed (253) hide show
  1. package/{lib/src → es}/index.d.ts +1 -0
  2. package/es/{src/index.js → index.js} +4 -4
  3. package/es/{src/test → test}/index.test.js +0 -1
  4. package/{lib/src → es}/test/util/services.mock.d.ts +0 -1
  5. package/es/{src/test → test}/util/services.mock.js +0 -1
  6. package/{lib/src → es}/types/common.d.ts +2 -5
  7. package/{lib/src → es}/views/slides/index.d.ts +1 -2
  8. package/es/{src/views → views}/slides/index.js +18 -20
  9. package/{es/src → lib}/index.d.ts +1 -0
  10. package/lib/{src/index.js → index.js} +5 -4
  11. package/lib/{src/test → test}/index.test.js +0 -1
  12. package/{es/src → lib}/test/util/services.mock.d.ts +0 -1
  13. package/lib/{src/test → test}/util/services.mock.js +0 -1
  14. package/{es/src → lib}/types/common.d.ts +2 -5
  15. package/{es/src → lib}/views/slides/index.d.ts +1 -2
  16. package/lib/{src/views → views}/slides/index.js +18 -20
  17. package/package.json +4 -7
  18. package/src/index.tsx +6 -5
  19. package/src/test/index.test.tsx +0 -1
  20. package/src/test/util/services.mock.ts +0 -2
  21. package/src/types/common.ts +2 -6
  22. package/src/types/globals.d.ts +0 -1
  23. package/src/views/slides/index.ts +19 -43
  24. package/src/views/slides/test/header.on-click.test.ts +3 -10
  25. package/src/views/slides/test/index.test.ts +55 -58
  26. package/src/views/slides/test/on-quit-popin.on-click.test.ts +3 -12
  27. package/src/views/slides/test/slide.free-text.on-change.test.ts +2 -4
  28. package/src/views/slides/test/slide.next-slide.on-click.test.ts +3 -6
  29. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +2 -3
  30. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +2 -3
  31. package/src/views/slides/test/slide.qcm.on-click.test.ts +2 -3
  32. package/src/views/slides/test/slide.slider.on-change.test.ts +2 -3
  33. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +2 -3
  34. package/src/views/slides/test/slide.template.on-change.test.ts +4 -5
  35. package/es/locales/en/review.json +0 -14
  36. package/es/sandbox/index.d.ts +0 -9
  37. package/es/sandbox/index.js +0 -56
  38. package/lib/locales/en/review.json +0 -14
  39. package/lib/sandbox/index.d.ts +0 -9
  40. package/lib/sandbox/index.js +0 -67
  41. package/locales/en/review.json +0 -14
  42. /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  43. /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
  44. /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  45. /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
  46. /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  47. /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
  48. /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  49. /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
  50. /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
  51. /package/es/{src/actions → actions}/api/post-answer.js +0 -0
  52. /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
  53. /package/es/{src/actions → actions}/api/post-progression.js +0 -0
  54. /package/es/{src/actions → actions}/data/token.d.ts +0 -0
  55. /package/es/{src/actions → actions}/data/token.js +0 -0
  56. /package/es/{src/actions → actions}/index.d.ts +0 -0
  57. /package/es/{src/actions → actions}/index.js +0 -0
  58. /package/es/{src/actions → actions}/test/create-test-store.d.ts +0 -0
  59. /package/es/{src/actions → actions}/test/create-test-store.js +0 -0
  60. /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
  61. /package/es/{src/actions → actions}/ui/answers.js +0 -0
  62. /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
  63. /package/es/{src/actions → actions}/ui/navigation.js +0 -0
  64. /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  65. /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
  66. /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  67. /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
  68. /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
  69. /package/es/{src/actions → actions}/ui/slides.js +0 -0
  70. /package/es/{src/common → common}/index.d.ts +0 -0
  71. /package/es/{src/common → common}/index.js +0 -0
  72. /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  73. /package/es/{src/configure-store.js → configure-store.js} +0 -0
  74. /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
  75. /package/es/{src/helpers → helpers}/css-register.js +0 -0
  76. /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  77. /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
  78. /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
  79. /package/es/{src/reducers → reducers}/data/index.js +0 -0
  80. /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
  81. /package/es/{src/reducers → reducers}/data/progression.js +0 -0
  82. /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
  83. /package/es/{src/reducers → reducers}/data/rank.js +0 -0
  84. /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
  85. /package/es/{src/reducers → reducers}/data/skills.js +0 -0
  86. /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
  87. /package/es/{src/reducers → reducers}/data/slides.js +0 -0
  88. /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
  89. /package/es/{src/reducers → reducers}/data/token.js +0 -0
  90. /package/es/{src/reducers → reducers}/index.d.ts +0 -0
  91. /package/es/{src/reducers → reducers}/index.js +0 -0
  92. /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  93. /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
  94. /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  95. /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  96. /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
  97. /package/es/{src/reducers → reducers}/ui/index.js +0 -0
  98. /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  99. /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
  100. /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  101. /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
  102. /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  103. /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  104. /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  105. /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  106. /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  107. /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
  108. /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
  109. /package/es/{src/services → services}/fetch-correction.js +0 -0
  110. /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
  111. /package/es/{src/services → services}/fetch-rank.js +0 -0
  112. /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
  113. /package/es/{src/services → services}/fetch-skills.js +0 -0
  114. /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
  115. /package/es/{src/services → services}/fetch-slide.js +0 -0
  116. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  117. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  118. /package/es/{src/services → services}/index.d.ts +0 -0
  119. /package/es/{src/services → services}/index.js +0 -0
  120. /package/es/{src/services → services}/post-answer.d.ts +0 -0
  121. /package/es/{src/services → services}/post-answer.js +0 -0
  122. /package/es/{src/services → services}/post-progression.d.ts +0 -0
  123. /package/es/{src/services → services}/post-progression.js +0 -0
  124. /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  125. /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
  126. /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
  127. /package/es/{src/services → services}/tools/sleep.js +0 -0
  128. /package/es/{src/test → test}/index.test.d.ts +0 -0
  129. /package/es/{src/types → types}/common.js +0 -0
  130. /package/es/{src/types → types}/slides.d.ts +0 -0
  131. /package/es/{src/types → types}/slides.js +0 -0
  132. /package/es/{src/views → views}/skills/index.d.ts +0 -0
  133. /package/es/{src/views → views}/skills/index.js +0 -0
  134. /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  135. /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  136. /package/es/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
  137. /package/es/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
  138. /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  139. /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
  140. /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  141. /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
  142. /package/es/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
  143. /package/es/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
  144. /package/es/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
  145. /package/es/{src/views → views}/slides/test/fixtures/slider.js +0 -0
  146. /package/es/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
  147. /package/es/{src/views → views}/slides/test/fixtures/template.js +0 -0
  148. /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  149. /package/lib/{src/actions → actions}/api/fetch-correction.js +0 -0
  150. /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  151. /package/lib/{src/actions → actions}/api/fetch-rank.js +0 -0
  152. /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  153. /package/lib/{src/actions → actions}/api/fetch-skills.js +0 -0
  154. /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  155. /package/lib/{src/actions → actions}/api/fetch-slide.js +0 -0
  156. /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
  157. /package/lib/{src/actions → actions}/api/post-answer.js +0 -0
  158. /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
  159. /package/lib/{src/actions → actions}/api/post-progression.js +0 -0
  160. /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
  161. /package/lib/{src/actions → actions}/data/token.js +0 -0
  162. /package/lib/{src/actions → actions}/index.d.ts +0 -0
  163. /package/lib/{src/actions → actions}/index.js +0 -0
  164. /package/lib/{src/actions → actions}/test/create-test-store.d.ts +0 -0
  165. /package/lib/{src/actions → actions}/test/create-test-store.js +0 -0
  166. /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
  167. /package/lib/{src/actions → actions}/ui/answers.js +0 -0
  168. /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
  169. /package/lib/{src/actions → actions}/ui/navigation.js +0 -0
  170. /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  171. /package/lib/{src/actions → actions}/ui/next-slide.js +0 -0
  172. /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  173. /package/lib/{src/actions → actions}/ui/quit-popin.js +0 -0
  174. /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
  175. /package/lib/{src/actions → actions}/ui/slides.js +0 -0
  176. /package/lib/{src/common → common}/index.d.ts +0 -0
  177. /package/lib/{src/common → common}/index.js +0 -0
  178. /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  179. /package/lib/{src/configure-store.js → configure-store.js} +0 -0
  180. /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
  181. /package/lib/{src/helpers → helpers}/css-register.js +0 -0
  182. /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  183. /package/lib/{src/reducers → reducers}/data/corrections.js +0 -0
  184. /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
  185. /package/lib/{src/reducers → reducers}/data/index.js +0 -0
  186. /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
  187. /package/lib/{src/reducers → reducers}/data/progression.js +0 -0
  188. /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
  189. /package/lib/{src/reducers → reducers}/data/rank.js +0 -0
  190. /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
  191. /package/lib/{src/reducers → reducers}/data/skills.js +0 -0
  192. /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
  193. /package/lib/{src/reducers → reducers}/data/slides.js +0 -0
  194. /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
  195. /package/lib/{src/reducers → reducers}/data/token.js +0 -0
  196. /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
  197. /package/lib/{src/reducers → reducers}/index.js +0 -0
  198. /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  199. /package/lib/{src/reducers → reducers}/ui/answers.js +0 -0
  200. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  201. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  202. /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
  203. /package/lib/{src/reducers → reducers}/ui/index.js +0 -0
  204. /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  205. /package/lib/{src/reducers → reducers}/ui/navigation.js +0 -0
  206. /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  207. /package/lib/{src/reducers → reducers}/ui/positions.js +0 -0
  208. /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  209. /package/lib/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  210. /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  211. /package/lib/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  212. /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  213. /package/lib/{src/reducers → reducers}/ui/slide.js +0 -0
  214. /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
  215. /package/lib/{src/services → services}/fetch-correction.js +0 -0
  216. /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
  217. /package/lib/{src/services → services}/fetch-rank.js +0 -0
  218. /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
  219. /package/lib/{src/services → services}/fetch-skills.js +0 -0
  220. /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
  221. /package/lib/{src/services → services}/fetch-slide.js +0 -0
  222. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  223. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  224. /package/lib/{src/services → services}/index.d.ts +0 -0
  225. /package/lib/{src/services → services}/index.js +0 -0
  226. /package/lib/{src/services → services}/post-answer.d.ts +0 -0
  227. /package/lib/{src/services → services}/post-answer.js +0 -0
  228. /package/lib/{src/services → services}/post-progression.d.ts +0 -0
  229. /package/lib/{src/services → services}/post-progression.js +0 -0
  230. /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  231. /package/lib/{src/services → services}/tools/fetch-responses.js +0 -0
  232. /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
  233. /package/lib/{src/services → services}/tools/sleep.js +0 -0
  234. /package/lib/{src/test → test}/index.test.d.ts +0 -0
  235. /package/lib/{src/types → types}/common.js +0 -0
  236. /package/lib/{src/types → types}/slides.d.ts +0 -0
  237. /package/lib/{src/types → types}/slides.js +0 -0
  238. /package/lib/{src/views → views}/skills/index.d.ts +0 -0
  239. /package/lib/{src/views → views}/skills/index.js +0 -0
  240. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  241. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  242. /package/lib/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
  243. /package/lib/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
  244. /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  245. /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
  246. /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  247. /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
  248. /package/lib/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
  249. /package/lib/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
  250. /package/lib/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
  251. /package/lib/{src/views → views}/slides/test/fixtures/slider.js +0 -0
  252. /package/lib/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
  253. /package/lib/{src/views → views}/slides/test/fixtures/template.js +0 -0
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { AppOptions } from './types/common';
2
3
  declare const AppReview: ({ options }: {
3
4
  options: AppOptions;
@@ -11,11 +11,11 @@ import { postProgression } from './actions/api/post-progression';
11
11
  import { VIEWS } from './common';
12
12
  import { mapStateToSlidesProps } from './views/slides';
13
13
  import { mapStateToSkillsProps } from './views/skills';
14
- const ConnectedApp = (options) => {
14
+ const ConnectedApp = ({ onQuitClick }) => {
15
15
  const dispatch = useDispatch();
16
16
  const props = {
17
17
  viewName: useSelector((state) => state.ui.navigation[state.ui.navigation.length - 1]),
18
- slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, options)),
18
+ slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, onQuitClick)),
19
19
  skills: useSelector((state) => mapStateToSkillsProps(state)),
20
20
  onboarding: {}
21
21
  };
@@ -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 onQuitClick = options.onQuitClick;
28
28
  useEffect(() => {
29
29
  if (store)
30
30
  return;
@@ -68,6 +68,6 @@ const AppReview = ({ options }) => {
68
68
  if (!store)
69
69
  return null;
70
70
  return (React.createElement(Provider, { store: store },
71
- React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate })));
71
+ React.createElement(ConnectedApp, { onQuitClick: onQuitClick })));
72
72
  };
73
73
  export default AppReview;
@@ -40,7 +40,6 @@ const appOptions = {
40
40
  skillRef: 'skill_NJC0jFKoH',
41
41
  services,
42
42
  onQuitClick: identity,
43
- translate: key => key,
44
43
  url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
45
44
  };
46
45
  test('should show the loader while the app is fetching the data', async (t) => {
@@ -5,4 +5,3 @@ export declare const incorrectFreeTextPostAnswerResponse: ProgressionFromAPI;
5
5
  export declare const progressionSlideWithPendingSlide: ProgressionFromAPI;
6
6
  export declare const getChoicesCorrection: (ref: string, wrongChoice?: boolean) => CorrectionFromAPI;
7
7
  export declare const services: Services;
8
- export declare const translate: (key: string) => string;
@@ -442,4 +442,3 @@ export const services = {
442
442
  fetchRank: () => Promise.resolve(fetchRankResponse),
443
443
  fetchSlidesToReviewBySkillRef: () => Promise.resolve(fetchSlidesToReviewBySkillRefResponse)
444
444
  };
445
- export const translate = (key) => `___${key}`;
@@ -139,14 +139,11 @@ export declare type Services = {
139
139
  export declare type Options = {
140
140
  services: Services;
141
141
  };
142
- export declare type ConnectedOptions = {
143
- translate: (key: string, data?: unknown) => string;
144
- onQuitClick: Function;
145
- };
146
- export declare type AppOptions = ConnectedOptions & {
142
+ export declare type AppOptions = {
147
143
  token: string;
148
144
  skillRef?: string;
149
145
  services: Services;
146
+ onQuitClick: Function;
150
147
  url: string;
151
148
  };
152
149
  export declare type JWT = {
@@ -1,5 +1,4 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { ConnectedOptions } from '../../types/common';
3
2
  import { type SlideIndexes } from '../../common';
4
3
  import type { StoreState } from '../../reducers';
5
4
  import type { AnswerUI } from '../../types/slides';
@@ -139,5 +138,5 @@ export declare type CongratsProps = {
139
138
  };
140
139
  export declare const initialState: SlidesStack;
141
140
  export declare const buildStepItems: (state: StoreState) => StepItem[];
142
- export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, options: ConnectedOptions) => SlidesViewProps;
141
+ export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, onQuitClick: Function) => SlidesViewProps;
143
142
  export {};
@@ -166,22 +166,22 @@ export const buildStepItems = (state) => {
166
166
  });
167
167
  return steps;
168
168
  };
169
- const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, translate) => {
169
+ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf) => {
170
170
  return {
171
171
  klf: isCorrect
172
172
  ? undefined
173
173
  : {
174
- label: translate('KLF'),
174
+ label: '_klf',
175
175
  tooltip: klf
176
176
  },
177
- resultLabel: isCorrect ? translate('Correct Answer') : translate('Wrong Answer'),
177
+ resultLabel: isCorrect ? '_right' : '_wrong',
178
178
  information: {
179
- label: isCorrect ? translate('KLF') : translate('Correct Answer'),
179
+ label: isCorrect ? '_klf' : '_correctAnswer',
180
180
  message: isCorrect ? klf : join(',', correctAnswer)
181
181
  },
182
182
  next: {
183
- ariaLabel: translate('Next Question'),
184
- label: translate('Next Question'),
183
+ ariaLabel: '_correctionNextAriaLabel',
184
+ label: '_correctionNextLabel',
185
185
  onClick: () => {
186
186
  dispatch(nextSlide);
187
187
  }
@@ -214,7 +214,7 @@ const buildQuitPopinProps = (dispatch) => (onQuitClick) => {
214
214
  }
215
215
  };
216
216
  };
217
- const buildRankCard = (rank, translate) => {
217
+ const buildRankCard = (rank) => {
218
218
  return {
219
219
  'aria-label': 'Review Card Congrats Container',
220
220
  'data-name': 'card-rank',
@@ -229,13 +229,13 @@ const buildRankCard = (rank, translate) => {
229
229
  cardType: 'card-rank',
230
230
  iconAriaLabel: 'Image without information',
231
231
  className: undefined,
232
- reviewCardTitle: translate('You are now'),
232
+ reviewCardTitle: 'You are now',
233
233
  reviewCardValue: `${rank}`,
234
234
  rankSuffix: 'th',
235
235
  timerAnimation: 200
236
236
  };
237
237
  };
238
- const buildCongratsProps = (state, translate) => {
238
+ const buildCongratsProps = (state) => {
239
239
  if (!state.ui.showCongrats)
240
240
  return;
241
241
  const progression = state.data.progression;
@@ -258,18 +258,18 @@ const buildCongratsProps = (state, translate) => {
258
258
  iconAriaLabel: 'Image without information',
259
259
  className: undefined,
260
260
  cardType: 'card-star',
261
- reviewCardTitle: translate('You have won'),
261
+ reviewCardTitle: 'You have won',
262
262
  reviewCardValue: `${stars}`,
263
263
  timerAnimation: 200
264
264
  };
265
265
  const { start, end } = state.data.rank;
266
266
  const newRank = start - end;
267
- const cardCongratsRank = !Number.isNaN(newRank) && newRank > 0 ? buildRankCard(end, translate) : undefined;
267
+ const cardCongratsRank = !Number.isNaN(newRank) && newRank > 0 ? buildRankCard(end) : undefined;
268
268
  return {
269
269
  'aria-label': 'Review Congratulations',
270
270
  'data-name': 'review-congrats',
271
271
  animationLottie: confettiAnimation,
272
- title: translate('Congratulations!'),
272
+ title: 'Congratulations!',
273
273
  cardCongratsStar,
274
274
  cardCongratsRank,
275
275
  buttonRevising: undefined,
@@ -281,8 +281,7 @@ const isEndOfProgression = (progression) => {
281
281
  return false;
282
282
  return progression.state.nextContent.ref === 'successExitNode';
283
283
  };
284
- export const mapStateToSlidesProps = (state, dispatch, options) => {
285
- const { translate, onQuitClick } = options;
284
+ export const mapStateToSlidesProps = (state, dispatch, onQuitClick) => {
286
285
  const currentSlideRef = getCurrentSlideRef(state);
287
286
  const endReview = isEndOfProgression(state.data.progression);
288
287
  const correction = get(['data', 'corrections', currentSlideRef], state);
@@ -291,8 +290,8 @@ export const mapStateToSlidesProps = (state, dispatch, options) => {
291
290
  const showQuitPopin = get(['ui', 'showQuitPopin'], state);
292
291
  return {
293
292
  header: {
294
- mode: translate('Review Title'),
295
- skillName: translate('Content Parent Title'),
293
+ mode: '__revision_mode',
294
+ skillName: '__agility',
296
295
  onQuitClick: () => dispatch(openQuitPopin),
297
296
  'aria-label': 'aria-header-wrapper',
298
297
  closeButtonAriaLabel: 'aria-close-button',
@@ -301,17 +300,16 @@ export const mapStateToSlidesProps = (state, dispatch, options) => {
301
300
  stack: {
302
301
  slides: buildStackSlides(state, dispatch),
303
302
  validateButton: {
304
- label: translate('Validate'),
303
+ label: '__validate',
305
304
  disabled: !get(['ui', 'slide', currentSlideRef, 'validateButton'], state),
306
305
  onClick: () => {
307
306
  dispatch(postAnswer);
308
307
  }
309
308
  },
310
- correctionPopinProps: correction &&
311
- getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, options.translate),
309
+ correctionPopinProps: correction && getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf),
312
310
  endReview: endReview && state.ui.showCongrats
313
311
  },
314
- congrats: buildCongratsProps(state, options.translate),
312
+ congrats: buildCongratsProps(state),
315
313
  quitPopin: showQuitPopin ? buildQuitPopinProps(dispatch)(onQuitClick) : undefined
316
314
  };
317
315
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { AppOptions } from './types/common';
2
3
  declare const AppReview: ({ options }: {
3
4
  options: AppOptions;
@@ -22,11 +22,12 @@ import { postProgression } from './actions/api/post-progression';
22
22
  import { VIEWS } from './common';
23
23
  import { mapStateToSlidesProps } from './views/slides';
24
24
  import { mapStateToSkillsProps } from './views/skills';
25
- var ConnectedApp = function (options) {
25
+ var ConnectedApp = function (_a) {
26
+ var onQuitClick = _a.onQuitClick;
26
27
  var dispatch = useDispatch();
27
28
  var props = {
28
29
  viewName: useSelector(function (state) { return state.ui.navigation[state.ui.navigation.length - 1]; }),
29
- slides: useSelector(function (state) { return mapStateToSlidesProps(state, dispatch, options); }),
30
+ slides: useSelector(function (state) { return mapStateToSlidesProps(state, dispatch, onQuitClick); }),
30
31
  skills: useSelector(function (state) { return mapStateToSkillsProps(state); }),
31
32
  onboarding: {}
32
33
  };
@@ -36,7 +37,7 @@ var AppReview = function (_a) {
36
37
  var options = _a.options;
37
38
  var _b = useState(null), store = _b[0], setStore = _b[1];
38
39
  var _c = useState(false), isProgressionCreated = _c[0], setIsProgressionCreated = _c[1];
39
- var translate = options.translate, onQuitClick = options.onQuitClick;
40
+ var onQuitClick = options.onQuitClick;
40
41
  useEffect(function () {
41
42
  if (store)
42
43
  return;
@@ -80,6 +81,6 @@ var AppReview = function (_a) {
80
81
  if (!store)
81
82
  return null;
82
83
  return (React.createElement(Provider, { store: store },
83
- React.createElement(ConnectedApp, { onQuitClick: onQuitClick, translate: translate })));
84
+ React.createElement(ConnectedApp, { onQuitClick: onQuitClick })));
84
85
  };
85
86
  export default AppReview;
@@ -135,7 +135,6 @@ var appOptions = {
135
135
  skillRef: 'skill_NJC0jFKoH',
136
136
  services: services,
137
137
  onQuitClick: identity,
138
- translate: function (key) { return key; },
139
138
  url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
140
139
  };
141
140
  test('should show the loader while the app is fetching the data', function (t) { return __awaiter(void 0, void 0, void 0, function () {
@@ -5,4 +5,3 @@ export declare const incorrectFreeTextPostAnswerResponse: ProgressionFromAPI;
5
5
  export declare const progressionSlideWithPendingSlide: ProgressionFromAPI;
6
6
  export declare const getChoicesCorrection: (ref: string, wrongChoice?: boolean) => CorrectionFromAPI;
7
7
  export declare const services: Services;
8
- export declare const translate: (key: string) => string;
@@ -446,4 +446,3 @@ export var services = {
446
446
  fetchRank: function () { return Promise.resolve(fetchRankResponse); },
447
447
  fetchSlidesToReviewBySkillRef: function () { return Promise.resolve(fetchSlidesToReviewBySkillRefResponse); }
448
448
  };
449
- export var translate = function (key) { return "___".concat(key); };
@@ -139,14 +139,11 @@ export declare type Services = {
139
139
  export declare type Options = {
140
140
  services: Services;
141
141
  };
142
- export declare type ConnectedOptions = {
143
- translate: (key: string, data?: unknown) => string;
144
- onQuitClick: Function;
145
- };
146
- export declare type AppOptions = ConnectedOptions & {
142
+ export declare type AppOptions = {
147
143
  token: string;
148
144
  skillRef?: string;
149
145
  services: Services;
146
+ onQuitClick: Function;
150
147
  url: string;
151
148
  };
152
149
  export declare type JWT = {
@@ -1,5 +1,4 @@
1
1
  import type { Dispatch } from 'redux';
2
- import type { ConnectedOptions } from '../../types/common';
3
2
  import { type SlideIndexes } from '../../common';
4
3
  import type { StoreState } from '../../reducers';
5
4
  import type { AnswerUI } from '../../types/slides';
@@ -139,5 +138,5 @@ export declare type CongratsProps = {
139
138
  };
140
139
  export declare const initialState: SlidesStack;
141
140
  export declare const buildStepItems: (state: StoreState) => StepItem[];
142
- export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, options: ConnectedOptions) => SlidesViewProps;
141
+ export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, onQuitClick: Function) => SlidesViewProps;
143
142
  export {};
@@ -161,22 +161,22 @@ export var buildStepItems = function (state) {
161
161
  return steps;
162
162
  };
163
163
  var getCorrectionPopinProps = function (dispatch) {
164
- return function (isCorrect, correctAnswer, klf, translate) {
164
+ return function (isCorrect, correctAnswer, klf) {
165
165
  return {
166
166
  klf: isCorrect
167
167
  ? undefined
168
168
  : {
169
- label: translate('KLF'),
169
+ label: '_klf',
170
170
  tooltip: klf
171
171
  },
172
- resultLabel: isCorrect ? translate('Correct Answer') : translate('Wrong Answer'),
172
+ resultLabel: isCorrect ? '_right' : '_wrong',
173
173
  information: {
174
- label: isCorrect ? translate('KLF') : translate('Correct Answer'),
174
+ label: isCorrect ? '_klf' : '_correctAnswer',
175
175
  message: isCorrect ? klf : join(',', correctAnswer)
176
176
  },
177
177
  next: {
178
- ariaLabel: translate('Next Question'),
179
- label: translate('Next Question'),
178
+ ariaLabel: '_correctionNextAriaLabel',
179
+ label: '_correctionNextLabel',
180
180
  onClick: function () {
181
181
  dispatch(nextSlide);
182
182
  }
@@ -212,7 +212,7 @@ var buildQuitPopinProps = function (dispatch) {
212
212
  };
213
213
  };
214
214
  };
215
- var buildRankCard = function (rank, translate) {
215
+ var buildRankCard = function (rank) {
216
216
  return {
217
217
  'aria-label': 'Review Card Congrats Container',
218
218
  'data-name': 'card-rank',
@@ -227,13 +227,13 @@ var buildRankCard = function (rank, translate) {
227
227
  cardType: 'card-rank',
228
228
  iconAriaLabel: 'Image without information',
229
229
  className: undefined,
230
- reviewCardTitle: translate('You are now'),
230
+ reviewCardTitle: 'You are now',
231
231
  reviewCardValue: "".concat(rank),
232
232
  rankSuffix: 'th',
233
233
  timerAnimation: 200
234
234
  };
235
235
  };
236
- var buildCongratsProps = function (state, translate) {
236
+ var buildCongratsProps = function (state) {
237
237
  if (!state.ui.showCongrats)
238
238
  return;
239
239
  var progression = state.data.progression;
@@ -256,18 +256,18 @@ var buildCongratsProps = function (state, translate) {
256
256
  iconAriaLabel: 'Image without information',
257
257
  className: undefined,
258
258
  cardType: 'card-star',
259
- reviewCardTitle: translate('You have won'),
259
+ reviewCardTitle: 'You have won',
260
260
  reviewCardValue: "".concat(stars),
261
261
  timerAnimation: 200
262
262
  };
263
263
  var _a = state.data.rank, start = _a.start, end = _a.end;
264
264
  var newRank = start - end;
265
- var cardCongratsRank = !Number.isNaN(newRank) && newRank > 0 ? buildRankCard(end, translate) : undefined;
265
+ var cardCongratsRank = !Number.isNaN(newRank) && newRank > 0 ? buildRankCard(end) : undefined;
266
266
  return {
267
267
  'aria-label': 'Review Congratulations',
268
268
  'data-name': 'review-congrats',
269
269
  animationLottie: confettiAnimation,
270
- title: translate('Congratulations!'),
270
+ title: 'Congratulations!',
271
271
  cardCongratsStar: cardCongratsStar,
272
272
  cardCongratsRank: cardCongratsRank,
273
273
  buttonRevising: undefined,
@@ -279,8 +279,7 @@ var isEndOfProgression = function (progression) {
279
279
  return false;
280
280
  return progression.state.nextContent.ref === 'successExitNode';
281
281
  };
282
- export var mapStateToSlidesProps = function (state, dispatch, options) {
283
- var translate = options.translate, onQuitClick = options.onQuitClick;
282
+ export var mapStateToSlidesProps = function (state, dispatch, onQuitClick) {
284
283
  var currentSlideRef = getCurrentSlideRef(state);
285
284
  var endReview = isEndOfProgression(state.data.progression);
286
285
  var correction = get(['data', 'corrections', currentSlideRef], state);
@@ -289,8 +288,8 @@ export var mapStateToSlidesProps = function (state, dispatch, options) {
289
288
  var showQuitPopin = get(['ui', 'showQuitPopin'], state);
290
289
  return {
291
290
  header: {
292
- mode: translate('Review Title'),
293
- skillName: translate('Content Parent Title'),
291
+ mode: '__revision_mode',
292
+ skillName: '__agility',
294
293
  onQuitClick: function () { return dispatch(openQuitPopin); },
295
294
  'aria-label': 'aria-header-wrapper',
296
295
  closeButtonAriaLabel: 'aria-close-button',
@@ -299,17 +298,16 @@ export var mapStateToSlidesProps = function (state, dispatch, options) {
299
298
  stack: {
300
299
  slides: buildStackSlides(state, dispatch),
301
300
  validateButton: {
302
- label: translate('Validate'),
301
+ label: '__validate',
303
302
  disabled: !get(['ui', 'slide', currentSlideRef, 'validateButton'], state),
304
303
  onClick: function () {
305
304
  dispatch(postAnswer);
306
305
  }
307
306
  },
308
- correctionPopinProps: correction &&
309
- getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf, options.translate),
307
+ correctionPopinProps: correction && getCorrectionPopinProps(dispatch)(isCorrect, correction.correctAnswer, klf),
310
308
  endReview: endReview && state.ui.showCongrats
311
309
  },
312
- congrats: buildCongratsProps(state, options.translate),
310
+ congrats: buildCongratsProps(state),
313
311
  quitPopin: showQuitPopin ? buildQuitPopinProps(dispatch)(onQuitClick) : undefined
314
312
  };
315
313
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.5.6-alpha.9+0b1916fe7",
3
+ "version": "0.5.6",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -30,7 +30,6 @@
30
30
  "lib",
31
31
  "es",
32
32
  "src",
33
- "locales",
34
33
  "readme.md"
35
34
  ],
36
35
  "main": "./es/index.js",
@@ -40,13 +39,11 @@
40
39
  "commonjs": "./lib/index.js",
41
40
  "types": "./es/index.d.ts"
42
41
  },
43
- "./package.json": "./package.json",
44
- "./locales/en/review.json": "./locales/en/review.json"
42
+ "./package.json": "./package.json"
45
43
  },
46
44
  "dependencies": {
47
- "@coorpacademy/components": "10.24.4",
45
+ "@coorpacademy/components": "10.24.5",
48
46
  "@coorpacademy/redux-task": "1.1.6",
49
- "@coorpacademy/translate": "6.1.5",
50
47
  "cross-fetch": "^3.1.5",
51
48
  "jwt-decode": "^3.1.2",
52
49
  "react-redux": "^7.2.9",
@@ -80,5 +77,5 @@
80
77
  "webpack-cli": "^4.10.0",
81
78
  "webpack-dev-server": "^4.11.1"
82
79
  },
83
- "gitHead": "0b1916fe74bf3a250dc021360c84ce87db32b6d6"
80
+ "gitHead": "56b61ee3e78d9670cb28ab04d0a912779a265a78"
84
81
  }
package/src/index.tsx CHANGED
@@ -8,7 +8,7 @@ import isEmpty from 'lodash/fp/isEmpty';
8
8
  import get from 'lodash/fp/get';
9
9
  import configureStore from './configure-store';
10
10
 
11
- import type {AppOptions, ConnectedOptions} from './types/common';
11
+ import type {AppOptions} from './types/common';
12
12
  import type {StoreState} from './reducers';
13
13
 
14
14
  import {navigateTo, ViewPath} from './actions/ui/navigation';
@@ -19,13 +19,14 @@ import {VIEWS} from './common';
19
19
  import {mapStateToSlidesProps} from './views/slides';
20
20
  import {mapStateToSkillsProps} from './views/skills';
21
21
 
22
- const ConnectedApp = (options: ConnectedOptions): JSX.Element => {
22
+ const ConnectedApp = ({onQuitClick}: {onQuitClick: Function}): JSX.Element => {
23
23
  const dispatch = useDispatch();
24
+
24
25
  const props = {
25
26
  viewName: useSelector(
26
27
  (state: StoreState) => state.ui.navigation[state.ui.navigation.length - 1]
27
28
  ),
28
- slides: useSelector((state: StoreState) => mapStateToSlidesProps(state, dispatch, options)),
29
+ slides: useSelector((state: StoreState) => mapStateToSlidesProps(state, dispatch, onQuitClick)),
29
30
  skills: useSelector((state: StoreState) => mapStateToSkillsProps(state)),
30
31
  onboarding: {}
31
32
  };
@@ -36,7 +37,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
36
37
  const [store, setStore] = useState<Store<StoreState, AnyAction> | null>(null);
37
38
  const [isProgressionCreated, setIsProgressionCreated] = useState(false);
38
39
 
39
- const {translate, onQuitClick} = options;
40
+ const onQuitClick = options.onQuitClick;
40
41
 
41
42
  useEffect(() => {
42
43
  if (store) return;
@@ -89,7 +90,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
89
90
 
90
91
  return (
91
92
  <Provider store={store}>
92
- <ConnectedApp onQuitClick={onQuitClick} translate={translate} />
93
+ <ConnectedApp onQuitClick={onQuitClick} />
93
94
  </Provider>
94
95
  );
95
96
  };
@@ -62,7 +62,6 @@ const appOptions: AppOptions = {
62
62
  skillRef: 'skill_NJC0jFKoH',
63
63
  services,
64
64
  onQuitClick: identity,
65
- translate: key => key,
66
65
  url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
67
66
  };
68
67
 
@@ -463,5 +463,3 @@ export const services: Services = {
463
463
  fetchRank: () => Promise.resolve(fetchRankResponse),
464
464
  fetchSlidesToReviewBySkillRef: () => Promise.resolve(fetchSlidesToReviewBySkillRefResponse)
465
465
  };
466
-
467
- export const translate = (key: string): string => `___${key}`;
@@ -179,15 +179,11 @@ export type Options = {
179
179
  services: Services;
180
180
  };
181
181
 
182
- export type ConnectedOptions = {
183
- translate: (key: string, data?: unknown) => string;
184
- onQuitClick: Function;
185
- };
186
-
187
- export type AppOptions = ConnectedOptions & {
182
+ export type AppOptions = {
188
183
  token: string;
189
184
  skillRef?: string;
190
185
  services: Services;
186
+ onQuitClick: Function;
191
187
  url: string;
192
188
  };
193
189
 
@@ -2,4 +2,3 @@ declare module '*.css';
2
2
  declare module 'browser-env';
3
3
  declare module '@coorpacademy/components/es/*';
4
4
  declare module '@coorpacademy/redux-task';
5
- declare module '@coorpacademy/translate';