@coorpacademy/app-review 0.8.2 → 0.8.3-alpha.3

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.
@@ -0,0 +1,5 @@
1
+ import { ReceivedSkill } from '../../actions/api/fetch-skill';
2
+ import { Skill } from '../../types/common';
3
+ export declare type CurrentSkillState = Skill | null;
4
+ declare const reducer: (state: CurrentSkillState | undefined, action: ReceivedSkill) => CurrentSkillState;
5
+ export default reducer;
@@ -0,0 +1,13 @@
1
+ import { SKILL_FETCH_SUCCESS } from '../../actions/api/fetch-skill';
2
+ const initialState = null;
3
+ const reducer = (
4
+ // eslint-disable-next-line default-param-last
5
+ state = initialState, action) => {
6
+ switch (action.type) {
7
+ case SKILL_FETCH_SUCCESS:
8
+ return action.payload;
9
+ default:
10
+ return state;
11
+ }
12
+ };
13
+ export default reducer;
@@ -4,6 +4,7 @@ import { SkillsState } from './skills';
4
4
  import { SlidesState } from './slides';
5
5
  import { TokenState } from './token';
6
6
  import { RankState } from './rank';
7
+ import { CurrentSkillState } from './current-skill';
7
8
  export declare type DataState = {
8
9
  corrections: CorrectionsState;
9
10
  progression: ProgressionState;
@@ -11,6 +12,7 @@ export declare type DataState = {
11
12
  slides: SlidesState;
12
13
  token: TokenState;
13
14
  rank: RankState;
15
+ currentSkill: CurrentSkillState;
14
16
  };
15
17
  declare const _default: import("redux").Reducer<import("redux").CombinedState<{
16
18
  corrections: CorrectionsState;
@@ -19,5 +21,6 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
19
21
  slides: SlidesState;
20
22
  token: string;
21
23
  rank: RankState;
22
- }>, 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>;
24
+ 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>;
23
26
  export default _default;
@@ -5,4 +5,13 @@ import skills from './skills';
5
5
  import slides from './slides';
6
6
  import token from './token';
7
7
  import rank from './rank';
8
- export default combineReducers({ corrections, progression, skills, slides, token, rank });
8
+ import currentSkill from './current-skill';
9
+ export default combineReducers({
10
+ corrections,
11
+ progression,
12
+ skills,
13
+ slides,
14
+ token,
15
+ rank,
16
+ currentSkill
17
+ });
@@ -12,6 +12,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
12
12
  slides: import("./data/slides").SlidesState;
13
13
  token: string;
14
14
  rank: import("./data/rank").RankState;
15
+ currentSkill: import("./data/current-skill").CurrentSkillState;
15
16
  }>;
16
17
  ui: import("redux").CombinedState<{
17
18
  currentSlideRef: string;
@@ -23,7 +24,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
23
24
  showButtonRevising: boolean;
24
25
  showCongrats: boolean;
25
26
  }>;
26
- }>, import("../actions/ui/slides").SetCurrentSlideAction | 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 | {
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 | {
27
28
  type: "@@ui/OPEN_POPIN";
28
29
  } | {
29
30
  type: "@@ui/CLOSE_POPIN";
@@ -1,24 +1,3 @@
1
+ import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
1
2
  import { StoreState } from '../../reducers';
2
- declare type SkillCard = {
3
- 'aria-label': string;
4
- skillTitle: string;
5
- skillAriaLabel: string;
6
- buttonLabel: string;
7
- buttonAriaLabel: string;
8
- reviseLabel: string;
9
- reviseAriaLabel: string;
10
- isCustom: boolean;
11
- onClick: () => void;
12
- };
13
- declare type NoSkillsProps = {
14
- iconSkillAriaLabel: string;
15
- };
16
- declare type SkillsProps = NoSkillsProps & {
17
- 'aria-label'?: string;
18
- title: string;
19
- isLoading?: boolean;
20
- isLoadingAriaLabel: string;
21
- listSkills: SkillCard[];
22
- };
23
- export { SkillsProps };
24
- export declare const mapStateToSkillsProps: (state: StoreState) => SkillsProps;
3
+ export declare const mapStateToSkillsProps: (state: StoreState) => ReviewSkillsProps;
@@ -1,11 +1,11 @@
1
1
  export const mapStateToSkillsProps = (state) => {
2
2
  return {
3
+ 'aria-label': '@todo aria-label',
3
4
  title: '@todo title',
4
- iconSkillAriaLabel: '@todo iconSkillAriaLabel',
5
5
  isLoading: false,
6
6
  isLoadingAriaLabel: '@todo loading',
7
7
  listSkills: state.data.skills.map(skill => ({
8
- 'aria-label': '',
8
+ 'aria-label': '@todo aria-label skill',
9
9
  isCustom: skill.custom,
10
10
  skillTitle: skill.name,
11
11
  skillAriaLabel: '@todo skill aria label',
@@ -15,6 +15,9 @@ export const mapStateToSkillsProps = (state) => {
15
15
  reviseAriaLabel: '@todo revise aria label',
16
16
  // eslint-disable-next-line no-console
17
17
  onClick: () => console.log('@todo plug dispatcher select skill')
18
- }))
18
+ })),
19
+ titleNoSkills: '@todo title no skills',
20
+ textNoSkills: '@todo text no skills',
21
+ iconSkillAriaLabel: '@todo iconSkillAriaLabel'
19
22
  };
20
23
  };
@@ -188,7 +188,7 @@ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, tr
188
188
  resultLabel: isCorrect ? translate('Correct Answer') : translate('Wrong Answer'),
189
189
  information: {
190
190
  label: isCorrect ? translate('KLF') : translate('Correct Answer'),
191
- message: isCorrect ? klf : join(',', correctAnswer)
191
+ message: isCorrect ? klf : join(', ', correctAnswer)
192
192
  },
193
193
  next: {
194
194
  'aria-label': translate('Next Question'),
@@ -0,0 +1,5 @@
1
+ import { ReceivedSkill } from '../../actions/api/fetch-skill';
2
+ import { Skill } from '../../types/common';
3
+ export declare type CurrentSkillState = Skill | null;
4
+ declare const reducer: (state: CurrentSkillState | undefined, action: ReceivedSkill) => CurrentSkillState;
5
+ export default reducer;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fetch_skill_1 = require("../../actions/api/fetch-skill");
4
+ const initialState = null;
5
+ const reducer = (
6
+ // eslint-disable-next-line default-param-last
7
+ state = initialState, action) => {
8
+ switch (action.type) {
9
+ case fetch_skill_1.SKILL_FETCH_SUCCESS:
10
+ return action.payload;
11
+ default:
12
+ return state;
13
+ }
14
+ };
15
+ exports.default = reducer;
@@ -4,6 +4,7 @@ import { SkillsState } from './skills';
4
4
  import { SlidesState } from './slides';
5
5
  import { TokenState } from './token';
6
6
  import { RankState } from './rank';
7
+ import { CurrentSkillState } from './current-skill';
7
8
  export declare type DataState = {
8
9
  corrections: CorrectionsState;
9
10
  progression: ProgressionState;
@@ -11,6 +12,7 @@ export declare type DataState = {
11
12
  slides: SlidesState;
12
13
  token: TokenState;
13
14
  rank: RankState;
15
+ currentSkill: CurrentSkillState;
14
16
  };
15
17
  declare const _default: import("redux").Reducer<import("redux").CombinedState<{
16
18
  corrections: CorrectionsState;
@@ -19,5 +21,6 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
19
21
  slides: SlidesState;
20
22
  token: string;
21
23
  rank: RankState;
22
- }>, 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>;
24
+ 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>;
23
26
  export default _default;
@@ -10,4 +10,13 @@ const skills_1 = __importDefault(require("./skills"));
10
10
  const slides_1 = __importDefault(require("./slides"));
11
11
  const token_1 = __importDefault(require("./token"));
12
12
  const rank_1 = __importDefault(require("./rank"));
13
- exports.default = (0, redux_1.combineReducers)({ corrections: corrections_1.default, progression: progression_1.default, skills: skills_1.default, slides: slides_1.default, token: token_1.default, rank: rank_1.default });
13
+ const current_skill_1 = __importDefault(require("./current-skill"));
14
+ exports.default = (0, redux_1.combineReducers)({
15
+ corrections: corrections_1.default,
16
+ progression: progression_1.default,
17
+ skills: skills_1.default,
18
+ slides: slides_1.default,
19
+ token: token_1.default,
20
+ rank: rank_1.default,
21
+ currentSkill: current_skill_1.default
22
+ });
@@ -12,6 +12,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
12
12
  slides: import("./data/slides").SlidesState;
13
13
  token: string;
14
14
  rank: import("./data/rank").RankState;
15
+ currentSkill: import("./data/current-skill").CurrentSkillState;
15
16
  }>;
16
17
  ui: import("redux").CombinedState<{
17
18
  currentSlideRef: string;
@@ -23,7 +24,7 @@ declare const _default: import("redux").Reducer<import("redux").CombinedState<{
23
24
  showButtonRevising: boolean;
24
25
  showCongrats: boolean;
25
26
  }>;
26
- }>, import("../actions/ui/slides").SetCurrentSlideAction | 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 | {
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 | {
27
28
  type: "@@ui/OPEN_POPIN";
28
29
  } | {
29
30
  type: "@@ui/CLOSE_POPIN";
@@ -1,24 +1,3 @@
1
+ import { ReviewSkillsProps } from '@coorpacademy/components/es/template/app-review/skills/prop-types';
1
2
  import { StoreState } from '../../reducers';
2
- declare type SkillCard = {
3
- 'aria-label': string;
4
- skillTitle: string;
5
- skillAriaLabel: string;
6
- buttonLabel: string;
7
- buttonAriaLabel: string;
8
- reviseLabel: string;
9
- reviseAriaLabel: string;
10
- isCustom: boolean;
11
- onClick: () => void;
12
- };
13
- declare type NoSkillsProps = {
14
- iconSkillAriaLabel: string;
15
- };
16
- declare type SkillsProps = NoSkillsProps & {
17
- 'aria-label'?: string;
18
- title: string;
19
- isLoading?: boolean;
20
- isLoadingAriaLabel: string;
21
- listSkills: SkillCard[];
22
- };
23
- export { SkillsProps };
24
- export declare const mapStateToSkillsProps: (state: StoreState) => SkillsProps;
3
+ export declare const mapStateToSkillsProps: (state: StoreState) => ReviewSkillsProps;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapStateToSkillsProps = void 0;
4
4
  const mapStateToSkillsProps = (state) => {
5
5
  return {
6
+ 'aria-label': '@todo aria-label',
6
7
  title: '@todo title',
7
- iconSkillAriaLabel: '@todo iconSkillAriaLabel',
8
8
  isLoading: false,
9
9
  isLoadingAriaLabel: '@todo loading',
10
10
  listSkills: state.data.skills.map(skill => ({
11
- 'aria-label': '',
11
+ 'aria-label': '@todo aria-label skill',
12
12
  isCustom: skill.custom,
13
13
  skillTitle: skill.name,
14
14
  skillAriaLabel: '@todo skill aria label',
@@ -18,7 +18,10 @@ const mapStateToSkillsProps = (state) => {
18
18
  reviseAriaLabel: '@todo revise aria label',
19
19
  // eslint-disable-next-line no-console
20
20
  onClick: () => console.log('@todo plug dispatcher select skill')
21
- }))
21
+ })),
22
+ titleNoSkills: '@todo title no skills',
23
+ textNoSkills: '@todo text no skills',
24
+ iconSkillAriaLabel: '@todo iconSkillAriaLabel'
22
25
  };
23
26
  };
24
27
  exports.mapStateToSkillsProps = mapStateToSkillsProps;
@@ -195,7 +195,7 @@ const getCorrectionPopinProps = (dispatch) => (isCorrect, correctAnswer, klf, tr
195
195
  resultLabel: isCorrect ? translate('Correct Answer') : translate('Wrong Answer'),
196
196
  information: {
197
197
  label: isCorrect ? translate('KLF') : translate('Correct Answer'),
198
- message: isCorrect ? klf : (0, join_1.default)(',', correctAnswer)
198
+ message: isCorrect ? klf : (0, join_1.default)(', ', correctAnswer)
199
199
  },
200
200
  next: {
201
201
  'aria-label': translate('Next Question'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coorpacademy/app-review",
3
- "version": "0.8.2",
3
+ "version": "0.8.3-alpha.3+f2bb79b3c",
4
4
  "description": "",
5
5
  "engines": {
6
6
  "node": ">=16.15.0"
@@ -35,9 +35,9 @@
35
35
  "main": "lib/index.js",
36
36
  "module": "es/index.js",
37
37
  "dependencies": {
38
- "@coorpacademy/components": "10.28.2",
38
+ "@coorpacademy/components": "10.28.3-alpha.3+f2bb79b3c",
39
39
  "@coorpacademy/redux-task": "1.1.6",
40
- "@coorpacademy/translate": "^6.1.5",
40
+ "@coorpacademy/translate": "6.1.5",
41
41
  "cross-fetch": "^3.1.5",
42
42
  "jwt-decode": "^3.1.2",
43
43
  "react-redux": "^7.2.9",
@@ -71,5 +71,5 @@
71
71
  "webpack-cli": "^4.10.0",
72
72
  "webpack-dev-server": "^4.11.1"
73
73
  },
74
- "gitHead": "58af61c6cd1fbc11f036fdbef04bfe405cdad226"
74
+ "gitHead": "f2bb79b3cbf9c8299df8a8dde9d05b0ca98cc199"
75
75
  }