catchup-library-web 2.2.26 → 2.2.28

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.d.mts CHANGED
@@ -886,11 +886,15 @@ declare const retrieveUserAuthorityGeneralOptionList: () => {
886
886
  text: string;
887
887
  value: string;
888
888
  }[];
889
- declare const filterGradeLevelOptionList: (institutionDTO: any, gradeDTO: any) => {
889
+ declare const filterGradeLevelOptionList: (level: any, institutionType: any) => {
890
890
  value: number;
891
891
  text: string;
892
892
  }[];
893
- declare const filterCoterieTypeOptionList: (userInformation: any, userProfile: any, userProfileInstitution: any) => any;
893
+ declare const filterCoterieTypeOptionList: (coterieType: any, institutionType: any) => {
894
+ text: string;
895
+ value: string;
896
+ includes: string[];
897
+ }[];
894
898
  declare const filterCoterieTypeByDistinctOptionList: (distinctCoterieTypeOptionList: any[]) => {
895
899
  text: string;
896
900
  value: string;
package/dist/index.d.ts CHANGED
@@ -886,11 +886,15 @@ declare const retrieveUserAuthorityGeneralOptionList: () => {
886
886
  text: string;
887
887
  value: string;
888
888
  }[];
889
- declare const filterGradeLevelOptionList: (institutionDTO: any, gradeDTO: any) => {
889
+ declare const filterGradeLevelOptionList: (level: any, institutionType: any) => {
890
890
  value: number;
891
891
  text: string;
892
892
  }[];
893
- declare const filterCoterieTypeOptionList: (userInformation: any, userProfile: any, userProfileInstitution: any) => any;
893
+ declare const filterCoterieTypeOptionList: (coterieType: any, institutionType: any) => {
894
+ text: string;
895
+ value: string;
896
+ includes: string[];
897
+ }[];
894
898
  declare const filterCoterieTypeByDistinctOptionList: (distinctCoterieTypeOptionList: any[]) => {
895
899
  text: string;
896
900
  value: string;
package/dist/index.js CHANGED
@@ -8897,31 +8897,30 @@ var retrieveUserAuthorityGeneralOptionList = () => {
8897
8897
  { text: i18n_default.t("completion_assignment"), value: "ETUDE" }
8898
8898
  ];
8899
8899
  };
8900
- var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8901
- if (gradeDTO) {
8900
+ var filterGradeLevelOptionList = (level, institutionType) => {
8901
+ if (level) {
8902
8902
  return retrieveGradeLevelOptionList().filter(
8903
- (gradeLevel) => parseFloat(gradeLevel.value) === gradeDTO.level
8903
+ (gradeLevel) => parseFloat(gradeLevel.value) === level
8904
8904
  );
8905
8905
  }
8906
- if (institutionDTO) {
8907
- const { type } = institutionDTO;
8908
- if (type === "WEST_PRIMARY") {
8906
+ if (institutionType) {
8907
+ if (institutionType === "WEST_PRIMARY") {
8909
8908
  return retrieveGradeLevelOptionList().filter(
8910
8909
  (gradeLevel) => parseFloat(gradeLevel.value) <= 8
8911
8910
  );
8912
- } else if (type === "EAST_PRIMARY") {
8911
+ } else if (institutionType === "EAST_PRIMARY") {
8913
8912
  return retrieveGradeLevelOptionList().filter(
8914
8913
  (gradeLevel) => parseFloat(gradeLevel.value) <= 4
8915
8914
  );
8916
- } else if (type === "EAST_SECONDARY") {
8915
+ } else if (institutionType === "EAST_SECONDARY") {
8917
8916
  return retrieveGradeLevelOptionList().filter(
8918
8917
  (gradeLevel) => parseFloat(gradeLevel.value) > 4 && parseFloat(gradeLevel.value) <= 8
8919
8918
  );
8920
- } else if (type === "HIGH_SCHOOL") {
8919
+ } else if (institutionType === "HIGH_SCHOOL") {
8921
8920
  return retrieveGradeLevelOptionList().filter(
8922
8921
  (gradeLevel) => parseFloat(gradeLevel.value) > 8
8923
8922
  );
8924
- } else if (type === "COLLEGE" || type === "PRIVATE_TRAINING" || type === "PRIVATE_LESSON" || type === "COURSE") {
8923
+ } else if (institutionType === "COLLEGE" || institutionType === "PRIVATE_TRAINING" || institutionType === "PRIVATE_LESSON" || institutionType === "COURSE") {
8925
8924
  return retrieveGradeLevelOptionList();
8926
8925
  } else {
8927
8926
  return [];
@@ -8929,42 +8928,20 @@ var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8929
8928
  }
8930
8929
  return retrieveGradeLevelOptionList();
8931
8930
  };
8932
- var filterCoterieTypeOptionList = (userInformation, userProfile, userProfileInstitution) => {
8933
- if (userInformation.accountType === "GENIXO") {
8934
- return retrieveCoterieTypeOptionList().sort(
8935
- (a, b) => a.text.localeCompare(b.text)
8936
- );
8937
- }
8938
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
8939
- if (userProfile.coterieType === "MANAGEMENT") {
8940
- if (userProfileInstitution) {
8941
- return retrieveCoterieTypeOptionList().filter(
8942
- (coterieTypeOption) => coterieTypeOption.includes.includes(userProfileInstitution.type)
8943
- ).sort((a, b) => a.text.localeCompare(b.text));
8944
- } else {
8945
- return retrieveCoterieTypeOptionList().sort(
8946
- (a, b) => a.text.localeCompare(b.text)
8947
- );
8948
- }
8949
- } else {
8931
+ var filterCoterieTypeOptionList = (coterieType, institutionType) => {
8932
+ if (coterieType === "MANAGEMENT") {
8933
+ if (institutionType) {
8950
8934
  return retrieveCoterieTypeOptionList().filter(
8951
- (coterieTypeOption) => coterieTypeOption.value === userProfile.coterieType
8935
+ (coterieTypeOption) => coterieTypeOption.includes.includes(institutionType)
8952
8936
  ).sort((a, b) => a.text.localeCompare(b.text));
8953
- }
8954
- } else if (userProfile.role === "INDIVIDUAL") {
8955
- const individualCoterieTypeOptionList = [];
8956
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
8957
- userProfile.coterieTypeList.forEach((coterieType) => {
8958
- const foundCoterieTypeOption = coterieTypeOptionList.find(
8959
- (coterieTypeOption) => coterieTypeOption.value === coterieType
8937
+ } else {
8938
+ return retrieveCoterieTypeOptionList().sort(
8939
+ (a, b) => a.text.localeCompare(b.text)
8960
8940
  );
8961
- if (foundCoterieTypeOption) {
8962
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
8963
- }
8964
- });
8965
- return individualCoterieTypeOptionList;
8941
+ }
8942
+ } else {
8943
+ return retrieveCoterieTypeOptionList().filter((coterieTypeOption) => coterieTypeOption.value === coterieType).sort((a, b) => a.text.localeCompare(b.text));
8966
8944
  }
8967
- return [];
8968
8945
  };
8969
8946
  var filterCoterieTypeByDistinctOptionList = (distinctCoterieTypeOptionList) => {
8970
8947
  const coterieTypeOptionList = retrieveCoterieTypeOptionList();
package/dist/index.mjs CHANGED
@@ -8672,31 +8672,30 @@ var retrieveUserAuthorityGeneralOptionList = () => {
8672
8672
  { text: i18n_default.t("completion_assignment"), value: "ETUDE" }
8673
8673
  ];
8674
8674
  };
8675
- var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8676
- if (gradeDTO) {
8675
+ var filterGradeLevelOptionList = (level, institutionType) => {
8676
+ if (level) {
8677
8677
  return retrieveGradeLevelOptionList().filter(
8678
- (gradeLevel) => parseFloat(gradeLevel.value) === gradeDTO.level
8678
+ (gradeLevel) => parseFloat(gradeLevel.value) === level
8679
8679
  );
8680
8680
  }
8681
- if (institutionDTO) {
8682
- const { type } = institutionDTO;
8683
- if (type === "WEST_PRIMARY") {
8681
+ if (institutionType) {
8682
+ if (institutionType === "WEST_PRIMARY") {
8684
8683
  return retrieveGradeLevelOptionList().filter(
8685
8684
  (gradeLevel) => parseFloat(gradeLevel.value) <= 8
8686
8685
  );
8687
- } else if (type === "EAST_PRIMARY") {
8686
+ } else if (institutionType === "EAST_PRIMARY") {
8688
8687
  return retrieveGradeLevelOptionList().filter(
8689
8688
  (gradeLevel) => parseFloat(gradeLevel.value) <= 4
8690
8689
  );
8691
- } else if (type === "EAST_SECONDARY") {
8690
+ } else if (institutionType === "EAST_SECONDARY") {
8692
8691
  return retrieveGradeLevelOptionList().filter(
8693
8692
  (gradeLevel) => parseFloat(gradeLevel.value) > 4 && parseFloat(gradeLevel.value) <= 8
8694
8693
  );
8695
- } else if (type === "HIGH_SCHOOL") {
8694
+ } else if (institutionType === "HIGH_SCHOOL") {
8696
8695
  return retrieveGradeLevelOptionList().filter(
8697
8696
  (gradeLevel) => parseFloat(gradeLevel.value) > 8
8698
8697
  );
8699
- } else if (type === "COLLEGE" || type === "PRIVATE_TRAINING" || type === "PRIVATE_LESSON" || type === "COURSE") {
8698
+ } else if (institutionType === "COLLEGE" || institutionType === "PRIVATE_TRAINING" || institutionType === "PRIVATE_LESSON" || institutionType === "COURSE") {
8700
8699
  return retrieveGradeLevelOptionList();
8701
8700
  } else {
8702
8701
  return [];
@@ -8704,42 +8703,20 @@ var filterGradeLevelOptionList = (institutionDTO, gradeDTO) => {
8704
8703
  }
8705
8704
  return retrieveGradeLevelOptionList();
8706
8705
  };
8707
- var filterCoterieTypeOptionList = (userInformation, userProfile, userProfileInstitution) => {
8708
- if (userInformation.accountType === "GENIXO") {
8709
- return retrieveCoterieTypeOptionList().sort(
8710
- (a, b) => a.text.localeCompare(b.text)
8711
- );
8712
- }
8713
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
8714
- if (userProfile.coterieType === "MANAGEMENT") {
8715
- if (userProfileInstitution) {
8716
- return retrieveCoterieTypeOptionList().filter(
8717
- (coterieTypeOption) => coterieTypeOption.includes.includes(userProfileInstitution.type)
8718
- ).sort((a, b) => a.text.localeCompare(b.text));
8719
- } else {
8720
- return retrieveCoterieTypeOptionList().sort(
8721
- (a, b) => a.text.localeCompare(b.text)
8722
- );
8723
- }
8724
- } else {
8706
+ var filterCoterieTypeOptionList = (coterieType, institutionType) => {
8707
+ if (coterieType === "MANAGEMENT") {
8708
+ if (institutionType) {
8725
8709
  return retrieveCoterieTypeOptionList().filter(
8726
- (coterieTypeOption) => coterieTypeOption.value === userProfile.coterieType
8710
+ (coterieTypeOption) => coterieTypeOption.includes.includes(institutionType)
8727
8711
  ).sort((a, b) => a.text.localeCompare(b.text));
8728
- }
8729
- } else if (userProfile.role === "INDIVIDUAL") {
8730
- const individualCoterieTypeOptionList = [];
8731
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
8732
- userProfile.coterieTypeList.forEach((coterieType) => {
8733
- const foundCoterieTypeOption = coterieTypeOptionList.find(
8734
- (coterieTypeOption) => coterieTypeOption.value === coterieType
8712
+ } else {
8713
+ return retrieveCoterieTypeOptionList().sort(
8714
+ (a, b) => a.text.localeCompare(b.text)
8735
8715
  );
8736
- if (foundCoterieTypeOption) {
8737
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
8738
- }
8739
- });
8740
- return individualCoterieTypeOptionList;
8716
+ }
8717
+ } else {
8718
+ return retrieveCoterieTypeOptionList().filter((coterieTypeOption) => coterieTypeOption.value === coterieType).sort((a, b) => a.text.localeCompare(b.text));
8741
8719
  }
8742
- return [];
8743
8720
  };
8744
8721
  var filterCoterieTypeByDistinctOptionList = (distinctCoterieTypeOptionList) => {
8745
8722
  const coterieTypeOptionList = retrieveCoterieTypeOptionList();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.26",
3
+ "version": "2.2.28",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1150,38 +1150,37 @@ export const retrieveUserAuthorityGeneralOptionList = () => {
1150
1150
  };
1151
1151
 
1152
1152
  export const filterGradeLevelOptionList = (
1153
- institutionDTO: any,
1154
- gradeDTO: any
1153
+ level: any,
1154
+ institutionType: any
1155
1155
  ) => {
1156
- if (gradeDTO) {
1156
+ if (level) {
1157
1157
  return retrieveGradeLevelOptionList().filter(
1158
- (gradeLevel: any) => parseFloat(gradeLevel.value) === gradeDTO.level
1158
+ (gradeLevel: any) => parseFloat(gradeLevel.value) === level
1159
1159
  );
1160
1160
  }
1161
- if (institutionDTO) {
1162
- const { type } = institutionDTO;
1163
- if (type === "WEST_PRIMARY") {
1161
+ if (institutionType) {
1162
+ if (institutionType === "WEST_PRIMARY") {
1164
1163
  return retrieveGradeLevelOptionList().filter(
1165
1164
  (gradeLevel: any) => parseFloat(gradeLevel.value) <= 8
1166
1165
  );
1167
- } else if (type === "EAST_PRIMARY") {
1166
+ } else if (institutionType === "EAST_PRIMARY") {
1168
1167
  return retrieveGradeLevelOptionList().filter(
1169
1168
  (gradeLevel: any) => parseFloat(gradeLevel.value) <= 4
1170
1169
  );
1171
- } else if (type === "EAST_SECONDARY") {
1170
+ } else if (institutionType === "EAST_SECONDARY") {
1172
1171
  return retrieveGradeLevelOptionList().filter(
1173
1172
  (gradeLevel: any) =>
1174
1173
  parseFloat(gradeLevel.value) > 4 && parseFloat(gradeLevel.value) <= 8
1175
1174
  );
1176
- } else if (type === "HIGH_SCHOOL") {
1175
+ } else if (institutionType === "HIGH_SCHOOL") {
1177
1176
  return retrieveGradeLevelOptionList().filter(
1178
1177
  (gradeLevel: any) => parseFloat(gradeLevel.value) > 8
1179
1178
  );
1180
1179
  } else if (
1181
- type === "COLLEGE" ||
1182
- type === "PRIVATE_TRAINING" ||
1183
- type === "PRIVATE_LESSON" ||
1184
- type === "COURSE"
1180
+ institutionType === "COLLEGE" ||
1181
+ institutionType === "PRIVATE_TRAINING" ||
1182
+ institutionType === "PRIVATE_LESSON" ||
1183
+ institutionType === "COURSE"
1185
1184
  ) {
1186
1185
  return retrieveGradeLevelOptionList();
1187
1186
  } else {
@@ -1192,50 +1191,26 @@ export const filterGradeLevelOptionList = (
1192
1191
  };
1193
1192
 
1194
1193
  export const filterCoterieTypeOptionList = (
1195
- userInformation: any,
1196
- userProfile: any,
1197
- userProfileInstitution: any
1194
+ coterieType: any,
1195
+ institutionType: any
1198
1196
  ) => {
1199
- if (userInformation.accountType === "GENIXO") {
1200
- return retrieveCoterieTypeOptionList().sort((a, b) =>
1201
- a.text.localeCompare(b.text)
1202
- );
1203
- }
1204
- if (userProfile.role === "STAFF" || userProfile.role === "CONTENT_CREATOR") {
1205
- if (userProfile.coterieType === "MANAGEMENT") {
1206
- if (userProfileInstitution) {
1207
- return retrieveCoterieTypeOptionList()
1208
- .filter((coterieTypeOption) =>
1209
- coterieTypeOption.includes.includes(userProfileInstitution.type)
1210
- )
1211
- .sort((a, b) => a.text.localeCompare(b.text));
1212
- } else {
1213
- return retrieveCoterieTypeOptionList().sort((a, b) =>
1214
- a.text.localeCompare(b.text)
1215
- );
1216
- }
1217
- } else {
1197
+ if (coterieType === "MANAGEMENT") {
1198
+ if (institutionType) {
1218
1199
  return retrieveCoterieTypeOptionList()
1219
- .filter(
1220
- (coterieTypeOption) =>
1221
- coterieTypeOption.value === userProfile.coterieType
1200
+ .filter((coterieTypeOption) =>
1201
+ coterieTypeOption.includes.includes(institutionType)
1222
1202
  )
1223
1203
  .sort((a, b) => a.text.localeCompare(b.text));
1224
- }
1225
- } else if (userProfile.role === "INDIVIDUAL") {
1226
- const individualCoterieTypeOptionList: any = [];
1227
- const coterieTypeOptionList = retrieveCoterieTypeOptionList();
1228
- userProfile.coterieTypeList.forEach((coterieType: any) => {
1229
- const foundCoterieTypeOption = coterieTypeOptionList.find(
1230
- (coterieTypeOption) => coterieTypeOption.value === coterieType
1204
+ } else {
1205
+ return retrieveCoterieTypeOptionList().sort((a, b) =>
1206
+ a.text.localeCompare(b.text)
1231
1207
  );
1232
- if (foundCoterieTypeOption) {
1233
- individualCoterieTypeOptionList.push(foundCoterieTypeOption);
1234
- }
1235
- });
1236
- return individualCoterieTypeOptionList;
1208
+ }
1209
+ } else {
1210
+ return retrieveCoterieTypeOptionList()
1211
+ .filter((coterieTypeOption) => coterieTypeOption.value === coterieType)
1212
+ .sort((a, b) => a.text.localeCompare(b.text));
1237
1213
  }
1238
- return [];
1239
1214
  };
1240
1215
 
1241
1216
  export const filterCoterieTypeByDistinctOptionList = (