@coorpacademy/app-review 0.1.15 → 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 (212) 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 +22 -19
  5. package/es/actions/api/post-progression.d.ts +4 -6
  6. package/es/actions/api/post-progression.js +13 -8
  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.d.ts +1 -0
  12. package/es/actions/api/test/post-progression.test.js +102 -0
  13. package/es/actions/ui/answers.d.ts +7 -0
  14. package/es/actions/ui/answers.js +7 -0
  15. package/es/fixtures/temp-fixture.d.ts +1 -1
  16. package/es/index.js +10 -16
  17. package/es/reducers/data/index.d.ts +1 -1
  18. package/es/reducers/data/slides.d.ts +2 -2
  19. package/es/reducers/data/slides.js +5 -1
  20. package/es/reducers/data/test/progression.test.d.ts +1 -0
  21. package/es/reducers/data/test/progression.test.js +38 -0
  22. package/es/reducers/data/test/skills.test.d.ts +1 -0
  23. package/es/reducers/data/test/skills.test.js +12 -0
  24. package/es/reducers/data/test/slides.test.d.ts +1 -0
  25. package/es/reducers/data/test/slides.test.js +20 -0
  26. package/es/reducers/data/test/token.test.d.ts +1 -0
  27. package/es/reducers/data/test/token.test.js +11 -0
  28. package/es/reducers/index.d.ts +2 -2
  29. package/es/reducers/ui/answers.d.ts +4 -0
  30. package/es/reducers/ui/answers.js +13 -0
  31. package/es/reducers/ui/index.d.ts +4 -4
  32. package/es/reducers/ui/index.js +2 -2
  33. package/es/reducers/ui/test/answers.test.d.ts +1 -0
  34. package/es/reducers/ui/test/answers.test.js +11 -0
  35. package/es/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
  36. package/es/reducers/ui/test/current-slide-ref.test.js +12 -0
  37. package/es/reducers/ui/test/navigation.test.d.ts +1 -0
  38. package/es/reducers/ui/test/navigation.test.js +15 -0
  39. package/es/services/fetch-slide.js +1 -1
  40. package/es/services/index.js +3 -1
  41. package/es/services/post-answer.d.ts +2 -0
  42. package/es/services/post-answer.js +18 -0
  43. package/es/services/test/fetch-slide.test.d.ts +1 -0
  44. package/es/services/test/fetch-slide.test.js +22 -0
  45. package/es/services/test/post-answer.test.d.ts +1 -0
  46. package/es/services/test/post-answer.test.js +57 -0
  47. package/es/services/test/post-progression.test.js +9 -1
  48. package/es/test/util/services.mock.js +37 -7
  49. package/es/types/common.d.ts +22 -8
  50. package/es/views/slides/index.d.ts +78 -2
  51. package/es/views/slides/index.js +70 -4
  52. package/es/views/slides/map-api-slide-to-ui.d.ts +8 -0
  53. package/es/views/slides/map-api-slide-to-ui.js +172 -0
  54. package/{lib/helpers → es/views/slides}/test/fixtures/free-text.d.ts +1 -1
  55. package/es/views/slides/test/fixtures/free-text.js +38 -0
  56. package/es/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +1 -1
  57. package/es/views/slides/test/fixtures/qcm-drag.js +108 -0
  58. package/es/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +1 -1
  59. package/es/views/slides/test/fixtures/qcm-graphic.js +88 -0
  60. package/es/{helpers → views/slides}/test/fixtures/qcm.d.ts +1 -1
  61. package/es/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
  62. package/es/{helpers → views/slides}/test/fixtures/select-template.d.ts +1 -1
  63. package/es/views/slides/test/fixtures/select-template.js +92 -0
  64. package/es/{helpers → views/slides}/test/fixtures/slider.d.ts +1 -1
  65. package/es/views/slides/test/fixtures/slider.js +36 -0
  66. package/es/{helpers → views/slides}/test/fixtures/text-template.d.ts +1 -1
  67. package/es/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
  68. package/es/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
  69. package/es/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
  70. package/lib/actions/api/fetch-skills.d.ts +4 -6
  71. package/lib/actions/api/fetch-skills.js +55 -7
  72. package/lib/actions/api/fetch-slide.d.ts +14 -7
  73. package/lib/actions/api/fetch-slide.js +70 -20
  74. package/lib/actions/api/post-progression.d.ts +4 -6
  75. package/lib/actions/api/post-progression.js +63 -9
  76. package/lib/actions/api/test/create-test-store.d.ts +5 -0
  77. package/lib/actions/api/test/create-test-store.js +18 -0
  78. package/lib/actions/api/test/fetch-skills.test.d.ts +1 -0
  79. package/lib/actions/api/test/fetch-skills.test.js +113 -0
  80. package/lib/actions/api/test/fetch-slide.test.d.ts +1 -0
  81. package/lib/actions/api/test/fetch-slide.test.js +120 -0
  82. package/lib/actions/api/test/post-progression.test.d.ts +1 -0
  83. package/lib/actions/api/test/post-progression.test.js +160 -0
  84. package/lib/actions/ui/answers.d.ts +7 -0
  85. package/lib/actions/ui/answers.js +9 -0
  86. package/lib/fixtures/temp-fixture.d.ts +1 -1
  87. package/lib/index.js +21 -18
  88. package/lib/reducers/data/index.d.ts +1 -1
  89. package/lib/reducers/data/slides.d.ts +2 -2
  90. package/lib/reducers/data/slides.js +5 -1
  91. package/lib/reducers/data/test/progression.test.d.ts +1 -0
  92. package/lib/reducers/data/test/progression.test.js +38 -0
  93. package/lib/reducers/data/test/skills.test.d.ts +1 -0
  94. package/lib/reducers/data/test/skills.test.js +12 -0
  95. package/lib/reducers/data/test/slides.test.d.ts +1 -0
  96. package/lib/reducers/data/test/slides.test.js +20 -0
  97. package/lib/reducers/data/test/token.test.d.ts +1 -0
  98. package/lib/reducers/data/test/token.test.js +11 -0
  99. package/lib/reducers/index.d.ts +2 -2
  100. package/lib/reducers/ui/answers.d.ts +4 -0
  101. package/lib/reducers/ui/answers.js +14 -0
  102. package/lib/reducers/ui/index.d.ts +4 -4
  103. package/lib/reducers/ui/index.js +2 -2
  104. package/lib/reducers/ui/test/answers.test.d.ts +1 -0
  105. package/lib/reducers/ui/test/answers.test.js +11 -0
  106. package/lib/reducers/ui/test/current-slide-ref.test.d.ts +1 -0
  107. package/lib/reducers/ui/test/current-slide-ref.test.js +12 -0
  108. package/lib/reducers/ui/test/navigation.test.d.ts +1 -0
  109. package/lib/reducers/ui/test/navigation.test.js +15 -0
  110. package/lib/services/fetch-slide.js +1 -1
  111. package/lib/services/index.js +3 -1
  112. package/lib/services/post-answer.d.ts +2 -0
  113. package/lib/services/post-answer.js +62 -0
  114. package/lib/services/test/fetch-slide.test.d.ts +1 -0
  115. package/lib/services/test/fetch-slide.test.js +76 -0
  116. package/lib/services/test/post-answer.test.d.ts +1 -0
  117. package/lib/services/test/post-answer.test.js +111 -0
  118. package/lib/services/test/post-progression.test.js +9 -1
  119. package/lib/test/util/services.mock.js +37 -7
  120. package/lib/types/common.d.ts +22 -8
  121. package/lib/views/slides/index.d.ts +78 -2
  122. package/lib/views/slides/index.js +70 -4
  123. package/lib/views/slides/map-api-slide-to-ui.d.ts +8 -0
  124. package/lib/views/slides/map-api-slide-to-ui.js +178 -0
  125. package/{es/helpers → lib/views/slides}/test/fixtures/free-text.d.ts +1 -1
  126. package/lib/views/slides/test/fixtures/free-text.js +38 -0
  127. package/lib/{helpers → views/slides}/test/fixtures/qcm-drag.d.ts +1 -1
  128. package/lib/views/slides/test/fixtures/qcm-drag.js +108 -0
  129. package/lib/{helpers → views/slides}/test/fixtures/qcm-graphic.d.ts +1 -1
  130. package/lib/views/slides/test/fixtures/qcm-graphic.js +88 -0
  131. package/lib/{helpers → views/slides}/test/fixtures/qcm.d.ts +1 -1
  132. package/lib/{helpers → views/slides}/test/fixtures/qcm.js +5 -1
  133. package/lib/{helpers → views/slides}/test/fixtures/select-template.d.ts +1 -1
  134. package/lib/views/slides/test/fixtures/select-template.js +92 -0
  135. package/lib/{helpers → views/slides}/test/fixtures/slider.d.ts +1 -1
  136. package/lib/views/slides/test/fixtures/slider.js +36 -0
  137. package/lib/{helpers → views/slides}/test/fixtures/text-template.d.ts +1 -1
  138. package/lib/{helpers → views/slides}/test/fixtures/text-template.js +5 -1
  139. package/lib/views/slides/test/map-api-slide-to-ui.test.d.ts +1 -0
  140. package/lib/{helpers → views/slides}/test/map-api-slide-to-ui.test.js +19 -9
  141. package/package.json +3 -3
  142. package/src/actions/api/fetch-skills.ts +12 -12
  143. package/src/actions/api/fetch-slide.ts +33 -29
  144. package/src/actions/api/post-progression.ts +18 -21
  145. package/src/actions/api/test/create-test-store.ts +25 -0
  146. package/src/actions/api/test/fetch-skills.test.ts +70 -0
  147. package/src/actions/api/test/fetch-slide.test.ts +77 -0
  148. package/src/actions/api/test/post-progression.test.ts +119 -0
  149. package/src/actions/ui/answers.ts +16 -0
  150. package/src/fixtures/temp-fixture.ts +1 -1
  151. package/src/index.tsx +14 -29
  152. package/src/reducers/data/index.ts +1 -1
  153. package/src/reducers/data/slides.ts +11 -2
  154. package/src/reducers/data/test/progression.test.ts +42 -0
  155. package/src/reducers/data/test/skills.test.ts +14 -0
  156. package/src/reducers/data/test/slides.test.ts +26 -0
  157. package/src/reducers/data/test/token.test.ts +13 -0
  158. package/src/reducers/ui/answers.ts +19 -0
  159. package/src/reducers/ui/index.ts +3 -3
  160. package/src/reducers/ui/test/answers.test.ts +13 -0
  161. package/src/reducers/ui/test/current-slide-ref.test.ts +14 -0
  162. package/src/reducers/ui/test/navigation.test.ts +19 -0
  163. package/src/services/fetch-slide.ts +1 -1
  164. package/src/services/index.ts +3 -1
  165. package/src/services/post-answer.ts +27 -0
  166. package/src/services/test/fetch-slide.test.ts +30 -0
  167. package/src/services/test/post-answer.test.ts +68 -0
  168. package/src/services/test/post-progression.test.ts +9 -1
  169. package/src/test/util/services.mock.ts +37 -7
  170. package/src/types/common.ts +34 -14
  171. package/src/views/slides/index.ts +164 -5
  172. package/src/views/slides/map-api-slide-to-ui.ts +251 -0
  173. package/src/views/slides/test/fixtures/free-text.ts +43 -0
  174. package/src/views/slides/test/fixtures/qcm-drag.ts +111 -0
  175. package/src/views/slides/test/fixtures/qcm-graphic.ts +94 -0
  176. package/src/{helpers → views/slides}/test/fixtures/qcm.ts +6 -2
  177. package/src/views/slides/test/fixtures/select-template.ts +98 -0
  178. package/src/views/slides/test/fixtures/slider.ts +41 -0
  179. package/src/{helpers → views/slides}/test/fixtures/text-template.ts +6 -2
  180. package/src/{helpers → views/slides}/test/map-api-slide-to-ui.test.ts +21 -10
  181. package/es/helpers/map-api-slide-to-ui.d.ts +0 -11
  182. package/es/helpers/map-api-slide-to-ui.js +0 -193
  183. package/es/helpers/test/fixtures/free-text.js +0 -30
  184. package/es/helpers/test/fixtures/qcm-drag.js +0 -112
  185. package/es/helpers/test/fixtures/qcm-graphic.js +0 -76
  186. package/es/helpers/test/fixtures/select-template.js +0 -94
  187. package/es/helpers/test/fixtures/slider.js +0 -33
  188. package/es/reducers/ui/slides.d.ts +0 -9
  189. package/es/reducers/ui/slides.js +0 -42
  190. package/es/types/views/slides.d.ts +0 -74
  191. package/es/types/views/slides.js +0 -6
  192. package/lib/helpers/map-api-slide-to-ui.d.ts +0 -11
  193. package/lib/helpers/map-api-slide-to-ui.js +0 -201
  194. package/lib/helpers/test/fixtures/free-text.js +0 -30
  195. package/lib/helpers/test/fixtures/qcm-drag.js +0 -112
  196. package/lib/helpers/test/fixtures/qcm-graphic.js +0 -76
  197. package/lib/helpers/test/fixtures/select-template.js +0 -94
  198. package/lib/helpers/test/fixtures/slider.js +0 -33
  199. package/lib/reducers/ui/slides.d.ts +0 -9
  200. package/lib/reducers/ui/slides.js +0 -43
  201. package/lib/types/views/slides.d.ts +0 -74
  202. package/lib/types/views/slides.js +0 -6
  203. package/src/helpers/map-api-slide-to-ui.ts +0 -279
  204. package/src/helpers/test/fixtures/free-text.ts +0 -33
  205. package/src/helpers/test/fixtures/qcm-drag.ts +0 -115
  206. package/src/helpers/test/fixtures/qcm-graphic.ts +0 -79
  207. package/src/helpers/test/fixtures/select-template.ts +0 -97
  208. package/src/helpers/test/fixtures/slider.ts +0 -36
  209. package/src/reducers/ui/slides.ts +0 -58
  210. package/src/types/views/slides.ts +0 -90
  211. /package/es/{helpers/test/map-api-slide-to-ui.test.d.ts → actions/api/test/fetch-skills.test.d.ts} +0 -0
  212. /package/{lib/helpers/test/map-api-slide-to-ui.test.d.ts → es/actions/api/test/fetch-slide.test.d.ts} +0 -0
@@ -1,115 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- import {SlideFromAPI, UISlide} from '../../../types/common';
3
-
4
- export const qcmDragSlide: SlideFromAPI = {
5
- id: 'sli_419IlQQnf',
6
- universalRef: 'sli_419IlQQnf',
7
- question: {
8
- type: 'qcmDrag',
9
- header: 'sli_419IlQQnf.header',
10
- explanation: 'sli_419IlQQnf.explanation',
11
- content: {
12
- choices: [
13
- {
14
- media: {
15
- src: [],
16
- posters: [],
17
- subtitles: []
18
- },
19
- _id: '62b1ba3ec4f4015504212571',
20
- label: 'sli_419IlQQnf.choice_4kWwlQXhG',
21
- value: 'sli_419IlQQnf.choice_4kWwlQXhG',
22
- items: []
23
- },
24
- {
25
- media: {
26
- src: [],
27
- posters: [],
28
- subtitles: []
29
- },
30
- _id: '62b1ba3ec4f4015504212572',
31
- label: 'sli_419IlQQnf.choice_NJxbwgXm2G',
32
- value: 'sli_419IlQQnf.choice_NJxbwgXm2G',
33
- items: []
34
- },
35
- {
36
- media: {
37
- src: [],
38
- posters: [],
39
- subtitles: []
40
- },
41
- _id: '62b1ba3ec4f4015504212573',
42
- label: 'sli_419IlQQnf.choice_41fwgQXnf',
43
- value: 'sli_419IlQQnf.choice_41fwgQXnf',
44
- items: []
45
- },
46
- {
47
- media: {
48
- src: [],
49
- posters: [],
50
- subtitles: []
51
- },
52
- _id: '62b1ba3ec4f4015504212574',
53
- label: 'sli_419IlQQnf.choice_VJmweQ7nz',
54
- value: 'sli_419IlQQnf.choice_VJmweQ7nz',
55
- items: []
56
- },
57
- {
58
- media: {
59
- src: [],
60
- posters: [],
61
- subtitles: []
62
- },
63
- _id: '62b1ba3ec4f4015504212575',
64
- label: 'sli_419IlQQnf.choice_4kDDgXQhz',
65
- value: 'sli_419IlQQnf.choice_4kDDgXQhz',
66
- items: []
67
- }
68
- ]
69
- }
70
- },
71
- klf: 'sli_419IlQQnf.klf',
72
- tips: 'sli_419IlQQnf.tips'
73
- };
74
-
75
- export const qcmDragUISlide: Partial<UISlide> = {
76
- questionText: 'sli_419IlQQnf.header',
77
- answerUI: {
78
- help: 'sli_419IlQQnf.explanation',
79
- model: {
80
- type: 'qcmDrag',
81
- answers: [
82
- {
83
- title: 'sli_419IlQQnf.choice_4kWwlQXhG',
84
- selected: false,
85
- order: -1,
86
- onClick: noop
87
- },
88
- {
89
- title: 'sli_419IlQQnf.choice_NJxbwgXm2G',
90
- selected: false,
91
- order: -1,
92
- onClick: noop
93
- },
94
- {
95
- title: 'sli_419IlQQnf.choice_41fwgQXnf',
96
- selected: false,
97
- order: -1,
98
- onClick: noop
99
- },
100
- {
101
- title: 'sli_419IlQQnf.choice_VJmweQ7nz',
102
- selected: false,
103
- order: -1,
104
- onClick: noop
105
- },
106
- {
107
- title: 'sli_419IlQQnf.choice_4kDDgXQhz',
108
- selected: false,
109
- order: -1,
110
- onClick: noop
111
- }
112
- ]
113
- }
114
- }
115
- };
@@ -1,79 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- import {SlideFromAPI, UISlide} from '../../../types/common';
3
-
4
- export const qcmGraphicSlide: SlideFromAPI = {
5
- id: 'sli_41~RSVclH',
6
- universalRef: 'sli_41~RSVclH',
7
- question: {
8
- type: 'qcmGraphic',
9
- header: 'sli_41~RSVclH.header',
10
- explanation: 'sli_41~RSVclH.explanation',
11
- content: {
12
- choices: [
13
- {
14
- media: {
15
- type: 'img',
16
- src: [
17
- {
18
- _id: '5fdce726359bf4003ee66997',
19
- mimeType: 'image/png',
20
- url: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB'
21
- }
22
- ],
23
- posters: [],
24
- subtitles: []
25
- },
26
- _id: '5fdce726359bf4003ee66996',
27
- label: 'sli_41~RSVclH.choice_V1gN0r4qgS',
28
- value: 'sli_41~RSVclH.choice_V1gN0r4qgS',
29
- items: []
30
- },
31
- {
32
- media: {
33
- type: 'img',
34
- src: [
35
- {
36
- _id: '5fdce726359bf4003ee66999',
37
- mimeType: 'image/png',
38
- url: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH'
39
- }
40
- ],
41
- posters: [],
42
- subtitles: []
43
- },
44
- _id: '5fdce726359bf4003ee66998',
45
- label: 'sli_41~RSVclH.choice_4JlLeLE5lS',
46
- value: 'sli_41~RSVclH.choice_4JlLeLE5lS',
47
- items: []
48
- }
49
- ]
50
- }
51
- },
52
- clue: 'sli_41~RSVclH.clue',
53
- klf: 'sli_41~RSVclH.klf',
54
- tips: 'sli_41~RSVclH.tips'
55
- };
56
-
57
- export const qcmGraphicUISlide: Partial<UISlide> = {
58
- questionText: 'sli_41~RSVclH.header',
59
- answerUI: {
60
- help: 'sli_41~RSVclH.explanation',
61
- model: {
62
- type: 'qcmGraphic',
63
- answers: [
64
- {
65
- title: 'sli_41~RSVclH.choice_V1gN0r4qgS',
66
- image: 'med_4JVRrE5gH.mediaUrl_VkBtUV9gB',
67
- selected: false,
68
- onClick: noop
69
- },
70
- {
71
- title: 'sli_41~RSVclH.choice_4JlLeLE5lS',
72
- image: 'med_Ek8gIEqxB.mediaUrl_EkcFUEclH',
73
- selected: false,
74
- onClick: noop
75
- }
76
- ]
77
- }
78
- }
79
- };
@@ -1,97 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- import {SlideFromAPI, UISlide} from '../../../types/common';
3
-
4
- export const selectTemplateSlide: SlideFromAPI = {
5
- id: 'sli_410xZQxrZ',
6
- universalRef: 'sli_410xZQxrZ',
7
- question: {
8
- type: 'template',
9
- header: 'sli_410xZQxrZ.header',
10
- explanation: 'sli_410xZQxrZ.explanation',
11
- content: {
12
- template: 'sli_410xZQxrZ.template',
13
- choices: [
14
- {
15
- media: {
16
- src: [],
17
- posters: [],
18
- subtitles: []
19
- },
20
- _id: '5fdce726359bf4003ee66967',
21
- type: 'select',
22
- name: 'sel36665',
23
- items: [
24
- {
25
- _id: '5fdce726359bf4003ee66968',
26
- text: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
27
- value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~'
28
- },
29
- {
30
- _id: '5fdce726359bf4003ee66969',
31
- text: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
32
- value: 'sli_410xZQxrZ.choice_VJWCN~mgB~'
33
- },
34
- {
35
- _id: '5fdce726359bf4003ee6696a',
36
- text: 'sli_410xZQxrZ.choice_VkaH~XgBb',
37
- value: 'sli_410xZQxrZ.choice_VkaH~XgBb'
38
- },
39
- {
40
- _id: '5fdce726359bf4003ee6696b',
41
- text: 'sli_410xZQxrZ.choice_E1uUWXeBb',
42
- value: 'sli_410xZQxrZ.choice_E1uUWXeBb'
43
- }
44
- ]
45
- }
46
- ]
47
- }
48
- },
49
- clue: 'sli_410xZQxrZ.clue',
50
- klf: 'sli_410xZQxrZ.klf',
51
- tips: 'sli_410xZQxrZ.tips'
52
- };
53
-
54
- export const selectTemplateUISlide: Partial<UISlide> = {
55
- questionText: 'sli_410xZQxrZ.header',
56
- answerUI: {
57
- help: 'sli_410xZQxrZ.explanation',
58
- model: {
59
- type: 'template',
60
- template: 'sli_410xZQxrZ.template',
61
- answers: [
62
- {
63
- type: 'select',
64
- name: 'sel36665',
65
- onChange: noop,
66
- options: [
67
- {name: 'Select an answer', value: '', validOption: false, selected: true},
68
- {
69
- name: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
70
- value: 'sli_410xZQxrZ.choice_4yeA4Z7lr~',
71
- validOption: true,
72
- selected: false
73
- },
74
- {
75
- name: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
76
- value: 'sli_410xZQxrZ.choice_VJWCN~mgB~',
77
- validOption: true,
78
- selected: false
79
- },
80
- {
81
- name: 'sli_410xZQxrZ.choice_VkaH~XgBb',
82
- value: 'sli_410xZQxrZ.choice_VkaH~XgBb',
83
- validOption: true,
84
- selected: false
85
- },
86
- {
87
- name: 'sli_410xZQxrZ.choice_E1uUWXeBb',
88
- value: 'sli_410xZQxrZ.choice_E1uUWXeBb',
89
- validOption: true,
90
- selected: false
91
- }
92
- ]
93
- }
94
- ]
95
- }
96
- }
97
- };
@@ -1,36 +0,0 @@
1
- import noop from 'lodash/fp/noop';
2
- import {SlideFromAPI, UISlide} from '../../../types/common';
3
-
4
- export const sliderSlide: SlideFromAPI = {
5
- id: 'sli_41D5AovN~',
6
- universalRef: 'sli_41D5AovN~',
7
- question: {
8
- type: 'slider',
9
- header: 'sli_41D5AovN~.header',
10
- explanation: 'sli_41D5AovN~.explanation',
11
- content: {
12
- min: 1,
13
- max: 10,
14
- unitLabel: 'sli_41D5AovN~.unitLabel'
15
- }
16
- },
17
- clue: 'sli_41D5AovN~.clue',
18
- klf: 'sli_41D5AovN~.klf',
19
- tips: 'sli_41D5AovN~.tips'
20
- };
21
-
22
- export const sliderUISlide: Partial<UISlide> = {
23
- questionText: 'sli_41D5AovN~.header',
24
- answerUI: {
25
- help: 'sli_41D5AovN~.explanation',
26
- model: {
27
- type: 'slider',
28
- placeholder: 'sli_41D5AovN~.explanation',
29
- minLabel: '1 undefined',
30
- maxLabel: '10 undefined',
31
- title: '0 sli_41D5AovN~.unitLabel',
32
- value: -0.1111111111111111,
33
- onChange: noop
34
- }
35
- }
36
- };
@@ -1,58 +0,0 @@
1
- import pipe from 'lodash/fp/pipe';
2
- import set from 'lodash/fp/set';
3
- import type {SlideFromAPI, UISlide} from '../../types/common';
4
- import {SlideIndexes} from '../../common';
5
- import {mapApiSlideToUi} from '../../helpers/map-api-slide-to-ui';
6
- import {SET_CURRENT_SLIDE, UISlidesAction} from '../../actions/ui/slides';
7
-
8
- export type UISlidesState = {
9
- [key in SlideIndexes]: UISlide;
10
- };
11
-
12
- export const initialState: UISlidesState = {
13
- '0': {
14
- hidden: false,
15
- position: 0
16
- },
17
- '1': {
18
- hidden: false,
19
- position: 1
20
- },
21
- '2': {
22
- hidden: false,
23
- position: 2
24
- },
25
- '3': {
26
- hidden: false,
27
- position: 3
28
- },
29
- '4': {
30
- hidden: false,
31
- position: 4
32
- }
33
- };
34
-
35
- const setFirstSlide = (state: UISlidesState, slideFromAPI: SlideFromAPI): UISlidesState => {
36
- const {questionText, answerUI} = mapApiSlideToUi({translate: (text: string) => text})(
37
- slideFromAPI
38
- );
39
-
40
- return pipe(
41
- set(['0', 'questionText'], questionText),
42
- set(['0', 'answerUI'], answerUI),
43
- set(['0', 'parentContentTitle'], 'Parent Title') // TODO parentContentTitle + translate
44
- )(state);
45
- };
46
-
47
- // eslint-disable-next-line default-param-last
48
- const reducer = (state: UISlidesState = initialState, action: UISlidesAction): UISlidesState => {
49
- switch (action.type) {
50
- case SET_CURRENT_SLIDE: {
51
- return setFirstSlide(state, action.payload);
52
- }
53
- default:
54
- return state;
55
- }
56
- };
57
-
58
- export default reducer;
@@ -1,90 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import type {StoreState} from '../../reducers';
3
- import {Dispatchers} from '../../actions';
4
-
5
- const ICON_VALUES = {
6
- right: 'right',
7
- wrong: 'wrong',
8
- 'no-answer': 'no-answer'
9
- } as const;
10
-
11
- type IconValue = keyof typeof ICON_VALUES;
12
-
13
- type StepItem = {
14
- current: boolean;
15
- icon: IconValue;
16
- value: string;
17
- };
18
-
19
- type CorrectionPopinProps = {
20
- klf: {
21
- label: string;
22
- onClick: Function;
23
- tooltip: string;
24
- };
25
- information: {
26
- label: string;
27
- message: string;
28
- };
29
- next: {
30
- label: string;
31
- ariaLabel: string;
32
- };
33
- successLabel: string;
34
- failureLabel: string;
35
- };
36
-
37
- type SlidesViewStaticProps = {
38
- header: {
39
- mode: string;
40
- skillName: string;
41
- onQuitClick: Function;
42
- 'aria-label'?: string;
43
- closeButtonAriaLabel: string;
44
- steps: StepItem[];
45
- };
46
- stack: {
47
- slides: StoreState['ui']['slides'];
48
- validateButton: {
49
- label: string;
50
- disabled: boolean;
51
- onClick: Function;
52
- };
53
- correctionPopinProps?: CorrectionPopinProps;
54
- endReview: boolean;
55
- };
56
- reviewBackgroundAriaLabel?: string;
57
- congratsProps?: {
58
- 'aria-label'?: string;
59
- 'data-name'?: string;
60
- animationLottie: any;
61
- title: string;
62
- cardCongratsStar: any;
63
- cardCongratsRank: any;
64
- buttonRevising: {
65
- 'aria-label'?: string;
66
- label: string;
67
- onClick: Function;
68
- type: string;
69
- };
70
- buttonRevisingSkill: {
71
- 'aria-label'?: string;
72
- label: string;
73
- onClick: Function;
74
- type: string;
75
- };
76
- };
77
- };
78
-
79
- type SlidesViewDispatcherProps = Omit<Dispatchers, 'navigateTo' | 'navigateBack'>;
80
-
81
- type SlidesViewProps = SlidesViewStaticProps & SlidesViewDispatcherProps;
82
-
83
- export {
84
- CorrectionPopinProps,
85
- IconValue,
86
- SlidesViewStaticProps,
87
- SlidesViewDispatcherProps,
88
- SlidesViewProps,
89
- StepItem
90
- };