@coorpacademy/app-review 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/sandbox/index.d.ts +9 -0
- package/es/sandbox/index.js +41 -0
- package/es/{actions → src/actions}/api/fetch-correction.d.ts +2 -2
- package/{lib → es/src}/actions/api/fetch-rank.d.ts +3 -3
- package/{lib → es/src}/actions/api/fetch-skills.d.ts +2 -2
- package/{lib → es/src}/actions/api/fetch-slide.d.ts +2 -2
- package/{lib → es/src}/actions/api/post-answer.d.ts +2 -2
- package/es/{actions → src/actions}/api/post-progression.d.ts +2 -2
- package/es/{actions → src/actions}/test/create-test-store.d.ts +2 -2
- package/es/{actions → src/actions}/test/create-test-store.js +2 -2
- package/es/src/actions/ui/navigation.d.ts +19 -0
- package/es/src/actions/ui/navigation.js +26 -0
- package/{lib → es/src}/common/index.d.ts +0 -5
- package/es/{common → src/common}/index.js +0 -5
- package/es/{configure-store.js → src/configure-store.js} +5 -1
- package/{lib → es/src}/index.d.ts +0 -1
- package/es/{index.js → src/index.js} +3 -3
- package/{lib → es/src}/reducers/index.d.ts +1 -1
- package/es/{reducers → src/reducers}/ui/index.d.ts +1 -1
- package/{lib → es/src}/reducers/ui/navigation.d.ts +2 -2
- package/es/{reducers → src/reducers}/ui/navigation.js +1 -1
- package/{lib → es/src}/types/common.d.ts +7 -4
- package/{lib → es/src}/views/skills/index.d.ts +1 -3
- package/es/{views → src/views}/skills/index.js +0 -2
- package/es/src/views/slides/index.d.ts +34 -0
- package/es/{views → src/views}/slides/index.js +6 -4
- package/lib/sandbox/index.d.ts +9 -0
- package/lib/sandbox/index.js +43 -0
- package/lib/{actions → src/actions}/api/fetch-correction.d.ts +2 -2
- package/{es → lib/src}/actions/api/fetch-rank.d.ts +3 -3
- package/{es → lib/src}/actions/api/fetch-skills.d.ts +2 -2
- package/{es → lib/src}/actions/api/fetch-slide.d.ts +2 -2
- package/{es → lib/src}/actions/api/post-answer.d.ts +2 -2
- package/lib/{actions → src/actions}/api/post-progression.d.ts +2 -2
- package/lib/{actions → src/actions}/test/create-test-store.d.ts +2 -2
- package/lib/{actions → src/actions}/test/create-test-store.js +2 -2
- package/lib/src/actions/ui/navigation.d.ts +19 -0
- package/lib/src/actions/ui/navigation.js +86 -0
- package/{es → lib/src}/common/index.d.ts +0 -5
- package/lib/{common → src/common}/index.js +0 -5
- package/lib/{configure-store.js → src/configure-store.js} +5 -1
- package/{es → lib/src}/index.d.ts +0 -1
- package/lib/{index.js → src/index.js} +3 -3
- package/{es → lib/src}/reducers/index.d.ts +1 -1
- package/lib/{reducers → src/reducers}/ui/index.d.ts +1 -1
- package/{es → lib/src}/reducers/ui/navigation.d.ts +2 -2
- package/lib/{reducers → src/reducers}/ui/navigation.js +1 -1
- package/{es → lib/src}/types/common.d.ts +7 -4
- package/{es → lib/src}/views/skills/index.d.ts +1 -3
- package/lib/{views → src/views}/skills/index.js +0 -2
- package/lib/src/views/slides/index.d.ts +34 -0
- package/lib/{views → src/views}/slides/index.js +6 -4
- package/package.json +3 -3
- package/src/actions/api/fetch-correction.ts +2 -2
- package/src/actions/api/fetch-rank.ts +3 -3
- package/src/actions/api/fetch-skills.ts +2 -2
- package/src/actions/api/fetch-slide.ts +6 -2
- package/src/actions/api/post-answer.ts +2 -2
- package/src/actions/api/post-progression.ts +6 -2
- package/src/actions/api/test/fetch-correction.test.ts +2 -2
- package/src/actions/api/test/fetch-rank.test.ts +4 -4
- package/src/actions/api/test/fetch-skills.test.ts +2 -2
- package/src/actions/api/test/fetch-slide.test.ts +2 -2
- package/src/actions/api/test/post-answer.test.ts +11 -7
- package/src/actions/api/test/post-progression.test.ts +2 -2
- package/src/actions/data/test/token.test.ts +1 -1
- package/src/actions/test/create-test-store.ts +3 -3
- package/src/actions/ui/navigation.ts +49 -17
- package/src/actions/ui/test/answers.test.ts +8 -8
- package/src/actions/ui/test/navigation.test.ts +95 -0
- package/src/actions/ui/test/next-slide.test.ts +2 -2
- package/src/actions/ui/test/quit-popin.test.ts +2 -2
- package/src/actions/ui/test/slides.test.ts +1 -1
- package/src/common/index.ts +0 -10
- package/src/configure-store.ts +8 -2
- package/src/index.tsx +8 -6
- package/src/reducers/ui/navigation.ts +5 -5
- package/src/reducers/ui/test/navigation.test.ts +5 -5
- package/src/types/common.ts +9 -5
- package/src/views/skills/index.ts +1 -5
- package/src/views/skills/test/skills.test.ts +0 -4
- package/src/views/slides/index.ts +20 -132
- package/src/views/slides/test/header.on-click.test.ts +1 -1
- package/src/views/slides/test/index.test.ts +21 -6
- package/src/views/slides/test/on-quit-popin.on-click.test.ts +6 -5
- package/src/views/slides/test/slide.free-text.on-change.test.ts +3 -4
- package/src/views/slides/test/slide.next-slide.on-click.test.ts +7 -5
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.qcm.on-click.test.ts +1 -1
- package/src/views/slides/test/slide.slider.on-change.test.ts +1 -1
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +1 -1
- package/src/views/slides/test/slide.template.on-change.test.ts +2 -2
- package/es/actions/index.d.ts +0 -5
- package/es/actions/index.js +0 -1
- package/es/actions/ui/navigation.d.ts +0 -18
- package/es/actions/ui/navigation.js +0 -10
- package/es/views/slides/index.d.ts +0 -142
- package/lib/actions/index.d.ts +0 -5
- package/lib/actions/index.js +0 -1
- package/lib/actions/ui/navigation.d.ts +0 -18
- package/lib/actions/ui/navigation.js +0 -10
- package/lib/views/slides/index.d.ts +0 -142
- package/src/actions/index.ts +0 -6
- /package/es/{actions → src/actions}/api/fetch-correction.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-rank.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-skills.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-slide.js +0 -0
- /package/es/{actions → src/actions}/api/post-answer.js +0 -0
- /package/es/{actions → src/actions}/api/post-progression.js +0 -0
- /package/es/{actions → src/actions}/data/token.d.ts +0 -0
- /package/es/{actions → src/actions}/data/token.js +0 -0
- /package/es/{actions → src/actions}/ui/answers.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/answers.js +0 -0
- /package/es/{actions → src/actions}/ui/next-slide.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/next-slide.js +0 -0
- /package/es/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/quit-popin.js +0 -0
- /package/es/{actions → src/actions}/ui/slides.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/slides.js +0 -0
- /package/es/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
- /package/es/{helpers → src/helpers}/css-register.d.ts +0 -0
- /package/es/{helpers → src/helpers}/css-register.js +0 -0
- /package/es/{reducers → src/reducers}/data/corrections.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/corrections.js +0 -0
- /package/es/{reducers → src/reducers}/data/index.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/index.js +0 -0
- /package/es/{reducers → src/reducers}/data/progression.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/progression.js +0 -0
- /package/es/{reducers → src/reducers}/data/rank.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/rank.js +0 -0
- /package/es/{reducers → src/reducers}/data/skills.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/skills.js +0 -0
- /package/es/{reducers → src/reducers}/data/slides.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/slides.js +0 -0
- /package/es/{reducers → src/reducers}/data/token.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/token.js +0 -0
- /package/es/{reducers → src/reducers}/index.js +0 -0
- /package/es/{reducers → src/reducers}/ui/answers.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/answers.js +0 -0
- /package/es/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
- /package/es/{reducers → src/reducers}/ui/index.js +0 -0
- /package/es/{reducers → src/reducers}/ui/positions.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/positions.js +0 -0
- /package/es/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/quit-popin.js +0 -0
- /package/es/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/show-congrats.js +0 -0
- /package/es/{reducers → src/reducers}/ui/slide.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/slide.js +0 -0
- /package/es/{services → src/services}/fetch-correction.d.ts +0 -0
- /package/es/{services → src/services}/fetch-correction.js +0 -0
- /package/es/{services → src/services}/fetch-rank.d.ts +0 -0
- /package/es/{services → src/services}/fetch-rank.js +0 -0
- /package/es/{services → src/services}/fetch-skills.d.ts +0 -0
- /package/es/{services → src/services}/fetch-skills.js +0 -0
- /package/es/{services → src/services}/fetch-slide.d.ts +0 -0
- /package/es/{services → src/services}/fetch-slide.js +0 -0
- /package/es/{services → src/services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/es/{services → src/services}/fetch-slides-to-review-by-skill-ref.js +0 -0
- /package/es/{services → src/services}/index.d.ts +0 -0
- /package/es/{services → src/services}/index.js +0 -0
- /package/es/{services → src/services}/post-answer.d.ts +0 -0
- /package/es/{services → src/services}/post-answer.js +0 -0
- /package/es/{services → src/services}/post-progression.d.ts +0 -0
- /package/es/{services → src/services}/post-progression.js +0 -0
- /package/es/{services → src/services}/tools/fetch-responses.d.ts +0 -0
- /package/es/{services → src/services}/tools/fetch-responses.js +0 -0
- /package/es/{services → src/services}/tools/sleep.d.ts +0 -0
- /package/es/{services → src/services}/tools/sleep.js +0 -0
- /package/es/{test → src/test}/index.test.d.ts +0 -0
- /package/es/{test → src/test}/index.test.js +0 -0
- /package/es/{test → src/test}/util/services.mock.d.ts +0 -0
- /package/es/{test → src/test}/util/services.mock.js +0 -0
- /package/es/{types → src/types}/common.js +0 -0
- /package/es/{types → src/types}/slides.d.ts +0 -0
- /package/es/{types → src/types}/slides.js +0 -0
- /package/es/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/es/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/slider.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/template.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-correction.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-rank.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-skills.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-slide.js +0 -0
- /package/lib/{actions → src/actions}/api/post-answer.js +0 -0
- /package/lib/{actions → src/actions}/api/post-progression.js +0 -0
- /package/lib/{actions → src/actions}/data/token.d.ts +0 -0
- /package/lib/{actions → src/actions}/data/token.js +0 -0
- /package/lib/{actions → src/actions}/ui/answers.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/answers.js +0 -0
- /package/lib/{actions → src/actions}/ui/next-slide.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/next-slide.js +0 -0
- /package/lib/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/quit-popin.js +0 -0
- /package/lib/{actions → src/actions}/ui/slides.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/slides.js +0 -0
- /package/lib/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
- /package/lib/{helpers → src/helpers}/css-register.d.ts +0 -0
- /package/lib/{helpers → src/helpers}/css-register.js +0 -0
- /package/lib/{reducers → src/reducers}/data/corrections.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/corrections.js +0 -0
- /package/lib/{reducers → src/reducers}/data/index.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/index.js +0 -0
- /package/lib/{reducers → src/reducers}/data/progression.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/progression.js +0 -0
- /package/lib/{reducers → src/reducers}/data/rank.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/rank.js +0 -0
- /package/lib/{reducers → src/reducers}/data/skills.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/skills.js +0 -0
- /package/lib/{reducers → src/reducers}/data/slides.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/slides.js +0 -0
- /package/lib/{reducers → src/reducers}/data/token.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/token.js +0 -0
- /package/lib/{reducers → src/reducers}/index.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/answers.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/answers.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/index.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/positions.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/positions.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/quit-popin.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/show-congrats.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/slide.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/slide.js +0 -0
- /package/lib/{services → src/services}/fetch-correction.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-correction.js +0 -0
- /package/lib/{services → src/services}/fetch-rank.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-rank.js +0 -0
- /package/lib/{services → src/services}/fetch-skills.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-skills.js +0 -0
- /package/lib/{services → src/services}/fetch-slide.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-slide.js +0 -0
- /package/lib/{services → src/services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-slides-to-review-by-skill-ref.js +0 -0
- /package/lib/{services → src/services}/index.d.ts +0 -0
- /package/lib/{services → src/services}/index.js +0 -0
- /package/lib/{services → src/services}/post-answer.d.ts +0 -0
- /package/lib/{services → src/services}/post-answer.js +0 -0
- /package/lib/{services → src/services}/post-progression.d.ts +0 -0
- /package/lib/{services → src/services}/post-progression.js +0 -0
- /package/lib/{services → src/services}/tools/fetch-responses.d.ts +0 -0
- /package/lib/{services → src/services}/tools/fetch-responses.js +0 -0
- /package/lib/{services → src/services}/tools/sleep.d.ts +0 -0
- /package/lib/{services → src/services}/tools/sleep.js +0 -0
- /package/lib/{test → src/test}/index.test.d.ts +0 -0
- /package/lib/{test → src/test}/index.test.js +0 -0
- /package/lib/{test → src/test}/util/services.mock.d.ts +0 -0
- /package/lib/{test → src/test}/util/services.mock.js +0 -0
- /package/lib/{types → src/types}/common.js +0 -0
- /package/lib/{types → src/types}/slides.d.ts +0 -0
- /package/lib/{types → src/types}/slides.js +0 -0
- /package/lib/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/lib/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/slider.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/template.js +0 -0
|
@@ -96,7 +96,7 @@ test('should dispatch POST_PROGRESSION_SUCCESS and SLIDE_FETCH_REQUEST actions w
|
|
|
96
96
|
{type: SET_CURRENT_SLIDE, payload: freeTextSlide}
|
|
97
97
|
];
|
|
98
98
|
|
|
99
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedActions);
|
|
99
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
100
100
|
|
|
101
101
|
await dispatch(postProgression('skill_12345'));
|
|
102
102
|
});
|
|
@@ -121,7 +121,7 @@ test('should dispatch POST_PROGRESSION_FAILURE action when postProgression fails
|
|
|
121
121
|
}
|
|
122
122
|
];
|
|
123
123
|
|
|
124
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedActions);
|
|
124
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
125
125
|
|
|
126
126
|
await dispatch(postProgression('skill_12345'));
|
|
127
127
|
});
|
|
@@ -27,6 +27,6 @@ const initialState: StoreState = {
|
|
|
27
27
|
test('should dispatch STORE_TOKEN action when storeToken is called', async t => {
|
|
28
28
|
const expectedActions = [{type: STORE_TOKEN, payload: 'JWT.token'}];
|
|
29
29
|
|
|
30
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedActions);
|
|
30
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
31
31
|
await dispatch(storeToken('JWT.token'));
|
|
32
32
|
});
|
|
@@ -2,8 +2,8 @@ import type {ExecutionContext} from 'ava';
|
|
|
2
2
|
import constant from 'lodash/fp/constant';
|
|
3
3
|
import {AnyAction, applyMiddleware, compose, createStore, Dispatch, Middleware, Store} from 'redux';
|
|
4
4
|
import thunk from 'redux-thunk';
|
|
5
|
+
import {ThunkOptions} from '../../types/common';
|
|
5
6
|
import rootReducer, {StoreState} from '../../reducers';
|
|
6
|
-
import {Services} from '../../types/common';
|
|
7
7
|
|
|
8
8
|
const assertActionsMiddleware = (t: ExecutionContext, ACTIONS: AnyAction[]): Middleware =>
|
|
9
9
|
constant((next: Dispatch) => (action: AnyAction): unknown => {
|
|
@@ -16,10 +16,10 @@ const assertActionsMiddleware = (t: ExecutionContext, ACTIONS: AnyAction[]): Mid
|
|
|
16
16
|
export const createTestStore = (
|
|
17
17
|
t: ExecutionContext,
|
|
18
18
|
initialState: StoreState,
|
|
19
|
-
|
|
19
|
+
thunkOptions: ThunkOptions,
|
|
20
20
|
actions: AnyAction[]
|
|
21
21
|
): Store<StoreState, AnyAction> => {
|
|
22
|
-
const thunkMiddleware = thunk.withExtraArgument(
|
|
22
|
+
const thunkMiddleware = thunk.withExtraArgument(thunkOptions);
|
|
23
23
|
const enhancer = compose(applyMiddleware(thunkMiddleware, assertActionsMiddleware(t, actions)));
|
|
24
24
|
return createStore(rootReducer, initialState, enhancer);
|
|
25
25
|
};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Dispatch} from 'redux';
|
|
2
|
+
import type {StoreState} from '../../reducers';
|
|
3
|
+
import {ThunkOptions, AppOptions, ViewName} from '../../types/common';
|
|
2
4
|
|
|
3
|
-
export
|
|
4
|
-
export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
5
|
-
export const START_APP = '@@navigation/START_APP';
|
|
6
|
-
|
|
7
|
-
export type ViewPath = 'skills' | 'onboarding' | 'slides' | 'loader';
|
|
8
|
-
|
|
9
|
-
export type NavigateTo = {
|
|
5
|
+
export type NavigateToAction = {
|
|
10
6
|
type: '@@navigation/NAVIGATE_TO';
|
|
11
|
-
payload:
|
|
7
|
+
payload: ViewName;
|
|
12
8
|
};
|
|
13
9
|
|
|
14
|
-
export type
|
|
10
|
+
export type NavigateBackAction = {
|
|
15
11
|
type: '@@navigation/NAVIGATE_BACK';
|
|
16
12
|
};
|
|
17
13
|
|
|
@@ -20,11 +16,47 @@ export type StartApp = {
|
|
|
20
16
|
payload: AppOptions;
|
|
21
17
|
};
|
|
22
18
|
|
|
23
|
-
export const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
export const NAVIGATE_TO = '@@navigation/NAVIGATE_TO';
|
|
20
|
+
export const NAVIGATE_BACK = '@@navigation/NAVIGATE_BACK';
|
|
21
|
+
export const START_APP = '@@navigation/START_APP';
|
|
22
|
+
|
|
23
|
+
export const navigateTo =
|
|
24
|
+
(newViewName: ViewName) =>
|
|
25
|
+
async (
|
|
26
|
+
dispatch: Dispatch,
|
|
27
|
+
getState: () => StoreState,
|
|
28
|
+
{callbackOnViewChanged}: ThunkOptions
|
|
29
|
+
): Promise<NavigateToAction> => {
|
|
30
|
+
const action: NavigateToAction = {
|
|
31
|
+
type: NAVIGATE_TO,
|
|
32
|
+
payload: newViewName
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const res = await dispatch(action);
|
|
36
|
+
|
|
37
|
+
if (callbackOnViewChanged) {
|
|
38
|
+
callbackOnViewChanged(newViewName);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return res;
|
|
42
|
+
};
|
|
27
43
|
|
|
28
|
-
export const navigateBack =
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
export const navigateBack = async (
|
|
45
|
+
dispatch: Dispatch,
|
|
46
|
+
getState: () => StoreState,
|
|
47
|
+
{callbackOnViewChanged}: ThunkOptions
|
|
48
|
+
): Promise<NavigateBackAction> => {
|
|
49
|
+
const action: NavigateBackAction = {
|
|
50
|
+
type: NAVIGATE_BACK
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const res = await dispatch(action);
|
|
54
|
+
|
|
55
|
+
if (callbackOnViewChanged) {
|
|
56
|
+
const storeState: StoreState = getState();
|
|
57
|
+
const viewName = storeState.ui.navigation[storeState.ui.navigation.length - 1];
|
|
58
|
+
callbackOnViewChanged(viewName);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return res;
|
|
62
|
+
};
|
|
@@ -73,7 +73,7 @@ test('editAnswer should throw an Error if the slide is not found', async t => {
|
|
|
73
73
|
const {dispatch} = createTestStore(
|
|
74
74
|
t,
|
|
75
75
|
omit(['data', 'slides'], state) as StoreState,
|
|
76
|
-
services,
|
|
76
|
+
{services},
|
|
77
77
|
expectedActions
|
|
78
78
|
);
|
|
79
79
|
await t.throws(
|
|
@@ -88,7 +88,7 @@ test('editAnswer should throw an Error for unsupported questions', async t => {
|
|
|
88
88
|
...freeTextSlide,
|
|
89
89
|
question: {...freeTextSlide.question, type: 'unsupportedType'} as unknown as Question
|
|
90
90
|
});
|
|
91
|
-
const {dispatch} = createTestStore(t, state, services, []);
|
|
91
|
+
const {dispatch} = createTestStore(t, state, {services}, []);
|
|
92
92
|
await t.throws(
|
|
93
93
|
() => dispatch(editAnswer(['Some kind of answer'])),
|
|
94
94
|
undefined,
|
|
@@ -101,7 +101,7 @@ test('should dispatch EDIT_BASIC action when editAnswer is called', async t => {
|
|
|
101
101
|
const expectedActions = [
|
|
102
102
|
{type: ANSWER_EDIT.basic, meta: {slideRef: freeTextSlide.universalRef}, payload: ['My Answer']}
|
|
103
103
|
];
|
|
104
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
104
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
105
105
|
await dispatch(editAnswer(['My Answer']));
|
|
106
106
|
});
|
|
107
107
|
|
|
@@ -112,7 +112,7 @@ test('should dispatch EDIT_QCM action when editAnswer is called', async t => {
|
|
|
112
112
|
const expectedActions = [
|
|
113
113
|
{type: ANSWER_EDIT.qcm, meta: {slideRef: qcmSlide.universalRef}, payload: ['My First Answer']}
|
|
114
114
|
];
|
|
115
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
115
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
116
116
|
await dispatch(editAnswer(['My Second Answer']));
|
|
117
117
|
});
|
|
118
118
|
|
|
@@ -131,7 +131,7 @@ test('should dispatch EDIT_QCM_GRAPHIC action when editAnswer is called', async
|
|
|
131
131
|
payload: ['My First Answer', 'My Third Answer']
|
|
132
132
|
}
|
|
133
133
|
];
|
|
134
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
134
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
135
135
|
await dispatch(editAnswer(['My Second Answer']));
|
|
136
136
|
});
|
|
137
137
|
|
|
@@ -146,7 +146,7 @@ test('should dispatch EDIT_QCM_DRAG action when editAnswer is called', async t =
|
|
|
146
146
|
payload: ['My First Answer', 'My Second Answer', 'My Third Answer']
|
|
147
147
|
}
|
|
148
148
|
];
|
|
149
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
149
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
150
150
|
await dispatch(editAnswer(['My Third Answer']));
|
|
151
151
|
});
|
|
152
152
|
|
|
@@ -155,7 +155,7 @@ test('should dispatch EDIT_SLIDER action when editAnswer is called', async t =>
|
|
|
155
155
|
const expectedActions = [
|
|
156
156
|
{type: ANSWER_EDIT.slider, meta: {slideRef: sliderSlide.universalRef}, payload: ['5']}
|
|
157
157
|
];
|
|
158
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
158
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
159
159
|
await dispatch(editAnswer(['5']));
|
|
160
160
|
});
|
|
161
161
|
|
|
@@ -169,6 +169,6 @@ test('should dispatch EDIT_TEMPLATE action when editAnswer is called', async t =
|
|
|
169
169
|
payload: ['Catalogue', 'My Answer', 'étoiles']
|
|
170
170
|
}
|
|
171
171
|
];
|
|
172
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
172
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
173
173
|
await dispatch(editAnswer(['Catalogue', 'My Answer', 'étoiles']));
|
|
174
174
|
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import {createTestStore} from '../../test/create-test-store';
|
|
3
|
+
import type {StoreState} from '../../../reducers';
|
|
4
|
+
import {services} from '../../../test/util/services.mock';
|
|
5
|
+
import {navigateBack, navigateTo} from '../navigation';
|
|
6
|
+
|
|
7
|
+
const initialState: StoreState = {
|
|
8
|
+
data: {
|
|
9
|
+
progression: null,
|
|
10
|
+
slides: {},
|
|
11
|
+
skills: [],
|
|
12
|
+
token: '1234',
|
|
13
|
+
corrections: {},
|
|
14
|
+
rank: {start: 10, end: Number.NaN}
|
|
15
|
+
},
|
|
16
|
+
ui: {
|
|
17
|
+
positions: [0, 1, 2, 3, 4],
|
|
18
|
+
currentSlideRef: '',
|
|
19
|
+
navigation: ['loader', 'skills'],
|
|
20
|
+
answers: {},
|
|
21
|
+
slide: {},
|
|
22
|
+
showCongrats: false,
|
|
23
|
+
showQuitPopin: false
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
test('should dispatch NAVIGATE_TO', async t => {
|
|
28
|
+
const expectedActions = [
|
|
29
|
+
{
|
|
30
|
+
type: '@@navigation/NAVIGATE_TO',
|
|
31
|
+
payload: 'slides'
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
36
|
+
await dispatch(navigateTo('slides'));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('should dispatch NAVIGATE_BACK', t => {
|
|
40
|
+
const expectedActions = [
|
|
41
|
+
{
|
|
42
|
+
type: '@@navigation/NAVIGATE_BACK'
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
47
|
+
dispatch(navigateBack);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('should dispatch NAVIGATE_TO with callbackOnViewChanged', async t => {
|
|
51
|
+
t.plan(2);
|
|
52
|
+
|
|
53
|
+
const callbackOnViewChanged = (viewName: string): void => {
|
|
54
|
+
t.is(viewName, 'slides');
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const expectedActions = [
|
|
58
|
+
{
|
|
59
|
+
type: '@@navigation/NAVIGATE_TO',
|
|
60
|
+
payload: 'slides'
|
|
61
|
+
}
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
const {dispatch} = createTestStore(
|
|
65
|
+
t,
|
|
66
|
+
initialState,
|
|
67
|
+
{callbackOnViewChanged, services},
|
|
68
|
+
expectedActions
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
await dispatch(navigateTo('slides'));
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
test('should dispatch NAVIGATE_BACK with callbackOnViewChanged', async t => {
|
|
75
|
+
t.plan(2);
|
|
76
|
+
|
|
77
|
+
const callbackOnViewChanged = (viewName: string): void => {
|
|
78
|
+
t.is(viewName, 'loader');
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const expectedActions = [
|
|
82
|
+
{
|
|
83
|
+
type: '@@navigation/NAVIGATE_BACK'
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
const {dispatch} = createTestStore(
|
|
88
|
+
t,
|
|
89
|
+
initialState,
|
|
90
|
+
{callbackOnViewChanged, services},
|
|
91
|
+
expectedActions
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
await dispatch(navigateBack);
|
|
95
|
+
});
|
|
@@ -60,7 +60,7 @@ test('should dispatch NEXT_SLIDE action when nextSlide is called and the progres
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
];
|
|
63
|
-
const {dispatch} = createTestStore(t, state, services, expectedActions);
|
|
63
|
+
const {dispatch} = createTestStore(t, state, {services}, expectedActions);
|
|
64
64
|
dispatch(nextSlide);
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -82,6 +82,6 @@ test('should dispatch NEXT_SLIDE action when nextSlide is called and the progres
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
];
|
|
85
|
-
const {dispatch} = createTestStore(t, stateWithWrongAnswer, services, expectedActions);
|
|
85
|
+
const {dispatch} = createTestStore(t, stateWithWrongAnswer, {services}, expectedActions);
|
|
86
86
|
dispatch(nextSlide);
|
|
87
87
|
});
|
|
@@ -27,13 +27,13 @@ const initialState: StoreState = {
|
|
|
27
27
|
test('should dispatch OPEN_POPIN when openQuitPopin action is called', async t => {
|
|
28
28
|
const expectedAction = [{type: OPEN_POPIN}];
|
|
29
29
|
|
|
30
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedAction);
|
|
30
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedAction);
|
|
31
31
|
await dispatch(openQuitPopin);
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
test('should dispatch CLOSE_POPIN when closeQuitPopin action is called', async t => {
|
|
35
35
|
const expectedAction = [{type: CLOSE_POPIN}];
|
|
36
36
|
|
|
37
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedAction);
|
|
37
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedAction);
|
|
38
38
|
await dispatch(closeQuitPopin);
|
|
39
39
|
});
|
|
@@ -28,6 +28,6 @@ const initialState: StoreState = {
|
|
|
28
28
|
test('should dispatch SET_CURRENT_SLIDE action when setCurrentSlide is called', async t => {
|
|
29
29
|
const expectedActions = [{type: SET_CURRENT_SLIDE, payload: freeTextSlide}];
|
|
30
30
|
|
|
31
|
-
const {dispatch} = createTestStore(t, initialState, services, expectedActions);
|
|
31
|
+
const {dispatch} = createTestStore(t, initialState, {services}, expectedActions);
|
|
32
32
|
await dispatch(setCurrentSlide(freeTextSlide));
|
|
33
33
|
});
|
package/src/common/index.ts
CHANGED
|
@@ -2,16 +2,6 @@ import concat from 'lodash/fp/concat';
|
|
|
2
2
|
import slice from 'lodash/fp/slice';
|
|
3
3
|
import type {ProgressionFromAPI} from '../types/common';
|
|
4
4
|
|
|
5
|
-
export const VIEWS: {
|
|
6
|
-
readonly skills: 'skills';
|
|
7
|
-
readonly onboarding: 'onboarding';
|
|
8
|
-
readonly slides: 'slides';
|
|
9
|
-
} = {
|
|
10
|
-
skills: 'skills',
|
|
11
|
-
onboarding: 'onboarding',
|
|
12
|
-
slides: 'slides'
|
|
13
|
-
};
|
|
14
|
-
|
|
15
5
|
export const slideIndexes = ['0', '1', '2', '3', '4'] as const;
|
|
16
6
|
|
|
17
7
|
export type SlideIndexes = typeof slideIndexes[number];
|
package/src/configure-store.ts
CHANGED
|
@@ -3,7 +3,7 @@ import thunk from 'redux-thunk';
|
|
|
3
3
|
import rootReducer, {StoreState} from './reducers';
|
|
4
4
|
import {getServices} from './services';
|
|
5
5
|
|
|
6
|
-
import {AppOptions} from './types/common';
|
|
6
|
+
import {AppOptions, ThunkOptions} from './types/common';
|
|
7
7
|
|
|
8
8
|
export default function configureStore(options: AppOptions): Store<StoreState, AnyAction> {
|
|
9
9
|
const _compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
@@ -14,7 +14,13 @@ export default function configureStore(options: AppOptions): Store<StoreState, A
|
|
|
14
14
|
})
|
|
15
15
|
: compose;
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const thunkOptions: ThunkOptions = {
|
|
18
|
+
services: options.services || getServices(),
|
|
19
|
+
callbackOnViewChanged: options.callbackOnViewChanged
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const thunkMiddleware = thunk.withExtraArgument(thunkOptions);
|
|
23
|
+
|
|
18
24
|
const enhancer = _compose(applyMiddleware(thunkMiddleware));
|
|
19
25
|
const store = createStore(rootReducer, undefined, enhancer);
|
|
20
26
|
|
package/src/index.tsx
CHANGED
|
@@ -3,26 +3,27 @@ import type {} from 'redux-thunk/extend-redux'; // https://github.com/reduxjs/re
|
|
|
3
3
|
import {AnyAction, Store} from 'redux';
|
|
4
4
|
import {useSelector, useDispatch, Provider} from 'react-redux';
|
|
5
5
|
import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
|
|
6
|
+
import {AppReviewProps} from '@coorpacademy/components/es/template/app-review/prop-types';
|
|
6
7
|
|
|
7
8
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
8
9
|
import get from 'lodash/fp/get';
|
|
9
10
|
import configureStore from './configure-store';
|
|
10
11
|
|
|
11
|
-
import type {AppOptions} from './types/common';
|
|
12
|
+
import type {AppOptions, ViewName} from './types/common';
|
|
12
13
|
import type {StoreState} from './reducers';
|
|
13
14
|
|
|
14
|
-
import {
|
|
15
|
+
import {navigateBack, navigateTo} from './actions/ui/navigation';
|
|
15
16
|
import {storeToken} from './actions/data/token';
|
|
16
17
|
import {fetchSkills} from './actions/api/fetch-skills';
|
|
17
18
|
import {postProgression} from './actions/api/post-progression';
|
|
18
|
-
import {VIEWS} from './common';
|
|
19
19
|
import {mapStateToSlidesProps} from './views/slides';
|
|
20
20
|
import {mapStateToSkillsProps} from './views/skills';
|
|
21
21
|
|
|
22
|
-
const ConnectedApp = ({onQuitClick}: {onQuitClick:
|
|
22
|
+
const ConnectedApp = ({onQuitClick}: {onQuitClick: () => void}): JSX.Element => {
|
|
23
23
|
const dispatch = useDispatch();
|
|
24
24
|
|
|
25
|
-
const props = {
|
|
25
|
+
const props: AppReviewProps = {
|
|
26
|
+
navigateBack: () => dispatch(navigateBack),
|
|
26
27
|
viewName: useSelector(
|
|
27
28
|
(state: StoreState) => state.ui.navigation[state.ui.navigation.length - 1]
|
|
28
29
|
),
|
|
@@ -30,6 +31,7 @@ const ConnectedApp = ({onQuitClick}: {onQuitClick: Function}): JSX.Element => {
|
|
|
30
31
|
skills: useSelector((state: StoreState) => mapStateToSkillsProps(state)),
|
|
31
32
|
onboarding: {}
|
|
32
33
|
};
|
|
34
|
+
|
|
33
35
|
return <AppReviewTemplate {...props} />;
|
|
34
36
|
};
|
|
35
37
|
|
|
@@ -82,7 +84,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
const initialView:
|
|
87
|
+
const initialView: ViewName = skillRef ? 'slides' : 'skills';
|
|
86
88
|
store.dispatch(navigateTo(initialView));
|
|
87
89
|
}, [isProgressionCreated, options, store]);
|
|
88
90
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
NavigateToAction,
|
|
3
|
+
NavigateBackAction,
|
|
4
|
+
NAVIGATE_TO,
|
|
5
|
+
NAVIGATE_BACK
|
|
6
6
|
} from '../../actions/ui/navigation';
|
|
7
7
|
|
|
8
8
|
export type NavigationState = Array<'skills' | 'onboarding' | 'slides' | 'loader'>;
|
|
@@ -10,7 +10,7 @@ export type NavigationState = Array<'skills' | 'onboarding' | 'slides' | 'loader
|
|
|
10
10
|
const reducer = (
|
|
11
11
|
// eslint-disable-next-line default-param-last
|
|
12
12
|
state: NavigationState = [],
|
|
13
|
-
action:
|
|
13
|
+
action: NavigateToAction | NavigateBackAction
|
|
14
14
|
): NavigationState => {
|
|
15
15
|
switch (action.type) {
|
|
16
16
|
case NAVIGATE_TO: {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import reducer from '../navigation';
|
|
3
|
-
import {
|
|
3
|
+
import {NavigateToAction, NAVIGATE_BACK, NAVIGATE_TO} from '../../../actions/ui/navigation';
|
|
4
4
|
|
|
5
5
|
test('should have initial value', t => {
|
|
6
|
-
const state = reducer(undefined, {} as
|
|
6
|
+
const state = reducer(undefined, {} as NavigateToAction);
|
|
7
7
|
t.deepEqual(state, []);
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
test('should set the value of NAVIGATE_TO and NAVIGATE_BACK action', t => {
|
|
11
|
-
const state = reducer([],
|
|
11
|
+
const state = reducer([], {type: NAVIGATE_TO, payload: 'loader'});
|
|
12
12
|
t.deepEqual(state, ['loader']);
|
|
13
13
|
|
|
14
|
-
const updatedState = reducer(state,
|
|
14
|
+
const updatedState = reducer(state, {type: NAVIGATE_TO, payload: 'skills'});
|
|
15
15
|
t.deepEqual(updatedState, ['loader', 'skills']);
|
|
16
16
|
|
|
17
|
-
const _updatedState = reducer(updatedState,
|
|
17
|
+
const _updatedState = reducer(updatedState, {type: NAVIGATE_BACK});
|
|
18
18
|
t.deepEqual(_updatedState, ['loader']);
|
|
19
19
|
});
|
package/src/types/common.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
|
|
2
|
+
|
|
1
3
|
export type ChoiceFromAPI = {
|
|
2
4
|
_id: string;
|
|
3
5
|
id?: string;
|
|
@@ -175,16 +177,18 @@ export type Services = {
|
|
|
175
177
|
): Promise<SlideIdFromAPI[]>;
|
|
176
178
|
};
|
|
177
179
|
|
|
178
|
-
export type Options = {
|
|
179
|
-
services: Services;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
180
|
export type AppOptions = {
|
|
183
181
|
token: string;
|
|
184
182
|
skillRef?: string;
|
|
185
183
|
services: Services;
|
|
186
|
-
onQuitClick:
|
|
184
|
+
onQuitClick: () => void;
|
|
187
185
|
url: string;
|
|
186
|
+
callbackOnViewChanged?: (viewName: ViewName) => void;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type ThunkOptions = {
|
|
190
|
+
callbackOnViewChanged?: AppOptions['callbackOnViewChanged'];
|
|
191
|
+
services: Services;
|
|
188
192
|
};
|
|
189
193
|
|
|
190
194
|
export type JWT = {
|
|
@@ -9,12 +9,10 @@ type SkillCard = {
|
|
|
9
9
|
reviseLabel: string;
|
|
10
10
|
reviseAriaLabel: string;
|
|
11
11
|
isCustom: boolean;
|
|
12
|
-
onClick:
|
|
12
|
+
onClick: () => void;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
type NoSkillsProps = {
|
|
16
|
-
titleNoSkills: string;
|
|
17
|
-
textNoSkills: string;
|
|
18
16
|
iconSkillAriaLabel: string;
|
|
19
17
|
};
|
|
20
18
|
|
|
@@ -31,8 +29,6 @@ export {SkillsProps};
|
|
|
31
29
|
export const mapStateToSkillsProps = (state: StoreState): SkillsProps => {
|
|
32
30
|
return {
|
|
33
31
|
title: '@todo title',
|
|
34
|
-
titleNoSkills: '@todo titleNoSkills',
|
|
35
|
-
textNoSkills: '@todo textNoSkills',
|
|
36
32
|
iconSkillAriaLabel: '@todo iconSkillAriaLabel',
|
|
37
33
|
isLoading: false,
|
|
38
34
|
isLoadingAriaLabel: '@todo loading',
|
|
@@ -29,8 +29,6 @@ test('should create initial props when there are no skills on the state', t => {
|
|
|
29
29
|
|
|
30
30
|
t.deepEqual(props, {
|
|
31
31
|
title: '@todo title',
|
|
32
|
-
titleNoSkills: '@todo titleNoSkills',
|
|
33
|
-
textNoSkills: '@todo textNoSkills',
|
|
34
32
|
iconSkillAriaLabel: '@todo iconSkillAriaLabel',
|
|
35
33
|
isLoading: false,
|
|
36
34
|
isLoadingAriaLabel: '@todo loading',
|
|
@@ -76,8 +74,6 @@ test('should create initial props when skills on the state', t => {
|
|
|
76
74
|
|
|
77
75
|
t.deepEqual(omit('listSkills', props), {
|
|
78
76
|
title: '@todo title',
|
|
79
|
-
titleNoSkills: '@todo titleNoSkills',
|
|
80
|
-
textNoSkills: '@todo textNoSkills',
|
|
81
77
|
iconSkillAriaLabel: '@todo iconSkillAriaLabel',
|
|
82
78
|
isLoading: false,
|
|
83
79
|
isLoadingAriaLabel: '@todo loading'
|