catchup-library-web 1.20.18 → 1.20.20

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.
@@ -121,9 +121,9 @@ export const retrieveBadgeRuleListByParams = (
121
121
  sourceType: string,
122
122
  trackingType: string
123
123
  ) => {
124
- if (coterieType === "MANAGEMENT") {
125
- if (sourceType === "ACTIVITY") {
126
- if (trackingType === "COUNT") {
124
+ if (trackingType === "COUNT") {
125
+ if (coterieType === "MANAGEMENT") {
126
+ if (sourceType === "ACTIVITY") {
127
127
  return [
128
128
  {
129
129
  level: 1,
@@ -146,128 +146,104 @@ export const retrieveBadgeRuleListByParams = (
146
146
  value: 5000,
147
147
  },
148
148
  ];
149
- } else if (trackingType === "TIME_SPENT") {
149
+ } else if (
150
+ sourceType === "ACTIVITY_CORRECT" ||
151
+ sourceType === "ACTIVITY_REVIEW"
152
+ ) {
150
153
  return [
151
154
  {
152
155
  level: 1,
153
- value: 2,
156
+ value: 25,
154
157
  },
155
158
  {
156
159
  level: 2,
157
- value: 10,
160
+ value: 50,
158
161
  },
159
162
  {
160
163
  level: 3,
161
- value: 20,
164
+ value: 250,
162
165
  },
163
166
  {
164
167
  level: 4,
165
- value: 100,
168
+ value: 500,
166
169
  },
167
170
  {
168
171
  level: 5,
169
- value: 200,
172
+ value: 1000,
170
173
  },
171
174
  ];
172
- } else {
175
+ } else if (sourceType === "ACTIVITY_TIME_SPENT") {
173
176
  return [
174
177
  {
175
178
  level: 1,
176
- value: 25,
179
+ value: 2,
177
180
  },
178
181
  {
179
182
  level: 2,
180
- value: 50,
183
+ value: 10,
181
184
  },
182
185
  {
183
186
  level: 3,
184
- value: 250,
187
+ value: 20,
185
188
  },
186
189
  {
187
190
  level: 4,
188
- value: 500,
191
+ value: 100,
189
192
  },
190
193
  {
191
194
  level: 5,
192
- value: 1000,
195
+ value: 200,
193
196
  },
194
197
  ];
195
- }
196
- } else if (sourceType === "LOGIN") {
197
- return [
198
- {
199
- level: 1,
200
- value: 3,
201
- },
202
- {
203
- level: 2,
204
- value: 7,
205
- },
206
- {
207
- level: 3,
208
- value: 15,
209
- },
210
- {
211
- level: 4,
212
- value: 30,
213
- },
214
- {
215
- level: 5,
216
- value: 90,
217
- },
218
- ];
219
- } else {
220
- if (trackingType === "COUNT") {
198
+ } else if (sourceType === "LOGIN") {
221
199
  return [
222
200
  {
223
201
  level: 1,
224
- value: 5,
202
+ value: 3,
225
203
  },
226
204
  {
227
205
  level: 2,
228
- value: 10,
206
+ value: 7,
229
207
  },
230
208
  {
231
209
  level: 3,
232
- value: 50,
210
+ value: 15,
233
211
  },
234
212
  {
235
213
  level: 4,
236
- value: 100,
214
+ value: 30,
237
215
  },
238
216
  {
239
217
  level: 5,
240
- value: 500,
218
+ value: 90,
241
219
  },
242
220
  ];
243
221
  } else {
244
222
  return [
245
223
  {
246
224
  level: 1,
247
- value: 25,
225
+ value: 5,
248
226
  },
249
227
  {
250
228
  level: 2,
251
- value: 50,
229
+ value: 10,
252
230
  },
253
231
  {
254
232
  level: 3,
255
- value: 250,
233
+ value: 50,
256
234
  },
257
235
  {
258
236
  level: 4,
259
- value: 500,
237
+ value: 100,
260
238
  },
261
239
  {
262
240
  level: 5,
263
- value: 1000,
241
+ value: 500,
264
242
  },
265
243
  ];
266
244
  }
267
- }
268
- } else {
269
- if (sourceType === "ACTIVITY") {
270
- if (trackingType === "COUNT") {
245
+ } else {
246
+ if (sourceType === "ACTIVITY") {
271
247
  return [
272
248
  {
273
249
  level: 1,
@@ -290,57 +266,58 @@ export const retrieveBadgeRuleListByParams = (
290
266
  value: 1000,
291
267
  },
292
268
  ];
293
- } else if (trackingType === "TIME_SPENT") {
269
+ } else if (
270
+ sourceType === "ACTIVITY_CORRECT" ||
271
+ sourceType === "ACTIVITY_REVIEW"
272
+ ) {
294
273
  return [
295
274
  {
296
275
  level: 1,
297
- value: 1,
276
+ value: 5,
298
277
  },
299
278
  {
300
279
  level: 2,
301
- value: 2,
280
+ value: 25,
302
281
  },
303
282
  {
304
283
  level: 3,
305
- value: 10,
284
+ value: 50,
306
285
  },
307
286
  {
308
287
  level: 4,
309
- value: 20,
288
+ value: 250,
310
289
  },
311
290
  {
312
291
  level: 5,
313
- value: 100,
292
+ value: 500,
314
293
  },
315
294
  ];
316
- } else {
295
+ } else if (sourceType === "ACTIVITY_TIME_SPENT") {
317
296
  return [
318
297
  {
319
298
  level: 1,
320
- value: 5,
299
+ value: 1,
321
300
  },
322
301
  {
323
302
  level: 2,
324
- value: 25,
303
+ value: 2,
325
304
  },
326
305
  {
327
306
  level: 3,
328
- value: 50,
307
+ value: 10,
329
308
  },
330
309
  {
331
310
  level: 4,
332
- value: 250,
311
+ value: 20,
333
312
  },
334
313
  {
335
314
  level: 5,
336
- value: 500,
315
+ value: 100,
337
316
  },
338
317
  ];
339
- }
340
- } else if (sourceType === "LOGIN") {
341
- return [];
342
- } else {
343
- if (trackingType === "COUNT") {
318
+ } else if (sourceType === "LOGIN") {
319
+ return [];
320
+ } else {
344
321
  return [
345
322
  {
346
323
  level: 1,
@@ -382,169 +359,150 @@ export const retrieveBadgeRuleTextByParams = (
382
359
  );
383
360
  const foundBadgeRule = badgeRuleList[level - 1];
384
361
 
385
- if (coterieType === "MANAGEMENT") {
386
- if (sourceType === "ACTIVITY") {
387
- if (trackingType === "COUNT") {
362
+ if (trackingType === "COUNT") {
363
+ if (coterieType === "MANAGEMENT") {
364
+ if (sourceType === "ACTIVITY") {
388
365
  if (foundBadgeRule) {
389
- return `${i18n.t("total_activity_count_text_1")}${
366
+ return `${i18n.t("total_count_activity_text_1")}${
390
367
  foundBadgeRule.value
391
- }${i18n.t("total_activity_count_text_2")}`;
368
+ }${i18n.t("total_count_activity_text_2")}`;
392
369
  } else {
393
- return i18n.t("none_activity_count_text");
370
+ return i18n.t("none_count_activity_text");
394
371
  }
395
- } else if (trackingType === "CORRECT") {
372
+ } else if (sourceType === "ACTIVITY_CORRECT") {
396
373
  if (foundBadgeRule) {
397
- return `${i18n.t("total_activity_correct_text_1")}${
374
+ return `${i18n.t("total_count_activity_correct_text_1")}${
398
375
  foundBadgeRule.value
399
- }${i18n.t("total_activity_correct_text_2")}`;
376
+ }${i18n.t("total_count_activity_correct_text_2")}`;
400
377
  } else {
401
- return i18n.t("none_activity_correct_text");
378
+ return i18n.t("none_count_activity_correct_text");
402
379
  }
403
- } else if (trackingType === "REVIEW") {
380
+ } else if (sourceType === "ACTIVITY_REVIEW") {
404
381
  if (foundBadgeRule) {
405
- return `${i18n.t("total_activity_review_text_1")}${
382
+ return `${i18n.t("total_count_activity_review_text_1")}${
406
383
  foundBadgeRule.value
407
- }${i18n.t("total_activity_review_text_2")}`;
384
+ }${i18n.t("total_count_activity_review_text_2")}`;
408
385
  } else {
409
- return i18n.t("none_activity_review_text");
386
+ return i18n.t("none_count_activity_review_text");
410
387
  }
411
- } else if (trackingType === "TIME_SPENT") {
388
+ } else if (sourceType === "ACTIVITY_TIME_SPENT") {
412
389
  if (foundBadgeRule) {
413
- return `${i18n.t("total_activity_time_spent_text_1")}${
390
+ return `${i18n.t("coterie_count_activity_time_spent_text_1")}${
414
391
  foundBadgeRule.value
415
- }${i18n.t("total_activity_time_spent_text_2")}`;
392
+ }${i18n.t("coterie_count_activity_time_spent_text_2")}`;
416
393
  } else {
417
- return i18n.t("none_activity_time_spent_text");
394
+ return i18n.t("none_count_activity_time_spent_text");
418
395
  }
419
- }
420
- } else if (sourceType === "CATCHTIVITY") {
421
- if (trackingType === "COUNT") {
396
+ } else if (sourceType === "CATCHTIVITY") {
422
397
  if (foundBadgeRule) {
423
- return `${i18n.t("total_catchtivity_count_text_1")}${
398
+ return `${i18n.t("total_count_catchtivity_text_1")}${
424
399
  foundBadgeRule.value
425
- }${i18n.t("total_catchtivity_count_text_2")}`;
400
+ }${i18n.t("total_count_catchtivity_text_2")}`;
426
401
  } else {
427
- return i18n.t("none_catchtivity_count_text");
402
+ return i18n.t("none_count_catchtivity_text");
428
403
  }
429
- }
430
- } else if (sourceType === "CATCHXAM") {
431
- if (trackingType === "COUNT") {
404
+ } else if (sourceType === "CATCHXAM") {
432
405
  if (foundBadgeRule) {
433
- return `${i18n.t("total_catchxam_count_text_1")}${
406
+ return `${i18n.t("total_count_catchxam_text_1")}${
434
407
  foundBadgeRule.value
435
- }${i18n.t("total_catchxam_count_text_2")}`;
408
+ }${i18n.t("total_count_catchxam_text_2")}`;
436
409
  } else {
437
- return i18n.t("none_catchxam_count_text");
410
+ return i18n.t("none_count_catchxam_text");
438
411
  }
439
- }
440
- } else if (sourceType === "ETUDE") {
441
- if (trackingType === "COUNT") {
412
+ } else if (sourceType === "ETUDE") {
442
413
  if (foundBadgeRule) {
443
- return `${i18n.t("total_etude_count_text_1")}${
414
+ return `${i18n.t("total_count_etude_text_1")}${
444
415
  foundBadgeRule.value
445
- }${i18n.t("total_etude_count_text_2")}`;
416
+ }${i18n.t("total_count_etude_text_2")}`;
446
417
  } else {
447
- return i18n.t("none_etude_count_text");
418
+ return i18n.t("none_count_etude_text");
448
419
  }
449
- }
450
- } else if (sourceType === "CONTEST") {
451
- if (trackingType === "COUNT") {
420
+ } else if (sourceType === "CONTEST") {
452
421
  if (foundBadgeRule) {
453
- return `${i18n.t("total_contest_count_text_1")}${
422
+ return `${i18n.t("total_count_contest_text_1")}${
454
423
  foundBadgeRule.value
455
- }${i18n.t("total_contest_count_text_2")}`;
424
+ }${i18n.t("total_count_contest_text_2")}`;
456
425
  } else {
457
- return i18n.t("none_contest_count_text");
426
+ return i18n.t("none_count_contest_text");
458
427
  }
459
- }
460
- } else if (sourceType === "LOGIN") {
461
- if (trackingType === "COUNT") {
428
+ } else if (sourceType === "LOGIN") {
462
429
  if (foundBadgeRule) {
463
- return `${i18n.t("total_login_count_text_1")}${
430
+ return `${i18n.t("total_count_login_text_1")}${
464
431
  foundBadgeRule.value
465
- }${i18n.t("total_login_count_text_2")}`;
432
+ }${i18n.t("total_count_login_text_2")}`;
466
433
  } else {
467
- return i18n.t("none_login_count_text");
434
+ return i18n.t("none_count_login_text");
468
435
  }
469
436
  }
470
- }
471
- } else {
472
- if (sourceType === "ACTIVITY") {
473
- if (trackingType === "COUNT") {
437
+ } else {
438
+ if (sourceType === "ACTIVITY") {
474
439
  if (foundBadgeRule) {
475
- return `${i18n.t("coterie_activity_count_text_1")}${
440
+ return `${i18n.t("coterie_count_activity_text_1")}${
476
441
  foundBadgeRule.value
477
- }${i18n.t("coterie_activity_count_text_2")}`;
442
+ }${i18n.t("coterie_count_activity_text_2")}`;
478
443
  } else {
479
- return i18n.t("none_activity_count_text");
444
+ return i18n.t("none_count_activity_text");
480
445
  }
481
- } else if (trackingType === "CORRECT") {
446
+ } else if (sourceType === "ACTIVITY_CORRECT") {
482
447
  if (foundBadgeRule) {
483
- return `${i18n.t("coterie_activity_correct_text_1")}${
448
+ return `${i18n.t("coterie_count_activity_correct_text_1")}${
484
449
  foundBadgeRule.value
485
- }${i18n.t("coterie_activity_correct_text_2")}`;
450
+ }${i18n.t("coterie_count_activity_correct_text_2")}`;
486
451
  } else {
487
- return i18n.t("none_activity_correct_text");
452
+ return i18n.t("none_count_activity_correct_text");
488
453
  }
489
- } else if (trackingType === "REVIEW") {
454
+ } else if (sourceType === "ACTIVITY_REVIEW") {
490
455
  if (foundBadgeRule) {
491
- return `${i18n.t("coterie_activity_review_text_1")}${
456
+ return `${i18n.t("coterie_count_activity_review_text_1")}${
492
457
  foundBadgeRule.value
493
- }${i18n.t("coterie_activity_review_text_2")}`;
458
+ }${i18n.t("coterie_count_activity_review_text_2")}`;
494
459
  } else {
495
- return i18n.t("none_activity_review_text");
460
+ return i18n.t("none_count_activity_review_text");
496
461
  }
497
- } else if (trackingType === "TIME_SPENT") {
462
+ } else if (sourceType === "ACTIVITY_TIME_SPENT") {
498
463
  if (foundBadgeRule) {
499
- return `${i18n.t("coterie_activity_time_spent_text_1")}${
464
+ return `${i18n.t("total_count_activity_time_spent_text_1")}${
500
465
  foundBadgeRule.value
501
- }${i18n.t("coterie_activity_time_spent_text_2")}`;
466
+ }${i18n.t("total_count_activity_time_spent_text_2")}`;
502
467
  } else {
503
- return i18n.t("none_activity_time_spent_text");
468
+ return i18n.t("none_count_activity_time_spent_text");
504
469
  }
505
- }
506
- } else if (sourceType === "CATCHTIVITY") {
507
- if (trackingType === "COUNT") {
470
+ } else if (sourceType === "CATCHTIVITY") {
508
471
  if (foundBadgeRule) {
509
- return `${i18n.t("coterie_catchtivity_count_text_1")}${
472
+ return `${i18n.t("coterie_count_catchtivity_text_1")}${
510
473
  foundBadgeRule.value
511
- }${i18n.t("coterie_catchtivity_count_text_2")}`;
474
+ }${i18n.t("coterie_count_catchtivity_text_2")}`;
512
475
  } else {
513
- return i18n.t("none_catchtivity_count_text");
476
+ return i18n.t("none_count_catchtivity_text");
514
477
  }
515
- }
516
- } else if (sourceType === "CATCHXAM") {
517
- if (trackingType === "COUNT") {
478
+ } else if (sourceType === "CATCHXAM") {
518
479
  if (foundBadgeRule) {
519
- return `${i18n.t("coterie_catchxam_count_text_1")}${
480
+ return `${i18n.t("coterie_count_catchxam_text_1")}${
520
481
  foundBadgeRule.value
521
- }${i18n.t("coterie_catchxam_count_text_2")}`;
482
+ }${i18n.t("coterie_count_catchxam_text_2")}`;
522
483
  } else {
523
- return i18n.t("none_catchxam_count_text");
484
+ return i18n.t("none_count_catchxam_text");
524
485
  }
525
- }
526
- } else if (sourceType === "ETUDE") {
527
- if (trackingType === "COUNT") {
486
+ } else if (sourceType === "ETUDE") {
528
487
  if (foundBadgeRule) {
529
- return `${i18n.t("coterie_etude_count_text_1")}${
488
+ return `${i18n.t("coterie_count_etude_text_1")}${
530
489
  foundBadgeRule.value
531
- }${i18n.t("coterie_etude_count_text_2")}`;
490
+ }${i18n.t("coterie_count_etude_text_2")}`;
532
491
  } else {
533
- return i18n.t("none_etude_count_text");
492
+ return i18n.t("none_count_etude_text");
534
493
  }
535
- }
536
- } else if (sourceType === "CONTEST") {
537
- if (trackingType === "COUNT") {
494
+ } else if (sourceType === "CONTEST") {
538
495
  if (foundBadgeRule) {
539
- return `${i18n.t("coterie_contest_count_text_1")}${
496
+ return `${i18n.t("coterie_count_contest_text_1")}${
540
497
  foundBadgeRule.value
541
- }${i18n.t("coterie_contest_count_text_2")}`;
498
+ }${i18n.t("coterie_count_contest_text_2")}`;
542
499
  } else {
543
- return i18n.t("none_contest_count_text");
500
+ return i18n.t("none_count_contest_text");
544
501
  }
502
+ } else if (sourceType === "LOGIN") {
545
503
  }
546
- } else if (sourceType === "LOGIN") {
547
504
  }
548
505
  }
506
+
549
507
  return null;
550
508
  };