@coorpacademy/app-review 0.13.6 → 0.13.7

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/index.js CHANGED
@@ -7,16 +7,13 @@ import configureStore from './configure-store';
7
7
  import { navigateBack, navigateTo } from './actions/ui/navigation';
8
8
  import { storeToken } from './actions/data/token';
9
9
  import { postProgression } from './actions/api/post-progression';
10
- import { mapStateToSkillsProps } from './views/skills';
11
10
  import { mapStateToSlidesProps } from './views/slides';
12
11
  const ConnectedApp = (options) => {
13
12
  const dispatch = useDispatch();
14
13
  const props = {
15
14
  viewName: useSelector((state) => state.ui.navigation[state.ui.navigation.length - 1]),
16
15
  slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, options)),
17
- skills: useSelector((state) => mapStateToSkillsProps(state, options)),
18
- navigateBack: () => dispatch(navigateBack),
19
- onboarding: {}
16
+ navigateBack: () => dispatch(navigateBack)
20
17
  };
21
18
  return React.createElement(AppReviewTemplate, { ...props });
22
19
  };
@@ -1,6 +1,5 @@
1
1
  import { CorrectionsState } from './corrections';
2
2
  import { ProgressionState } from './progression';
3
- import { SkillsState } from './skills';
4
3
  import { SlidesState } from './slides';
5
4
  import { TokenState } from './token';
6
5
  import { RankState } from './rank';
@@ -8,7 +7,6 @@ import { CurrentSkillState } from './current-skill';
8
7
  export declare type DataState = {
9
8
  corrections: CorrectionsState;
10
9
  progression: ProgressionState;
11
- skills: SkillsState;
12
10
  slides: SlidesState;
13
11
  token: TokenState;
14
12
  rank: RankState;
@@ -17,10 +15,9 @@ export declare type DataState = {
17
15
  declare const _default: import("redux").Reducer<import("redux").CombinedState<{
18
16
  corrections: CorrectionsState;
19
17
  progression: ProgressionState;
20
- skills: SkillsState;
21
18
  slides: SlidesState;
22
19
  token: string;
23
20
  rank: RankState;
24
21
  currentSkill: CurrentSkillState;
25
- }>, import("../../actions/api/fetch-skill").ReceivedSkill | import("../../actions/api/post-progression").FetchProgression | import("../../actions/api/post-progression").ReceivedProgression | import("./corrections").CorrectionsAction | import("../../actions/api/fetch-rank").RankAction | import("../../actions/api/post-answer").PostAnswerSuccessAction | import("../../actions/api/fetch-skills").ReceivedSkills | import("./slides").SlidesAction | import("../../actions/data/token").StoreToken>;
22
+ }>, import("../../actions/api/fetch-skill").ReceivedSkill | import("../../actions/api/post-progression").FetchProgression | import("../../actions/api/post-progression").ReceivedProgression | import("./corrections").CorrectionsAction | import("../../actions/api/fetch-rank").RankAction | import("../../actions/api/post-answer").PostAnswerSuccessAction | import("./slides").SlidesAction | import("../../actions/data/token").StoreToken>;
26
23
  export default _default;
@@ -1,7 +1,6 @@
1
1
  import { combineReducers } from 'redux';
2
2
  import corrections from './corrections';
3
3
  import progression from './progression';
4
- import skills from './skills';
5
4
  import slides from './slides';
6
5
  import token from './token';
7
6
  import rank from './rank';
@@ -9,7 +8,6 @@ import currentSkill from './current-skill';
9
8
  export default combineReducers({
10
9
  corrections,
11
10
  progression,
12
- skills,
13
11
  slides,
14
12
  token,
15
13
  rank,
@@ -8,7 +8,6 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
8
8
  data: import("redux").CombinedState<{
9
9
  corrections: import("./data/corrections").CorrectionsState;
10
10
  progression: import("./data/progression").ProgressionState;
11
- skills: import("./data/skills").SkillsState;
12
11
  slides: import("./data/slides").SlidesState;
13
12
  token: string;
14
13
  rank: import("./data/rank").RankState;
@@ -24,7 +23,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
24
23
  showButtonRevising: boolean;
25
24
  showCongrats: boolean;
26
25
  }>;
27
- }>, import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-skill").ReceivedSkill | import("../actions/api/post-progression").FetchProgression | import("../actions/api/post-progression").ReceivedProgression | import("./data/corrections").CorrectionsAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
26
+ }>, import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-skill").ReceivedSkill | import("../actions/api/post-progression").FetchProgression | import("../actions/api/post-progression").ReceivedProgression | import("./data/corrections").CorrectionsAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
28
27
  type: "@@ui/OPEN_POPIN";
29
28
  } | {
30
29
  type: "@@ui/CLOSE_POPIN";
@@ -1,4 +1,4 @@
1
1
  import { NavigateToAction, NavigateBackAction } from '../../actions/ui/navigation';
2
- export declare type NavigationState = Array<'skills' | 'onboarding' | 'slides' | 'loader'>;
2
+ export declare type NavigationState = Array<'slides' | 'loader'>;
3
3
  declare const reducer: (state: NavigationState | undefined, action: NavigateToAction | NavigateBackAction) => NavigationState;
4
4
  export default reducer;
@@ -5,7 +5,7 @@ export declare type WithRequired<T, K extends keyof T> = T & {
5
5
  export interface Translate {
6
6
  (key: string, data?: Record<string, string>): string;
7
7
  }
8
- export declare type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
8
+ export declare type ViewName = 'slides' | 'loader';
9
9
  export declare type Skin = {
10
10
  common: {
11
11
  primary: string;
@@ -17,8 +17,8 @@ const ICON_VALUES = {
17
17
  wrong: 'wrong',
18
18
  'no-answer': 'no-answer'
19
19
  };
20
- const confettiAnimation = {
21
- 'aria-label': 'aria lottie',
20
+ const buildConfettiAnimation = (translate) => ({
21
+ 'aria-label': translate('Congratulations confetti animation'),
22
22
  'data-name': 'default-lottie',
23
23
  className: undefined,
24
24
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',
@@ -28,7 +28,7 @@ const confettiAnimation = {
28
28
  hideOnTransparent: false
29
29
  },
30
30
  ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'
31
- };
31
+ });
32
32
  export const initialState = {
33
33
  '0': {
34
34
  position: 0,
@@ -236,7 +236,7 @@ const buildRankCard = (rank, translate) => {
236
236
  'aria-label': 'Review Card Congrats Container',
237
237
  'data-name': 'card-rank',
238
238
  animationLottie: {
239
- 'aria-label': 'aria lottie',
239
+ 'aria-label': translate('New rank animation'),
240
240
  'data-name': 'default-lottie',
241
241
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',
242
242
  loop: true,
@@ -262,7 +262,7 @@ const buildCongratsProps = (state, dispatch, options) => {
262
262
  'aria-label': 'Review Card Congrats Container',
263
263
  'data-name': 'card-star',
264
264
  animationLottie: {
265
- 'aria-label': 'aria lottie',
265
+ 'aria-label': translate('Acquired stars animation'),
266
266
  'data-name': 'default-lottie',
267
267
  className: undefined,
268
268
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',
@@ -303,7 +303,7 @@ const buildCongratsProps = (state, dispatch, options) => {
303
303
  return {
304
304
  'aria-label': 'Review Congratulations',
305
305
  'data-name': 'review-congrats',
306
- animationLottie: confettiAnimation,
306
+ animationLottie: buildConfettiAnimation(translate),
307
307
  title: translate('Congratulations!'),
308
308
  cardCongratsStar,
309
309
  cardCongratsRank,
package/lib/index.js CHANGED
@@ -35,16 +35,13 @@ const configure_store_1 = __importDefault(require("./configure-store"));
35
35
  const navigation_1 = require("./actions/ui/navigation");
36
36
  const token_1 = require("./actions/data/token");
37
37
  const post_progression_1 = require("./actions/api/post-progression");
38
- const skills_1 = require("./views/skills");
39
38
  const slides_1 = require("./views/slides");
40
39
  const ConnectedApp = (options) => {
41
40
  const dispatch = (0, react_redux_1.useDispatch)();
42
41
  const props = {
43
42
  viewName: (0, react_redux_1.useSelector)((state) => state.ui.navigation[state.ui.navigation.length - 1]),
44
43
  slides: (0, react_redux_1.useSelector)((state) => (0, slides_1.mapStateToSlidesProps)(state, dispatch, options)),
45
- skills: (0, react_redux_1.useSelector)((state) => (0, skills_1.mapStateToSkillsProps)(state, options)),
46
- navigateBack: () => dispatch(navigation_1.navigateBack),
47
- onboarding: {}
44
+ navigateBack: () => dispatch(navigation_1.navigateBack)
48
45
  };
49
46
  return react_1.default.createElement(app_review_1.default, { ...props });
50
47
  };
@@ -1,6 +1,5 @@
1
1
  import { CorrectionsState } from './corrections';
2
2
  import { ProgressionState } from './progression';
3
- import { SkillsState } from './skills';
4
3
  import { SlidesState } from './slides';
5
4
  import { TokenState } from './token';
6
5
  import { RankState } from './rank';
@@ -8,7 +7,6 @@ import { CurrentSkillState } from './current-skill';
8
7
  export declare type DataState = {
9
8
  corrections: CorrectionsState;
10
9
  progression: ProgressionState;
11
- skills: SkillsState;
12
10
  slides: SlidesState;
13
11
  token: TokenState;
14
12
  rank: RankState;
@@ -17,10 +15,9 @@ export declare type DataState = {
17
15
  declare const _default: import("redux").Reducer<import("redux").CombinedState<{
18
16
  corrections: CorrectionsState;
19
17
  progression: ProgressionState;
20
- skills: SkillsState;
21
18
  slides: SlidesState;
22
19
  token: string;
23
20
  rank: RankState;
24
21
  currentSkill: CurrentSkillState;
25
- }>, import("../../actions/api/fetch-skill").ReceivedSkill | import("../../actions/api/post-progression").FetchProgression | import("../../actions/api/post-progression").ReceivedProgression | import("./corrections").CorrectionsAction | import("../../actions/api/fetch-rank").RankAction | import("../../actions/api/post-answer").PostAnswerSuccessAction | import("../../actions/api/fetch-skills").ReceivedSkills | import("./slides").SlidesAction | import("../../actions/data/token").StoreToken>;
22
+ }>, import("../../actions/api/fetch-skill").ReceivedSkill | import("../../actions/api/post-progression").FetchProgression | import("../../actions/api/post-progression").ReceivedProgression | import("./corrections").CorrectionsAction | import("../../actions/api/fetch-rank").RankAction | import("../../actions/api/post-answer").PostAnswerSuccessAction | import("./slides").SlidesAction | import("../../actions/data/token").StoreToken>;
26
23
  export default _default;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const redux_1 = require("redux");
7
7
  const corrections_1 = __importDefault(require("./corrections"));
8
8
  const progression_1 = __importDefault(require("./progression"));
9
- const skills_1 = __importDefault(require("./skills"));
10
9
  const slides_1 = __importDefault(require("./slides"));
11
10
  const token_1 = __importDefault(require("./token"));
12
11
  const rank_1 = __importDefault(require("./rank"));
@@ -14,7 +13,6 @@ const current_skill_1 = __importDefault(require("./current-skill"));
14
13
  exports.default = (0, redux_1.combineReducers)({
15
14
  corrections: corrections_1.default,
16
15
  progression: progression_1.default,
17
- skills: skills_1.default,
18
16
  slides: slides_1.default,
19
17
  token: token_1.default,
20
18
  rank: rank_1.default,
@@ -8,7 +8,6 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
8
8
  data: import("redux").CombinedState<{
9
9
  corrections: import("./data/corrections").CorrectionsState;
10
10
  progression: import("./data/progression").ProgressionState;
11
- skills: import("./data/skills").SkillsState;
12
11
  slides: import("./data/slides").SlidesState;
13
12
  token: string;
14
13
  rank: import("./data/rank").RankState;
@@ -24,7 +23,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
24
23
  showButtonRevising: boolean;
25
24
  showCongrats: boolean;
26
25
  }>;
27
- }>, import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-skill").ReceivedSkill | import("../actions/api/post-progression").FetchProgression | import("../actions/api/post-progression").ReceivedProgression | import("./data/corrections").CorrectionsAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("../actions/api/fetch-skills").ReceivedSkills | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
26
+ }>, import("../actions/ui/slides").SetCurrentSlideAction | import("../actions/api/fetch-skill").ReceivedSkill | import("../actions/api/post-progression").FetchProgression | import("../actions/api/post-progression").ReceivedProgression | import("./data/corrections").CorrectionsAction | import("../actions/api/fetch-rank").RankAction | import("../actions/api/fetch-slides-to-review-by-skill-ref").ReceivedSlidesToReviewBySkillRef | import("../actions/api/post-answer").PostAnswerRequestAction | import("../actions/api/post-answer").PostAnswerSuccessAction | import("./data/slides").SlidesAction | import("../actions/data/token").StoreToken | import("../actions/ui/next-slide").NextSlideAction | import("../actions/ui/navigation").NavigateToAction | import("../actions/ui/navigation").NavigateBackAction | import("../actions/ui/answers").EditAnswerAction | {
28
27
  type: "@@ui/OPEN_POPIN";
29
28
  } | {
30
29
  type: "@@ui/CLOSE_POPIN";
@@ -1,4 +1,4 @@
1
1
  import { NavigateToAction, NavigateBackAction } from '../../actions/ui/navigation';
2
- export declare type NavigationState = Array<'skills' | 'onboarding' | 'slides' | 'loader'>;
2
+ export declare type NavigationState = Array<'slides' | 'loader'>;
3
3
  declare const reducer: (state: NavigationState | undefined, action: NavigateToAction | NavigateBackAction) => NavigationState;
4
4
  export default reducer;
@@ -5,7 +5,7 @@ export declare type WithRequired<T, K extends keyof T> = T & {
5
5
  export interface Translate {
6
6
  (key: string, data?: Record<string, string>): string;
7
7
  }
8
- export declare type ViewName = 'skills' | 'onboarding' | 'slides' | 'loader';
8
+ export declare type ViewName = 'slides' | 'loader';
9
9
  export declare type Skin = {
10
10
  common: {
11
11
  primary: string;
@@ -23,8 +23,8 @@ const ICON_VALUES = {
23
23
  wrong: 'wrong',
24
24
  'no-answer': 'no-answer'
25
25
  };
26
- const confettiAnimation = {
27
- 'aria-label': 'aria lottie',
26
+ const buildConfettiAnimation = (translate) => ({
27
+ 'aria-label': translate('Congratulations confetti animation'),
28
28
  'data-name': 'default-lottie',
29
29
  className: undefined,
30
30
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/confetti.json',
@@ -34,7 +34,7 @@ const confettiAnimation = {
34
34
  hideOnTransparent: false
35
35
  },
36
36
  ie11ImageBackup: 'https://static-staging.coorpacademy.com/animations/review/conffeti_congrats.svg'
37
- };
37
+ });
38
38
  exports.initialState = {
39
39
  '0': {
40
40
  position: 0,
@@ -243,7 +243,7 @@ const buildRankCard = (rank, translate) => {
243
243
  'aria-label': 'Review Card Congrats Container',
244
244
  'data-name': 'card-rank',
245
245
  animationLottie: {
246
- 'aria-label': 'aria lottie',
246
+ 'aria-label': translate('New rank animation'),
247
247
  'data-name': 'default-lottie',
248
248
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/rank.json',
249
249
  loop: true,
@@ -269,7 +269,7 @@ const buildCongratsProps = (state, dispatch, options) => {
269
269
  'aria-label': 'Review Card Congrats Container',
270
270
  'data-name': 'card-star',
271
271
  animationLottie: {
272
- 'aria-label': 'aria lottie',
272
+ 'aria-label': translate('Acquired stars animation'),
273
273
  'data-name': 'default-lottie',
274
274
  className: undefined,
275
275
  animationSrc: 'https://static-staging.coorpacademy.com/animations/review/star.json',
@@ -310,7 +310,7 @@ const buildCongratsProps = (state, dispatch, options) => {
310
310
  return {
311
311
  'aria-label': 'Review Congratulations',
312
312
  'data-name': 'review-congrats',
313
- animationLottie: confettiAnimation,
313
+ animationLottie: buildConfettiAnimation(translate),
314
314
  title: translate('Congratulations!'),
315
315
  cardCongratsStar,
316
316
  cardCongratsRank,
@@ -53,5 +53,8 @@
53
53
  "no_skills": {
54
54
  "title": "You have no skill to revise yet",
55
55
  "text": "First you need to complete courses before you can review different skills."
56
- }
56
+ },
57
+ "Acquired stars animation": "Acquired stars animation",
58
+ "New rank animation": "New rank animation",
59
+ "Congratulations confetti animation": "Congratulations confetti animation"
57
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.13.6",
3
+ "version": "0.13.7",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -35,7 +35,7 @@
35
35
  "main": "lib/index.js",
36
36
  "module": "es/index.js",
37
37
  "dependencies": {
38
- "@coorpacademy/components": "11.2.10",
38
+ "@coorpacademy/components": "11.2.11",
39
39
  "@coorpacademy/progression-engine": "11.5.3",
40
40
  "@coorpacademy/redux-task": "1.1.6",
41
41
  "@coorpacademy/review-services": "1.1.0",
@@ -74,5 +74,5 @@
74
74
  "webpack-cli": "^4.10.0",
75
75
  "webpack-dev-server": "^4.11.1"
76
76
  },
77
- "gitHead": "a528f3c84e4a9d44cf332e5fc0fcff774b3cd714"
77
+ "gitHead": "73a0f0f00e2a9d68d01fa8c64c3f7b3a786df31f"
78
78
  }
@@ -1,12 +0,0 @@
1
- import type { Dispatch } from 'redux';
2
- import type { SkillToReview } from '@coorpacademy/review-services';
3
- import type { StoreState } from '../../reducers';
4
- import type { ThunkOptions } from '../../types/common';
5
- export declare const SKILLS_FETCH_REQUEST: "@@skills/FETCH_REQUEST";
6
- export declare const SKILLS_FETCH_SUCCESS: "@@skills/FETCH_SUCCESS";
7
- export declare const SKILLS_FETCH_FAILURE: "@@skills/FETCH_FAILURE";
8
- export declare type ReceivedSkills = {
9
- type: typeof SKILLS_FETCH_SUCCESS;
10
- payload: SkillToReview[];
11
- };
12
- export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedSkills;
@@ -1,16 +0,0 @@
1
- import buildTask from '@coorpacademy/redux-task';
2
- import get from 'lodash/fp/get';
3
- export const SKILLS_FETCH_REQUEST = '@@skills/FETCH_REQUEST';
4
- export const SKILLS_FETCH_SUCCESS = '@@skills/FETCH_SUCCESS';
5
- export const SKILLS_FETCH_FAILURE = '@@skills/FETCH_FAILURE';
6
- export const fetchSkills = (dispatch, getState, { services }) => {
7
- const action = buildTask({
8
- types: [SKILLS_FETCH_REQUEST, SKILLS_FETCH_SUCCESS, SKILLS_FETCH_FAILURE],
9
- task: () => {
10
- const state = getState();
11
- const token = get(['data', 'token'], state);
12
- return services.fetchSkills(token);
13
- }
14
- });
15
- return dispatch(action);
16
- };
@@ -1,5 +0,0 @@
1
- import type { SkillToReview } from '@coorpacademy/review-services';
2
- import { ReceivedSkills } from '../../actions/api/fetch-skills';
3
- export declare type SkillsState = SkillToReview[];
4
- declare const reducer: (state: SkillsState | undefined, action: ReceivedSkills) => SkillsState;
5
- export default reducer;
@@ -1,13 +0,0 @@
1
- import { SKILLS_FETCH_SUCCESS } from '../../actions/api/fetch-skills';
2
- const initialState = [];
3
- const reducer = (
4
- // eslint-disable-next-line default-param-last
5
- state = initialState, action) => {
6
- switch (action.type) {
7
- case SKILLS_FETCH_SUCCESS:
8
- return action.payload;
9
- default:
10
- return state;
11
- }
12
- };
13
- export default reducer;
@@ -1,4 +0,0 @@
1
- import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
2
- import type { ConnectedOptions } from '../../types/common';
3
- import { StoreState } from '../../reducers';
4
- export declare const mapStateToSkillsProps: (state: StoreState, options: ConnectedOptions) => ReviewSkillsProps;
@@ -1,26 +0,0 @@
1
- export const mapStateToSkillsProps = (state, options) => {
2
- const { translate } = options;
3
- return {
4
- 'aria-label': translate('list_aria_label'),
5
- title: translate('list_title'),
6
- isLoading: false,
7
- isLoadingAriaLabel: 'Review skills container is loading',
8
- listSkills: state.data.skills.map(skill => ({
9
- 'aria-label': translate('card.aria_label'),
10
- isCustom: skill.custom,
11
- skillTitle: skill.name,
12
- skillAriaLabel: skill.name,
13
- buttonLabel: translate('card.button_text'),
14
- buttonAriaLabel: translate('card.button_text'),
15
- reviseLabel: translate('card.text', { total: `${skill.slidesToReview}` }),
16
- reviseAriaLabel: translate('card.text', {
17
- total: `${skill.slidesToReview}`
18
- }),
19
- // eslint-disable-next-line no-console
20
- onClick: () => console.log('@todo plug dispatcher select skill')
21
- })),
22
- titleNoSkills: translate('no_skills.title'),
23
- textNoSkills: translate('no_skills.text'),
24
- iconSkillAriaLabel: 'Image without information'
25
- };
26
- };
@@ -1,12 +0,0 @@
1
- import type { Dispatch } from 'redux';
2
- import type { SkillToReview } from '@coorpacademy/review-services';
3
- import type { StoreState } from '../../reducers';
4
- import type { ThunkOptions } from '../../types/common';
5
- export declare const SKILLS_FETCH_REQUEST: "@@skills/FETCH_REQUEST";
6
- export declare const SKILLS_FETCH_SUCCESS: "@@skills/FETCH_SUCCESS";
7
- export declare const SKILLS_FETCH_FAILURE: "@@skills/FETCH_FAILURE";
8
- export declare type ReceivedSkills = {
9
- type: typeof SKILLS_FETCH_SUCCESS;
10
- payload: SkillToReview[];
11
- };
12
- export declare const fetchSkills: (dispatch: Dispatch, getState: () => StoreState, { services }: ThunkOptions) => ReceivedSkills;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fetchSkills = exports.SKILLS_FETCH_FAILURE = exports.SKILLS_FETCH_SUCCESS = exports.SKILLS_FETCH_REQUEST = void 0;
7
- const redux_task_1 = __importDefault(require("@coorpacademy/redux-task"));
8
- const get_1 = __importDefault(require("lodash/fp/get"));
9
- exports.SKILLS_FETCH_REQUEST = '@@skills/FETCH_REQUEST';
10
- exports.SKILLS_FETCH_SUCCESS = '@@skills/FETCH_SUCCESS';
11
- exports.SKILLS_FETCH_FAILURE = '@@skills/FETCH_FAILURE';
12
- const fetchSkills = (dispatch, getState, { services }) => {
13
- const action = (0, redux_task_1.default)({
14
- types: [exports.SKILLS_FETCH_REQUEST, exports.SKILLS_FETCH_SUCCESS, exports.SKILLS_FETCH_FAILURE],
15
- task: () => {
16
- const state = getState();
17
- const token = (0, get_1.default)(['data', 'token'], state);
18
- return services.fetchSkills(token);
19
- }
20
- });
21
- return dispatch(action);
22
- };
23
- exports.fetchSkills = fetchSkills;
@@ -1,5 +0,0 @@
1
- import type { SkillToReview } from '@coorpacademy/review-services';
2
- import { ReceivedSkills } from '../../actions/api/fetch-skills';
3
- export declare type SkillsState = SkillToReview[];
4
- declare const reducer: (state: SkillsState | undefined, action: ReceivedSkills) => SkillsState;
5
- export default reducer;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fetch_skills_1 = require("../../actions/api/fetch-skills");
4
- const initialState = [];
5
- const reducer = (
6
- // eslint-disable-next-line default-param-last
7
- state = initialState, action) => {
8
- switch (action.type) {
9
- case fetch_skills_1.SKILLS_FETCH_SUCCESS:
10
- return action.payload;
11
- default:
12
- return state;
13
- }
14
- };
15
- exports.default = reducer;
@@ -1,4 +0,0 @@
1
- import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
2
- import type { ConnectedOptions } from '../../types/common';
3
- import { StoreState } from '../../reducers';
4
- export declare const mapStateToSkillsProps: (state: StoreState, options: ConnectedOptions) => ReviewSkillsProps;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapStateToSkillsProps = void 0;
4
- const mapStateToSkillsProps = (state, options) => {
5
- const { translate } = options;
6
- return {
7
- 'aria-label': translate('list_aria_label'),
8
- title: translate('list_title'),
9
- isLoading: false,
10
- isLoadingAriaLabel: 'Review skills container is loading',
11
- listSkills: state.data.skills.map(skill => ({
12
- 'aria-label': translate('card.aria_label'),
13
- isCustom: skill.custom,
14
- skillTitle: skill.name,
15
- skillAriaLabel: skill.name,
16
- buttonLabel: translate('card.button_text'),
17
- buttonAriaLabel: translate('card.button_text'),
18
- reviseLabel: translate('card.text', { total: `${skill.slidesToReview}` }),
19
- reviseAriaLabel: translate('card.text', {
20
- total: `${skill.slidesToReview}`
21
- }),
22
- // eslint-disable-next-line no-console
23
- onClick: () => console.log('@todo plug dispatcher select skill')
24
- })),
25
- titleNoSkills: translate('no_skills.title'),
26
- textNoSkills: translate('no_skills.text'),
27
- iconSkillAriaLabel: 'Image without information'
28
- };
29
- };
30
- exports.mapStateToSkillsProps = mapStateToSkillsProps;