@sunbird-cb/consumption 0.0.96 → 0.0.98
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/bundles/sunbird-cb-consumption.umd.js +37 -10
- package/bundles/sunbird-cb-consumption.umd.js.map +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js.map +1 -1
- package/esm2015/lib/_common/events/events.component.js +22 -2
- package/esm2015/lib/_services/widget-content-lib.service.js +31 -21
- package/esm5/lib/_common/events/events.component.js +22 -2
- package/esm5/lib/_services/widget-content-lib.service.js +17 -10
- package/fesm2015/sunbird-cb-consumption.js +51 -21
- package/fesm2015/sunbird-cb-consumption.js.map +1 -1
- package/fesm5/sunbird-cb-consumption.js +37 -10
- package/fesm5/sunbird-cb-consumption.js.map +1 -1
- package/package.json +1 -1
|
@@ -3252,31 +3252,38 @@
|
|
|
3252
3252
|
*/
|
|
3253
3253
|
function (content) {
|
|
3254
3254
|
return __awaiter(this, void 0, void 0, function () {
|
|
3255
|
-
var enrolledCourse, enrolledCourseData, data, data;
|
|
3255
|
+
var urlData, enrolledCourse, enrolledCourseData, data, data;
|
|
3256
3256
|
return __generator(this, function (_a) {
|
|
3257
3257
|
switch (_a.label) {
|
|
3258
|
-
case 0:
|
|
3259
|
-
|
|
3258
|
+
case 0:
|
|
3259
|
+
if (!content.externalId) return [3 /*break*/, 1];
|
|
3260
|
+
urlData = {
|
|
3261
|
+
url: "app/toc/ext/" + content.contentId,
|
|
3262
|
+
queryParams: { batchId: content.batchId },
|
|
3263
|
+
};
|
|
3264
|
+
return [2 /*return*/, urlData];
|
|
3265
|
+
case 1: return [4 /*yield*/, this.getEnrolledData(content.identifier)];
|
|
3266
|
+
case 2:
|
|
3260
3267
|
enrolledCourse = _a.sent();
|
|
3261
|
-
if (!(enrolledCourse && enrolledCourse.length)) return [3 /*break*/,
|
|
3268
|
+
if (!(enrolledCourse && enrolledCourse.length)) return [3 /*break*/, 6];
|
|
3262
3269
|
enrolledCourseData = enrolledCourse[0];
|
|
3263
3270
|
if (!(enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.BLENDED_PROGRAM ||
|
|
3264
3271
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.INVITE_ONLY_PROGRAM ||
|
|
3265
3272
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.MODERATED_PROGRAM ||
|
|
3266
3273
|
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.BLENDED_PROGRAM ||
|
|
3267
|
-
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/,
|
|
3274
|
+
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/, 4];
|
|
3268
3275
|
if (!this.isBatchInProgress(enrolledCourseData.batch)) {
|
|
3269
3276
|
return [2 /*return*/, this.gotoTocPage(content)];
|
|
3270
3277
|
}
|
|
3271
3278
|
return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
3272
|
-
case
|
|
3279
|
+
case 3:
|
|
3273
3280
|
data = _a.sent();
|
|
3274
3281
|
return [2 /*return*/, data];
|
|
3275
|
-
case
|
|
3276
|
-
case
|
|
3282
|
+
case 4: return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
3283
|
+
case 5:
|
|
3277
3284
|
data = _a.sent();
|
|
3278
3285
|
return [2 /*return*/, data];
|
|
3279
|
-
case
|
|
3286
|
+
case 6: return [2 /*return*/, this.gotoTocPage(content)];
|
|
3280
3287
|
}
|
|
3281
3288
|
});
|
|
3282
3289
|
});
|
|
@@ -20431,6 +20438,14 @@
|
|
|
20431
20438
|
function (res) {
|
|
20432
20439
|
_this.events = [];
|
|
20433
20440
|
if (res && res.result && res.result.count > 0) {
|
|
20441
|
+
res.result.Event.forEach((/**
|
|
20442
|
+
* @param {?} eveEle
|
|
20443
|
+
* @return {?}
|
|
20444
|
+
*/
|
|
20445
|
+
function (eveEle) {
|
|
20446
|
+
eveEle['eventDate'] = _this.customDateFormat(eveEle.startDate, eveEle.startTime);
|
|
20447
|
+
eveEle['eventendDate'] = _this.customDateFormat(eveEle.endDate, eveEle.endTime);
|
|
20448
|
+
}));
|
|
20434
20449
|
_this.events = _this.sortItemByTime(res.result.Event);
|
|
20435
20450
|
_this.loader = false;
|
|
20436
20451
|
}
|
|
@@ -20467,6 +20482,14 @@
|
|
|
20467
20482
|
function (res) {
|
|
20468
20483
|
_this.events = [];
|
|
20469
20484
|
if (res && res.result && res.result.count > 0) {
|
|
20485
|
+
res.result.Event.forEach((/**
|
|
20486
|
+
* @param {?} eveEle
|
|
20487
|
+
* @return {?}
|
|
20488
|
+
*/
|
|
20489
|
+
function (eveEle) {
|
|
20490
|
+
eveEle['eventDate'] = _this.customDateFormat(eveEle.startDate, eveEle.startTime);
|
|
20491
|
+
eveEle['eventendDate'] = _this.customDateFormat(eveEle.endDate, eveEle.endTime);
|
|
20492
|
+
}));
|
|
20470
20493
|
_this.events = _this.sortItemByTime(res.result.Event);
|
|
20471
20494
|
_this.loader = false;
|
|
20472
20495
|
}
|
|
@@ -20496,7 +20519,11 @@
|
|
|
20496
20519
|
* @return {?}
|
|
20497
20520
|
*/
|
|
20498
20521
|
function (a, b) {
|
|
20499
|
-
|
|
20522
|
+
/** @type {?} */
|
|
20523
|
+
var firstDate = new Date(a.eventDate);
|
|
20524
|
+
/** @type {?} */
|
|
20525
|
+
var secondDate = new Date(b.eventDate);
|
|
20526
|
+
return secondDate < firstDate ? 1 : -1;
|
|
20500
20527
|
}));
|
|
20501
20528
|
};
|
|
20502
20529
|
/**
|