@coorpacademy/app-review 0.1.14 → 0.1.16

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 (295) hide show
  1. package/es/actions/api/fetch-skills.d.ts +4 -6
  2. package/es/actions/api/fetch-skills.js +7 -4
  3. package/es/actions/api/fetch-slide.d.ts +14 -7
  4. package/es/actions/api/fetch-slide.js +27 -4
  5. package/es/actions/api/post-progression.d.ts +4 -6
  6. package/es/actions/api/post-progression.js +13 -9
  7. package/es/actions/api/test/create-test-store.d.ts +5 -0
  8. package/es/actions/api/test/create-test-store.js +16 -0
  9. package/es/actions/api/test/fetch-skills.test.js +54 -0
  10. package/es/actions/api/test/fetch-slide.test.js +61 -0
  11. package/es/actions/api/test/post-progression.test.js +102 -0
  12. package/es/actions/index.d.ts +1 -10
  13. package/es/actions/ui/answers.d.ts +7 -0
  14. package/es/actions/ui/answers.js +7 -0
  15. package/es/actions/ui/is-fetching.js +0 -2
  16. package/es/actions/ui/slides.d.ts +26 -0
  17. package/es/actions/ui/slides.js +9 -0
  18. package/es/common/index.d.ts +3 -1
  19. package/es/common/index.js +3 -1
  20. package/es/fixtures/qcm-slide.d.ts +2 -2
  21. package/es/fixtures/temp-fixture.d.ts +2 -2
  22. package/es/index.js +22 -92
  23. package/es/reducers/data/index.d.ts +2 -2
  24. package/es/reducers/data/progression.d.ts +3 -16
  25. package/es/reducers/data/progression.js +3 -22
  26. package/es/reducers/data/slides.d.ts +5 -6
  27. package/es/reducers/data/slides.js +9 -108
  28. package/es/reducers/data/test/progression.test.js +38 -0
  29. package/es/reducers/data/test/skills.test.js +12 -0
  30. package/es/reducers/data/test/slides.test.js +20 -0
  31. package/es/reducers/data/test/token.test.js +11 -0
  32. package/es/reducers/index.d.ts +3 -4
  33. package/es/reducers/ui/answers.d.ts +4 -0
  34. package/es/reducers/ui/{review-status.js → answers.js} +3 -3
  35. package/es/reducers/ui/current-slide-ref.d.ts +4 -0
  36. package/es/reducers/ui/current-slide-ref.js +13 -0
  37. package/es/reducers/ui/index.d.ts +7 -10
  38. package/es/reducers/ui/index.js +4 -6
  39. package/es/reducers/ui/test/answers.test.js +11 -0
  40. package/es/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
  41. package/es/reducers/ui/test/current-slide-ref.test.js +12 -0
  42. package/es/reducers/ui/test/navigation.test.d.ts +1 -0
  43. package/es/reducers/ui/test/navigation.test.js +15 -0
  44. package/es/services/fetch-slide.js +1 -1
  45. package/es/services/index.js +3 -1
  46. package/es/services/post-answer.d.ts +2 -0
  47. package/es/services/post-answer.js +18 -0
  48. package/es/services/test/fetch-slide.test.d.ts +1 -0
  49. package/es/services/test/fetch-slide.test.js +22 -0
  50. package/es/services/test/post-answer.test.d.ts +1 -0
  51. package/es/services/test/post-answer.test.js +57 -0
  52. package/es/services/test/post-progression.test.js +14 -4
  53. package/es/test/util/services.mock.js +46 -4
  54. package/es/types/common.d.ts +61 -30
  55. package/es/types/common.js +0 -5
  56. package/es/types/slides.d.ts +0 -4
  57. package/{lib/types/views/skills.d.ts → es/views/skills/index.d.ts} +2 -0
  58. package/es/views/skills/index.js +25 -0
  59. package/es/views/slides/index.d.ts +79 -0
  60. package/es/views/slides/index.js +151 -0
  61. package/es/views/slides/map-api-slide-to-ui.d.ts +8 -0
  62. package/es/views/slides/map-api-slide-to-ui.js +172 -0
  63. package/es/views/slides/test/fixtures/free-text.d.ts +3 -0
  64. package/es/views/slides/test/fixtures/free-text.js +38 -0
  65. package/es/views/slides/test/fixtures/qcm-drag.d.ts +3 -0
  66. package/es/views/slides/test/fixtures/qcm-drag.js +108 -0
  67. package/es/views/slides/test/fixtures/qcm-graphic.d.ts +3 -0
  68. package/es/views/slides/test/fixtures/qcm-graphic.js +88 -0
  69. package/es/views/slides/test/fixtures/qcm.d.ts +3 -0
  70. package/es/{helpers → views/slides}/test/fixtures/qcm.js +37 -27
  71. package/es/views/slides/test/fixtures/select-template.d.ts +3 -0
  72. package/es/views/slides/test/fixtures/select-template.js +92 -0
  73. package/es/views/slides/test/fixtures/slider.d.ts +3 -0
  74. package/es/views/slides/test/fixtures/slider.js +36 -0
  75. package/es/views/slides/test/fixtures/text-template.d.ts +3 -0
  76. package/es/{helpers → views/slides}/test/fixtures/text-template.js +21 -11
  77. package/es/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
  78. package/es/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
  79. package/lib/actions/api/fetch-skills.d.ts +4 -6
  80. package/lib/actions/api/fetch-skills.js +55 -7
  81. package/lib/actions/api/fetch-slide.d.ts +14 -7
  82. package/lib/actions/api/fetch-slide.js +75 -7
  83. package/lib/actions/api/post-progression.d.ts +4 -6
  84. package/lib/actions/api/post-progression.js +63 -10
  85. package/lib/actions/api/test/create-test-store.d.ts +5 -0
  86. package/lib/actions/api/test/create-test-store.js +18 -0
  87. package/lib/actions/api/test/fetch-skills.test.d.ts +1 -0
  88. package/lib/actions/api/test/fetch-skills.test.js +113 -0
  89. package/lib/actions/api/test/fetch-slide.test.d.ts +1 -0
  90. package/lib/actions/api/test/fetch-slide.test.js +120 -0
  91. package/lib/actions/api/test/post-progression.test.d.ts +1 -0
  92. package/lib/actions/api/test/post-progression.test.js +160 -0
  93. package/lib/actions/index.d.ts +1 -10
  94. package/lib/actions/ui/answers.d.ts +7 -0
  95. package/lib/actions/ui/answers.js +9 -0
  96. package/lib/actions/ui/is-fetching.js +0 -2
  97. package/lib/actions/ui/slides.d.ts +26 -0
  98. package/lib/actions/ui/slides.js +9 -0
  99. package/lib/common/index.d.ts +3 -1
  100. package/lib/common/index.js +3 -1
  101. package/lib/fixtures/qcm-slide.d.ts +2 -2
  102. package/lib/fixtures/temp-fixture.d.ts +2 -2
  103. package/lib/index.js +33 -94
  104. package/lib/reducers/data/index.d.ts +2 -2
  105. package/lib/reducers/data/progression.d.ts +3 -16
  106. package/lib/reducers/data/progression.js +3 -22
  107. package/lib/reducers/data/slides.d.ts +5 -6
  108. package/lib/reducers/data/slides.js +9 -114
  109. package/lib/reducers/data/test/progression.test.d.ts +1 -0
  110. package/lib/reducers/data/test/progression.test.js +38 -0
  111. package/lib/reducers/data/test/skills.test.d.ts +1 -0
  112. package/lib/reducers/data/test/skills.test.js +12 -0
  113. package/lib/reducers/data/test/slides.test.d.ts +1 -0
  114. package/lib/reducers/data/test/slides.test.js +20 -0
  115. package/lib/reducers/data/test/token.test.d.ts +1 -0
  116. package/lib/reducers/data/test/token.test.js +11 -0
  117. package/lib/reducers/index.d.ts +3 -4
  118. package/lib/reducers/ui/answers.d.ts +4 -0
  119. package/lib/reducers/ui/{review-status.js → answers.js} +3 -3
  120. package/lib/reducers/ui/current-slide-ref.d.ts +4 -0
  121. package/lib/reducers/ui/current-slide-ref.js +14 -0
  122. package/lib/reducers/ui/index.d.ts +7 -10
  123. package/lib/reducers/ui/index.js +4 -6
  124. package/lib/reducers/ui/test/answers.test.d.ts +1 -0
  125. package/lib/reducers/ui/test/answers.test.js +11 -0
  126. package/lib/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
  127. package/lib/reducers/ui/test/current-slide-ref.test.js +12 -0
  128. package/lib/reducers/ui/test/navigation.test.d.ts +1 -0
  129. package/lib/reducers/ui/test/navigation.test.js +15 -0
  130. package/lib/services/fetch-slide.js +1 -1
  131. package/lib/services/index.js +3 -1
  132. package/lib/services/post-answer.d.ts +2 -0
  133. package/lib/services/post-answer.js +62 -0
  134. package/lib/services/test/fetch-slide.test.d.ts +1 -0
  135. package/lib/services/test/fetch-slide.test.js +76 -0
  136. package/lib/services/test/post-answer.test.d.ts +1 -0
  137. package/lib/services/test/post-answer.test.js +111 -0
  138. package/lib/services/test/post-progression.test.js +14 -4
  139. package/lib/test/util/services.mock.js +46 -4
  140. package/lib/types/common.d.ts +61 -30
  141. package/lib/types/common.js +0 -5
  142. package/lib/types/slides.d.ts +0 -4
  143. package/{es/types/views/skills.d.ts → lib/views/skills/index.d.ts} +2 -0
  144. package/lib/views/skills/index.js +25 -0
  145. package/lib/views/slides/index.d.ts +79 -0
  146. package/lib/views/slides/index.js +155 -0
  147. package/lib/views/slides/map-api-slide-to-ui.d.ts +8 -0
  148. package/lib/views/slides/map-api-slide-to-ui.js +178 -0
  149. package/lib/views/slides/test/fixtures/free-text.d.ts +3 -0
  150. package/lib/views/slides/test/fixtures/free-text.js +38 -0
  151. package/lib/views/slides/test/fixtures/qcm-drag.d.ts +3 -0
  152. package/lib/views/slides/test/fixtures/qcm-drag.js +108 -0
  153. package/lib/views/slides/test/fixtures/qcm-graphic.d.ts +3 -0
  154. package/lib/views/slides/test/fixtures/qcm-graphic.js +88 -0
  155. package/lib/views/slides/test/fixtures/qcm.d.ts +3 -0
  156. package/lib/{helpers → views/slides}/test/fixtures/qcm.js +37 -27
  157. package/lib/views/slides/test/fixtures/select-template.d.ts +3 -0
  158. package/lib/views/slides/test/fixtures/select-template.js +92 -0
  159. package/lib/views/slides/test/fixtures/slider.d.ts +3 -0
  160. package/lib/views/slides/test/fixtures/slider.js +36 -0
  161. package/lib/views/slides/test/fixtures/text-template.d.ts +3 -0
  162. package/lib/{helpers → views/slides}/test/fixtures/text-template.js +21 -11
  163. package/lib/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
  164. package/lib/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
  165. package/package.json +4 -3
  166. package/src/actions/api/fetch-skills.ts +12 -12
  167. package/src/actions/api/fetch-slide.ts +38 -13
  168. package/src/actions/api/post-progression.ts +18 -22
  169. package/src/actions/api/test/create-test-store.ts +25 -0
  170. package/src/actions/api/test/fetch-skills.test.ts +70 -0
  171. package/src/actions/api/test/fetch-slide.test.ts +77 -0
  172. package/src/actions/api/test/post-progression.test.ts +119 -0
  173. package/src/actions/index.ts +1 -10
  174. package/src/actions/ui/answers.ts +16 -0
  175. package/src/actions/ui/is-fetching.ts +0 -6
  176. package/src/actions/ui/slides.ts +35 -0
  177. package/src/common/index.ts +7 -1
  178. package/src/fixtures/qcm-slide.ts +2 -2
  179. package/src/fixtures/temp-fixture.ts +2 -2
  180. package/src/index.tsx +26 -110
  181. package/src/reducers/data/index.ts +1 -1
  182. package/src/reducers/data/progression.ts +5 -40
  183. package/src/reducers/data/slides.ts +17 -125
  184. package/src/reducers/data/test/progression.test.ts +42 -0
  185. package/src/reducers/data/test/skills.test.ts +14 -0
  186. package/src/reducers/data/test/slides.test.ts +26 -0
  187. package/src/reducers/data/test/token.test.ts +13 -0
  188. package/src/reducers/ui/answers.ts +19 -0
  189. package/src/reducers/ui/current-slide-ref.ts +19 -0
  190. package/src/reducers/ui/index.ts +6 -9
  191. package/src/reducers/ui/test/answers.test.ts +13 -0
  192. package/src/reducers/ui/test/current-slide-ref.test.ts +14 -0
  193. package/src/reducers/ui/test/navigation.test.ts +19 -0
  194. package/src/services/fetch-slide.ts +1 -1
  195. package/src/services/index.ts +3 -1
  196. package/src/services/post-answer.ts +27 -0
  197. package/src/services/test/fetch-slide.test.ts +30 -0
  198. package/src/services/test/post-answer.test.ts +68 -0
  199. package/src/services/test/post-progression.test.ts +14 -4
  200. package/src/test/util/services.mock.ts +46 -4
  201. package/src/types/common.ts +77 -40
  202. package/src/types/slides.ts +0 -5
  203. package/src/views/skills/index.ts +56 -0
  204. package/src/views/slides/index.ts +251 -0
  205. package/src/views/slides/map-api-slide-to-ui.ts +251 -0
  206. package/src/views/slides/test/fixtures/free-text.ts +43 -0
  207. package/src/views/slides/test/fixtures/qcm-drag.ts +111 -0
  208. package/src/views/slides/test/fixtures/qcm-graphic.ts +94 -0
  209. package/src/{helpers → views/slides}/test/fixtures/qcm.ts +43 -33
  210. package/src/views/slides/test/fixtures/select-template.ts +98 -0
  211. package/src/views/slides/test/fixtures/slider.ts +41 -0
  212. package/src/{helpers → views/slides}/test/fixtures/text-template.ts +23 -14
  213. package/src/{helpers → views/slides}/test/map-api-slide-to-ui.test.ts +22 -20
  214. package/es/actions/data/slides.d.ts +0 -37
  215. package/es/actions/data/slides.js +0 -16
  216. package/es/actions/ui/finished-slides.d.ts +0 -10
  217. package/es/actions/ui/finished-slides.js +0 -8
  218. package/es/actions/ui/review-status.d.ts +0 -7
  219. package/es/actions/ui/review-status.js +0 -7
  220. package/es/actions/ui/step-items.d.ts +0 -24
  221. package/es/actions/ui/step-items.js +0 -11
  222. package/es/helpers/map-api-slide-to-ui.d.ts +0 -8
  223. package/es/helpers/map-api-slide-to-ui.js +0 -175
  224. package/es/helpers/test/fixtures/free-text.d.ts +0 -4
  225. package/es/helpers/test/fixtures/free-text.js +0 -24
  226. package/es/helpers/test/fixtures/qcm-drag.d.ts +0 -4
  227. package/es/helpers/test/fixtures/qcm-drag.js +0 -106
  228. package/es/helpers/test/fixtures/qcm-graphic.d.ts +0 -4
  229. package/es/helpers/test/fixtures/qcm-graphic.js +0 -70
  230. package/es/helpers/test/fixtures/qcm.d.ts +0 -4
  231. package/es/helpers/test/fixtures/select-template.d.ts +0 -4
  232. package/es/helpers/test/fixtures/select-template.js +0 -88
  233. package/es/helpers/test/fixtures/slider.d.ts +0 -4
  234. package/es/helpers/test/fixtures/slider.js +0 -27
  235. package/es/helpers/test/fixtures/text-template.d.ts +0 -4
  236. package/es/reducers/ui/finished-slides.d.ts +0 -7
  237. package/es/reducers/ui/finished-slides.js +0 -33
  238. package/es/reducers/ui/review-status.d.ts +0 -4
  239. package/es/reducers/ui/step-items.d.ts +0 -14
  240. package/es/reducers/ui/step-items.js +0 -74
  241. package/es/types/ui-progression.d.ts +0 -10
  242. package/es/types/views/slides.d.ts +0 -60
  243. package/lib/actions/data/slides.d.ts +0 -37
  244. package/lib/actions/data/slides.js +0 -16
  245. package/lib/actions/ui/finished-slides.d.ts +0 -10
  246. package/lib/actions/ui/finished-slides.js +0 -8
  247. package/lib/actions/ui/review-status.d.ts +0 -7
  248. package/lib/actions/ui/review-status.js +0 -7
  249. package/lib/actions/ui/step-items.d.ts +0 -24
  250. package/lib/actions/ui/step-items.js +0 -11
  251. package/lib/helpers/map-api-slide-to-ui.d.ts +0 -8
  252. package/lib/helpers/map-api-slide-to-ui.js +0 -181
  253. package/lib/helpers/test/fixtures/free-text.d.ts +0 -4
  254. package/lib/helpers/test/fixtures/free-text.js +0 -24
  255. package/lib/helpers/test/fixtures/qcm-drag.d.ts +0 -4
  256. package/lib/helpers/test/fixtures/qcm-drag.js +0 -106
  257. package/lib/helpers/test/fixtures/qcm-graphic.d.ts +0 -4
  258. package/lib/helpers/test/fixtures/qcm-graphic.js +0 -70
  259. package/lib/helpers/test/fixtures/qcm.d.ts +0 -4
  260. package/lib/helpers/test/fixtures/select-template.d.ts +0 -4
  261. package/lib/helpers/test/fixtures/select-template.js +0 -88
  262. package/lib/helpers/test/fixtures/slider.d.ts +0 -4
  263. package/lib/helpers/test/fixtures/slider.js +0 -27
  264. package/lib/helpers/test/fixtures/text-template.d.ts +0 -4
  265. package/lib/reducers/ui/finished-slides.d.ts +0 -7
  266. package/lib/reducers/ui/finished-slides.js +0 -45
  267. package/lib/reducers/ui/review-status.d.ts +0 -4
  268. package/lib/reducers/ui/step-items.d.ts +0 -14
  269. package/lib/reducers/ui/step-items.js +0 -86
  270. package/lib/types/ui-progression.d.ts +0 -10
  271. package/lib/types/views/slides.d.ts +0 -60
  272. package/src/actions/data/slides.ts +0 -65
  273. package/src/actions/ui/finished-slides.ts +0 -21
  274. package/src/actions/ui/review-status.ts +0 -19
  275. package/src/actions/ui/step-items.ts +0 -45
  276. package/src/helpers/map-api-slide-to-ui.ts +0 -253
  277. package/src/helpers/test/fixtures/free-text.ts +0 -28
  278. package/src/helpers/test/fixtures/qcm-drag.ts +0 -110
  279. package/src/helpers/test/fixtures/qcm-graphic.ts +0 -74
  280. package/src/helpers/test/fixtures/select-template.ts +0 -92
  281. package/src/helpers/test/fixtures/slider.ts +0 -31
  282. package/src/reducers/ui/finished-slides.ts +0 -52
  283. package/src/reducers/ui/review-status.ts +0 -19
  284. package/src/reducers/ui/step-items.ts +0 -116
  285. package/src/types/ui-progression.ts +0 -25
  286. package/src/types/views/skills.ts +0 -27
  287. package/src/types/views/slides.ts +0 -65
  288. /package/es/{helpers/test/map-api-slide-to-ui.test.d.ts → actions/api/test/fetch-skills.test.d.ts} +0 -0
  289. /package/es/{types/ui-progression.js → actions/api/test/fetch-slide.test.d.ts} +0 -0
  290. /package/es/{types/views/skills.js → actions/api/test/post-progression.test.d.ts} +0 -0
  291. /package/es/{types/views/slides.js → reducers/data/test/progression.test.d.ts} +0 -0
  292. /package/{lib/helpers/test/map-api-slide-to-ui.test.d.ts → es/reducers/data/test/skills.test.d.ts} +0 -0
  293. /package/{lib/types/ui-progression.js → es/reducers/data/test/slides.test.d.ts} +0 -0
  294. /package/{lib/types/views/skills.js → es/reducers/data/test/token.test.d.ts} +0 -0
  295. /package/{lib/types/views/slides.js → es/reducers/ui/test/answers.test.d.ts} +0 -0
@@ -1,10 +0,0 @@
1
- export declare type UiProgression = {
2
- _id?: string;
3
- slideNumber?: number;
4
- isCorrect?: boolean;
5
- exitNode?: 'successExitNode' | 'failExitNode';
6
- nextContent?: {
7
- ref: 'successExitNode' | string;
8
- type: 'success' | 'slide';
9
- };
10
- } | null;
@@ -1,60 +0,0 @@
1
- import type { StoreState } from '../../reducers';
2
- import { Dispatchers } from '../../actions';
3
- declare type SlidesViewStaticProps = {
4
- slides: StoreState['data']['slides'];
5
- headerProps: {
6
- mode: string;
7
- skillName: string;
8
- onQuitClick: Function;
9
- 'aria-label'?: string;
10
- closeButtonAriaLabel: string;
11
- };
12
- finishedSlides: StoreState['ui']['finishedSlides'];
13
- stepItems: StoreState['ui']['stepItems'];
14
- reviewStatus: StoreState['ui']['reviewStatus'];
15
- validate: {
16
- label: string;
17
- };
18
- congratsProps?: {
19
- 'aria-label'?: string;
20
- 'data-name'?: string;
21
- animationLottie: any;
22
- title: string;
23
- cardCongratsStar: any;
24
- cardCongratsRank: any;
25
- buttonRevising: {
26
- 'aria-label'?: string;
27
- label: string;
28
- onClick: Function;
29
- type: string;
30
- };
31
- buttonRevisingSkill: {
32
- 'aria-label'?: string;
33
- label: string;
34
- onClick: Function;
35
- type: string;
36
- };
37
- };
38
- correctionPopinProps?: {
39
- klf: {
40
- label: string;
41
- onClick: Function;
42
- tooltip: string;
43
- };
44
- information: {
45
- label: string;
46
- message: string;
47
- };
48
- next: {
49
- label: string;
50
- ariaLabel: string;
51
- };
52
- successLabel: string;
53
- failureLabel: string;
54
- };
55
- reviewBackgroundAriaLabel?: string;
56
- progression: StoreState['data']['progression'];
57
- };
58
- declare type SlidesViewDispatcherProps = Omit<Dispatchers, 'navigateTo' | 'navigateBack'>;
59
- declare type SlidesViewProps = SlidesViewStaticProps & SlidesViewDispatcherProps;
60
- export { SlidesViewStaticProps, SlidesViewDispatcherProps, SlidesViewProps };
@@ -1,37 +0,0 @@
1
- import { UISlide } from '../../types/slides';
2
- import { ReceivedSlide } from '../api/fetch-slide';
3
- export declare const UPDATE_SLIDES_ON_VALIDATION = "@@slide/UPDATE_SLIDES_ON_VALIDATION";
4
- export declare const UPDATE_SLIDES_ON_NEXT = "@@slide/UPDATE_SLIDES_ON_NEXT";
5
- export declare const VALIDATE_SLIDE = "@@slide/VALIDATE";
6
- declare type SlideUIAnimations = 'unstack' | 'restack';
7
- export declare type Slide = UISlide & {
8
- hidden?: boolean;
9
- position: number;
10
- animationType?: SlideUIAnimations;
11
- isCorrect?: boolean;
12
- endReview?: boolean;
13
- nextContent?: Omit<Slide, 'endReview' | 'hidden' | 'position' | 'nextContent'>;
14
- };
15
- export declare type ValidationPayload = {
16
- slideNumber: number;
17
- newSlideContent: Slide;
18
- numberOfFinishedSlides: number;
19
- nextContent: Slide;
20
- };
21
- export declare type OnNextPayload = Omit<ValidationPayload, 'nextContent'>;
22
- export declare type UpdateSlidesOnValidation = {
23
- type: typeof UPDATE_SLIDES_ON_VALIDATION;
24
- payload: ValidationPayload;
25
- };
26
- export declare type UpdateSlidesOnNext = {
27
- type: typeof UPDATE_SLIDES_ON_NEXT;
28
- payload: OnNextPayload;
29
- };
30
- export declare type ValidateSlide = {
31
- type: typeof VALIDATE_SLIDE;
32
- };
33
- export declare type SlidesAction = ReceivedSlide | UpdateSlidesOnValidation | UpdateSlidesOnNext;
34
- export declare const updateSlidesOnValidation: (payload: ValidationPayload) => UpdateSlidesOnValidation;
35
- export declare const updateSlidesOnNext: (payload: OnNextPayload) => UpdateSlidesOnNext;
36
- export declare const validateSlide: () => ValidateSlide;
37
- export {};
@@ -1,16 +0,0 @@
1
- // -----------------------------------------------------------------------------
2
- export var UPDATE_SLIDES_ON_VALIDATION = '@@slide/UPDATE_SLIDES_ON_VALIDATION';
3
- export var UPDATE_SLIDES_ON_NEXT = '@@slide/UPDATE_SLIDES_ON_NEXT';
4
- export var VALIDATE_SLIDE = '@@slide/VALIDATE';
5
- // -----------------------------------------------------------------------------
6
- export var updateSlidesOnValidation = function (payload) { return ({
7
- type: UPDATE_SLIDES_ON_VALIDATION,
8
- payload: payload
9
- }); };
10
- export var updateSlidesOnNext = function (payload) { return ({
11
- type: UPDATE_SLIDES_ON_NEXT,
12
- payload: payload
13
- }); };
14
- export var validateSlide = function () { return ({
15
- type: VALIDATE_SLIDE
16
- }); };
@@ -1,10 +0,0 @@
1
- export declare type FinishedSlide = {
2
- slideNumber: number;
3
- value: true;
4
- };
5
- export declare const UPDATE_FINISHED_SLIDES = "@@finished-slides/UPDATE_FINISHED_SLIDES";
6
- export declare type UpdateFinishedSlides = {
7
- type: typeof UPDATE_FINISHED_SLIDES;
8
- payload: FinishedSlide;
9
- };
10
- export declare const updateFinishedSlides: (payload: FinishedSlide) => UpdateFinishedSlides;
@@ -1,8 +0,0 @@
1
- // Stores only successful slides
2
- // -----------------------------------------------------------------------------
3
- export var UPDATE_FINISHED_SLIDES = '@@finished-slides/UPDATE_FINISHED_SLIDES';
4
- // -----------------------------------------------------------------------------
5
- export var updateFinishedSlides = function (payload) { return ({
6
- type: UPDATE_FINISHED_SLIDES,
7
- payload: payload
8
- }); };
@@ -1,7 +0,0 @@
1
- export declare const UPDATE_REVIEW_STATUS = "@@review-status/UPDATE_REVIEW_STATUS";
2
- export declare type FinishedStatus = 'finished';
3
- export declare type UpdateReviewStatus = {
4
- type: typeof UPDATE_REVIEW_STATUS;
5
- payload: FinishedStatus;
6
- };
7
- export declare const updateReviewStatus: (payload: FinishedStatus) => UpdateReviewStatus;
@@ -1,7 +0,0 @@
1
- // -----------------------------------------------------------------------------
2
- export var UPDATE_REVIEW_STATUS = '@@review-status/UPDATE_REVIEW_STATUS';
3
- // -----------------------------------------------------------------------------
4
- export var updateReviewStatus = function (payload) { return ({
5
- type: UPDATE_REVIEW_STATUS,
6
- payload: payload
7
- }); };
@@ -1,24 +0,0 @@
1
- import { FinishedSlides, IconValue } from '../../types/common';
2
- export declare const UPDATE_STEP_ITEMS_ON_VALIDATION = "@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION";
3
- export declare const UPDATE_STEP_ITEMS_ON_NEXT = "@@step-items/UPDATE_STEP_ITEMS_ON_NEXT";
4
- declare type UpdateStepItemsOnValidationClickPayload = {
5
- stepNumber: number;
6
- icon: IconValue;
7
- };
8
- declare type UpdateStepItemsOnNextClickPayload = {
9
- stepNumber: number;
10
- finishedSlides: FinishedSlides;
11
- current: boolean;
12
- };
13
- export declare type UpdateStepItemsOnValidation = {
14
- type: typeof UPDATE_STEP_ITEMS_ON_VALIDATION;
15
- payload: UpdateStepItemsOnValidationClickPayload;
16
- };
17
- export declare type UpdateStepItemsOnNext = {
18
- type: typeof UPDATE_STEP_ITEMS_ON_NEXT;
19
- payload: UpdateStepItemsOnNextClickPayload;
20
- };
21
- export declare type StepItemsAction = UpdateStepItemsOnValidation | UpdateStepItemsOnNext;
22
- export declare const updateStepItemsOnValidation: (payload: UpdateStepItemsOnValidationClickPayload) => UpdateStepItemsOnValidation;
23
- export declare const updateStepItemsOnNext: (payload: UpdateStepItemsOnNextClickPayload) => UpdateStepItemsOnNext;
24
- export {};
@@ -1,11 +0,0 @@
1
- export var UPDATE_STEP_ITEMS_ON_VALIDATION = '@@step-items/UPDATE_STEP_ITEMS_ON_VALIDATION';
2
- export var UPDATE_STEP_ITEMS_ON_NEXT = '@@step-items/UPDATE_STEP_ITEMS_ON_NEXT';
3
- // -----------------------------------------------------------------------------
4
- export var updateStepItemsOnValidation = function (payload) { return ({
5
- type: UPDATE_STEP_ITEMS_ON_VALIDATION,
6
- payload: payload
7
- }); };
8
- export var updateStepItemsOnNext = function (payload) { return ({
9
- type: UPDATE_STEP_ITEMS_ON_NEXT,
10
- payload: payload
11
- }); };
@@ -1,8 +0,0 @@
1
- import { AnswerUI } from '../types/slides';
2
- import { SlideFromAPI } from '../types/common';
3
- declare type UiUtils = {
4
- translate: (text: string) => string;
5
- };
6
- export declare const getQuestionType: (slide: SlideFromAPI) => SlideFromAPI['question']['type'];
7
- export declare const mapApiSlideToUi: (uiUtils: UiUtils) => (slide: SlideFromAPI) => AnswerUI['model'] | void;
8
- export {};
@@ -1,181 +0,0 @@
1
- import { concat, divide, get, getOr, head, includes, indexOf, isEmpty, map, noop, pipe, rangeStep, size, toInteger } from 'lodash/fp';
2
- var qcmProps = function (question) {
3
- // TODO: EDIT_CHOICES -> getAnswerValues
4
- var answers = [];
5
- return {
6
- type: 'qcm',
7
- answers: map(function (choice) { return ({
8
- title: choice.label,
9
- selected: includes(choice.label, answers),
10
- // TODO: EDIT_CHOICES
11
- onClick: noop,
12
- ariaLabel: choice.label
13
- }); },
14
- // TODO: EDIT_CHOICES -> getChoices
15
- question.content.choices)
16
- };
17
- };
18
- var qcmDragProps = function (question) {
19
- // mock the answers
20
- // TODO: EDIT_CHOICES -> getAnswerValues
21
- var answers = [];
22
- return {
23
- type: 'qcmDrag',
24
- answers: map(function (choice) {
25
- var indexInAnswer = indexOf(choice.label, answers);
26
- return {
27
- title: choice.label,
28
- selected: indexInAnswer !== -1,
29
- order: indexInAnswer,
30
- // TODO: EDIT_CHOICES
31
- onClick: noop
32
- };
33
- // TODO: EDIT_CHOICES -> getChoices
34
- }, question.content.choices)
35
- };
36
- };
37
- var qcmGraphicProps = function (question) {
38
- // mock the answers
39
- // TODO: EDIT_CHOICES -> getAnswerValues
40
- var answers = [];
41
- return {
42
- type: 'qcmGraphic',
43
- answers: map(function (choice) { return ({
44
- title: choice.label,
45
- image: get('media.src.0.url', choice),
46
- selected: includes(choice.label, answers),
47
- // TODO: EDIT_CHOICES
48
- onClick: noop
49
- }); },
50
- // TODO: EDIT_CHOICES -> getChoices
51
- question.content.choices)
52
- };
53
- };
54
- var templateTextProps = function (uiUtils) {
55
- return function (choice, index) {
56
- var translate = uiUtils.translate;
57
- // TODO: EDIT_CHOICES -> getAnswerValues
58
- var answers = [];
59
- return {
60
- type: 'text',
61
- name: getOr('', 'name', choice),
62
- placeholder: translate('Type here'),
63
- value: get(index, answers),
64
- // TODO: EDIT_CHOICES
65
- onChange: noop
66
- };
67
- };
68
- };
69
- // const getItemText = (item: ChoiceFromAPI['items'][0]): item['text'] is string =>
70
- var templateSelectProps = function (uiUtils) {
71
- return function (choice, index) {
72
- var translate = uiUtils.translate;
73
- // TODO: EDIT_CHOICES -> getAnswerValues
74
- var answers = [];
75
- var answer = get(index, answers);
76
- var temporaryOption = {
77
- name: translate('Select an answer'),
78
- value: '',
79
- validOption: false,
80
- selected: true
81
- };
82
- var selectOptions = choice.items.map(function (item) {
83
- var itemText = getOr('', 'text', item);
84
- return {
85
- name: itemText,
86
- value: itemText,
87
- validOption: true,
88
- selected: itemText === answer
89
- };
90
- });
91
- return {
92
- type: 'select',
93
- name: getOr('', 'name', choice),
94
- // TODO: EDIT_CHOICES
95
- onChange: noop,
96
- options: isEmpty(answer) ? concat([temporaryOption], selectOptions) : selectOptions
97
- };
98
- };
99
- };
100
- var templateProps = function (uiUtils) {
101
- var templateTextProps_ = templateTextProps(uiUtils);
102
- var templateSelectProps_ = templateSelectProps(uiUtils);
103
- return function (question) {
104
- // TODO: EDIT_CHOICES -> getChoices
105
- var choices = question.content.choices;
106
- return {
107
- type: 'template',
108
- template: get('content.template', question),
109
- answers: choices.map(function (choice, index) {
110
- return choice.type === 'text'
111
- ? templateTextProps_(choice, index)
112
- : templateSelectProps_(choice, index);
113
- })
114
- };
115
- };
116
- };
117
- var basicProps = function (uiUtils) {
118
- var translate = uiUtils.translate;
119
- // TODO: EDIT_CHOICES -> getAnswerValues
120
- var answers = [];
121
- return function () {
122
- return {
123
- type: 'freeText',
124
- placeholder: translate('Type here'),
125
- value: head(answers),
126
- // TODO: EDIT_CHOICES
127
- onChange: noop
128
- };
129
- };
130
- };
131
- var sliderProps = function (question) {
132
- var values = rangeStep(getOr(1, 'content.step', question), getOr(Number.NaN, 'content.min', question), getOr(Number.NaN, 'content.max', question) + 1
133
- // Lodash doesn't infere the type very well here
134
- );
135
- // TODO: EDIT_CHOICES -> getAnswerValues
136
- var answers = [];
137
- var stateValue = head(answers);
138
- var currentValue = toInteger(stateValue);
139
- var indexValue = indexOf(currentValue, values);
140
- var sliderPosition = divide(indexValue, size(values) - 1);
141
- var unitLabel = get('question.content.unitLabel', question);
142
- return {
143
- type: 'slider',
144
- placeholder: question.explanation,
145
- minLabel: "".concat(question.content.min, " ").concat(unitLabel),
146
- maxLabel: "".concat(question.content.max, " ").concat(unitLabel),
147
- title: "".concat(currentValue, " ").concat(question.content.unitLabel),
148
- value: sliderPosition,
149
- // TODO: EDIT_CHOICES
150
- onChange: noop
151
- };
152
- };
153
- export var getQuestionType = function (slide) {
154
- return slide.question.type;
155
- };
156
- export var mapApiSlideToUi = function (uiUtils) {
157
- var basicProps_ = basicProps(uiUtils);
158
- var templateProps_ = templateProps(uiUtils);
159
- return function (slide) {
160
- if (!slide) {
161
- return;
162
- }
163
- var type = getQuestionType(slide);
164
- switch (type) {
165
- case 'qcm':
166
- return pipe(get('question'), qcmProps)(slide);
167
- case 'qcmGraphic':
168
- return pipe(get('question'), qcmGraphicProps)(slide);
169
- case 'qcmDrag':
170
- return pipe(get('question'), qcmDragProps)(slide);
171
- case 'basic':
172
- return basicProps_();
173
- case 'template':
174
- return pipe(get('question'), templateProps_)(slide);
175
- case 'slider':
176
- return pipe(get('question'), sliderProps)(slide);
177
- default:
178
- throw new Error("".concat(type, " is not an handled question.type"));
179
- }
180
- };
181
- };
@@ -1,4 +0,0 @@
1
- import { FreeText } from '../../../types/slides';
2
- import { SlideFromAPI } from '../../../types/common';
3
- export declare const freeTextSlide: SlideFromAPI;
4
- export declare const freeTextUISlide: FreeText;
@@ -1,24 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- export var freeTextSlide = {
3
- id: 'sli_E1Pcl-XAYbi',
4
- universalRef: 'sli_E1Pcl-XAYbi',
5
- question: {
6
- type: 'basic',
7
- header: 'sli_E1Pcl-XAYbi.header',
8
- explanation: 'sli_E1Pcl-XAYbi.explanation',
9
- content: {
10
- label: 'sli_E1Pcl-XAYbi.label',
11
- placeholder: 'sli_E1Pcl-XAYbi.placeholder',
12
- id: 'sli_E1Pcl-XAYbi.choice_1'
13
- }
14
- },
15
- clue: 'sli_E1Pcl-XAYbi.clue',
16
- klf: 'sli_E1Pcl-XAYbi.klf',
17
- tips: 'sli_E1Pcl-XAYbi.tips'
18
- };
19
- export var freeTextUISlide = {
20
- type: 'freeText',
21
- placeholder: 'Type here',
22
- value: undefined,
23
- onChange: noop
24
- };
@@ -1,4 +0,0 @@
1
- import { QcmDrag } from '../../../types/slides';
2
- import { SlideFromAPI } from '../../../types/common';
3
- export declare const qcmDragSlide: SlideFromAPI;
4
- export declare const qcmDragUISlide: QcmDrag;
@@ -1,106 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- export var qcmDragSlide = {
3
- id: 'sli_419IlQQnf',
4
- universalRef: 'sli_419IlQQnf',
5
- question: {
6
- type: 'qcmDrag',
7
- header: 'sli_419IlQQnf.header',
8
- explanation: 'sli_419IlQQnf.explanation',
9
- content: {
10
- choices: [
11
- {
12
- media: {
13
- src: [],
14
- posters: [],
15
- subtitles: []
16
- },
17
- _id: '62b1ba3ec4f4015504212571',
18
- label: 'sli_419IlQQnf.choice_4kWwlQXhG',
19
- value: 'sli_419IlQQnf.choice_4kWwlQXhG',
20
- items: []
21
- },
22
- {
23
- media: {
24
- src: [],
25
- posters: [],
26
- subtitles: []
27
- },
28
- _id: '62b1ba3ec4f4015504212572',
29
- label: 'sli_419IlQQnf.choice_NJxbwgXm2G',
30
- value: 'sli_419IlQQnf.choice_NJxbwgXm2G',
31
- items: []
32
- },
33
- {
34
- media: {
35
- src: [],
36
- posters: [],
37
- subtitles: []
38
- },
39
- _id: '62b1ba3ec4f4015504212573',
40
- label: 'sli_419IlQQnf.choice_41fwgQXnf',
41
- value: 'sli_419IlQQnf.choice_41fwgQXnf',
42
- items: []
43
- },
44
- {
45
- media: {
46
- src: [],
47
- posters: [],
48
- subtitles: []
49
- },
50
- _id: '62b1ba3ec4f4015504212574',
51
- label: 'sli_419IlQQnf.choice_VJmweQ7nz',
52
- value: 'sli_419IlQQnf.choice_VJmweQ7nz',
53
- items: []
54
- },
55
- {
56
- media: {
57
- src: [],
58
- posters: [],
59
- subtitles: []
60
- },
61
- _id: '62b1ba3ec4f4015504212575',
62
- label: 'sli_419IlQQnf.choice_4kDDgXQhz',
63
- value: 'sli_419IlQQnf.choice_4kDDgXQhz',
64
- items: []
65
- }
66
- ]
67
- }
68
- },
69
- klf: 'sli_419IlQQnf.klf',
70
- tips: 'sli_419IlQQnf.tips'
71
- };
72
- export var qcmDragUISlide = {
73
- type: 'qcmDrag',
74
- answers: [
75
- {
76
- title: 'sli_419IlQQnf.choice_4kWwlQXhG',
77
- selected: false,
78
- order: -1,
79
- onClick: noop
80
- },
81
- {
82
- title: 'sli_419IlQQnf.choice_NJxbwgXm2G',
83
- selected: false,
84
- order: -1,
85
- onClick: noop
86
- },
87
- {
88
- title: 'sli_419IlQQnf.choice_41fwgQXnf',
89
- selected: false,
90
- order: -1,
91
- onClick: noop
92
- },
93
- {
94
- title: 'sli_419IlQQnf.choice_VJmweQ7nz',
95
- selected: false,
96
- order: -1,
97
- onClick: noop
98
- },
99
- {
100
- title: 'sli_419IlQQnf.choice_4kDDgXQhz',
101
- selected: false,
102
- order: -1,
103
- onClick: noop
104
- }
105
- ]
106
- };
@@ -1,4 +0,0 @@
1
- import { QcmGraphic } from '../../../types/slides';
2
- import { SlideFromAPI } from '../../../types/common';
3
- export declare const qcmGraphicSlide: SlideFromAPI;
4
- export declare const qcmGraphicUISlide: QcmGraphic;
@@ -1,70 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- export var qcmGraphicSlide = {
3
- id: 'sli_41~RSVclH',
4
- universalRef: 'sli_41~RSVclH',
5
- question: {
6
- type: 'qcmGraphic',
7
- header: 'sli_41~RSVclH.header',
8
- explanation: 'sli_41~RSVclH.explanation',
9
- content: {
10
- choices: [
11
- {
12
- media: {
13
- type: 'img',
14
- src: [
15
- {
16
- _id: '5fdce726359bf4003ee66997',
17
- mimeType: 'image/png',
18
- url: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB'
19
- }
20
- ],
21
- posters: [],
22
- subtitles: []
23
- },
24
- _id: '5fdce726359bf4003ee66996',
25
- label: 'sli_41~RSVclH.choice_V1gN0r4qgS',
26
- value: 'sli_41~RSVclH.choice_V1gN0r4qgS',
27
- items: []
28
- },
29
- {
30
- media: {
31
- type: 'img',
32
- src: [
33
- {
34
- _id: '5fdce726359bf4003ee66999',
35
- mimeType: 'image/png',
36
- url: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH'
37
- }
38
- ],
39
- posters: [],
40
- subtitles: []
41
- },
42
- _id: '5fdce726359bf4003ee66998',
43
- label: 'sli_41~RSVclH.choice_4JlLeLE5lS',
44
- value: 'sli_41~RSVclH.choice_4JlLeLE5lS',
45
- items: []
46
- }
47
- ]
48
- }
49
- },
50
- clue: 'sli_41~RSVclH.clue',
51
- klf: 'sli_41~RSVclH.klf',
52
- tips: 'sli_41~RSVclH.tips'
53
- };
54
- export var qcmGraphicUISlide = {
55
- type: 'qcmGraphic',
56
- answers: [
57
- {
58
- title: 'sli_41~RSVclH.choice_V1gN0r4qgS',
59
- image: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB',
60
- selected: false,
61
- onClick: noop
62
- },
63
- {
64
- title: 'sli_41~RSVclH.choice_4JlLeLE5lS',
65
- image: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH',
66
- selected: false,
67
- onClick: noop
68
- }
69
- ]
70
- };
@@ -1,4 +0,0 @@
1
- import { Qcm } from '../../../types/slides';
2
- import { SlideFromAPI } from '../../../types/common';
3
- export declare const qcmSlide: SlideFromAPI;
4
- export declare const qcmUISlide: Qcm;
@@ -1,4 +0,0 @@
1
- import { Template } from '../../../types/slides';
2
- import { SlideFromAPI } from '../../../types/common';
3
- export declare const selectTemplateSlide: SlideFromAPI;
4
- export declare const selectTemplateUISlide: Template;