catchup-library-web 2.2.20 → 2.2.22

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/dist/index.js CHANGED
@@ -7371,7 +7371,10 @@ var ActivityPreviewByData = ({
7371
7371
  showCorrectAnswer,
7372
7372
  isFullScreen
7373
7373
  };
7374
- const isEmpty = answerMapMap[selectedType].isEmpty;
7374
+ let isEmpty = false;
7375
+ if (answerMapMap[selectedType] && answerMapMap[selectedType].isEmpty) {
7376
+ isEmpty = answerMapMap[selectedType].isEmpty;
7377
+ }
7375
7378
  switch (selectedType) {
7376
7379
  case "ORDERING":
7377
7380
  return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
@@ -7918,76 +7921,88 @@ var retrieveCurrencyTypeOptionList = () => {
7918
7921
  var retrieveBrandDTOByUserProfileOptionList = (userProfile) => {
7919
7922
  const brandDTOOptionList = [];
7920
7923
  if (userProfile) {
7921
- for (const branchDTO of userProfile.branchDTOList) {
7922
- const currentBrand = branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7923
- if (brandDTOOptionList.findIndex(
7924
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7925
- ) === -1) {
7926
- brandDTOOptionList.push({
7927
- value: currentBrand.id,
7928
- fullValue: currentBrand,
7929
- text: currentBrand.name
7930
- });
7924
+ if (userProfile.branchDTOList) {
7925
+ for (const branchDTO of userProfile.branchDTOList) {
7926
+ const currentBrand = branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7927
+ if (brandDTOOptionList.findIndex(
7928
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7929
+ ) === -1) {
7930
+ brandDTOOptionList.push({
7931
+ value: currentBrand.id,
7932
+ fullValue: currentBrand,
7933
+ text: currentBrand.name
7934
+ });
7935
+ }
7931
7936
  }
7932
7937
  }
7933
- for (const gradeDTO of userProfile.gradeDTOList) {
7934
- const currentBrand = gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7935
- if (brandDTOOptionList.findIndex(
7936
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7937
- ) === -1) {
7938
- brandDTOOptionList.push({
7939
- value: currentBrand.id,
7940
- fullValue: currentBrand,
7941
- text: currentBrand.name
7942
- });
7938
+ if (userProfile.gradeDTOList) {
7939
+ for (const gradeDTO of userProfile.gradeDTOList) {
7940
+ const currentBrand = gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7941
+ if (brandDTOOptionList.findIndex(
7942
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7943
+ ) === -1) {
7944
+ brandDTOOptionList.push({
7945
+ value: currentBrand.id,
7946
+ fullValue: currentBrand,
7947
+ text: currentBrand.name
7948
+ });
7949
+ }
7943
7950
  }
7944
7951
  }
7945
- for (const seasonDTO of userProfile.seasonDTOList) {
7946
- const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
7947
- if (brandDTOOptionList.findIndex(
7948
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7949
- ) === -1) {
7950
- brandDTOOptionList.push({
7951
- value: currentBrand.id,
7952
- fullValue: currentBrand,
7953
- text: currentBrand.name
7954
- });
7952
+ if (userProfile.seasonDTOList) {
7953
+ for (const seasonDTO of userProfile.seasonDTOList) {
7954
+ const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
7955
+ if (brandDTOOptionList.findIndex(
7956
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7957
+ ) === -1) {
7958
+ brandDTOOptionList.push({
7959
+ value: currentBrand.id,
7960
+ fullValue: currentBrand,
7961
+ text: currentBrand.name
7962
+ });
7963
+ }
7955
7964
  }
7956
7965
  }
7957
- for (const institutionDTO of userProfile.institutionDTOList) {
7958
- const currentBrand = institutionDTO.campusDTO.brandDTO;
7959
- if (brandDTOOptionList.findIndex(
7960
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7961
- ) === -1) {
7962
- brandDTOOptionList.push({
7963
- value: currentBrand.id,
7964
- fullValue: currentBrand,
7965
- text: currentBrand.name
7966
- });
7966
+ if (userProfile.institutionDTOList) {
7967
+ for (const institutionDTO of userProfile.institutionDTOList) {
7968
+ const currentBrand = institutionDTO.campusDTO.brandDTO;
7969
+ if (brandDTOOptionList.findIndex(
7970
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7971
+ ) === -1) {
7972
+ brandDTOOptionList.push({
7973
+ value: currentBrand.id,
7974
+ fullValue: currentBrand,
7975
+ text: currentBrand.name
7976
+ });
7977
+ }
7967
7978
  }
7968
7979
  }
7969
- for (const campusDTO of userProfile.campusDTOList) {
7970
- const currentBrand = campusDTO.brandDTO;
7971
- if (brandDTOOptionList.findIndex(
7972
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7973
- ) === -1) {
7974
- brandDTOOptionList.push({
7975
- value: currentBrand.id,
7976
- fullValue: currentBrand,
7977
- text: currentBrand.name
7978
- });
7980
+ if (userProfile.campusDTOList) {
7981
+ for (const campusDTO of userProfile.campusDTOList) {
7982
+ const currentBrand = campusDTO.brandDTO;
7983
+ if (brandDTOOptionList.findIndex(
7984
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7985
+ ) === -1) {
7986
+ brandDTOOptionList.push({
7987
+ value: currentBrand.id,
7988
+ fullValue: currentBrand,
7989
+ text: currentBrand.name
7990
+ });
7991
+ }
7979
7992
  }
7980
7993
  }
7981
- for (const brandDTO of userProfile.brandDTOList) {
7982
- const currentBrand = brandDTO;
7983
- if (brandDTOOptionList.findIndex(
7984
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7985
- ) === -1) {
7986
- brandDTOOptionList.push({
7987
- value: currentBrand.id,
7988
- fullValue: currentBrand,
7989
- text: currentBrand.name
7990
- });
7994
+ if (userProfile.brandDTOList) {
7995
+ for (const brandDTO of userProfile.brandDTOList) {
7996
+ const currentBrand = brandDTO;
7997
+ if (brandDTOOptionList.findIndex(
7998
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7999
+ ) === -1) {
8000
+ brandDTOOptionList.push({
8001
+ value: currentBrand.id,
8002
+ fullValue: currentBrand,
8003
+ text: currentBrand.name
8004
+ });
8005
+ }
7991
8006
  }
7992
8007
  }
7993
8008
  }
package/dist/index.mjs CHANGED
@@ -7148,7 +7148,10 @@ var ActivityPreviewByData = ({
7148
7148
  showCorrectAnswer,
7149
7149
  isFullScreen
7150
7150
  };
7151
- const isEmpty = answerMapMap[selectedType].isEmpty;
7151
+ let isEmpty = false;
7152
+ if (answerMapMap[selectedType] && answerMapMap[selectedType].isEmpty) {
7153
+ isEmpty = answerMapMap[selectedType].isEmpty;
7154
+ }
7152
7155
  switch (selectedType) {
7153
7156
  case "ORDERING":
7154
7157
  return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ jsxs36(Fragment11, { children: [
@@ -7695,76 +7698,88 @@ var retrieveCurrencyTypeOptionList = () => {
7695
7698
  var retrieveBrandDTOByUserProfileOptionList = (userProfile) => {
7696
7699
  const brandDTOOptionList = [];
7697
7700
  if (userProfile) {
7698
- for (const branchDTO of userProfile.branchDTOList) {
7699
- const currentBrand = branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7700
- if (brandDTOOptionList.findIndex(
7701
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7702
- ) === -1) {
7703
- brandDTOOptionList.push({
7704
- value: currentBrand.id,
7705
- fullValue: currentBrand,
7706
- text: currentBrand.name
7707
- });
7701
+ if (userProfile.branchDTOList) {
7702
+ for (const branchDTO of userProfile.branchDTOList) {
7703
+ const currentBrand = branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7704
+ if (brandDTOOptionList.findIndex(
7705
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7706
+ ) === -1) {
7707
+ brandDTOOptionList.push({
7708
+ value: currentBrand.id,
7709
+ fullValue: currentBrand,
7710
+ text: currentBrand.name
7711
+ });
7712
+ }
7708
7713
  }
7709
7714
  }
7710
- for (const gradeDTO of userProfile.gradeDTOList) {
7711
- const currentBrand = gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7712
- if (brandDTOOptionList.findIndex(
7713
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7714
- ) === -1) {
7715
- brandDTOOptionList.push({
7716
- value: currentBrand.id,
7717
- fullValue: currentBrand,
7718
- text: currentBrand.name
7719
- });
7715
+ if (userProfile.gradeDTOList) {
7716
+ for (const gradeDTO of userProfile.gradeDTOList) {
7717
+ const currentBrand = gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
7718
+ if (brandDTOOptionList.findIndex(
7719
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7720
+ ) === -1) {
7721
+ brandDTOOptionList.push({
7722
+ value: currentBrand.id,
7723
+ fullValue: currentBrand,
7724
+ text: currentBrand.name
7725
+ });
7726
+ }
7720
7727
  }
7721
7728
  }
7722
- for (const seasonDTO of userProfile.seasonDTOList) {
7723
- const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
7724
- if (brandDTOOptionList.findIndex(
7725
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7726
- ) === -1) {
7727
- brandDTOOptionList.push({
7728
- value: currentBrand.id,
7729
- fullValue: currentBrand,
7730
- text: currentBrand.name
7731
- });
7729
+ if (userProfile.seasonDTOList) {
7730
+ for (const seasonDTO of userProfile.seasonDTOList) {
7731
+ const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
7732
+ if (brandDTOOptionList.findIndex(
7733
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7734
+ ) === -1) {
7735
+ brandDTOOptionList.push({
7736
+ value: currentBrand.id,
7737
+ fullValue: currentBrand,
7738
+ text: currentBrand.name
7739
+ });
7740
+ }
7732
7741
  }
7733
7742
  }
7734
- for (const institutionDTO of userProfile.institutionDTOList) {
7735
- const currentBrand = institutionDTO.campusDTO.brandDTO;
7736
- if (brandDTOOptionList.findIndex(
7737
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7738
- ) === -1) {
7739
- brandDTOOptionList.push({
7740
- value: currentBrand.id,
7741
- fullValue: currentBrand,
7742
- text: currentBrand.name
7743
- });
7743
+ if (userProfile.institutionDTOList) {
7744
+ for (const institutionDTO of userProfile.institutionDTOList) {
7745
+ const currentBrand = institutionDTO.campusDTO.brandDTO;
7746
+ if (brandDTOOptionList.findIndex(
7747
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7748
+ ) === -1) {
7749
+ brandDTOOptionList.push({
7750
+ value: currentBrand.id,
7751
+ fullValue: currentBrand,
7752
+ text: currentBrand.name
7753
+ });
7754
+ }
7744
7755
  }
7745
7756
  }
7746
- for (const campusDTO of userProfile.campusDTOList) {
7747
- const currentBrand = campusDTO.brandDTO;
7748
- if (brandDTOOptionList.findIndex(
7749
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7750
- ) === -1) {
7751
- brandDTOOptionList.push({
7752
- value: currentBrand.id,
7753
- fullValue: currentBrand,
7754
- text: currentBrand.name
7755
- });
7757
+ if (userProfile.campusDTOList) {
7758
+ for (const campusDTO of userProfile.campusDTOList) {
7759
+ const currentBrand = campusDTO.brandDTO;
7760
+ if (brandDTOOptionList.findIndex(
7761
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7762
+ ) === -1) {
7763
+ brandDTOOptionList.push({
7764
+ value: currentBrand.id,
7765
+ fullValue: currentBrand,
7766
+ text: currentBrand.name
7767
+ });
7768
+ }
7756
7769
  }
7757
7770
  }
7758
- for (const brandDTO of userProfile.brandDTOList) {
7759
- const currentBrand = brandDTO;
7760
- if (brandDTOOptionList.findIndex(
7761
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
7762
- ) === -1) {
7763
- brandDTOOptionList.push({
7764
- value: currentBrand.id,
7765
- fullValue: currentBrand,
7766
- text: currentBrand.name
7767
- });
7771
+ if (userProfile.brandDTOList) {
7772
+ for (const brandDTO of userProfile.brandDTOList) {
7773
+ const currentBrand = brandDTO;
7774
+ if (brandDTOOptionList.findIndex(
7775
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
7776
+ ) === -1) {
7777
+ brandDTOOptionList.push({
7778
+ value: currentBrand.id,
7779
+ fullValue: currentBrand,
7780
+ text: currentBrand.name
7781
+ });
7782
+ }
7768
7783
  }
7769
7784
  }
7770
7785
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.20",
3
+ "version": "2.2.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -132,7 +132,10 @@ const ActivityPreviewByData = ({
132
132
  isFullScreen,
133
133
  };
134
134
 
135
- const isEmpty = answerMapMap[selectedType].isEmpty;
135
+ let isEmpty = false;
136
+ if (answerMapMap[selectedType] && answerMapMap[selectedType].isEmpty) {
137
+ isEmpty = answerMapMap[selectedType].isEmpty;
138
+ }
136
139
 
137
140
  switch (selectedType) {
138
141
  case "ORDERING":
@@ -3,89 +3,106 @@ import i18n from "../language/i18n";
3
3
  export const retrieveBrandDTOByUserProfileOptionList = (userProfile: any) => {
4
4
  const brandDTOOptionList = [];
5
5
  if (userProfile) {
6
- for (const branchDTO of userProfile.branchDTOList) {
7
- const currentBrand =
8
- branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
9
- if (
10
- brandDTOOptionList.findIndex(
11
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
12
- ) === -1
13
- ) {
14
- brandDTOOptionList.push({
15
- value: currentBrand.id,
16
- fullValue: currentBrand,
17
- text: currentBrand.name,
18
- });
6
+ if (userProfile.branchDTOList) {
7
+ for (const branchDTO of userProfile.branchDTOList) {
8
+ const currentBrand =
9
+ branchDTO.gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
10
+ if (
11
+ brandDTOOptionList.findIndex(
12
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
13
+ ) === -1
14
+ ) {
15
+ brandDTOOptionList.push({
16
+ value: currentBrand.id,
17
+ fullValue: currentBrand,
18
+ text: currentBrand.name,
19
+ });
20
+ }
19
21
  }
20
22
  }
21
- for (const gradeDTO of userProfile.gradeDTOList) {
22
- const currentBrand = gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
23
- if (
24
- brandDTOOptionList.findIndex(
25
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
26
- ) === -1
27
- ) {
28
- brandDTOOptionList.push({
29
- value: currentBrand.id,
30
- fullValue: currentBrand,
31
- text: currentBrand.name,
32
- });
23
+ if (userProfile.gradeDTOList) {
24
+ for (const gradeDTO of userProfile.gradeDTOList) {
25
+ const currentBrand =
26
+ gradeDTO.seasonDTO.institutionDTO.campusDTO.brandDTO;
27
+ if (
28
+ brandDTOOptionList.findIndex(
29
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
30
+ ) === -1
31
+ ) {
32
+ brandDTOOptionList.push({
33
+ value: currentBrand.id,
34
+ fullValue: currentBrand,
35
+ text: currentBrand.name,
36
+ });
37
+ }
33
38
  }
34
39
  }
35
- for (const seasonDTO of userProfile.seasonDTOList) {
36
- const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
37
- if (
38
- brandDTOOptionList.findIndex(
39
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
40
- ) === -1
41
- ) {
42
- brandDTOOptionList.push({
43
- value: currentBrand.id,
44
- fullValue: currentBrand,
45
- text: currentBrand.name,
46
- });
40
+
41
+ if (userProfile.seasonDTOList) {
42
+ for (const seasonDTO of userProfile.seasonDTOList) {
43
+ const currentBrand = seasonDTO.institutionDTO.campusDTO.brandDTO;
44
+ if (
45
+ brandDTOOptionList.findIndex(
46
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
47
+ ) === -1
48
+ ) {
49
+ brandDTOOptionList.push({
50
+ value: currentBrand.id,
51
+ fullValue: currentBrand,
52
+ text: currentBrand.name,
53
+ });
54
+ }
47
55
  }
48
56
  }
49
- for (const institutionDTO of userProfile.institutionDTOList) {
50
- const currentBrand = institutionDTO.campusDTO.brandDTO;
51
- if (
52
- brandDTOOptionList.findIndex(
53
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
54
- ) === -1
55
- ) {
56
- brandDTOOptionList.push({
57
- value: currentBrand.id,
58
- fullValue: currentBrand,
59
- text: currentBrand.name,
60
- });
57
+
58
+ if (userProfile.institutionDTOList) {
59
+ for (const institutionDTO of userProfile.institutionDTOList) {
60
+ const currentBrand = institutionDTO.campusDTO.brandDTO;
61
+ if (
62
+ brandDTOOptionList.findIndex(
63
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
64
+ ) === -1
65
+ ) {
66
+ brandDTOOptionList.push({
67
+ value: currentBrand.id,
68
+ fullValue: currentBrand,
69
+ text: currentBrand.name,
70
+ });
71
+ }
61
72
  }
62
73
  }
63
- for (const campusDTO of userProfile.campusDTOList) {
64
- const currentBrand = campusDTO.brandDTO;
65
- if (
66
- brandDTOOptionList.findIndex(
67
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
68
- ) === -1
69
- ) {
70
- brandDTOOptionList.push({
71
- value: currentBrand.id,
72
- fullValue: currentBrand,
73
- text: currentBrand.name,
74
- });
74
+
75
+ if (userProfile.campusDTOList) {
76
+ for (const campusDTO of userProfile.campusDTOList) {
77
+ const currentBrand = campusDTO.brandDTO;
78
+ if (
79
+ brandDTOOptionList.findIndex(
80
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
81
+ ) === -1
82
+ ) {
83
+ brandDTOOptionList.push({
84
+ value: currentBrand.id,
85
+ fullValue: currentBrand,
86
+ text: currentBrand.name,
87
+ });
88
+ }
75
89
  }
76
90
  }
77
- for (const brandDTO of userProfile.brandDTOList) {
78
- const currentBrand = brandDTO;
79
- if (
80
- brandDTOOptionList.findIndex(
81
- (brandDTOOption) => brandDTOOption.value === currentBrand.id
82
- ) === -1
83
- ) {
84
- brandDTOOptionList.push({
85
- value: currentBrand.id,
86
- fullValue: currentBrand,
87
- text: currentBrand.name,
88
- });
91
+
92
+ if (userProfile.brandDTOList) {
93
+ for (const brandDTO of userProfile.brandDTOList) {
94
+ const currentBrand = brandDTO;
95
+ if (
96
+ brandDTOOptionList.findIndex(
97
+ (brandDTOOption) => brandDTOOption.value === currentBrand.id
98
+ ) === -1
99
+ ) {
100
+ brandDTOOptionList.push({
101
+ value: currentBrand.id,
102
+ fullValue: currentBrand,
103
+ text: currentBrand.name,
104
+ });
105
+ }
89
106
  }
90
107
  }
91
108
  }