@coorpacademy/app-review 0.5.6-alpha.8 → 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.
- package/{lib/src → es}/index.d.ts +1 -0
- package/es/{src/index.js → index.js} +4 -4
- package/es/{src/test → test}/index.test.js +0 -1
- package/{lib/src → es}/test/util/services.mock.d.ts +0 -1
- package/es/{src/test → test}/util/services.mock.js +0 -1
- package/{lib/src → es}/types/common.d.ts +2 -5
- package/{lib/src → es}/views/slides/index.d.ts +1 -2
- package/es/{src/views → views}/slides/index.js +18 -20
- package/{es/src → lib}/index.d.ts +1 -0
- package/lib/{src/index.js → index.js} +5 -4
- package/lib/{src/test → test}/index.test.js +0 -1
- package/{es/src → lib}/test/util/services.mock.d.ts +0 -1
- package/lib/{src/test → test}/util/services.mock.js +0 -1
- package/{es/src → lib}/types/common.d.ts +2 -5
- package/{es/src → lib}/views/slides/index.d.ts +1 -2
- package/lib/{src/views → views}/slides/index.js +18 -20
- package/package.json +3 -5
- package/src/index.tsx +6 -5
- package/src/test/index.test.tsx +0 -1
- package/src/test/util/services.mock.ts +0 -2
- package/src/types/common.ts +2 -6
- package/src/types/globals.d.ts +0 -1
- package/src/views/slides/index.ts +19 -43
- package/src/views/slides/test/header.on-click.test.ts +3 -10
- package/src/views/slides/test/index.test.ts +55 -58
- package/src/views/slides/test/on-quit-popin.on-click.test.ts +3 -12
- package/src/views/slides/test/slide.free-text.on-change.test.ts +2 -4
- package/src/views/slides/test/slide.next-slide.on-click.test.ts +3 -6
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +2 -3
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +2 -3
- package/src/views/slides/test/slide.qcm.on-click.test.ts +2 -3
- package/src/views/slides/test/slide.slider.on-change.test.ts +2 -3
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +2 -3
- package/src/views/slides/test/slide.template.on-change.test.ts +4 -5
- package/es/locales/en/review.json +0 -14
- package/es/sandbox/index.d.ts +0 -9
- package/es/sandbox/index.js +0 -56
- package/lib/locales/en/review.json +0 -14
- package/lib/sandbox/index.d.ts +0 -9
- package/lib/sandbox/index.js +0 -67
- package/locales/en/review.json +0 -14
- /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
- /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
- /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
- /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
- /package/es/{src/actions → actions}/api/post-answer.js +0 -0
- /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
- /package/es/{src/actions → actions}/api/post-progression.js +0 -0
- /package/es/{src/actions → actions}/data/token.d.ts +0 -0
- /package/es/{src/actions → actions}/data/token.js +0 -0
- /package/es/{src/actions → actions}/index.d.ts +0 -0
- /package/es/{src/actions → actions}/index.js +0 -0
- /package/es/{src/actions → actions}/test/create-test-store.d.ts +0 -0
- /package/es/{src/actions → actions}/test/create-test-store.js +0 -0
- /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/answers.js +0 -0
- /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/navigation.js +0 -0
- /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
- /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
- /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
- /package/es/{src/actions → actions}/ui/slides.js +0 -0
- /package/es/{src/common → common}/index.d.ts +0 -0
- /package/es/{src/common → common}/index.js +0 -0
- /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
- /package/es/{src/configure-store.js → configure-store.js} +0 -0
- /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
- /package/es/{src/helpers → helpers}/css-register.js +0 -0
- /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
- /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/index.js +0 -0
- /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/progression.js +0 -0
- /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/rank.js +0 -0
- /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/skills.js +0 -0
- /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/slides.js +0 -0
- /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
- /package/es/{src/reducers → reducers}/data/token.js +0 -0
- /package/es/{src/reducers → reducers}/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/index.js +0 -0
- /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
- /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
- /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/index.js +0 -0
- /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
- /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
- /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
- /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
- /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
- /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
- /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
- /package/es/{src/services → services}/fetch-correction.js +0 -0
- /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
- /package/es/{src/services → services}/fetch-rank.js +0 -0
- /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
- /package/es/{src/services → services}/fetch-skills.js +0 -0
- /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
- /package/es/{src/services → services}/fetch-slide.js +0 -0
- /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
- /package/es/{src/services → services}/index.d.ts +0 -0
- /package/es/{src/services → services}/index.js +0 -0
- /package/es/{src/services → services}/post-answer.d.ts +0 -0
- /package/es/{src/services → services}/post-answer.js +0 -0
- /package/es/{src/services → services}/post-progression.d.ts +0 -0
- /package/es/{src/services → services}/post-progression.js +0 -0
- /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
- /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
- /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
- /package/es/{src/services → services}/tools/sleep.js +0 -0
- /package/es/{src/test → test}/index.test.d.ts +0 -0
- /package/es/{src/types → types}/common.js +0 -0
- /package/es/{src/types → types}/slides.d.ts +0 -0
- /package/es/{src/types → types}/slides.js +0 -0
- /package/es/{src/views → views}/skills/index.d.ts +0 -0
- /package/es/{src/views → views}/skills/index.js +0 -0
- /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/slider.js +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
- /package/es/{src/views → views}/slides/test/fixtures/template.js +0 -0
- /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-correction.js +0 -0
- /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-rank.js +0 -0
- /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-skills.js +0 -0
- /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/fetch-slide.js +0 -0
- /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/post-answer.js +0 -0
- /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
- /package/lib/{src/actions → actions}/api/post-progression.js +0 -0
- /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
- /package/lib/{src/actions → actions}/data/token.js +0 -0
- /package/lib/{src/actions → actions}/index.d.ts +0 -0
- /package/lib/{src/actions → actions}/index.js +0 -0
- /package/lib/{src/actions → actions}/test/create-test-store.d.ts +0 -0
- /package/lib/{src/actions → actions}/test/create-test-store.js +0 -0
- /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/answers.js +0 -0
- /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/navigation.js +0 -0
- /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/next-slide.js +0 -0
- /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/quit-popin.js +0 -0
- /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
- /package/lib/{src/actions → actions}/ui/slides.js +0 -0
- /package/lib/{src/common → common}/index.d.ts +0 -0
- /package/lib/{src/common → common}/index.js +0 -0
- /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
- /package/lib/{src/configure-store.js → configure-store.js} +0 -0
- /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
- /package/lib/{src/helpers → helpers}/css-register.js +0 -0
- /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/corrections.js +0 -0
- /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/index.js +0 -0
- /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/progression.js +0 -0
- /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/rank.js +0 -0
- /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/skills.js +0 -0
- /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/slides.js +0 -0
- /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/data/token.js +0 -0
- /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/index.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/answers.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/index.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/navigation.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/positions.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/quit-popin.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/show-congrats.js +0 -0
- /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
- /package/lib/{src/reducers → reducers}/ui/slide.js +0 -0
- /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-correction.js +0 -0
- /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-rank.js +0 -0
- /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-skills.js +0 -0
- /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-slide.js +0 -0
- /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
- /package/lib/{src/services → services}/index.d.ts +0 -0
- /package/lib/{src/services → services}/index.js +0 -0
- /package/lib/{src/services → services}/post-answer.d.ts +0 -0
- /package/lib/{src/services → services}/post-answer.js +0 -0
- /package/lib/{src/services → services}/post-progression.d.ts +0 -0
- /package/lib/{src/services → services}/post-progression.js +0 -0
- /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
- /package/lib/{src/services → services}/tools/fetch-responses.js +0 -0
- /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
- /package/lib/{src/services → services}/tools/sleep.js +0 -0
- /package/lib/{src/test → test}/index.test.d.ts +0 -0
- /package/lib/{src/types → types}/common.js +0 -0
- /package/lib/{src/types → types}/slides.d.ts +0 -0
- /package/lib/{src/types → types}/slides.js +0 -0
- /package/lib/{src/views → views}/skills/index.d.ts +0 -0
- /package/lib/{src/views → views}/skills/index.js +0 -0
- /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/lib/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/slider.js +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
- /package/lib/{src/views → views}/slides/test/fixtures/template.js +0 -0
|
@@ -4,14 +4,13 @@ import get from 'lodash/fp/get';
|
|
|
4
4
|
import identity from 'lodash/fp/identity';
|
|
5
5
|
import {mapStateToSlidesProps} from '..';
|
|
6
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
7
|
-
import {services
|
|
7
|
+
import {services} from '../../../test/util/services.mock';
|
|
8
8
|
import {createTestStore} from '../../../actions/test/create-test-store';
|
|
9
9
|
import {StoreState} from '../../../reducers';
|
|
10
10
|
import {EDIT_QCM} from '../../../actions/ui/answers';
|
|
11
11
|
import {Qcm} from '../../../types/slides';
|
|
12
12
|
import {qcmSlide} from './fixtures/qcm';
|
|
13
13
|
|
|
14
|
-
const connectedOptions = {translate, onQuitClick: identity};
|
|
15
14
|
const progression: ProgressionFromAPI = {
|
|
16
15
|
_id: '123456789123',
|
|
17
16
|
content: {type: 'skill', ref: '_skill-ref'},
|
|
@@ -76,7 +75,7 @@ test('should dispatch EDIT_QCM action via the property onClick of a QCM slide',
|
|
|
76
75
|
];
|
|
77
76
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
78
77
|
|
|
79
|
-
const props = mapStateToSlidesProps(getState(), dispatch,
|
|
78
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
80
79
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
81
80
|
animationType: undefined,
|
|
82
81
|
animateCorrectionPopin: false,
|
|
@@ -4,14 +4,13 @@ import get from 'lodash/fp/get';
|
|
|
4
4
|
import identity from 'lodash/fp/identity';
|
|
5
5
|
import {mapStateToSlidesProps} from '..';
|
|
6
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
7
|
-
import {services
|
|
7
|
+
import {services} from '../../../test/util/services.mock';
|
|
8
8
|
import {createTestStore} from '../../../actions/test/create-test-store';
|
|
9
9
|
import {StoreState} from '../../../reducers';
|
|
10
10
|
import {EDIT_SLIDER} from '../../../actions/ui/answers';
|
|
11
11
|
import {QuestionRange} from '../../../types/slides';
|
|
12
12
|
import {sliderSlide} from './fixtures/slider';
|
|
13
13
|
|
|
14
|
-
const connectedOptions = {translate, onQuitClick: identity};
|
|
15
14
|
const progression: ProgressionFromAPI = {
|
|
16
15
|
_id: '123456789123',
|
|
17
16
|
content: {type: 'skill', ref: '_skill-ref'},
|
|
@@ -74,7 +73,7 @@ test('should dispatch EDIT_SLIDER action via the property onChange of a Slider s
|
|
|
74
73
|
];
|
|
75
74
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
76
75
|
|
|
77
|
-
const props = mapStateToSlidesProps(getState(), dispatch,
|
|
76
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
78
77
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
79
78
|
animationType: undefined,
|
|
80
79
|
animateCorrectionPopin: false,
|
|
@@ -5,13 +5,12 @@ import identity from 'lodash/fp/identity';
|
|
|
5
5
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
6
|
import {StoreState} from '../../../reducers';
|
|
7
7
|
import {mapStateToSlidesProps} from '..';
|
|
8
|
-
import {services
|
|
8
|
+
import {services} from '../../../test/util/services.mock';
|
|
9
9
|
import {createTestStore} from '../../../actions/test/create-test-store';
|
|
10
10
|
import {EDIT_SLIDER} from '../../../actions/ui/answers';
|
|
11
11
|
import {QuestionRange} from '../../../types/slides';
|
|
12
12
|
import {sliderSlide} from './fixtures/slider';
|
|
13
13
|
|
|
14
|
-
const connectedOptions = {translate, onQuitClick: identity};
|
|
15
14
|
const progression: ProgressionFromAPI = {
|
|
16
15
|
_id: '123456789123',
|
|
17
16
|
content: {type: 'skill', ref: '_skill-ref'},
|
|
@@ -73,7 +72,7 @@ test('should dispatch EDIT_SLIDER action via the property onSliderChange of a Sl
|
|
|
73
72
|
}
|
|
74
73
|
];
|
|
75
74
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
76
|
-
const props = mapStateToSlidesProps(getState(), dispatch,
|
|
75
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
77
76
|
|
|
78
77
|
const slideProps = props.stack.slides['0'].answerUI?.model as QuestionRange;
|
|
79
78
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
@@ -5,14 +5,13 @@ import set from 'lodash/fp/set';
|
|
|
5
5
|
import identity from 'lodash/fp/identity';
|
|
6
6
|
import {mapStateToSlidesProps} from '..';
|
|
7
7
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
8
|
-
import {services
|
|
8
|
+
import {services} from '../../../test/util/services.mock';
|
|
9
9
|
import {createTestStore} from '../../../actions/test/create-test-store';
|
|
10
10
|
import {StoreState} from '../../../reducers';
|
|
11
11
|
import {EDIT_TEMPLATE} from '../../../actions/ui/answers';
|
|
12
12
|
import {Template, TextTemplate} from '../../../types/slides';
|
|
13
13
|
import {templateSlide} from './fixtures/template';
|
|
14
14
|
|
|
15
|
-
const connectedOptions = {translate, onQuitClick: identity};
|
|
16
15
|
const progression: ProgressionFromAPI = {
|
|
17
16
|
_id: '123456789123',
|
|
18
17
|
content: {type: 'skill', ref: '_skill-ref'},
|
|
@@ -72,7 +71,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
72
71
|
];
|
|
73
72
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
74
73
|
|
|
75
|
-
const props = mapStateToSlidesProps(getState(), dispatch,
|
|
74
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
76
75
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
77
76
|
animationType: undefined,
|
|
78
77
|
animateCorrectionPopin: false,
|
|
@@ -103,7 +102,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
103
102
|
expectedActions
|
|
104
103
|
);
|
|
105
104
|
|
|
106
|
-
const props = mapStateToSlidesProps(getState(), dispatch,
|
|
105
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
107
106
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
108
107
|
animationType: undefined,
|
|
109
108
|
animateCorrectionPopin: false,
|
|
@@ -120,7 +119,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
120
119
|
const onChangeText = get(['1', 'onChange'], slideProps.answers);
|
|
121
120
|
onChangeText('');
|
|
122
121
|
|
|
123
|
-
const newProps = mapStateToSlidesProps(getState(), dispatch,
|
|
122
|
+
const newProps = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
124
123
|
const slidePropsAfterOnChange = newProps.stack.slides['0'].answerUI?.model as Template;
|
|
125
124
|
const textAnswerPropsAfterOnChange = slidePropsAfterOnChange.answers[1] as TextTemplate;
|
|
126
125
|
t.is(textAnswerPropsAfterOnChange.value, '');
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Review Title": "Review Mode",
|
|
3
|
-
"Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
|
|
4
|
-
"Validate": "Validate",
|
|
5
|
-
"Next Question": "Next Question",
|
|
6
|
-
"KLF": "Key Learning Factor",
|
|
7
|
-
"Correct Answer": "Correct Answer",
|
|
8
|
-
"Wrong Answer": "Wrong Answer",
|
|
9
|
-
"You have won": "You have won",
|
|
10
|
-
"You are now": "You are now",
|
|
11
|
-
"Revise another skill": "Revise another skill",
|
|
12
|
-
"Continue reviewing": "Continue reviewing",
|
|
13
|
-
"Congratulations!": "Congratulations!"
|
|
14
|
-
}
|
package/es/sandbox/index.d.ts
DELETED
package/es/sandbox/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from 'react-dom';
|
|
3
|
-
import isNil from 'lodash/fp/isNil';
|
|
4
|
-
import get from 'lodash/fp/get';
|
|
5
|
-
import pipe from 'lodash/fp/pipe';
|
|
6
|
-
import createTranslate from '@coorpacademy/translate';
|
|
7
|
-
import { WebContext } from '@coorpacademy/components/es/atom/provider';
|
|
8
|
-
import localesComponents from '@coorpacademy/components/locales/en/global.json';
|
|
9
|
-
import localesAppReview from '../locales/en/review.json';
|
|
10
|
-
import AppReview from '../src';
|
|
11
|
-
import { services } from '../src/test/util/services.mock';
|
|
12
|
-
const translate = (key, data) => {
|
|
13
|
-
try {
|
|
14
|
-
return createTranslate({
|
|
15
|
-
...localesAppReview,
|
|
16
|
-
...localesComponents
|
|
17
|
-
})(key, data);
|
|
18
|
-
}
|
|
19
|
-
catch (err) {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.error(err);
|
|
22
|
-
return createTranslate({ [key]: key })(key, data);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const isContainerAvailable = (options) => !pipe(get('container'), isNil)(options);
|
|
26
|
-
const createSandbox = (options) => {
|
|
27
|
-
if (!isContainerAvailable(options)) {
|
|
28
|
-
// eslint-disable-next-line no-console
|
|
29
|
-
console.error('[AppReview sandbox] Requires a container.');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
const container = document.getElementById(options.container);
|
|
33
|
-
// mode mobile/web
|
|
34
|
-
const appOptions = {
|
|
35
|
-
token: process.env.API_TEST_TOKEN || '',
|
|
36
|
-
skillRef: '123',
|
|
37
|
-
services,
|
|
38
|
-
translate,
|
|
39
|
-
onQuitClick: () => {
|
|
40
|
-
location.reload();
|
|
41
|
-
},
|
|
42
|
-
url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
|
|
43
|
-
};
|
|
44
|
-
const skin = {
|
|
45
|
-
common: {
|
|
46
|
-
primary: '#248e59'
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
render(React.createElement(WebContext, { skin: skin, translate: translate },
|
|
50
|
-
React.createElement(AppReview, { options: appOptions })), container);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
if (window && !window.createSandbox) {
|
|
54
|
-
window.createSandbox = createSandbox;
|
|
55
|
-
}
|
|
56
|
-
createSandbox({ container: 'root' });
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Review Title": "Review Mode",
|
|
3
|
-
"Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
|
|
4
|
-
"Validate": "Validate",
|
|
5
|
-
"Next Question": "Next Question",
|
|
6
|
-
"KLF": "Key Learning Factor",
|
|
7
|
-
"Correct Answer": "Correct Answer",
|
|
8
|
-
"Wrong Answer": "Wrong Answer",
|
|
9
|
-
"You have won": "You have won",
|
|
10
|
-
"You are now": "You are now",
|
|
11
|
-
"Revise another skill": "Revise another skill",
|
|
12
|
-
"Continue reviewing": "Continue reviewing",
|
|
13
|
-
"Congratulations!": "Congratulations!"
|
|
14
|
-
}
|
package/lib/sandbox/index.d.ts
DELETED
package/lib/sandbox/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { render } from 'react-dom';
|
|
14
|
-
import isNil from 'lodash/fp/isNil';
|
|
15
|
-
import get from 'lodash/fp/get';
|
|
16
|
-
import pipe from 'lodash/fp/pipe';
|
|
17
|
-
import createTranslate from '@coorpacademy/translate';
|
|
18
|
-
import { WebContext } from '@coorpacademy/components/es/atom/provider';
|
|
19
|
-
import localesComponents from '@coorpacademy/components/locales/en/global.json';
|
|
20
|
-
import localesAppReview from '../locales/en/review.json';
|
|
21
|
-
import AppReview from '../src';
|
|
22
|
-
import { services } from '../src/test/util/services.mock';
|
|
23
|
-
var translate = function (key, data) {
|
|
24
|
-
var _a;
|
|
25
|
-
try {
|
|
26
|
-
return createTranslate(__assign(__assign({}, localesAppReview), localesComponents))(key, data);
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
// eslint-disable-next-line no-console
|
|
30
|
-
console.error(err);
|
|
31
|
-
return createTranslate((_a = {}, _a[key] = key, _a))(key, data);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
var isContainerAvailable = function (options) {
|
|
35
|
-
return !pipe(get('container'), isNil)(options);
|
|
36
|
-
};
|
|
37
|
-
var createSandbox = function (options) {
|
|
38
|
-
if (!isContainerAvailable(options)) {
|
|
39
|
-
// eslint-disable-next-line no-console
|
|
40
|
-
console.error('[AppReview sandbox] Requires a container.');
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
var container = document.getElementById(options.container);
|
|
44
|
-
// mode mobile/web
|
|
45
|
-
var appOptions = {
|
|
46
|
-
token: process.env.API_TEST_TOKEN || '',
|
|
47
|
-
skillRef: '123',
|
|
48
|
-
services: services,
|
|
49
|
-
translate: translate,
|
|
50
|
-
onQuitClick: function () {
|
|
51
|
-
location.reload();
|
|
52
|
-
},
|
|
53
|
-
url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
|
|
54
|
-
};
|
|
55
|
-
var skin = {
|
|
56
|
-
common: {
|
|
57
|
-
primary: '#248e59'
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
render(React.createElement(WebContext, { skin: skin, translate: translate },
|
|
61
|
-
React.createElement(AppReview, { options: appOptions })), container);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
if (window && !window.createSandbox) {
|
|
65
|
-
window.createSandbox = createSandbox;
|
|
66
|
-
}
|
|
67
|
-
createSandbox({ container: 'root' });
|
package/locales/en/review.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Review Title": "Review Mode",
|
|
3
|
-
"Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
|
|
4
|
-
"Validate": "Validate",
|
|
5
|
-
"Next Question": "Next Question",
|
|
6
|
-
"KLF": "Key Learning Factor",
|
|
7
|
-
"Correct Answer": "Correct Answer",
|
|
8
|
-
"Wrong Answer": "Wrong Answer",
|
|
9
|
-
"You have won": "You have won",
|
|
10
|
-
"You are now": "You are now",
|
|
11
|
-
"Revise another skill": "Revise another skill",
|
|
12
|
-
"Continue reviewing": "Continue reviewing",
|
|
13
|
-
"Congratulations!": "Congratulations!"
|
|
14
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|