@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
|
@@ -3048,31 +3048,38 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3048
3048
|
*/
|
|
3049
3049
|
function (content) {
|
|
3050
3050
|
return __awaiter(this, void 0, void 0, function () {
|
|
3051
|
-
var enrolledCourse, enrolledCourseData, data, data;
|
|
3051
|
+
var urlData, enrolledCourse, enrolledCourseData, data, data;
|
|
3052
3052
|
return __generator(this, function (_a) {
|
|
3053
3053
|
switch (_a.label) {
|
|
3054
|
-
case 0:
|
|
3055
|
-
|
|
3054
|
+
case 0:
|
|
3055
|
+
if (!content.externalId) return [3 /*break*/, 1];
|
|
3056
|
+
urlData = {
|
|
3057
|
+
url: "app/toc/ext/" + content.contentId,
|
|
3058
|
+
queryParams: { batchId: content.batchId },
|
|
3059
|
+
};
|
|
3060
|
+
return [2 /*return*/, urlData];
|
|
3061
|
+
case 1: return [4 /*yield*/, this.getEnrolledData(content.identifier)];
|
|
3062
|
+
case 2:
|
|
3056
3063
|
enrolledCourse = _a.sent();
|
|
3057
|
-
if (!(enrolledCourse && enrolledCourse.length)) return [3 /*break*/,
|
|
3064
|
+
if (!(enrolledCourse && enrolledCourse.length)) return [3 /*break*/, 6];
|
|
3058
3065
|
enrolledCourseData = enrolledCourse[0];
|
|
3059
3066
|
if (!(enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.BLENDED_PROGRAM ||
|
|
3060
3067
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.INVITE_ONLY_PROGRAM ||
|
|
3061
3068
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.MODERATED_PROGRAM ||
|
|
3062
3069
|
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.BLENDED_PROGRAM ||
|
|
3063
|
-
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/,
|
|
3070
|
+
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/, 4];
|
|
3064
3071
|
if (!this.isBatchInProgress(enrolledCourseData.batch)) {
|
|
3065
3072
|
return [2 /*return*/, this.gotoTocPage(content)];
|
|
3066
3073
|
}
|
|
3067
3074
|
return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
3068
|
-
case
|
|
3075
|
+
case 3:
|
|
3069
3076
|
data = _a.sent();
|
|
3070
3077
|
return [2 /*return*/, data];
|
|
3071
|
-
case
|
|
3072
|
-
case
|
|
3078
|
+
case 4: return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
3079
|
+
case 5:
|
|
3073
3080
|
data = _a.sent();
|
|
3074
3081
|
return [2 /*return*/, data];
|
|
3075
|
-
case
|
|
3082
|
+
case 6: return [2 /*return*/, this.gotoTocPage(content)];
|
|
3076
3083
|
}
|
|
3077
3084
|
});
|
|
3078
3085
|
});
|
|
@@ -20227,6 +20234,14 @@ var EventsComponent = /** @class */ (function () {
|
|
|
20227
20234
|
function (res) {
|
|
20228
20235
|
_this.events = [];
|
|
20229
20236
|
if (res && res.result && res.result.count > 0) {
|
|
20237
|
+
res.result.Event.forEach((/**
|
|
20238
|
+
* @param {?} eveEle
|
|
20239
|
+
* @return {?}
|
|
20240
|
+
*/
|
|
20241
|
+
function (eveEle) {
|
|
20242
|
+
eveEle['eventDate'] = _this.customDateFormat(eveEle.startDate, eveEle.startTime);
|
|
20243
|
+
eveEle['eventendDate'] = _this.customDateFormat(eveEle.endDate, eveEle.endTime);
|
|
20244
|
+
}));
|
|
20230
20245
|
_this.events = _this.sortItemByTime(res.result.Event);
|
|
20231
20246
|
_this.loader = false;
|
|
20232
20247
|
}
|
|
@@ -20263,6 +20278,14 @@ var EventsComponent = /** @class */ (function () {
|
|
|
20263
20278
|
function (res) {
|
|
20264
20279
|
_this.events = [];
|
|
20265
20280
|
if (res && res.result && res.result.count > 0) {
|
|
20281
|
+
res.result.Event.forEach((/**
|
|
20282
|
+
* @param {?} eveEle
|
|
20283
|
+
* @return {?}
|
|
20284
|
+
*/
|
|
20285
|
+
function (eveEle) {
|
|
20286
|
+
eveEle['eventDate'] = _this.customDateFormat(eveEle.startDate, eveEle.startTime);
|
|
20287
|
+
eveEle['eventendDate'] = _this.customDateFormat(eveEle.endDate, eveEle.endTime);
|
|
20288
|
+
}));
|
|
20266
20289
|
_this.events = _this.sortItemByTime(res.result.Event);
|
|
20267
20290
|
_this.loader = false;
|
|
20268
20291
|
}
|
|
@@ -20292,7 +20315,11 @@ var EventsComponent = /** @class */ (function () {
|
|
|
20292
20315
|
* @return {?}
|
|
20293
20316
|
*/
|
|
20294
20317
|
function (a, b) {
|
|
20295
|
-
|
|
20318
|
+
/** @type {?} */
|
|
20319
|
+
var firstDate = new Date(a.eventDate);
|
|
20320
|
+
/** @type {?} */
|
|
20321
|
+
var secondDate = new Date(b.eventDate);
|
|
20322
|
+
return secondDate < firstDate ? 1 : -1;
|
|
20296
20323
|
}));
|
|
20297
20324
|
};
|
|
20298
20325
|
/**
|