@sunbird-cb/consumption 0.0.89 → 0.0.90
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 +1265 -1349
- package/bundles/sunbird-cb-consumption.umd.js.map +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js +2 -2
- package/bundles/sunbird-cb-consumption.umd.min.js.map +1 -1
- package/esm2015/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +7 -4
- package/esm2015/lib/_common/cards/card-karma-programs/card-karma-programs.component.js +3 -3
- package/esm2015/lib/_common/cards/card-mdo-channel/card-mdo-channel.component.js +3 -3
- package/esm2015/lib/_common/cards/card-mdo-channel-v1/card-mdo-channel-v1.component.js +3 -3
- package/esm2015/lib/_common/cards/card-portrait/card-portrait.component.js +3 -3
- package/esm2015/lib/_common/cards/card-portrait-ext/card-portrait-ext.component.js +3 -3
- package/esm2015/lib/_common/cards/card-progress-portrait-lib/card-progress-portrait-lib.component.js +3 -3
- package/esm2015/lib/_common/cards/cards.component.js +24 -4
- package/esm2015/lib/_common/common-strip/common-strip.component.js +5 -5
- package/esm2015/lib/_common/competency-passbook/competency-passbook.component.js +3 -3
- package/esm2015/lib/_common/competency-passbook-mdo/competency-passbook-mdo.component.js +3 -3
- package/esm2015/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.js +54 -50
- package/esm2015/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.js +12 -4
- package/esm2015/lib/_common/strips/content-strip-facet-filter/content-strip-facet-filter.component.js +19 -18
- package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +8 -8
- package/esm2015/lib/_common/user-progress/user-progress.component.js +2 -1
- package/esm2015/lib/_services/widget-content.service.js +852 -0
- package/esm2015/lib/_services/widget-user.service.js +475 -0
- package/esm2015/public-api.js +2 -3
- package/esm2015/sunbird-cb-consumption.js +78 -77
- package/esm5/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +7 -4
- package/esm5/lib/_common/cards/card-karma-programs/card-karma-programs.component.js +3 -3
- package/esm5/lib/_common/cards/card-mdo-channel/card-mdo-channel.component.js +3 -3
- package/esm5/lib/_common/cards/card-mdo-channel-v1/card-mdo-channel-v1.component.js +3 -3
- package/esm5/lib/_common/cards/card-portrait/card-portrait.component.js +3 -3
- package/esm5/lib/_common/cards/card-portrait-ext/card-portrait-ext.component.js +3 -3
- package/esm5/lib/_common/cards/card-progress-portrait-lib/card-progress-portrait-lib.component.js +3 -3
- package/esm5/lib/_common/cards/cards.component.js +27 -4
- package/esm5/lib/_common/common-strip/common-strip.component.js +5 -5
- package/esm5/lib/_common/competency-passbook/competency-passbook.component.js +3 -3
- package/esm5/lib/_common/competency-passbook-mdo/competency-passbook-mdo.component.js +3 -3
- package/esm5/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.js +87 -83
- package/esm5/lib/_common/microsites/national-learning-week/national-learning/national-learning.component.js +12 -4
- package/esm5/lib/_common/strips/content-strip-facet-filter/content-strip-facet-filter.component.js +19 -19
- package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +9 -8
- package/esm5/lib/_common/user-progress/user-progress.component.js +2 -1
- package/esm5/lib/_services/widget-content.service.js +1109 -0
- package/esm5/lib/_services/widget-user.service.js +542 -0
- package/esm5/public-api.js +2 -3
- package/esm5/sunbird-cb-consumption.js +78 -77
- package/fesm2015/sunbird-cb-consumption.js +1059 -1115
- package/fesm2015/sunbird-cb-consumption.js.map +1 -1
- package/fesm5/sunbird-cb-consumption.js +1322 -1406
- package/fesm5/sunbird-cb-consumption.js.map +1 -1
- package/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.d.ts +3 -2
- package/lib/_common/cards/card-karma-programs/card-karma-programs.component.d.ts +2 -2
- package/lib/_common/cards/card-mdo-channel/card-mdo-channel.component.d.ts +2 -2
- package/lib/_common/cards/card-mdo-channel-v1/card-mdo-channel-v1.component.d.ts +2 -2
- package/lib/_common/cards/card-portrait/card-portrait.component.d.ts +2 -2
- package/lib/_common/cards/card-portrait-ext/card-portrait-ext.component.d.ts +2 -2
- package/lib/_common/cards/card-progress-portrait-lib/card-progress-portrait-lib.component.d.ts +2 -2
- package/lib/_common/cards/cards.component.d.ts +5 -2
- package/lib/_common/common-strip/common-strip.component.d.ts +3 -3
- package/lib/_common/competency-passbook/competency-passbook.component.d.ts +3 -3
- package/lib/_common/competency-passbook-mdo/competency-passbook-mdo.component.d.ts +3 -3
- package/lib/_common/content-strip-with-tabs-lib/content-strip-with-tabs-lib.component.d.ts +6 -4
- package/lib/_common/strips/content-strip-facet-filter/content-strip-facet-filter.component.d.ts +5 -4
- package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.d.ts +4 -3
- package/lib/_services/{widget-content-lib.service.d.ts → widget-content.service.d.ts} +3 -6
- package/lib/_services/{widget-user-lib.service.d.ts → widget-user.service.d.ts} +4 -9
- package/package.json +1 -1
- package/public-api.d.ts +1 -2
- package/sunbird-cb-consumption.d.ts +76 -75
- package/sunbird-cb-consumption.metadata.json +1 -1
- package/esm2015/lib/_services/widget-content-lib.service.js +0 -899
- package/esm2015/lib/_services/widget-user-lib.service.js +0 -523
- package/esm5/lib/_services/widget-content-lib.service.js +0 -1170
- package/esm5/lib/_services/widget-user-lib.service.js +0 -607
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Injectable, ɵɵdefineInjectable, Component, EventEmitter, Input, Output, ViewChild, NgModule,
|
|
1
|
+
import { Injectable, ɵɵdefineInjectable, Component, EventEmitter, Input, Output, ViewChild, NgModule, ɵɵinject, Inject, HostBinding, Directive, HostListener, CUSTOM_ELEMENTS_SCHEMA, ElementRef, ViewChildren, Pipe } from '@angular/core';
|
|
2
2
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
3
3
|
import { Router, RouterModule, ActivatedRoute } from '@angular/router';
|
|
4
|
-
import { fromEvent, timer,
|
|
5
|
-
import { debounceTime, throttleTime,
|
|
4
|
+
import { fromEvent, timer, BehaviorSubject, Subject, of, EMPTY, ReplaySubject, throwError, Observable, interval } from 'rxjs';
|
|
5
|
+
import { debounceTime, throttleTime, shareReplay, retry, map, catchError, filter, distinctUntilChanged } from 'rxjs/operators';
|
|
6
6
|
import { ValueService, ConfigurationsService as ConfigurationsService$1, WsEvents, LoggerService, EventService, UtilityService, MultilingualTranslationsService as MultilingualTranslationsService$1, PipeSafeSanitizerModule } from '@sunbird-cb/utils-v2';
|
|
7
7
|
import { MatButtonModule, MatIconModule, MatProgressSpinnerModule, MatToolbarModule, MatTooltipModule, MatListModule, MatSidenavModule, MatCardModule, MatExpansionModule, MatRadioModule, MatChipsModule, MatInputModule, MatFormFieldModule, MatDialogModule, MatSnackBarModule, MatSelectModule, MatDatepickerModule, MatNativeDateModule, MatTableModule, MatCheckboxModule, MatButtonToggleModule, MatTabsModule, MatAutocompleteModule, MatSnackBar, MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatProgressBarModule, MatMenuModule, MatRippleModule } from '@angular/material';
|
|
8
8
|
import { __assign, __awaiter, __generator, __extends, __values, __spread, __read } from 'tslib';
|
|
9
9
|
import { WidgetBaseComponent, SbUiResolverModule } from '@sunbird-cb/resolver-v2';
|
|
10
|
-
import {
|
|
11
|
-
import { uniqBy, orderBy,
|
|
12
|
-
import 'rxjs/add/observable/of';
|
|
13
|
-
import * as dayjs_ from 'dayjs';
|
|
10
|
+
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
11
|
+
import { get, uniqBy, orderBy, camelCase, kebabCase } from 'lodash';
|
|
14
12
|
import * as moment$4 from 'moment';
|
|
15
13
|
import { duration, utc } from 'moment';
|
|
16
14
|
import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
15
|
+
import 'rxjs/add/observable/of';
|
|
16
|
+
import * as dayjs_ from 'dayjs';
|
|
17
17
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
|
18
18
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
19
19
|
import { HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
|
|
@@ -1474,1136 +1474,464 @@ function viewerRouteGenerator(id, mimeType, collectionId, collectionType, forPre
|
|
|
1474
1474
|
};
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
/**
|
|
1478
|
-
* @fileoverview added by tsickle
|
|
1479
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1480
|
-
*/
|
|
1481
|
-
var NsCardContent;
|
|
1482
|
-
(function (NsCardContent) {
|
|
1483
|
-
/**
|
|
1484
|
-
* @record
|
|
1485
|
-
*/
|
|
1486
|
-
function ICard() { }
|
|
1487
|
-
NsCardContent.ICard = ICard;
|
|
1488
|
-
if (false) {
|
|
1489
|
-
/** @type {?} */
|
|
1490
|
-
ICard.prototype.content;
|
|
1491
|
-
/** @type {?} */
|
|
1492
|
-
ICard.prototype.cardSubType;
|
|
1493
|
-
/** @type {?} */
|
|
1494
|
-
ICard.prototype.context;
|
|
1495
|
-
/** @type {?|undefined} */
|
|
1496
|
-
ICard.prototype.intranetMode;
|
|
1497
|
-
/** @type {?|undefined} */
|
|
1498
|
-
ICard.prototype.deletedMode;
|
|
1499
|
-
/** @type {?|undefined} */
|
|
1500
|
-
ICard.prototype.likes;
|
|
1501
|
-
/** @type {?|undefined} */
|
|
1502
|
-
ICard.prototype.contentTags;
|
|
1503
|
-
/** @type {?} */
|
|
1504
|
-
ICard.prototype.stateData;
|
|
1505
|
-
}
|
|
1506
|
-
/**
|
|
1507
|
-
* @record
|
|
1508
|
-
*/
|
|
1509
|
-
function IContentTags() { }
|
|
1510
|
-
NsCardContent.IContentTags = IContentTags;
|
|
1511
|
-
if (false) {
|
|
1512
|
-
/** @type {?|undefined} */
|
|
1513
|
-
IContentTags.prototype.daysSpan;
|
|
1514
|
-
/** @type {?|undefined} */
|
|
1515
|
-
IContentTags.prototype.excludeContentType;
|
|
1516
|
-
/** @type {?|undefined} */
|
|
1517
|
-
IContentTags.prototype.excludeMimeType;
|
|
1518
|
-
/** @type {?} */
|
|
1519
|
-
IContentTags.prototype.tag;
|
|
1520
|
-
/** @type {?|undefined} */
|
|
1521
|
-
IContentTags.prototype.criteriaField;
|
|
1522
|
-
}
|
|
1523
|
-
/**
|
|
1524
|
-
* @record
|
|
1525
|
-
*/
|
|
1526
|
-
function ICompetency() { }
|
|
1527
|
-
NsCardContent.ICompetency = ICompetency;
|
|
1528
|
-
if (false) {
|
|
1529
|
-
/** @type {?} */
|
|
1530
|
-
ICompetency.prototype.competencyArea;
|
|
1531
|
-
/** @type {?} */
|
|
1532
|
-
ICompetency.prototype.competencyObject;
|
|
1533
|
-
}
|
|
1534
|
-
var EContentStatus;
|
|
1535
|
-
(function (EContentStatus) {
|
|
1536
|
-
EContentStatus["LIVE"] = "Live";
|
|
1537
|
-
EContentStatus["EXPIRED"] = "Expired";
|
|
1538
|
-
EContentStatus["DELETED"] = "Deleted";
|
|
1539
|
-
EContentStatus["MARK_FOR_DELETION"] = "MarkedForDeletion";
|
|
1540
|
-
})(EContentStatus = NsCardContent.EContentStatus || (NsCardContent.EContentStatus = {}));
|
|
1541
|
-
var ACBPConst;
|
|
1542
|
-
(function (ACBPConst) {
|
|
1543
|
-
ACBPConst["UPCOMING"] = "upcoming";
|
|
1544
|
-
ACBPConst["ALL"] = "All";
|
|
1545
|
-
ACBPConst["OVERDUE"] = "overdue";
|
|
1546
|
-
ACBPConst["SUCCESS"] = "success";
|
|
1547
|
-
})(ACBPConst = NsCardContent.ACBPConst || (NsCardContent.ACBPConst = {}));
|
|
1548
|
-
var IGOTConst;
|
|
1549
|
-
(function (IGOTConst) {
|
|
1550
|
-
IGOTConst["COMPETENCIES"] = "competencies_v5";
|
|
1551
|
-
IGOTConst["RETIRED"] = "Retired";
|
|
1552
|
-
})(IGOTConst = NsCardContent.IGOTConst || (NsCardContent.IGOTConst = {}));
|
|
1553
|
-
})(NsCardContent || (NsCardContent = {}));
|
|
1554
|
-
|
|
1555
1477
|
/**
|
|
1556
1478
|
* @fileoverview added by tsickle
|
|
1557
1479
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1558
1480
|
*/
|
|
1559
1481
|
/** @type {?} */
|
|
1560
|
-
var
|
|
1561
|
-
//
|
|
1562
|
-
|
|
1482
|
+
var moment = moment$4;
|
|
1483
|
+
// tslint:enable
|
|
1484
|
+
// TODO: move this in some common place
|
|
1563
1485
|
/** @type {?} */
|
|
1564
1486
|
var PROTECTED_SLAG_V8 = '/apis/protected/v8';
|
|
1565
1487
|
var ɵ0 = /**
|
|
1566
|
-
* @param {?}
|
|
1488
|
+
* @param {?} type
|
|
1489
|
+
* @param {?} id
|
|
1567
1490
|
* @return {?}
|
|
1568
1491
|
*/
|
|
1569
|
-
function (
|
|
1570
|
-
return PROTECTED_SLAG_V8 + "/
|
|
1492
|
+
function (type, id) {
|
|
1493
|
+
return PROTECTED_SLAG_V8 + "/content/collection/" + type + "/" + id;
|
|
1571
1494
|
}, ɵ1 = /**
|
|
1572
|
-
* @param {?}
|
|
1495
|
+
* @param {?} contentId
|
|
1573
1496
|
* @return {?}
|
|
1574
1497
|
*/
|
|
1575
|
-
function (
|
|
1576
|
-
|
|
1577
|
-
return "/apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=orgName,email&licenseDetails=name,description,url&fields=contentType,primaryCategory,courseCategory,topic,name,channel,mimeType,appIcon,gradeLevel,resourceType,identifier,medium,pkgVersion,board,subject,trackable,posterImage,duration,creatorLogo,license,version,versionKey,avgRating,additionalTags," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=name,endDate,startDate,status,enrollmentType,createdBy,certificates,batchAttributes";
|
|
1578
|
-
}, ɵ2 = /**
|
|
1579
|
-
* @param {?} userId
|
|
1498
|
+
function (contentId) { return PROTECTED_SLAG_V8 + "/user/progress/" + contentId; }, ɵ2 = /**
|
|
1499
|
+
* @param {?} certId
|
|
1580
1500
|
* @return {?}
|
|
1581
1501
|
*/
|
|
1582
|
-
function (
|
|
1583
|
-
|
|
1584
|
-
return "/apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=orgName,email&licenseDetails=name,description,url&fields=contentType,primaryCategory,courseCategory,topic,name,channel,mimeType,appIcon,gradeLevel,resourceType,identifier,medium,pkgVersion,board,subject,trackable,posterImage,duration,creatorLogo,license,version,versionKey,avgRating,additionalTags," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=name,endDate,startDate,status,enrollmentType,createdBy,certificates,batchAttributes&retiredCoursesEnabled=true";
|
|
1585
|
-
}, ɵ3 = /**
|
|
1586
|
-
* @param {?} userId
|
|
1587
|
-
* @param {?} orgdetails
|
|
1588
|
-
* @param {?} licenseDetails
|
|
1589
|
-
* @param {?} fields
|
|
1590
|
-
* @param {?} batchDetails
|
|
1502
|
+
function (certId) { return PROTECTED_SLAG_V8 + "/cohorts/course/batch/cert/download/" + certId; }, ɵ3 = /**
|
|
1503
|
+
* @param {?} contentId
|
|
1591
1504
|
* @return {?}
|
|
1592
1505
|
*/
|
|
1593
|
-
function (
|
|
1594
|
-
// tslint:disable-next-line: max-line-length
|
|
1595
|
-
return "apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=" + orgdetails + "&licenseDetails=" + licenseDetails + "&fields=" + fields + ",courseCategory," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=" + batchDetails;
|
|
1596
|
-
};
|
|
1506
|
+
function (contentId) { return "/apis/proxies/v8/action/content/v3/read/" + contentId; };
|
|
1597
1507
|
/** @type {?} */
|
|
1598
1508
|
var API_END_POINTS = {
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1509
|
+
CONTENT: PROTECTED_SLAG_V8 + "/content",
|
|
1510
|
+
AUTHORING_CONTENT: "/api/course/v1/hierarchy",
|
|
1511
|
+
CONTENT_LIKES: PROTECTED_SLAG_V8 + "/content/likeCount",
|
|
1512
|
+
SET_S3_COOKIE: PROTECTED_SLAG_V8 + "/content/setCookie",
|
|
1513
|
+
SET_S3_IMAGE_COOKIE: PROTECTED_SLAG_V8 + "/content/setImageCookie",
|
|
1514
|
+
FETCH_MANIFEST: PROTECTED_SLAG_V8 + "/content/getWebModuleManifest",
|
|
1515
|
+
FETCH_WEB_MODULE_FILES: PROTECTED_SLAG_V8 + "/content/getWebModuleFiles",
|
|
1516
|
+
MULTIPLE_CONTENT: PROTECTED_SLAG_V8 + "/content/multiple",
|
|
1517
|
+
CONTENT_SEARCH_V5: PROTECTED_SLAG_V8 + "/content/searchV5",
|
|
1518
|
+
CONTENT_SEARCH_V6: "/apis/proxies/v8/sunbirdigot/search",
|
|
1519
|
+
TRENDING_CONTENT_SEARCH: "apis/proxies/v8/trending/content/search",
|
|
1520
|
+
CONTENT_SEARCH_RELATED_CBP_V6: "/apis/proxies/v8/sunbirdigot/search",
|
|
1521
|
+
CONTENT_SEARCH_REGION_RECOMMENDATION: PROTECTED_SLAG_V8 + "/content/searchRegionRecommendation",
|
|
1522
|
+
CONTENT_HISTORY: PROTECTED_SLAG_V8 + "/user/history",
|
|
1523
|
+
CONTENT_HISTORYV2: "/apis/proxies/v8/read/content-progres",
|
|
1524
|
+
COURSE_BATCH_LIST: "/apis/proxies/v8/learner/course/v1/batch/list",
|
|
1525
|
+
COURSE_BATCH: "/apis/proxies/v8/course/v1/batch/read",
|
|
1526
|
+
AUTO_ASSIGN_BATCH: "/apis/protected/v8/cohorts/user/autoenrollment/",
|
|
1527
|
+
AUTO_ASSIGN_CURATED_BATCH: "/apis/proxies/v8/curatedprogram/v1/enrol",
|
|
1528
|
+
AUTO_ASSIGN_OPEN_PROGRAM: "/apis/proxies/v8/openprogram/v1/enrol",
|
|
1529
|
+
USER_CONTINUE_LEARNING: PROTECTED_SLAG_V8 + "/user/history/continue",
|
|
1530
|
+
CONTENT_RATING: PROTECTED_SLAG_V8 + "/user/rating",
|
|
1531
|
+
COLLECTION_HIERARCHY: (ɵ0),
|
|
1532
|
+
REGISTRATION_STATUS: PROTECTED_SLAG_V8 + "/admin/userRegistration/checkUserRegistrationContent",
|
|
1533
|
+
MARK_AS_COMPLETE_META: (ɵ1),
|
|
1534
|
+
ENROLL_BATCH: "/apis/proxies/v8/learner/course/v1/enrol",
|
|
1535
|
+
ENROLL_BATCH_WF: "/apis/proxies/v8/workflow/blendedprogram/enrol",
|
|
1536
|
+
WITHDRAW_BATCH_WF: "/apis/proxies/v8/workflow/blendedprogram/unenrol",
|
|
1537
|
+
BLENDED_USER_WF: "/apis/proxies/v8/workflow/blendedprogram/user/search",
|
|
1538
|
+
BLENDED_USER_COUNT: "apis/proxies/v8/workflow/blendedprogram/enrol/status/count",
|
|
1539
|
+
CERT_ADD_TEMPLATE: PROTECTED_SLAG_V8 + "/cohorts/course/batch/cert/template/add",
|
|
1540
|
+
CERT_ISSUE: PROTECTED_SLAG_V8 + "/cohorts/course/batch/cert/issue",
|
|
1541
|
+
CERT_DOWNLOAD: (ɵ2),
|
|
1542
|
+
READ_KARMAPOINTS: "/apis/proxies/v8/karmapoints/read",
|
|
1543
|
+
CONTENT_READ: (ɵ3),
|
|
1544
|
+
READ_COURSE_KARMAPOINTS: '/apis/proxies/v8/karmapoints/user/course/read',
|
|
1545
|
+
CLAIM_KARMAPOINTS: '/apis/proxies/v8/claimkarmapoints',
|
|
1546
|
+
USER_KARMA_POINTS: '/apis/proxies/v8/user/totalkarmapoints',
|
|
1547
|
+
AGGREGATION_SEARCH: '/apis/proxies/v8/content/aggregation/search',
|
|
1548
|
+
FEATURE_SEARCH: '/apis/proxies/v8/featured/content/search',
|
|
1605
1549
|
};
|
|
1606
|
-
var
|
|
1607
|
-
function
|
|
1550
|
+
var WidgetContentService = /** @class */ (function () {
|
|
1551
|
+
function WidgetContentService(http, configSvc) {
|
|
1608
1552
|
this.http = http;
|
|
1609
|
-
this.
|
|
1553
|
+
this.configSvc = configSvc;
|
|
1554
|
+
this.tocConfigData = new BehaviorSubject({});
|
|
1555
|
+
this.tocConfigData$ = this.tocConfigData.asObservable();
|
|
1556
|
+
this.telemetryData = new Subject();
|
|
1557
|
+
this.telemetryData$ = this.telemetryData.asObservable();
|
|
1558
|
+
this.programChildCourseResumeData = new BehaviorSubject({});
|
|
1559
|
+
this.programChildCourseResumeData$ = this.programChildCourseResumeData.asObservable();
|
|
1610
1560
|
}
|
|
1611
1561
|
/**
|
|
1612
|
-
* @param {?}
|
|
1562
|
+
* @param {?} message
|
|
1613
1563
|
* @return {?}
|
|
1614
1564
|
*/
|
|
1615
|
-
|
|
1616
|
-
* @param {?}
|
|
1565
|
+
WidgetContentService.prototype.changeTelemetryData = /**
|
|
1566
|
+
* @param {?} message
|
|
1617
1567
|
* @return {?}
|
|
1618
1568
|
*/
|
|
1619
|
-
function (
|
|
1620
|
-
|
|
1621
|
-
var errorMessage = '';
|
|
1622
|
-
if (error.error instanceof ErrorEvent) {
|
|
1623
|
-
errorMessage = "Error: " + error.error.message;
|
|
1624
|
-
}
|
|
1625
|
-
return throwError(errorMessage);
|
|
1569
|
+
function (message) {
|
|
1570
|
+
this.telemetryData.next(message);
|
|
1626
1571
|
};
|
|
1627
1572
|
/**
|
|
1628
|
-
* @param {?}
|
|
1573
|
+
* @param {?} primaryCategory
|
|
1629
1574
|
* @return {?}
|
|
1630
1575
|
*/
|
|
1631
|
-
|
|
1632
|
-
* @param {?}
|
|
1576
|
+
WidgetContentService.prototype.isResource = /**
|
|
1577
|
+
* @param {?} primaryCategory
|
|
1633
1578
|
* @return {?}
|
|
1634
1579
|
*/
|
|
1635
|
-
function (
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1580
|
+
function (primaryCategory) {
|
|
1581
|
+
if (primaryCategory) {
|
|
1582
|
+
/** @type {?} */
|
|
1583
|
+
var isResource = (primaryCategory === NsContent.EResourcePrimaryCategories.LEARNING_RESOURCE) ||
|
|
1584
|
+
(primaryCategory === NsContent.EResourcePrimaryCategories.PRACTICE_RESOURCE) ||
|
|
1585
|
+
(primaryCategory === NsContent.EResourcePrimaryCategories.FINAL_ASSESSMENT) ||
|
|
1586
|
+
(primaryCategory === NsContent.EResourcePrimaryCategories.COMP_ASSESSMENT) ||
|
|
1587
|
+
(primaryCategory === NsContent.EResourcePrimaryCategories.OFFLINE_SESSION);
|
|
1588
|
+
return isResource;
|
|
1589
|
+
}
|
|
1590
|
+
return false;
|
|
1639
1591
|
};
|
|
1640
|
-
// tslint:disable-next-line: max-line-length
|
|
1641
|
-
// tslint:disable-next-line: max-line-length
|
|
1642
1592
|
/**
|
|
1643
|
-
* @param {?}
|
|
1644
|
-
* @param {?=} queryParams
|
|
1593
|
+
* @param {?} identifier
|
|
1645
1594
|
* @return {?}
|
|
1646
1595
|
*/
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
* @param {?} userId
|
|
1651
|
-
* @param {?=} queryParams
|
|
1596
|
+
WidgetContentService.prototype.fetchMarkAsCompleteMeta = /**
|
|
1597
|
+
* @param {?} identifier
|
|
1652
1598
|
* @return {?}
|
|
1653
1599
|
*/
|
|
1654
|
-
function (
|
|
1655
|
-
|
|
1656
|
-
/** @type {?} */
|
|
1657
|
-
var path = '';
|
|
1658
|
-
if (queryParams) {
|
|
1659
|
-
// tslint:disable-next-line: max-line-length
|
|
1660
|
-
path = API_END_POINTS.FETCH_USER_ENROLLMENT_LIST_V2(userId, queryParams.orgdetails, queryParams.licenseDetails, queryParams.fields, queryParams.batchDetails);
|
|
1661
|
-
}
|
|
1662
|
-
else {
|
|
1663
|
-
path = API_END_POINTS.FETCH_USER_ENROLLMENT_LIST(userId);
|
|
1664
|
-
}
|
|
1665
|
-
/** @type {?} */
|
|
1666
|
-
var headers = new HttpHeaders({
|
|
1667
|
-
'Cache-Control': 'no-cache, no-store, must-revalidate, post-check=0, pre-check=0',
|
|
1668
|
-
Pragma: 'no-cache',
|
|
1669
|
-
Expires: '0',
|
|
1670
|
-
});
|
|
1600
|
+
function (identifier) {
|
|
1601
|
+
// tslint:disable-next-line
|
|
1671
1602
|
/** @type {?} */
|
|
1672
|
-
var
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
var coursesData = [];
|
|
1679
|
-
if (data && data.result && data.result.courses) {
|
|
1680
|
-
data.result.courses.forEach((/**
|
|
1681
|
-
* @param {?} content
|
|
1682
|
-
* @return {?}
|
|
1683
|
-
*/
|
|
1684
|
-
function (content) {
|
|
1685
|
-
if (content.contentStatus) {
|
|
1686
|
-
delete content.contentStatus;
|
|
1687
|
-
}
|
|
1688
|
-
coursesData.push(content);
|
|
1689
|
-
}));
|
|
1690
|
-
_this.storeUserEnrollmentInfo(data.result.userCourseEnrolmentInfo, data.result.courses.length);
|
|
1691
|
-
data.result.courses = coursesData;
|
|
1692
|
-
}
|
|
1693
|
-
return data.result;
|
|
1694
|
-
})));
|
|
1695
|
-
return result;
|
|
1603
|
+
var url = API_END_POINTS.MARK_AS_COMPLETE_META(identifier)
|
|
1604
|
+
// return this.http.get(url).toPromise()
|
|
1605
|
+
;
|
|
1606
|
+
// return this.http.get(url).toPromise()
|
|
1607
|
+
if (url) { }
|
|
1608
|
+
return of().toPromise();
|
|
1696
1609
|
};
|
|
1697
|
-
// tslint:disable-next-line: max-line-length
|
|
1698
|
-
// tslint:disable-next-line: max-line-length
|
|
1699
1610
|
/**
|
|
1700
|
-
* @param {?}
|
|
1701
|
-
* @param {?=} queryParams
|
|
1611
|
+
* @param {?} data
|
|
1702
1612
|
* @return {?}
|
|
1703
1613
|
*/
|
|
1704
|
-
|
|
1705
|
-
|
|
1614
|
+
WidgetContentService.prototype.updateTocConfig = /**
|
|
1615
|
+
* @param {?} data
|
|
1616
|
+
* @return {?}
|
|
1617
|
+
*/
|
|
1618
|
+
function (data) {
|
|
1619
|
+
this.tocConfigData.next(data);
|
|
1620
|
+
};
|
|
1706
1621
|
/**
|
|
1707
|
-
* @param {?}
|
|
1708
|
-
* @param {?=}
|
|
1622
|
+
* @param {?} contentId
|
|
1623
|
+
* @param {?=} hierarchyType
|
|
1624
|
+
* @param {?=} _additionalFields
|
|
1625
|
+
* @param {?=} primaryCategory
|
|
1709
1626
|
* @return {?}
|
|
1710
1627
|
*/
|
|
1711
|
-
|
|
1628
|
+
WidgetContentService.prototype.fetchContent = /**
|
|
1629
|
+
* @param {?} contentId
|
|
1630
|
+
* @param {?=} hierarchyType
|
|
1631
|
+
* @param {?=} _additionalFields
|
|
1632
|
+
* @param {?=} primaryCategory
|
|
1633
|
+
* @return {?}
|
|
1634
|
+
*/
|
|
1635
|
+
function (contentId, hierarchyType, _additionalFields, primaryCategory) {
|
|
1636
|
+
if (hierarchyType === void 0) { hierarchyType = 'detail'; }
|
|
1637
|
+
if (_additionalFields === void 0) { _additionalFields = []; }
|
|
1638
|
+
// const url = `${API_END_POINTS.CONTENT}/${contentId}?hierarchyType=${hierarchyType}`
|
|
1712
1639
|
/** @type {?} */
|
|
1713
|
-
var
|
|
1714
|
-
if (queryParams) {
|
|
1715
|
-
// tslint:disable-next-line: max-line-length
|
|
1716
|
-
path = API_END_POINTS.FETCH_USER_ENROLLMENT_LIST_V2(userId, queryParams.orgdetails, queryParams.licenseDetails, queryParams.fields, queryParams.batchDetails);
|
|
1717
|
-
}
|
|
1718
|
-
else {
|
|
1719
|
-
path = API_END_POINTS.FETCH_USER_ENROLLMENT_LIST_PROFILE(userId);
|
|
1720
|
-
}
|
|
1640
|
+
var url = '';
|
|
1721
1641
|
/** @type {?} */
|
|
1722
|
-
var
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1642
|
+
var forPreview = window.location.href.includes('/public/') || window.location.href.includes('&preview=true');
|
|
1643
|
+
if (primaryCategory && this.isResource(primaryCategory)) {
|
|
1644
|
+
if (!forPreview) {
|
|
1645
|
+
url = "/apis/proxies/v8/action/content/v3/read/" + contentId;
|
|
1646
|
+
}
|
|
1647
|
+
else {
|
|
1648
|
+
url = "/api/content/v1/read/" + contentId;
|
|
1649
|
+
}
|
|
1650
|
+
}
|
|
1651
|
+
else {
|
|
1652
|
+
if (!forPreview) {
|
|
1653
|
+
url = "/apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?hierarchyType=" + hierarchyType;
|
|
1654
|
+
}
|
|
1655
|
+
else {
|
|
1656
|
+
/** @type {?} */
|
|
1657
|
+
var forcreator = window.location.href.includes('editMode=true');
|
|
1658
|
+
if (forcreator) {
|
|
1659
|
+
url = "apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?mode=edit";
|
|
1660
|
+
}
|
|
1661
|
+
else {
|
|
1662
|
+
url = "/api/course/v1/hierarchy/" + contentId + "?hierarchyType=" + hierarchyType;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
// return this.http
|
|
1667
|
+
// .post<NsContent.IContent>(url, { additionalFields })
|
|
1668
|
+
// .pipe(retry(1))
|
|
1727
1669
|
return this.http
|
|
1728
|
-
.get(
|
|
1729
|
-
.pipe(
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
function (data) { return data.result; })));
|
|
1670
|
+
.get(url)
|
|
1671
|
+
.pipe(shareReplay(1));
|
|
1672
|
+
// if (apiData && apiData.result) {
|
|
1673
|
+
// return apiData.result.content
|
|
1674
|
+
// }
|
|
1734
1675
|
};
|
|
1735
1676
|
/**
|
|
1736
|
-
* @param {?}
|
|
1737
|
-
* @param {?} dataKey
|
|
1677
|
+
* @param {?} contentId
|
|
1738
1678
|
* @return {?}
|
|
1739
1679
|
*/
|
|
1740
|
-
|
|
1741
|
-
* @param {?}
|
|
1742
|
-
* @param {?} dataKey
|
|
1680
|
+
WidgetContentService.prototype.fetchAuthoringContent = /**
|
|
1681
|
+
* @param {?} contentId
|
|
1743
1682
|
* @return {?}
|
|
1744
1683
|
*/
|
|
1745
|
-
function (
|
|
1684
|
+
function (contentId) {
|
|
1746
1685
|
/** @type {?} */
|
|
1747
|
-
var
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
/** @type {?} */
|
|
1753
|
-
var date = dayjs();
|
|
1754
|
-
/** @type {?} */
|
|
1755
|
-
var diffMin = date.diff(parsedData[key], 'minute');
|
|
1756
|
-
/** @type {?} */
|
|
1757
|
-
var timeCheck = this.environment.apiCache || 0;
|
|
1758
|
-
if (diffMin >= timeCheck) {
|
|
1759
|
-
return true;
|
|
1760
|
-
}
|
|
1761
|
-
return localStorage.getItem(dataKey) ? false : true;
|
|
1762
|
-
}
|
|
1763
|
-
return true;
|
|
1686
|
+
var forcreator = window.location.href.includes('editMode=true');
|
|
1687
|
+
/** @type {?} */
|
|
1688
|
+
var url = '';
|
|
1689
|
+
if (forcreator) {
|
|
1690
|
+
url = "apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?mode=edit";
|
|
1764
1691
|
}
|
|
1765
|
-
|
|
1692
|
+
else {
|
|
1693
|
+
url = API_END_POINTS.AUTHORING_CONTENT + "/" + contentId + "?hierarchyType=detail";
|
|
1694
|
+
}
|
|
1695
|
+
return this.http.get(url).pipe(shareReplay(1), (/**
|
|
1696
|
+
* @param {?} r
|
|
1697
|
+
* @return {?}
|
|
1698
|
+
*/
|
|
1699
|
+
function (r) { return r; }));
|
|
1766
1700
|
};
|
|
1767
1701
|
/**
|
|
1768
|
-
* @param {?}
|
|
1702
|
+
* @param {?} ids
|
|
1769
1703
|
* @return {?}
|
|
1770
1704
|
*/
|
|
1771
|
-
|
|
1772
|
-
* @param {?}
|
|
1705
|
+
WidgetContentService.prototype.fetchMultipleContent = /**
|
|
1706
|
+
* @param {?} ids
|
|
1773
1707
|
* @return {?}
|
|
1774
1708
|
*/
|
|
1775
|
-
function (
|
|
1776
|
-
return
|
|
1709
|
+
function (ids) {
|
|
1710
|
+
return this.http.get(API_END_POINTS.MULTIPLE_CONTENT + "/" + ids.join(','));
|
|
1777
1711
|
};
|
|
1778
1712
|
/**
|
|
1779
|
-
* @param {?}
|
|
1713
|
+
* @param {?} type
|
|
1714
|
+
* @param {?} id
|
|
1715
|
+
* @param {?=} pageNumber
|
|
1716
|
+
* @param {?=} pageSize
|
|
1780
1717
|
* @return {?}
|
|
1781
1718
|
*/
|
|
1782
|
-
|
|
1783
|
-
* @param {?}
|
|
1719
|
+
WidgetContentService.prototype.fetchCollectionHierarchy = /**
|
|
1720
|
+
* @param {?} type
|
|
1721
|
+
* @param {?} id
|
|
1722
|
+
* @param {?=} pageNumber
|
|
1723
|
+
* @param {?=} pageSize
|
|
1784
1724
|
* @return {?}
|
|
1785
1725
|
*/
|
|
1786
|
-
function (
|
|
1787
|
-
|
|
1726
|
+
function (type, id, pageNumber, pageSize) {
|
|
1727
|
+
if (pageNumber === void 0) { pageNumber = 0; }
|
|
1728
|
+
if (pageSize === void 0) { pageSize = 1; }
|
|
1729
|
+
return this.http.get(API_END_POINTS.COLLECTION_HIERARCHY(type, id) + "?pageNumber=" + pageNumber + "&pageSize=" + pageSize);
|
|
1788
1730
|
};
|
|
1789
1731
|
/**
|
|
1790
|
-
* @param {?} key
|
|
1791
1732
|
* @return {?}
|
|
1792
1733
|
*/
|
|
1793
|
-
|
|
1794
|
-
* @param {?} key
|
|
1734
|
+
WidgetContentService.prototype.fetchBlendedCourse = /**
|
|
1795
1735
|
* @return {?}
|
|
1796
1736
|
*/
|
|
1797
|
-
function (
|
|
1798
|
-
/** @type {?} */
|
|
1799
|
-
var checkTime = localStorage.getItem('timeCheck');
|
|
1800
|
-
if (checkTime) {
|
|
1801
|
-
/** @type {?} */
|
|
1802
|
-
var parsedData = JSON.parse(checkTime);
|
|
1803
|
-
parsedData[key] = new Date().getTime();
|
|
1804
|
-
localStorage.setItem('timeCheck', JSON.stringify(parsedData));
|
|
1805
|
-
}
|
|
1806
|
-
else {
|
|
1807
|
-
/** @type {?} */
|
|
1808
|
-
var data = {};
|
|
1809
|
-
data[key] = new Date().getTime();
|
|
1810
|
-
localStorage.setItem('timeCheck', JSON.stringify(data));
|
|
1811
|
-
}
|
|
1737
|
+
function () {
|
|
1812
1738
|
};
|
|
1813
1739
|
/**
|
|
1814
|
-
* @param {?}
|
|
1740
|
+
* @param {?} req
|
|
1815
1741
|
* @return {?}
|
|
1816
1742
|
*/
|
|
1817
|
-
|
|
1818
|
-
* @param {?}
|
|
1743
|
+
WidgetContentService.prototype.fetchCourseBatches = /**
|
|
1744
|
+
* @param {?} req
|
|
1819
1745
|
* @return {?}
|
|
1820
1746
|
*/
|
|
1821
|
-
function (
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
localStorage.setItem('timeCheck', JSON.stringify(parsedData));
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1747
|
+
function (req) {
|
|
1748
|
+
return this.http
|
|
1749
|
+
.post(API_END_POINTS.COURSE_BATCH_LIST, req)
|
|
1750
|
+
.pipe(retry(1), map((/**
|
|
1751
|
+
* @param {?} data
|
|
1752
|
+
* @return {?}
|
|
1753
|
+
*/
|
|
1754
|
+
function (data) { return data.result.response; })));
|
|
1832
1755
|
};
|
|
1756
|
+
// fetch individual batch
|
|
1757
|
+
// fetch individual batch
|
|
1833
1758
|
/**
|
|
1834
|
-
* @param {?}
|
|
1759
|
+
* @param {?} batchId
|
|
1835
1760
|
* @return {?}
|
|
1836
1761
|
*/
|
|
1837
|
-
|
|
1838
|
-
|
|
1762
|
+
WidgetContentService.prototype.fetchCourseBatch =
|
|
1763
|
+
// fetch individual batch
|
|
1764
|
+
/**
|
|
1765
|
+
* @param {?} batchId
|
|
1839
1766
|
* @return {?}
|
|
1840
1767
|
*/
|
|
1841
|
-
function (
|
|
1842
|
-
|
|
1843
|
-
if (this.checkStorageData('cbpService', 'cbpData')) {
|
|
1844
|
-
/** @type {?} */
|
|
1845
|
-
var result = this.http.get(API_END_POINTS.FETCH_CPB_PLANS).pipe(catchError(this.handleError), map((/**
|
|
1846
|
-
* @param {?} data
|
|
1847
|
-
* @return {?}
|
|
1848
|
-
*/
|
|
1849
|
-
function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
1850
|
-
var cbpData, cbpDoIds, cbpContentData, responseData;
|
|
1851
|
-
var _this = this;
|
|
1852
|
-
return __generator(this, function (_a) {
|
|
1853
|
-
switch (_a.label) {
|
|
1854
|
-
case 0:
|
|
1855
|
-
if (!(data.result && data.result.content && data.result.content.length)) return [3 /*break*/, 3];
|
|
1856
|
-
cbpData = this.getCbpFormatedData(data.result.content);
|
|
1857
|
-
cbpDoIds = cbpData.contentIds.join(',');
|
|
1858
|
-
cbpContentData = cbpData.cbpContentData || [];
|
|
1859
|
-
return [4 /*yield*/, this.fetchEnrollmentDataByContentId(userId, cbpDoIds).toPromise().then((/**
|
|
1860
|
-
* @param {?} res
|
|
1861
|
-
* @return {?}
|
|
1862
|
-
*/
|
|
1863
|
-
function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
1864
|
-
var enrollData;
|
|
1865
|
-
return __generator(this, function (_a) {
|
|
1866
|
-
enrollData = {};
|
|
1867
|
-
if (res && res.courses && res.courses.length) {
|
|
1868
|
-
res.courses.forEach((/**
|
|
1869
|
-
* @param {?} data
|
|
1870
|
-
* @return {?}
|
|
1871
|
-
*/
|
|
1872
|
-
function (data) {
|
|
1873
|
-
enrollData[data.collectionId] = data;
|
|
1874
|
-
}));
|
|
1875
|
-
return [2 /*return*/, enrollData];
|
|
1876
|
-
}
|
|
1877
|
-
else {
|
|
1878
|
-
return [2 /*return*/, {}];
|
|
1879
|
-
}
|
|
1880
|
-
return [2 /*return*/];
|
|
1881
|
-
});
|
|
1882
|
-
}); })).catch((/**
|
|
1883
|
-
* @param {?} _err
|
|
1884
|
-
* @return {?}
|
|
1885
|
-
*/
|
|
1886
|
-
function (_err) {
|
|
1887
|
-
return {};
|
|
1888
|
-
}))];
|
|
1889
|
-
case 1:
|
|
1890
|
-
responseData = _a.sent();
|
|
1891
|
-
return [4 /*yield*/, this.mapCbpData(cbpContentData, responseData)];
|
|
1892
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
1893
|
-
case 3: return [2 /*return*/];
|
|
1894
|
-
}
|
|
1895
|
-
});
|
|
1896
|
-
}); })));
|
|
1897
|
-
this.setTime('cbpService');
|
|
1898
|
-
return result;
|
|
1899
|
-
}
|
|
1900
|
-
return this.getData('cbpData');
|
|
1768
|
+
function (batchId) {
|
|
1769
|
+
return this.http.get(API_END_POINTS.COURSE_BATCH + "/" + batchId);
|
|
1901
1770
|
};
|
|
1902
1771
|
/**
|
|
1903
|
-
* @param {?}
|
|
1904
|
-
* @param {?} enrolledCourseCount
|
|
1772
|
+
* @param {?} identifier
|
|
1905
1773
|
* @return {?}
|
|
1906
1774
|
*/
|
|
1907
|
-
|
|
1908
|
-
* @param {?}
|
|
1909
|
-
* @param {?} enrolledCourseCount
|
|
1775
|
+
WidgetContentService.prototype.autoAssignBatchApi = /**
|
|
1776
|
+
* @param {?} identifier
|
|
1910
1777
|
* @return {?}
|
|
1911
1778
|
*/
|
|
1912
|
-
function (
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
localStorage.setItem('userEnrollmentCount', JSON.stringify(userData));
|
|
1779
|
+
function (identifier) {
|
|
1780
|
+
return this.http.get("" + API_END_POINTS.AUTO_ASSIGN_BATCH + identifier)
|
|
1781
|
+
.pipe(retry(1), map((/**
|
|
1782
|
+
* @param {?} data
|
|
1783
|
+
* @return {?}
|
|
1784
|
+
*/
|
|
1785
|
+
function (data) { return data.result.response; })));
|
|
1920
1786
|
};
|
|
1921
1787
|
/**
|
|
1922
|
-
* @param {?}
|
|
1923
|
-
* @param {?}
|
|
1788
|
+
* @param {?} request
|
|
1789
|
+
* @param {?} programType
|
|
1924
1790
|
* @return {?}
|
|
1925
1791
|
*/
|
|
1926
|
-
|
|
1927
|
-
* @param {?}
|
|
1928
|
-
* @param {?}
|
|
1792
|
+
WidgetContentService.prototype.autoAssignCuratedBatchApi = /**
|
|
1793
|
+
* @param {?} request
|
|
1794
|
+
* @param {?} programType
|
|
1929
1795
|
* @return {?}
|
|
1930
1796
|
*/
|
|
1931
|
-
function (
|
|
1932
|
-
/** @type {?} */
|
|
1933
|
-
var path = API_END_POINTS.FETCH_USER_ENROLLMENT_LIST(userId);
|
|
1934
|
-
path = path + "&courseIds=" + contentdata + "&cache=false'";
|
|
1797
|
+
function (request, programType) {
|
|
1935
1798
|
/** @type {?} */
|
|
1936
|
-
var
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
});
|
|
1941
|
-
return this.http
|
|
1942
|
-
.get(path, { headers: headers })
|
|
1943
|
-
.pipe(catchError(this.handleError), map((/**
|
|
1799
|
+
var url = programType === NsContent.ECourseCategory.MODERATED_PROGRAM ?
|
|
1800
|
+
API_END_POINTS.AUTO_ASSIGN_OPEN_PROGRAM : API_END_POINTS.AUTO_ASSIGN_CURATED_BATCH;
|
|
1801
|
+
return this.http.post("" + url, request)
|
|
1802
|
+
.pipe(retry(1), map((/**
|
|
1944
1803
|
* @param {?} data
|
|
1945
1804
|
* @return {?}
|
|
1946
1805
|
*/
|
|
1947
|
-
function (data) { return data.result; })));
|
|
1806
|
+
function (data) { return data.result.response; })));
|
|
1948
1807
|
};
|
|
1949
1808
|
/**
|
|
1950
|
-
* @param {?}
|
|
1809
|
+
* @param {?} req
|
|
1951
1810
|
* @return {?}
|
|
1952
1811
|
*/
|
|
1953
|
-
|
|
1954
|
-
* @param {?}
|
|
1812
|
+
WidgetContentService.prototype.enrollUserToBatch = /**
|
|
1813
|
+
* @param {?} req
|
|
1955
1814
|
* @return {?}
|
|
1956
1815
|
*/
|
|
1957
|
-
function (
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1816
|
+
function (req) {
|
|
1817
|
+
return this.http
|
|
1818
|
+
.post(API_END_POINTS.ENROLL_BATCH, req)
|
|
1819
|
+
.toPromise();
|
|
1820
|
+
};
|
|
1821
|
+
/**
|
|
1822
|
+
* @param {?} req
|
|
1823
|
+
* @param {?} type
|
|
1824
|
+
* @return {?}
|
|
1825
|
+
*/
|
|
1826
|
+
WidgetContentService.prototype.enrollAndUnenrollUserToBatchWF = /**
|
|
1827
|
+
* @param {?} req
|
|
1828
|
+
* @param {?} type
|
|
1829
|
+
* @return {?}
|
|
1830
|
+
*/
|
|
1831
|
+
function (req, type) {
|
|
1962
1832
|
/** @type {?} */
|
|
1963
|
-
var
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
*/
|
|
1968
|
-
function (c) {
|
|
1969
|
-
c.contentList.forEach((/**
|
|
1970
|
-
* @param {?} childData
|
|
1971
|
-
* @return {?}
|
|
1972
|
-
*/
|
|
1973
|
-
function (childData) {
|
|
1974
|
-
/** @type {?} */
|
|
1975
|
-
var endDate = dayjs(c.endDate).format('YYYY-MM-DD');
|
|
1976
|
-
/** @type {?} */
|
|
1977
|
-
var daysCount = dayjs(endDate).diff(todayDate, 'day');
|
|
1978
|
-
childData['planDuration'] = daysCount < 0 ? NsCardContent.ACBPConst.OVERDUE : daysCount > 29
|
|
1979
|
-
? NsCardContent.ACBPConst.SUCCESS : NsCardContent.ACBPConst.UPCOMING;
|
|
1980
|
-
childData['endDate'] = c.endDate;
|
|
1981
|
-
childData['parentId'] = c.id;
|
|
1982
|
-
childData['planType'] = 'cbPlan';
|
|
1983
|
-
childData['contentStatus'] = 0;
|
|
1984
|
-
contentIds.push(childData.identifier);
|
|
1985
|
-
if (childData.status !== NsCardContent.IGOTConst.RETIRED) {
|
|
1986
|
-
cbpContentData.push(childData);
|
|
1987
|
-
}
|
|
1988
|
-
}));
|
|
1989
|
-
}));
|
|
1990
|
-
return { cbpContentData: cbpContentData, contentIds: contentIds };
|
|
1833
|
+
var url = type === 'WITHDRAW' ? API_END_POINTS.WITHDRAW_BATCH_WF : API_END_POINTS.ENROLL_BATCH_WF;
|
|
1834
|
+
return this.http
|
|
1835
|
+
.post(url, req)
|
|
1836
|
+
.toPromise();
|
|
1991
1837
|
};
|
|
1992
1838
|
/**
|
|
1993
|
-
* @param {?}
|
|
1994
|
-
* @param {?} enrollmentData
|
|
1839
|
+
* @param {?} req
|
|
1995
1840
|
* @return {?}
|
|
1996
1841
|
*/
|
|
1997
|
-
|
|
1998
|
-
* @param {?}
|
|
1999
|
-
* @param {?} enrollmentData
|
|
1842
|
+
WidgetContentService.prototype.fetchBlendedUserWF = /**
|
|
1843
|
+
* @param {?} req
|
|
2000
1844
|
* @return {?}
|
|
2001
1845
|
*/
|
|
2002
|
-
function (
|
|
2003
|
-
return
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
cbpFilteredContent = [];
|
|
2007
|
-
if (cbpContent && cbpContent.length) {
|
|
2008
|
-
if (Object.keys(enrollmentData).length) {
|
|
2009
|
-
cbpContent.forEach((/**
|
|
2010
|
-
* @param {?} cbp
|
|
2011
|
-
* @return {?}
|
|
2012
|
-
*/
|
|
2013
|
-
function (cbp) {
|
|
2014
|
-
/** @type {?} */
|
|
2015
|
-
var childEnrollData = enrollmentData[cbp.identifier];
|
|
2016
|
-
/** @type {?} */
|
|
2017
|
-
var competencyArea = [];
|
|
2018
|
-
/** @type {?} */
|
|
2019
|
-
var competencyTheme = [];
|
|
2020
|
-
/** @type {?} */
|
|
2021
|
-
var competencyThemeType = [];
|
|
2022
|
-
/** @type {?} */
|
|
2023
|
-
var competencySubTheme = [];
|
|
2024
|
-
/** @type {?} */
|
|
2025
|
-
var competencyAreaId = [];
|
|
2026
|
-
/** @type {?} */
|
|
2027
|
-
var competencyThemeId = [];
|
|
2028
|
-
/** @type {?} */
|
|
2029
|
-
var competencySubThemeId = [];
|
|
2030
|
-
cbp['contentStatus'] = 0;
|
|
2031
|
-
if (childEnrollData) {
|
|
2032
|
-
cbp['contentStatus'] = childEnrollData.status;
|
|
2033
|
-
}
|
|
2034
|
-
if (cbp.competencies_v5) {
|
|
2035
|
-
cbp.competencies_v5.forEach((/**
|
|
2036
|
-
* @param {?} element
|
|
2037
|
-
* @return {?}
|
|
2038
|
-
*/
|
|
2039
|
-
function (element) {
|
|
2040
|
-
if (!competencyArea.includes(element.competencyArea)) {
|
|
2041
|
-
competencyArea.push(element.competencyArea);
|
|
2042
|
-
competencyAreaId.push(element.competencyAreaId);
|
|
2043
|
-
}
|
|
2044
|
-
if (!competencyTheme.includes(element.competencyTheme)) {
|
|
2045
|
-
competencyTheme.push(element.competencyTheme);
|
|
2046
|
-
competencyThemeId.push(element.competencyThemeId);
|
|
2047
|
-
}
|
|
2048
|
-
if (!competencyThemeType.includes(element.competencyThemeType)) {
|
|
2049
|
-
competencyThemeType.push(element.competencyThemeType);
|
|
2050
|
-
}
|
|
2051
|
-
if (!competencySubTheme.includes(element.competencySubTheme)) {
|
|
2052
|
-
competencySubTheme.push(element.competencySubTheme);
|
|
2053
|
-
competencySubThemeId.push(element.competencySubThemeId);
|
|
2054
|
-
}
|
|
2055
|
-
}));
|
|
2056
|
-
}
|
|
2057
|
-
cbp['competencyArea'] = competencyArea;
|
|
2058
|
-
cbp['competencyTheme'] = competencyTheme;
|
|
2059
|
-
cbp['competencyThemeType'] = competencyThemeType;
|
|
2060
|
-
cbp['competencySubTheme'] = competencySubTheme;
|
|
2061
|
-
cbp['competencyAreaId'] = competencyAreaId;
|
|
2062
|
-
cbp['competencyThemeId'] = competencyThemeId;
|
|
2063
|
-
cbp['competencySubThemeId'] = competencySubThemeId;
|
|
2064
|
-
if (cbp.status !== NsCardContent.IGOTConst.RETIRED) {
|
|
2065
|
-
cbpFilteredContent.push(cbp);
|
|
2066
|
-
}
|
|
2067
|
-
else {
|
|
2068
|
-
if (childEnrollData && childEnrollData.status === 2) {
|
|
2069
|
-
cbpFilteredContent.push(cbp);
|
|
2070
|
-
}
|
|
2071
|
-
}
|
|
2072
|
-
}));
|
|
2073
|
-
if (cbpFilteredContent.length > 1) {
|
|
2074
|
-
sortedData = cbpFilteredContent.sort((/**
|
|
2075
|
-
* @param {?} a
|
|
2076
|
-
* @param {?} b
|
|
2077
|
-
* @return {?}
|
|
2078
|
-
*/
|
|
2079
|
-
function (a, b) {
|
|
2080
|
-
/** @type {?} */
|
|
2081
|
-
var firstDate = new Date(a.endDate);
|
|
2082
|
-
/** @type {?} */
|
|
2083
|
-
var secondDate = new Date(b.endDate);
|
|
2084
|
-
return secondDate > firstDate ? 1 : -1;
|
|
2085
|
-
}));
|
|
2086
|
-
uniqueUsersByID = uniqBy(sortedData, 'identifier');
|
|
2087
|
-
sortedByEndDate = orderBy(uniqueUsersByID, ['endDate'], ['asc']);
|
|
2088
|
-
sortedByStatus = orderBy(sortedByEndDate, ['contentStatus'], ['asc']);
|
|
2089
|
-
localStorage.setItem('cbpData', JSON.stringify(sortedByStatus));
|
|
2090
|
-
return [2 /*return*/, sortedByStatus];
|
|
2091
|
-
}
|
|
2092
|
-
localStorage.setItem('cbpData', JSON.stringify(cbpFilteredContent));
|
|
2093
|
-
return [2 /*return*/, cbpFilteredContent];
|
|
2094
|
-
}
|
|
2095
|
-
localStorage.setItem('cbpData', JSON.stringify(cbpContent));
|
|
2096
|
-
return [2 /*return*/, cbpContent];
|
|
2097
|
-
}
|
|
2098
|
-
localStorage.setItem('cbpData', JSON.stringify([]));
|
|
2099
|
-
return [2 /*return*/, []];
|
|
2100
|
-
});
|
|
2101
|
-
});
|
|
1846
|
+
function (req) {
|
|
1847
|
+
return this.http
|
|
1848
|
+
.post(API_END_POINTS.BLENDED_USER_WF, req)
|
|
1849
|
+
.toPromise();
|
|
2102
1850
|
};
|
|
2103
1851
|
/**
|
|
2104
|
-
* @param {?}
|
|
1852
|
+
* @param {?} req
|
|
2105
1853
|
* @return {?}
|
|
2106
1854
|
*/
|
|
2107
|
-
|
|
2108
|
-
* @param {?}
|
|
1855
|
+
WidgetContentService.prototype.fetchBlendedUserCOUNT = /**
|
|
1856
|
+
* @param {?} req
|
|
2109
1857
|
* @return {?}
|
|
2110
1858
|
*/
|
|
2111
|
-
function (
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
courseData.courses.forEach((/**
|
|
2116
|
-
* @param {?} data
|
|
2117
|
-
* @return {?}
|
|
2118
|
-
*/
|
|
2119
|
-
function (data) {
|
|
2120
|
-
enrollData[data.collectionId] = data;
|
|
2121
|
-
}));
|
|
2122
|
-
}
|
|
2123
|
-
return enrollData;
|
|
1859
|
+
function (req) {
|
|
1860
|
+
return this.http
|
|
1861
|
+
.post(API_END_POINTS.BLENDED_USER_COUNT, req)
|
|
1862
|
+
.toPromise();
|
|
2124
1863
|
};
|
|
2125
|
-
WidgetUserServiceLib.decorators = [
|
|
2126
|
-
{ type: Injectable, args: [{
|
|
2127
|
-
providedIn: 'root',
|
|
2128
|
-
},] }
|
|
2129
|
-
];
|
|
2130
|
-
/** @nocollapse */
|
|
2131
|
-
WidgetUserServiceLib.ctorParameters = function () { return [
|
|
2132
|
-
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
2133
|
-
{ type: HttpClient }
|
|
2134
|
-
]; };
|
|
2135
|
-
/** @nocollapse */ WidgetUserServiceLib.ngInjectableDef = ɵɵdefineInjectable({ factory: function WidgetUserServiceLib_Factory() { return new WidgetUserServiceLib(ɵɵinject("environment"), ɵɵinject(HttpClient)); }, token: WidgetUserServiceLib, providedIn: "root" });
|
|
2136
|
-
return WidgetUserServiceLib;
|
|
2137
|
-
}());
|
|
2138
|
-
if (false) {
|
|
2139
|
-
/** @type {?} */
|
|
2140
|
-
WidgetUserServiceLib.prototype.environment;
|
|
2141
|
-
/**
|
|
2142
|
-
* @type {?}
|
|
2143
|
-
* @private
|
|
2144
|
-
*/
|
|
2145
|
-
WidgetUserServiceLib.prototype.http;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
/**
|
|
2149
|
-
* @fileoverview added by tsickle
|
|
2150
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2151
|
-
*/
|
|
2152
|
-
/** @type {?} */
|
|
2153
|
-
var moment = moment$4;
|
|
2154
|
-
// tslint:enable
|
|
2155
|
-
// TODO: move this in some common place
|
|
2156
|
-
/** @type {?} */
|
|
2157
|
-
var PROTECTED_SLAG_V8$1 = '/apis/protected/v8';
|
|
2158
|
-
var ɵ0$1 = /**
|
|
2159
|
-
* @param {?} type
|
|
2160
|
-
* @param {?} id
|
|
2161
|
-
* @return {?}
|
|
2162
|
-
*/
|
|
2163
|
-
function (type, id) {
|
|
2164
|
-
return PROTECTED_SLAG_V8$1 + "/content/collection/" + type + "/" + id;
|
|
2165
|
-
}, ɵ1$1 = /**
|
|
2166
|
-
* @param {?} contentId
|
|
2167
|
-
* @return {?}
|
|
2168
|
-
*/
|
|
2169
|
-
function (contentId) { return PROTECTED_SLAG_V8$1 + "/user/progress/" + contentId; }, ɵ2$1 = /**
|
|
2170
|
-
* @param {?} certId
|
|
2171
|
-
* @return {?}
|
|
2172
|
-
*/
|
|
2173
|
-
function (certId) { return PROTECTED_SLAG_V8$1 + "/cohorts/course/batch/cert/download/" + certId; }, ɵ3$1 = /**
|
|
2174
|
-
* @param {?} contentId
|
|
2175
|
-
* @return {?}
|
|
2176
|
-
*/
|
|
2177
|
-
function (contentId) { return "/apis/proxies/v8/action/content/v3/read/" + contentId; };
|
|
2178
|
-
/** @type {?} */
|
|
2179
|
-
var API_END_POINTS$1 = {
|
|
2180
|
-
CONTENT: PROTECTED_SLAG_V8$1 + "/content",
|
|
2181
|
-
AUTHORING_CONTENT: "/api/course/v1/hierarchy",
|
|
2182
|
-
CONTENT_LIKES: PROTECTED_SLAG_V8$1 + "/content/likeCount",
|
|
2183
|
-
SET_S3_COOKIE: PROTECTED_SLAG_V8$1 + "/content/setCookie",
|
|
2184
|
-
SET_S3_IMAGE_COOKIE: PROTECTED_SLAG_V8$1 + "/content/setImageCookie",
|
|
2185
|
-
FETCH_MANIFEST: PROTECTED_SLAG_V8$1 + "/content/getWebModuleManifest",
|
|
2186
|
-
FETCH_WEB_MODULE_FILES: PROTECTED_SLAG_V8$1 + "/content/getWebModuleFiles",
|
|
2187
|
-
MULTIPLE_CONTENT: PROTECTED_SLAG_V8$1 + "/content/multiple",
|
|
2188
|
-
CONTENT_SEARCH_V5: PROTECTED_SLAG_V8$1 + "/content/searchV5",
|
|
2189
|
-
CONTENT_SEARCH_V6: "/apis/proxies/v8/sunbirdigot/search",
|
|
2190
|
-
TRENDING_CONTENT_SEARCH: "apis/proxies/v8/trending/content/search",
|
|
2191
|
-
CONTENT_SEARCH_RELATED_CBP_V6: "/apis/proxies/v8/sunbirdigot/search",
|
|
2192
|
-
CONTENT_SEARCH_REGION_RECOMMENDATION: PROTECTED_SLAG_V8$1 + "/content/searchRegionRecommendation",
|
|
2193
|
-
CONTENT_HISTORY: PROTECTED_SLAG_V8$1 + "/user/history",
|
|
2194
|
-
CONTENT_HISTORYV2: "/apis/proxies/v8/read/content-progres",
|
|
2195
|
-
COURSE_BATCH_LIST: "/apis/proxies/v8/learner/course/v1/batch/list",
|
|
2196
|
-
COURSE_BATCH: "/apis/proxies/v8/course/v1/batch/read",
|
|
2197
|
-
AUTO_ASSIGN_BATCH: "/apis/protected/v8/cohorts/user/autoenrollment/",
|
|
2198
|
-
AUTO_ASSIGN_CURATED_BATCH: "/apis/proxies/v8/curatedprogram/v1/enrol",
|
|
2199
|
-
AUTO_ASSIGN_OPEN_PROGRAM: "/apis/proxies/v8/openprogram/v1/enrol",
|
|
2200
|
-
USER_CONTINUE_LEARNING: PROTECTED_SLAG_V8$1 + "/user/history/continue",
|
|
2201
|
-
CONTENT_RATING: PROTECTED_SLAG_V8$1 + "/user/rating",
|
|
2202
|
-
COLLECTION_HIERARCHY: (ɵ0$1),
|
|
2203
|
-
REGISTRATION_STATUS: PROTECTED_SLAG_V8$1 + "/admin/userRegistration/checkUserRegistrationContent",
|
|
2204
|
-
MARK_AS_COMPLETE_META: (ɵ1$1),
|
|
2205
|
-
ENROLL_BATCH: "/apis/proxies/v8/learner/course/v1/enrol",
|
|
2206
|
-
ENROLL_BATCH_WF: "/apis/proxies/v8/workflow/blendedprogram/enrol",
|
|
2207
|
-
WITHDRAW_BATCH_WF: "/apis/proxies/v8/workflow/blendedprogram/unenrol",
|
|
2208
|
-
BLENDED_USER_WF: "/apis/proxies/v8/workflow/blendedprogram/user/search",
|
|
2209
|
-
BLENDED_USER_COUNT: "apis/proxies/v8/workflow/blendedprogram/enrol/status/count",
|
|
2210
|
-
CERT_ADD_TEMPLATE: PROTECTED_SLAG_V8$1 + "/cohorts/course/batch/cert/template/add",
|
|
2211
|
-
CERT_ISSUE: PROTECTED_SLAG_V8$1 + "/cohorts/course/batch/cert/issue",
|
|
2212
|
-
CERT_DOWNLOAD: (ɵ2$1),
|
|
2213
|
-
READ_KARMAPOINTS: "/apis/proxies/v8/karmapoints/read",
|
|
2214
|
-
CONTENT_READ: (ɵ3$1),
|
|
2215
|
-
READ_COURSE_KARMAPOINTS: '/apis/proxies/v8/karmapoints/user/course/read',
|
|
2216
|
-
CLAIM_KARMAPOINTS: '/apis/proxies/v8/claimkarmapoints',
|
|
2217
|
-
USER_KARMA_POINTS: '/apis/proxies/v8/user/totalkarmapoints',
|
|
2218
|
-
AGGREGATION_SEARCH: '/apis/proxies/v8/content/aggregation/search',
|
|
2219
|
-
FEATURE_SEARCH: '/apis/proxies/v8/featured/content/search',
|
|
2220
|
-
};
|
|
2221
|
-
var WidgetContentLibService = /** @class */ (function () {
|
|
2222
|
-
function WidgetContentLibService(http, configSvc, userSvc) {
|
|
2223
|
-
this.http = http;
|
|
2224
|
-
this.configSvc = configSvc;
|
|
2225
|
-
this.userSvc = userSvc;
|
|
2226
|
-
this.tocConfigData = new BehaviorSubject({});
|
|
2227
|
-
this.tocConfigData$ = this.tocConfigData.asObservable();
|
|
2228
|
-
this.telemetryData = new Subject();
|
|
2229
|
-
this.telemetryData$ = this.telemetryData.asObservable();
|
|
2230
|
-
this.programChildCourseResumeData = new BehaviorSubject({});
|
|
2231
|
-
this.programChildCourseResumeData$ = this.programChildCourseResumeData.asObservable();
|
|
2232
|
-
}
|
|
2233
1864
|
/**
|
|
2234
|
-
* @param {?}
|
|
1865
|
+
* @param {?} contentIds
|
|
2235
1866
|
* @return {?}
|
|
2236
1867
|
*/
|
|
2237
|
-
|
|
2238
|
-
* @param {?}
|
|
1868
|
+
WidgetContentService.prototype.fetchContentLikes = /**
|
|
1869
|
+
* @param {?} contentIds
|
|
2239
1870
|
* @return {?}
|
|
2240
1871
|
*/
|
|
2241
|
-
function (
|
|
2242
|
-
this.
|
|
1872
|
+
function (contentIds) {
|
|
1873
|
+
return this.http
|
|
1874
|
+
.post(API_END_POINTS.CONTENT_LIKES, contentIds)
|
|
1875
|
+
.toPromise();
|
|
2243
1876
|
};
|
|
2244
1877
|
/**
|
|
2245
|
-
* @param {?}
|
|
1878
|
+
* @param {?} contentIds
|
|
2246
1879
|
* @return {?}
|
|
2247
1880
|
*/
|
|
2248
|
-
|
|
2249
|
-
* @param {?}
|
|
1881
|
+
WidgetContentService.prototype.fetchContentRatings = /**
|
|
1882
|
+
* @param {?} contentIds
|
|
2250
1883
|
* @return {?}
|
|
2251
1884
|
*/
|
|
2252
|
-
function (
|
|
2253
|
-
if (
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
(primaryCategory === NsContent.EResourcePrimaryCategories.COMP_ASSESSMENT) ||
|
|
2259
|
-
(primaryCategory === NsContent.EResourcePrimaryCategories.OFFLINE_SESSION);
|
|
2260
|
-
return isResource;
|
|
2261
|
-
}
|
|
2262
|
-
return false;
|
|
1885
|
+
function (contentIds) {
|
|
1886
|
+
if (contentIds) { }
|
|
1887
|
+
// return this.http
|
|
1888
|
+
// .post(`${API_END_POINTS.CONTENT_RATING}/rating`, contentIds)
|
|
1889
|
+
// .toPromise()
|
|
1890
|
+
return of().toPromise();
|
|
2263
1891
|
};
|
|
2264
1892
|
/**
|
|
2265
|
-
* @param {?}
|
|
1893
|
+
* @param {?} contentId
|
|
2266
1894
|
* @return {?}
|
|
2267
1895
|
*/
|
|
2268
|
-
|
|
2269
|
-
* @param {?}
|
|
1896
|
+
WidgetContentService.prototype.fetchContentHistory = /**
|
|
1897
|
+
* @param {?} contentId
|
|
2270
1898
|
* @return {?}
|
|
2271
1899
|
*/
|
|
2272
|
-
function (
|
|
2273
|
-
|
|
2274
|
-
/** @type {?} */
|
|
2275
|
-
var url = API_END_POINTS$1.MARK_AS_COMPLETE_META(identifier)
|
|
2276
|
-
// return this.http.get(url).toPromise()
|
|
2277
|
-
;
|
|
2278
|
-
// return this.http.get(url).toPromise()
|
|
2279
|
-
if (url) { }
|
|
2280
|
-
return of().toPromise();
|
|
1900
|
+
function (contentId) {
|
|
1901
|
+
return this.http.get(API_END_POINTS.CONTENT_HISTORY + "/" + contentId);
|
|
2281
1902
|
};
|
|
2282
1903
|
/**
|
|
2283
|
-
* @param {?}
|
|
1904
|
+
* @param {?} req
|
|
2284
1905
|
* @return {?}
|
|
2285
1906
|
*/
|
|
2286
|
-
|
|
2287
|
-
* @param {?}
|
|
1907
|
+
WidgetContentService.prototype.fetchContentHistoryV2 = /**
|
|
1908
|
+
* @param {?} req
|
|
2288
1909
|
* @return {?}
|
|
2289
1910
|
*/
|
|
2290
|
-
function (
|
|
2291
|
-
this
|
|
1911
|
+
function (req) {
|
|
1912
|
+
var _this = this;
|
|
1913
|
+
req.request.fields = ['progressdetails'];
|
|
1914
|
+
/** @type {?} */
|
|
1915
|
+
var data = this.http.post(API_END_POINTS.CONTENT_HISTORYV2 + "/" + req.request.courseId, req);
|
|
1916
|
+
data.subscribe((/**
|
|
1917
|
+
* @param {?} subscribeData
|
|
1918
|
+
* @return {?}
|
|
1919
|
+
*/
|
|
1920
|
+
function (subscribeData) {
|
|
1921
|
+
_this.programChildCourseResumeData.next({ resumeData: subscribeData.result.contentList, courseId: req.request.courseId });
|
|
1922
|
+
}));
|
|
1923
|
+
return data;
|
|
2292
1924
|
};
|
|
2293
1925
|
/**
|
|
2294
|
-
* @param {?}
|
|
2295
|
-
* @param {?=}
|
|
2296
|
-
* @param {?=}
|
|
2297
|
-
* @param {?=} primaryCategory
|
|
1926
|
+
* @param {?} id
|
|
1927
|
+
* @param {?=} collectionId
|
|
1928
|
+
* @param {?=} collectionType
|
|
2298
1929
|
* @return {?}
|
|
2299
1930
|
*/
|
|
2300
|
-
|
|
2301
|
-
* @param {?}
|
|
2302
|
-
* @param {?=}
|
|
2303
|
-
* @param {?=}
|
|
2304
|
-
* @param {?=} primaryCategory
|
|
2305
|
-
* @return {?}
|
|
2306
|
-
*/
|
|
2307
|
-
function (contentId, hierarchyType, _additionalFields, primaryCategory) {
|
|
2308
|
-
if (hierarchyType === void 0) { hierarchyType = 'detail'; }
|
|
2309
|
-
if (_additionalFields === void 0) { _additionalFields = []; }
|
|
2310
|
-
// const url = `${API_END_POINTS.CONTENT}/${contentId}?hierarchyType=${hierarchyType}`
|
|
2311
|
-
/** @type {?} */
|
|
2312
|
-
var url = '';
|
|
2313
|
-
/** @type {?} */
|
|
2314
|
-
var forPreview = window.location.href.includes('/public/') || window.location.href.includes('&preview=true');
|
|
2315
|
-
if (primaryCategory && this.isResource(primaryCategory)) {
|
|
2316
|
-
if (!forPreview) {
|
|
2317
|
-
url = "/apis/proxies/v8/action/content/v3/read/" + contentId;
|
|
2318
|
-
}
|
|
2319
|
-
else {
|
|
2320
|
-
url = "/api/content/v1/read/" + contentId;
|
|
2321
|
-
}
|
|
2322
|
-
}
|
|
2323
|
-
else {
|
|
2324
|
-
if (!forPreview) {
|
|
2325
|
-
url = "/apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?hierarchyType=" + hierarchyType;
|
|
2326
|
-
}
|
|
2327
|
-
else {
|
|
2328
|
-
/** @type {?} */
|
|
2329
|
-
var forcreator = window.location.href.includes('editMode=true');
|
|
2330
|
-
if (forcreator) {
|
|
2331
|
-
url = "apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?mode=edit";
|
|
2332
|
-
}
|
|
2333
|
-
else {
|
|
2334
|
-
url = "/api/course/v1/hierarchy/" + contentId + "?hierarchyType=" + hierarchyType;
|
|
2335
|
-
}
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2338
|
-
// return this.http
|
|
2339
|
-
// .post<NsContent.IContent>(url, { additionalFields })
|
|
2340
|
-
// .pipe(retry(1))
|
|
2341
|
-
return this.http
|
|
2342
|
-
.get(url)
|
|
2343
|
-
.pipe(shareReplay(1));
|
|
2344
|
-
// if (apiData && apiData.result) {
|
|
2345
|
-
// return apiData.result.content
|
|
2346
|
-
// }
|
|
2347
|
-
};
|
|
2348
|
-
/**
|
|
2349
|
-
* @param {?} contentId
|
|
2350
|
-
* @return {?}
|
|
2351
|
-
*/
|
|
2352
|
-
WidgetContentLibService.prototype.fetchAuthoringContent = /**
|
|
2353
|
-
* @param {?} contentId
|
|
2354
|
-
* @return {?}
|
|
2355
|
-
*/
|
|
2356
|
-
function (contentId) {
|
|
2357
|
-
/** @type {?} */
|
|
2358
|
-
var forcreator = window.location.href.includes('editMode=true');
|
|
2359
|
-
/** @type {?} */
|
|
2360
|
-
var url = '';
|
|
2361
|
-
if (forcreator) {
|
|
2362
|
-
url = "apis/proxies/v8/action/content/v3/hierarchy/" + contentId + "?mode=edit";
|
|
2363
|
-
}
|
|
2364
|
-
else {
|
|
2365
|
-
url = API_END_POINTS$1.AUTHORING_CONTENT + "/" + contentId + "?hierarchyType=detail";
|
|
2366
|
-
}
|
|
2367
|
-
return this.http.get(url).pipe(shareReplay(1), (/**
|
|
2368
|
-
* @param {?} r
|
|
2369
|
-
* @return {?}
|
|
2370
|
-
*/
|
|
2371
|
-
function (r) { return r; }));
|
|
2372
|
-
};
|
|
2373
|
-
/**
|
|
2374
|
-
* @param {?} ids
|
|
2375
|
-
* @return {?}
|
|
2376
|
-
*/
|
|
2377
|
-
WidgetContentLibService.prototype.fetchMultipleContent = /**
|
|
2378
|
-
* @param {?} ids
|
|
2379
|
-
* @return {?}
|
|
2380
|
-
*/
|
|
2381
|
-
function (ids) {
|
|
2382
|
-
return this.http.get(API_END_POINTS$1.MULTIPLE_CONTENT + "/" + ids.join(','));
|
|
2383
|
-
};
|
|
2384
|
-
/**
|
|
2385
|
-
* @param {?} type
|
|
2386
|
-
* @param {?} id
|
|
2387
|
-
* @param {?=} pageNumber
|
|
2388
|
-
* @param {?=} pageSize
|
|
2389
|
-
* @return {?}
|
|
2390
|
-
*/
|
|
2391
|
-
WidgetContentLibService.prototype.fetchCollectionHierarchy = /**
|
|
2392
|
-
* @param {?} type
|
|
2393
|
-
* @param {?} id
|
|
2394
|
-
* @param {?=} pageNumber
|
|
2395
|
-
* @param {?=} pageSize
|
|
2396
|
-
* @return {?}
|
|
2397
|
-
*/
|
|
2398
|
-
function (type, id, pageNumber, pageSize) {
|
|
2399
|
-
if (pageNumber === void 0) { pageNumber = 0; }
|
|
2400
|
-
if (pageSize === void 0) { pageSize = 1; }
|
|
2401
|
-
return this.http.get(API_END_POINTS$1.COLLECTION_HIERARCHY(type, id) + "?pageNumber=" + pageNumber + "&pageSize=" + pageSize);
|
|
2402
|
-
};
|
|
2403
|
-
/**
|
|
2404
|
-
* @return {?}
|
|
2405
|
-
*/
|
|
2406
|
-
WidgetContentLibService.prototype.fetchBlendedCourse = /**
|
|
2407
|
-
* @return {?}
|
|
2408
|
-
*/
|
|
2409
|
-
function () {
|
|
2410
|
-
};
|
|
2411
|
-
/**
|
|
2412
|
-
* @param {?} req
|
|
2413
|
-
* @return {?}
|
|
2414
|
-
*/
|
|
2415
|
-
WidgetContentLibService.prototype.fetchCourseBatches = /**
|
|
2416
|
-
* @param {?} req
|
|
2417
|
-
* @return {?}
|
|
2418
|
-
*/
|
|
2419
|
-
function (req) {
|
|
2420
|
-
return this.http
|
|
2421
|
-
.post(API_END_POINTS$1.COURSE_BATCH_LIST, req)
|
|
2422
|
-
.pipe(retry(1), map((/**
|
|
2423
|
-
* @param {?} data
|
|
2424
|
-
* @return {?}
|
|
2425
|
-
*/
|
|
2426
|
-
function (data) { return data.result.response; })));
|
|
2427
|
-
};
|
|
2428
|
-
// fetch individual batch
|
|
2429
|
-
// fetch individual batch
|
|
2430
|
-
/**
|
|
2431
|
-
* @param {?} batchId
|
|
2432
|
-
* @return {?}
|
|
2433
|
-
*/
|
|
2434
|
-
WidgetContentLibService.prototype.fetchCourseBatch =
|
|
2435
|
-
// fetch individual batch
|
|
2436
|
-
/**
|
|
2437
|
-
* @param {?} batchId
|
|
2438
|
-
* @return {?}
|
|
2439
|
-
*/
|
|
2440
|
-
function (batchId) {
|
|
2441
|
-
return this.http.get(API_END_POINTS$1.COURSE_BATCH + "/" + batchId);
|
|
2442
|
-
};
|
|
2443
|
-
/**
|
|
2444
|
-
* @param {?} identifier
|
|
2445
|
-
* @return {?}
|
|
2446
|
-
*/
|
|
2447
|
-
WidgetContentLibService.prototype.autoAssignBatchApi = /**
|
|
2448
|
-
* @param {?} identifier
|
|
2449
|
-
* @return {?}
|
|
2450
|
-
*/
|
|
2451
|
-
function (identifier) {
|
|
2452
|
-
return this.http.get("" + API_END_POINTS$1.AUTO_ASSIGN_BATCH + identifier)
|
|
2453
|
-
.pipe(retry(1), map((/**
|
|
2454
|
-
* @param {?} data
|
|
2455
|
-
* @return {?}
|
|
2456
|
-
*/
|
|
2457
|
-
function (data) { return data.result.response; })));
|
|
2458
|
-
};
|
|
2459
|
-
/**
|
|
2460
|
-
* @param {?} request
|
|
2461
|
-
* @param {?} programType
|
|
2462
|
-
* @return {?}
|
|
2463
|
-
*/
|
|
2464
|
-
WidgetContentLibService.prototype.autoAssignCuratedBatchApi = /**
|
|
2465
|
-
* @param {?} request
|
|
2466
|
-
* @param {?} programType
|
|
2467
|
-
* @return {?}
|
|
2468
|
-
*/
|
|
2469
|
-
function (request, programType) {
|
|
2470
|
-
/** @type {?} */
|
|
2471
|
-
var url = programType === NsContent.ECourseCategory.MODERATED_PROGRAM ?
|
|
2472
|
-
API_END_POINTS$1.AUTO_ASSIGN_OPEN_PROGRAM : API_END_POINTS$1.AUTO_ASSIGN_CURATED_BATCH;
|
|
2473
|
-
return this.http.post("" + url, request)
|
|
2474
|
-
.pipe(retry(1), map((/**
|
|
2475
|
-
* @param {?} data
|
|
2476
|
-
* @return {?}
|
|
2477
|
-
*/
|
|
2478
|
-
function (data) { return data.result.response; })));
|
|
2479
|
-
};
|
|
2480
|
-
/**
|
|
2481
|
-
* @param {?} req
|
|
2482
|
-
* @return {?}
|
|
2483
|
-
*/
|
|
2484
|
-
WidgetContentLibService.prototype.enrollUserToBatch = /**
|
|
2485
|
-
* @param {?} req
|
|
2486
|
-
* @return {?}
|
|
2487
|
-
*/
|
|
2488
|
-
function (req) {
|
|
2489
|
-
return this.http
|
|
2490
|
-
.post(API_END_POINTS$1.ENROLL_BATCH, req)
|
|
2491
|
-
.toPromise();
|
|
2492
|
-
};
|
|
2493
|
-
/**
|
|
2494
|
-
* @param {?} req
|
|
2495
|
-
* @param {?} type
|
|
2496
|
-
* @return {?}
|
|
2497
|
-
*/
|
|
2498
|
-
WidgetContentLibService.prototype.enrollAndUnenrollUserToBatchWF = /**
|
|
2499
|
-
* @param {?} req
|
|
2500
|
-
* @param {?} type
|
|
2501
|
-
* @return {?}
|
|
2502
|
-
*/
|
|
2503
|
-
function (req, type) {
|
|
2504
|
-
/** @type {?} */
|
|
2505
|
-
var url = type === 'WITHDRAW' ? API_END_POINTS$1.WITHDRAW_BATCH_WF : API_END_POINTS$1.ENROLL_BATCH_WF;
|
|
2506
|
-
return this.http
|
|
2507
|
-
.post(url, req)
|
|
2508
|
-
.toPromise();
|
|
2509
|
-
};
|
|
2510
|
-
/**
|
|
2511
|
-
* @param {?} req
|
|
2512
|
-
* @return {?}
|
|
2513
|
-
*/
|
|
2514
|
-
WidgetContentLibService.prototype.fetchBlendedUserWF = /**
|
|
2515
|
-
* @param {?} req
|
|
2516
|
-
* @return {?}
|
|
2517
|
-
*/
|
|
2518
|
-
function (req) {
|
|
2519
|
-
return this.http
|
|
2520
|
-
.post(API_END_POINTS$1.BLENDED_USER_WF, req)
|
|
2521
|
-
.toPromise();
|
|
2522
|
-
};
|
|
2523
|
-
/**
|
|
2524
|
-
* @param {?} req
|
|
2525
|
-
* @return {?}
|
|
2526
|
-
*/
|
|
2527
|
-
WidgetContentLibService.prototype.fetchBlendedUserCOUNT = /**
|
|
2528
|
-
* @param {?} req
|
|
2529
|
-
* @return {?}
|
|
2530
|
-
*/
|
|
2531
|
-
function (req) {
|
|
2532
|
-
return this.http
|
|
2533
|
-
.post(API_END_POINTS$1.BLENDED_USER_COUNT, req)
|
|
2534
|
-
.toPromise();
|
|
2535
|
-
};
|
|
2536
|
-
/**
|
|
2537
|
-
* @param {?} contentIds
|
|
2538
|
-
* @return {?}
|
|
2539
|
-
*/
|
|
2540
|
-
WidgetContentLibService.prototype.fetchContentLikes = /**
|
|
2541
|
-
* @param {?} contentIds
|
|
2542
|
-
* @return {?}
|
|
2543
|
-
*/
|
|
2544
|
-
function (contentIds) {
|
|
2545
|
-
return this.http
|
|
2546
|
-
.post(API_END_POINTS$1.CONTENT_LIKES, contentIds)
|
|
2547
|
-
.toPromise();
|
|
2548
|
-
};
|
|
2549
|
-
/**
|
|
2550
|
-
* @param {?} contentIds
|
|
2551
|
-
* @return {?}
|
|
2552
|
-
*/
|
|
2553
|
-
WidgetContentLibService.prototype.fetchContentRatings = /**
|
|
2554
|
-
* @param {?} contentIds
|
|
2555
|
-
* @return {?}
|
|
2556
|
-
*/
|
|
2557
|
-
function (contentIds) {
|
|
2558
|
-
if (contentIds) { }
|
|
2559
|
-
// return this.http
|
|
2560
|
-
// .post(`${API_END_POINTS.CONTENT_RATING}/rating`, contentIds)
|
|
2561
|
-
// .toPromise()
|
|
2562
|
-
return of().toPromise();
|
|
2563
|
-
};
|
|
2564
|
-
/**
|
|
2565
|
-
* @param {?} contentId
|
|
2566
|
-
* @return {?}
|
|
2567
|
-
*/
|
|
2568
|
-
WidgetContentLibService.prototype.fetchContentHistory = /**
|
|
2569
|
-
* @param {?} contentId
|
|
2570
|
-
* @return {?}
|
|
2571
|
-
*/
|
|
2572
|
-
function (contentId) {
|
|
2573
|
-
return this.http.get(API_END_POINTS$1.CONTENT_HISTORY + "/" + contentId);
|
|
2574
|
-
};
|
|
2575
|
-
/**
|
|
2576
|
-
* @param {?} req
|
|
2577
|
-
* @return {?}
|
|
2578
|
-
*/
|
|
2579
|
-
WidgetContentLibService.prototype.fetchContentHistoryV2 = /**
|
|
2580
|
-
* @param {?} req
|
|
2581
|
-
* @return {?}
|
|
2582
|
-
*/
|
|
2583
|
-
function (req) {
|
|
2584
|
-
var _this = this;
|
|
2585
|
-
req.request.fields = ['progressdetails'];
|
|
2586
|
-
/** @type {?} */
|
|
2587
|
-
var data = this.http.post(API_END_POINTS$1.CONTENT_HISTORYV2 + "/" + req.request.courseId, req);
|
|
2588
|
-
data.subscribe((/**
|
|
2589
|
-
* @param {?} subscribeData
|
|
2590
|
-
* @return {?}
|
|
2591
|
-
*/
|
|
2592
|
-
function (subscribeData) {
|
|
2593
|
-
_this.programChildCourseResumeData.next({ resumeData: subscribeData.result.contentList, courseId: req.request.courseId });
|
|
2594
|
-
}));
|
|
2595
|
-
return data;
|
|
2596
|
-
};
|
|
2597
|
-
/**
|
|
2598
|
-
* @param {?} id
|
|
2599
|
-
* @param {?=} collectionId
|
|
2600
|
-
* @param {?=} collectionType
|
|
2601
|
-
* @return {?}
|
|
2602
|
-
*/
|
|
2603
|
-
WidgetContentLibService.prototype.continueLearning = /**
|
|
2604
|
-
* @param {?} id
|
|
2605
|
-
* @param {?=} collectionId
|
|
2606
|
-
* @param {?=} collectionType
|
|
1931
|
+
WidgetContentService.prototype.continueLearning = /**
|
|
1932
|
+
* @param {?} id
|
|
1933
|
+
* @param {?=} collectionId
|
|
1934
|
+
* @param {?=} collectionType
|
|
2607
1935
|
* @return {?}
|
|
2608
1936
|
*/
|
|
2609
1937
|
function (id, collectionId, collectionType) {
|
|
@@ -2667,7 +1995,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2667
1995
|
* @param {?} content
|
|
2668
1996
|
* @return {?}
|
|
2669
1997
|
*/
|
|
2670
|
-
|
|
1998
|
+
WidgetContentService.prototype.saveContinueLearning = /**
|
|
2671
1999
|
* @param {?} content
|
|
2672
2000
|
* @return {?}
|
|
2673
2001
|
*/
|
|
@@ -2682,7 +2010,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2682
2010
|
* @param {?} _contentId
|
|
2683
2011
|
* @return {?}
|
|
2684
2012
|
*/
|
|
2685
|
-
|
|
2013
|
+
WidgetContentService.prototype.setS3Cookie = /**
|
|
2686
2014
|
* @param {?} _contentId
|
|
2687
2015
|
* @return {?}
|
|
2688
2016
|
*/
|
|
@@ -2695,11 +2023,11 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2695
2023
|
/**
|
|
2696
2024
|
* @return {?}
|
|
2697
2025
|
*/
|
|
2698
|
-
|
|
2026
|
+
WidgetContentService.prototype.setS3ImageCookie = /**
|
|
2699
2027
|
* @return {?}
|
|
2700
2028
|
*/
|
|
2701
2029
|
function () {
|
|
2702
|
-
return this.http.post(API_END_POINTS
|
|
2030
|
+
return this.http.post(API_END_POINTS.SET_S3_IMAGE_COOKIE, {}).pipe(catchError((/**
|
|
2703
2031
|
* @param {?} _err
|
|
2704
2032
|
* @return {?}
|
|
2705
2033
|
*/
|
|
@@ -2709,35 +2037,35 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2709
2037
|
* @param {?} url
|
|
2710
2038
|
* @return {?}
|
|
2711
2039
|
*/
|
|
2712
|
-
|
|
2040
|
+
WidgetContentService.prototype.fetchManifest = /**
|
|
2713
2041
|
* @param {?} url
|
|
2714
2042
|
* @return {?}
|
|
2715
2043
|
*/
|
|
2716
2044
|
function (url) {
|
|
2717
|
-
return this.http.post(API_END_POINTS
|
|
2045
|
+
return this.http.post(API_END_POINTS.FETCH_MANIFEST, { url: url });
|
|
2718
2046
|
};
|
|
2719
2047
|
/**
|
|
2720
2048
|
* @param {?} url
|
|
2721
2049
|
* @return {?}
|
|
2722
2050
|
*/
|
|
2723
|
-
|
|
2051
|
+
WidgetContentService.prototype.fetchWebModuleContent = /**
|
|
2724
2052
|
* @param {?} url
|
|
2725
2053
|
* @return {?}
|
|
2726
2054
|
*/
|
|
2727
2055
|
function (url) {
|
|
2728
|
-
return this.http.get(API_END_POINTS
|
|
2056
|
+
return this.http.get(API_END_POINTS.FETCH_WEB_MODULE_FILES + "?url=" + encodeURIComponent(url));
|
|
2729
2057
|
};
|
|
2730
2058
|
/**
|
|
2731
2059
|
* @param {?} req
|
|
2732
2060
|
* @return {?}
|
|
2733
2061
|
*/
|
|
2734
|
-
|
|
2062
|
+
WidgetContentService.prototype.search = /**
|
|
2735
2063
|
* @param {?} req
|
|
2736
2064
|
* @return {?}
|
|
2737
2065
|
*/
|
|
2738
2066
|
function (req) {
|
|
2739
2067
|
req.query = req.query || '';
|
|
2740
|
-
return this.http.post(API_END_POINTS
|
|
2068
|
+
return this.http.post(API_END_POINTS.CONTENT_SEARCH_V5, {
|
|
2741
2069
|
request: req,
|
|
2742
2070
|
});
|
|
2743
2071
|
};
|
|
@@ -2745,7 +2073,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2745
2073
|
* @param {?} req
|
|
2746
2074
|
* @return {?}
|
|
2747
2075
|
*/
|
|
2748
|
-
|
|
2076
|
+
WidgetContentService.prototype.searchRegionRecommendation = /**
|
|
2749
2077
|
* @param {?} req
|
|
2750
2078
|
* @return {?}
|
|
2751
2079
|
*/
|
|
@@ -2755,13 +2083,13 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2755
2083
|
(req.preLabelValue || '') +
|
|
2756
2084
|
((this.configSvc.userProfile && this.configSvc.userProfile.country) || '');
|
|
2757
2085
|
req.filters = __assign({}, req.filters, { labels: [req.preLabelValue || ''] });
|
|
2758
|
-
return this.http.post(API_END_POINTS
|
|
2086
|
+
return this.http.post(API_END_POINTS.CONTENT_SEARCH_REGION_RECOMMENDATION, { request: req });
|
|
2759
2087
|
};
|
|
2760
2088
|
/**
|
|
2761
2089
|
* @param {?} req
|
|
2762
2090
|
* @return {?}
|
|
2763
2091
|
*/
|
|
2764
|
-
|
|
2092
|
+
WidgetContentService.prototype.searchV6 = /**
|
|
2765
2093
|
* @param {?} req
|
|
2766
2094
|
* @return {?}
|
|
2767
2095
|
*/
|
|
@@ -2772,59 +2100,59 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2772
2100
|
if (apiPath) {
|
|
2773
2101
|
return this.http.get(apiPath);
|
|
2774
2102
|
}
|
|
2775
|
-
return this.http.post(API_END_POINTS
|
|
2103
|
+
return this.http.post(API_END_POINTS.CONTENT_SEARCH_V6, req);
|
|
2776
2104
|
};
|
|
2777
2105
|
/**
|
|
2778
2106
|
* @param {?} req
|
|
2779
2107
|
* @return {?}
|
|
2780
2108
|
*/
|
|
2781
|
-
|
|
2109
|
+
WidgetContentService.prototype.searchRelatedCBPV6 = /**
|
|
2782
2110
|
* @param {?} req
|
|
2783
2111
|
* @return {?}
|
|
2784
2112
|
*/
|
|
2785
2113
|
function (req) {
|
|
2786
|
-
return this.http.post(API_END_POINTS
|
|
2114
|
+
return this.http.post(API_END_POINTS.CONTENT_SEARCH_RELATED_CBP_V6, req);
|
|
2787
2115
|
};
|
|
2788
2116
|
/**
|
|
2789
2117
|
* @param {?} contentId
|
|
2790
2118
|
* @return {?}
|
|
2791
2119
|
*/
|
|
2792
|
-
|
|
2120
|
+
WidgetContentService.prototype.fetchContentRating = /**
|
|
2793
2121
|
* @param {?} contentId
|
|
2794
2122
|
* @return {?}
|
|
2795
2123
|
*/
|
|
2796
2124
|
function (contentId) {
|
|
2797
|
-
return this.http.get(API_END_POINTS
|
|
2125
|
+
return this.http.get(API_END_POINTS.CONTENT_RATING + "/" + contentId);
|
|
2798
2126
|
};
|
|
2799
2127
|
/**
|
|
2800
2128
|
* @param {?} contentId
|
|
2801
2129
|
* @return {?}
|
|
2802
2130
|
*/
|
|
2803
|
-
|
|
2131
|
+
WidgetContentService.prototype.deleteContentRating = /**
|
|
2804
2132
|
* @param {?} contentId
|
|
2805
2133
|
* @return {?}
|
|
2806
2134
|
*/
|
|
2807
2135
|
function (contentId) {
|
|
2808
|
-
return this.http.delete(API_END_POINTS
|
|
2136
|
+
return this.http.delete(API_END_POINTS.CONTENT_RATING + "/" + contentId);
|
|
2809
2137
|
};
|
|
2810
2138
|
/**
|
|
2811
2139
|
* @param {?} contentId
|
|
2812
2140
|
* @param {?} data
|
|
2813
2141
|
* @return {?}
|
|
2814
2142
|
*/
|
|
2815
|
-
|
|
2143
|
+
WidgetContentService.prototype.addContentRating = /**
|
|
2816
2144
|
* @param {?} contentId
|
|
2817
2145
|
* @param {?} data
|
|
2818
2146
|
* @return {?}
|
|
2819
2147
|
*/
|
|
2820
2148
|
function (contentId, data) {
|
|
2821
|
-
return this.http.post(API_END_POINTS
|
|
2149
|
+
return this.http.post(API_END_POINTS.CONTENT_RATING + "/" + contentId, data);
|
|
2822
2150
|
};
|
|
2823
2151
|
/**
|
|
2824
2152
|
* @param {?} content
|
|
2825
2153
|
* @return {?}
|
|
2826
2154
|
*/
|
|
2827
|
-
|
|
2155
|
+
WidgetContentService.prototype.getFirstChildInHierarchy = /**
|
|
2828
2156
|
* @param {?} content
|
|
2829
2157
|
* @return {?}
|
|
2830
2158
|
*/
|
|
@@ -2863,18 +2191,18 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2863
2191
|
* @param {?} source
|
|
2864
2192
|
* @return {?}
|
|
2865
2193
|
*/
|
|
2866
|
-
|
|
2194
|
+
WidgetContentService.prototype.getRegistrationStatus = /**
|
|
2867
2195
|
* @param {?} source
|
|
2868
2196
|
* @return {?}
|
|
2869
2197
|
*/
|
|
2870
2198
|
function (source) {
|
|
2871
|
-
return this.http.get(API_END_POINTS
|
|
2199
|
+
return this.http.get(API_END_POINTS.REGISTRATION_STATUS + "/" + source).toPromise();
|
|
2872
2200
|
};
|
|
2873
2201
|
/**
|
|
2874
2202
|
* @param {?} url
|
|
2875
2203
|
* @return {?}
|
|
2876
2204
|
*/
|
|
2877
|
-
|
|
2205
|
+
WidgetContentService.prototype.fetchConfig = /**
|
|
2878
2206
|
* @param {?} url
|
|
2879
2207
|
* @return {?}
|
|
2880
2208
|
*/
|
|
@@ -2885,59 +2213,59 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2885
2213
|
* @param {?} body
|
|
2886
2214
|
* @return {?}
|
|
2887
2215
|
*/
|
|
2888
|
-
|
|
2216
|
+
WidgetContentService.prototype.addCertTemplate = /**
|
|
2889
2217
|
* @param {?} body
|
|
2890
2218
|
* @return {?}
|
|
2891
2219
|
*/
|
|
2892
2220
|
function (body) {
|
|
2893
|
-
return this.http.patch("" + API_END_POINTS
|
|
2221
|
+
return this.http.patch("" + API_END_POINTS.CERT_ADD_TEMPLATE, body);
|
|
2894
2222
|
};
|
|
2895
2223
|
/**
|
|
2896
2224
|
* @param {?} body
|
|
2897
2225
|
* @return {?}
|
|
2898
2226
|
*/
|
|
2899
|
-
|
|
2227
|
+
WidgetContentService.prototype.issueCert = /**
|
|
2900
2228
|
* @param {?} body
|
|
2901
2229
|
* @return {?}
|
|
2902
2230
|
*/
|
|
2903
2231
|
function (body) {
|
|
2904
|
-
return this.http.post("" + API_END_POINTS
|
|
2232
|
+
return this.http.post("" + API_END_POINTS.CERT_ISSUE, body);
|
|
2905
2233
|
};
|
|
2906
2234
|
/**
|
|
2907
2235
|
* @param {?} certId
|
|
2908
2236
|
* @return {?}
|
|
2909
2237
|
*/
|
|
2910
|
-
|
|
2238
|
+
WidgetContentService.prototype.downloadCert = /**
|
|
2911
2239
|
* @param {?} certId
|
|
2912
2240
|
* @return {?}
|
|
2913
2241
|
*/
|
|
2914
2242
|
function (certId) {
|
|
2915
|
-
return this.http.get("" + API_END_POINTS
|
|
2243
|
+
return this.http.get("" + API_END_POINTS.CERT_DOWNLOAD(certId));
|
|
2916
2244
|
};
|
|
2917
2245
|
/**
|
|
2918
2246
|
* @param {?} req
|
|
2919
2247
|
* @return {?}
|
|
2920
2248
|
*/
|
|
2921
|
-
|
|
2249
|
+
WidgetContentService.prototype.trendingContentSearch = /**
|
|
2922
2250
|
* @param {?} req
|
|
2923
2251
|
* @return {?}
|
|
2924
2252
|
*/
|
|
2925
2253
|
function (req) {
|
|
2926
2254
|
req.query = req.query || '';
|
|
2927
|
-
return this.http.post(API_END_POINTS
|
|
2255
|
+
return this.http.post(API_END_POINTS.TRENDING_CONTENT_SEARCH, req);
|
|
2928
2256
|
};
|
|
2929
2257
|
/**
|
|
2930
2258
|
* @param {?} limit
|
|
2931
2259
|
* @param {?} offset
|
|
2932
2260
|
* @return {?}
|
|
2933
2261
|
*/
|
|
2934
|
-
|
|
2262
|
+
WidgetContentService.prototype.getKarmaPoitns = /**
|
|
2935
2263
|
* @param {?} limit
|
|
2936
2264
|
* @param {?} offset
|
|
2937
2265
|
* @return {?}
|
|
2938
2266
|
*/
|
|
2939
2267
|
function (limit, offset) {
|
|
2940
|
-
return this.http.post(API_END_POINTS
|
|
2268
|
+
return this.http.post(API_END_POINTS.READ_KARMAPOINTS, { limit: limit, offset: offset }).pipe(catchError((/**
|
|
2941
2269
|
* @param {?} _err
|
|
2942
2270
|
* @return {?}
|
|
2943
2271
|
*/
|
|
@@ -2947,7 +2275,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2947
2275
|
* @param {?} contentId
|
|
2948
2276
|
* @return {?}
|
|
2949
2277
|
*/
|
|
2950
|
-
|
|
2278
|
+
WidgetContentService.prototype.fetchProgramContent = /**
|
|
2951
2279
|
* @param {?} contentId
|
|
2952
2280
|
* @return {?}
|
|
2953
2281
|
*/
|
|
@@ -2957,7 +2285,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2957
2285
|
/** @type {?} */
|
|
2958
2286
|
var forPreview = window.location.href.includes('/public/') || window.location.href.includes('&preview=true');
|
|
2959
2287
|
if (!forPreview) {
|
|
2960
|
-
return this.http.get(API_END_POINTS
|
|
2288
|
+
return this.http.get(API_END_POINTS.CONTENT_READ(contentId));
|
|
2961
2289
|
}
|
|
2962
2290
|
url = "/api/content/v1/read/" + contentId;
|
|
2963
2291
|
return this.http.get(url);
|
|
@@ -2967,112 +2295,81 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
2967
2295
|
* @param {?} request
|
|
2968
2296
|
* @return {?}
|
|
2969
2297
|
*/
|
|
2970
|
-
|
|
2298
|
+
WidgetContentService.prototype.getCourseKarmaPoints = /**
|
|
2971
2299
|
* @param {?} request
|
|
2972
2300
|
* @return {?}
|
|
2973
2301
|
*/
|
|
2974
2302
|
function (request) {
|
|
2975
|
-
return this.http.post(API_END_POINTS
|
|
2303
|
+
return this.http.post(API_END_POINTS.READ_COURSE_KARMAPOINTS, request);
|
|
2976
2304
|
};
|
|
2977
2305
|
/**
|
|
2978
2306
|
* @param {?} request
|
|
2979
2307
|
* @return {?}
|
|
2980
2308
|
*/
|
|
2981
|
-
|
|
2309
|
+
WidgetContentService.prototype.claimKarmapoints = /**
|
|
2982
2310
|
* @param {?} request
|
|
2983
2311
|
* @return {?}
|
|
2984
2312
|
*/
|
|
2985
2313
|
function (request) {
|
|
2986
|
-
return this.http.post(API_END_POINTS
|
|
2314
|
+
return this.http.post(API_END_POINTS.CLAIM_KARMAPOINTS, request);
|
|
2987
2315
|
};
|
|
2988
2316
|
/**
|
|
2989
2317
|
* @return {?}
|
|
2990
2318
|
*/
|
|
2991
|
-
|
|
2319
|
+
WidgetContentService.prototype.userKarmaPoints = /**
|
|
2992
2320
|
* @return {?}
|
|
2993
2321
|
*/
|
|
2994
2322
|
function () {
|
|
2995
|
-
return this.http.post(API_END_POINTS
|
|
2323
|
+
return this.http.post(API_END_POINTS.USER_KARMA_POINTS, {});
|
|
2996
2324
|
};
|
|
2997
2325
|
/**
|
|
2998
2326
|
* @param {?} doId
|
|
2999
2327
|
* @return {?}
|
|
3000
2328
|
*/
|
|
3001
|
-
|
|
2329
|
+
WidgetContentService.prototype.getEnrolledData = /**
|
|
3002
2330
|
* @param {?} doId
|
|
3003
2331
|
* @return {?}
|
|
3004
2332
|
*/
|
|
3005
2333
|
function (doId) {
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
case 0:
|
|
3012
|
-
userId = this.configSvc.userProfile.userId;
|
|
3013
|
-
return [4 /*yield*/, this.userSvc.fetchEnrollmentDataByContentId(userId, doId).toPromise().then((/**
|
|
3014
|
-
* @param {?} res
|
|
3015
|
-
* @return {?}
|
|
3016
|
-
*/
|
|
3017
|
-
function (res) { return __awaiter(_this, void 0, void 0, function () {
|
|
3018
|
-
return __generator(this, function (_a) {
|
|
3019
|
-
if (res && res.courses && res.courses.length) {
|
|
3020
|
-
return [2 /*return*/, res.courses];
|
|
3021
|
-
}
|
|
3022
|
-
else {
|
|
3023
|
-
return [2 /*return*/, []];
|
|
3024
|
-
}
|
|
3025
|
-
return [2 /*return*/];
|
|
3026
|
-
});
|
|
3027
|
-
}); })).catch((/**
|
|
3028
|
-
* @param {?} _err
|
|
3029
|
-
* @return {?}
|
|
3030
|
-
*/
|
|
3031
|
-
function (_err) {
|
|
3032
|
-
return [];
|
|
3033
|
-
}))];
|
|
3034
|
-
case 1:
|
|
3035
|
-
responseData = _a.sent();
|
|
3036
|
-
return [2 /*return*/, responseData || []];
|
|
3037
|
-
}
|
|
3038
|
-
});
|
|
3039
|
-
});
|
|
2334
|
+
/** @type {?} */
|
|
2335
|
+
var enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
|
|
2336
|
+
/** @type {?} */
|
|
2337
|
+
var enrolledCourseData = enrollmentMapData[doId];
|
|
2338
|
+
return enrolledCourseData;
|
|
3040
2339
|
};
|
|
3041
2340
|
/**
|
|
3042
2341
|
* @param {?} content
|
|
3043
2342
|
* @return {?}
|
|
3044
2343
|
*/
|
|
3045
|
-
|
|
2344
|
+
WidgetContentService.prototype.getResourseLink = /**
|
|
3046
2345
|
* @param {?} content
|
|
3047
2346
|
* @return {?}
|
|
3048
2347
|
*/
|
|
3049
2348
|
function (content) {
|
|
3050
2349
|
return __awaiter(this, void 0, void 0, function () {
|
|
3051
|
-
var
|
|
2350
|
+
var enrolledCourseData, data, data;
|
|
3052
2351
|
return __generator(this, function (_a) {
|
|
3053
2352
|
switch (_a.label) {
|
|
3054
|
-
case 0:
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
if (!(enrolledCourse && enrolledCourse.length)) return [3 /*break*/, 5];
|
|
3058
|
-
enrolledCourseData = enrolledCourse[0];
|
|
2353
|
+
case 0:
|
|
2354
|
+
enrolledCourseData = this.getEnrolledData(content.identifier);
|
|
2355
|
+
if (!enrolledCourseData) return [3 /*break*/, 4];
|
|
3059
2356
|
if (!(enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.BLENDED_PROGRAM ||
|
|
3060
2357
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.INVITE_ONLY_PROGRAM ||
|
|
3061
2358
|
enrolledCourseData.content.courseCategory === NsContent.ECourseCategory.MODERATED_PROGRAM ||
|
|
3062
2359
|
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.BLENDED_PROGRAM ||
|
|
3063
|
-
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/,
|
|
2360
|
+
enrolledCourseData.content.primaryCategory === NsContent.EPrimaryCategory.PROGRAM)) return [3 /*break*/, 2];
|
|
3064
2361
|
if (!this.isBatchInProgress(enrolledCourseData.batch)) {
|
|
3065
2362
|
return [2 /*return*/, this.gotoTocPage(content)];
|
|
3066
2363
|
}
|
|
3067
2364
|
return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
3068
|
-
case
|
|
2365
|
+
case 1:
|
|
3069
2366
|
data = _a.sent();
|
|
3070
2367
|
return [2 /*return*/, data];
|
|
3071
|
-
case
|
|
3072
|
-
case
|
|
2368
|
+
case 2: return [4 /*yield*/, this.checkForDataToFormUrl(content, enrolledCourseData)];
|
|
2369
|
+
case 3:
|
|
3073
2370
|
data = _a.sent();
|
|
3074
2371
|
return [2 /*return*/, data];
|
|
3075
|
-
case
|
|
2372
|
+
case 4: return [2 /*return*/, this.gotoTocPage(content)];
|
|
3076
2373
|
}
|
|
3077
2374
|
});
|
|
3078
2375
|
});
|
|
@@ -3082,7 +2379,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3082
2379
|
* @param {?} enrollData
|
|
3083
2380
|
* @return {?}
|
|
3084
2381
|
*/
|
|
3085
|
-
|
|
2382
|
+
WidgetContentService.prototype.checkForDataToFormUrl = /**
|
|
3086
2383
|
* @param {?} content
|
|
3087
2384
|
* @param {?} enrollData
|
|
3088
2385
|
* @return {?}
|
|
@@ -3140,7 +2437,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3140
2437
|
* @param {?} mimeType
|
|
3141
2438
|
* @return {?}
|
|
3142
2439
|
*/
|
|
3143
|
-
|
|
2440
|
+
WidgetContentService.prototype.getResourseDataWithData = /**
|
|
3144
2441
|
* @param {?} content
|
|
3145
2442
|
* @param {?} resourseId
|
|
3146
2443
|
* @param {?} mimeType
|
|
@@ -3158,7 +2455,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3158
2455
|
* @param {?} content
|
|
3159
2456
|
* @return {?}
|
|
3160
2457
|
*/
|
|
3161
|
-
|
|
2458
|
+
WidgetContentService.prototype.gotoTocPage = /**
|
|
3162
2459
|
* @param {?} content
|
|
3163
2460
|
* @return {?}
|
|
3164
2461
|
*/
|
|
@@ -3177,7 +2474,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3177
2474
|
* @param {?} batchData
|
|
3178
2475
|
* @return {?}
|
|
3179
2476
|
*/
|
|
3180
|
-
|
|
2477
|
+
WidgetContentService.prototype.isBatchInProgress = /**
|
|
3181
2478
|
* @param {?} batchData
|
|
3182
2479
|
* @return {?}
|
|
3183
2480
|
*/
|
|
@@ -3203,7 +2500,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3203
2500
|
* @param {?} req
|
|
3204
2501
|
* @return {?}
|
|
3205
2502
|
*/
|
|
3206
|
-
|
|
2503
|
+
WidgetContentService.prototype.postApiMethod = /**
|
|
3207
2504
|
* @param {?} apiUrl
|
|
3208
2505
|
* @param {?} req
|
|
3209
2506
|
* @return {?}
|
|
@@ -3215,7 +2512,7 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3215
2512
|
* @param {?} apiUrl
|
|
3216
2513
|
* @return {?}
|
|
3217
2514
|
*/
|
|
3218
|
-
|
|
2515
|
+
WidgetContentService.prototype.getApiMethod = /**
|
|
3219
2516
|
* @param {?} apiUrl
|
|
3220
2517
|
* @return {?}
|
|
3221
2518
|
*/
|
|
@@ -3223,78 +2520,51 @@ var WidgetContentLibService = /** @class */ (function () {
|
|
|
3223
2520
|
// req.query = req.query || '';
|
|
3224
2521
|
return this.http.get(apiUrl);
|
|
3225
2522
|
};
|
|
3226
|
-
|
|
3227
|
-
* @param {?} enrollmentList
|
|
3228
|
-
* @param {?} collectionId
|
|
3229
|
-
* @return {?}
|
|
3230
|
-
*/
|
|
3231
|
-
WidgetContentLibService.prototype.getEnrolledDataFromList = /**
|
|
3232
|
-
* @param {?} enrollmentList
|
|
3233
|
-
* @param {?} collectionId
|
|
3234
|
-
* @return {?}
|
|
3235
|
-
*/
|
|
3236
|
-
function (enrollmentList, collectionId) {
|
|
3237
|
-
if (enrollmentList && enrollmentList.length) {
|
|
3238
|
-
/** @type {?} */
|
|
3239
|
-
var enrolledData = enrollmentList.filter((/**
|
|
3240
|
-
* @param {?} ele
|
|
3241
|
-
* @return {?}
|
|
3242
|
-
*/
|
|
3243
|
-
function (ele) { return ele.collectionId === collectionId; }));
|
|
3244
|
-
return enrolledData.length ? enrolledData[0] : {};
|
|
3245
|
-
}
|
|
3246
|
-
};
|
|
3247
|
-
WidgetContentLibService.decorators = [
|
|
2523
|
+
WidgetContentService.decorators = [
|
|
3248
2524
|
{ type: Injectable, args: [{
|
|
3249
2525
|
providedIn: 'root',
|
|
3250
2526
|
},] }
|
|
3251
2527
|
];
|
|
3252
2528
|
/** @nocollapse */
|
|
3253
|
-
|
|
2529
|
+
WidgetContentService.ctorParameters = function () { return [
|
|
3254
2530
|
{ type: HttpClient },
|
|
3255
|
-
{ type: ConfigurationsService$1 }
|
|
3256
|
-
{ type: WidgetUserServiceLib }
|
|
2531
|
+
{ type: ConfigurationsService$1 }
|
|
3257
2532
|
]; };
|
|
3258
|
-
/** @nocollapse */
|
|
3259
|
-
return
|
|
2533
|
+
/** @nocollapse */ WidgetContentService.ngInjectableDef = ɵɵdefineInjectable({ factory: function WidgetContentService_Factory() { return new WidgetContentService(ɵɵinject(HttpClient), ɵɵinject(ConfigurationsService$1)); }, token: WidgetContentService, providedIn: "root" });
|
|
2534
|
+
return WidgetContentService;
|
|
3260
2535
|
}());
|
|
3261
2536
|
if (false) {
|
|
3262
2537
|
/** @type {?} */
|
|
3263
|
-
|
|
2538
|
+
WidgetContentService.prototype.tocConfigData;
|
|
3264
2539
|
/** @type {?} */
|
|
3265
|
-
|
|
2540
|
+
WidgetContentService.prototype.tocConfigData$;
|
|
3266
2541
|
/**
|
|
3267
2542
|
* @type {?}
|
|
3268
2543
|
* @private
|
|
3269
2544
|
*/
|
|
3270
|
-
|
|
2545
|
+
WidgetContentService.prototype.telemetryData;
|
|
3271
2546
|
/** @type {?} */
|
|
3272
|
-
|
|
2547
|
+
WidgetContentService.prototype.telemetryData$;
|
|
3273
2548
|
/** @type {?} */
|
|
3274
|
-
|
|
2549
|
+
WidgetContentService.prototype.currentMetaData;
|
|
3275
2550
|
/** @type {?} */
|
|
3276
|
-
|
|
2551
|
+
WidgetContentService.prototype.currentContentReadMetaData;
|
|
3277
2552
|
/** @type {?} */
|
|
3278
|
-
|
|
2553
|
+
WidgetContentService.prototype.currentBatchEnrollmentList;
|
|
3279
2554
|
/** @type {?} */
|
|
3280
|
-
|
|
2555
|
+
WidgetContentService.prototype.programChildCourseResumeData;
|
|
3281
2556
|
/** @type {?} */
|
|
3282
|
-
|
|
2557
|
+
WidgetContentService.prototype.programChildCourseResumeData$;
|
|
3283
2558
|
/**
|
|
3284
2559
|
* @type {?}
|
|
3285
2560
|
* @private
|
|
3286
2561
|
*/
|
|
3287
|
-
|
|
2562
|
+
WidgetContentService.prototype.http;
|
|
3288
2563
|
/**
|
|
3289
2564
|
* @type {?}
|
|
3290
2565
|
* @private
|
|
3291
2566
|
*/
|
|
3292
|
-
|
|
3293
|
-
/**
|
|
3294
|
-
* @type {?}
|
|
3295
|
-
* @private
|
|
3296
|
-
*/
|
|
3297
|
-
WidgetContentLibService.prototype.userSvc;
|
|
2567
|
+
WidgetContentService.prototype.configSvc;
|
|
3298
2568
|
}
|
|
3299
2569
|
|
|
3300
2570
|
/**
|
|
@@ -3569,234 +2839,840 @@ var MultilingualTranslationsService = /** @class */ (function () {
|
|
|
3569
2839
|
/**
|
|
3570
2840
|
* @return {?}
|
|
3571
2841
|
*/
|
|
3572
|
-
MultilingualTranslationsService.prototype.getLanguage = /**
|
|
2842
|
+
MultilingualTranslationsService.prototype.getLanguage = /**
|
|
2843
|
+
* @return {?}
|
|
2844
|
+
*/
|
|
2845
|
+
function () {
|
|
2846
|
+
if (this.configSvc.unMappedUser) {
|
|
2847
|
+
if (this.configSvc.unMappedUser.profileDetails &&
|
|
2848
|
+
this.configSvc.unMappedUser.profileDetails.additionalProperties &&
|
|
2849
|
+
this.configSvc.unMappedUser.profileDetails.additionalProperties.webPortalLang) {
|
|
2850
|
+
/** @type {?} */
|
|
2851
|
+
var lang = this.configSvc.unMappedUser.profileDetails.additionalProperties.webPortalLang;
|
|
2852
|
+
this.translate.use(lang);
|
|
2853
|
+
localStorage.setItem('websiteLanguage', lang);
|
|
2854
|
+
}
|
|
2855
|
+
else {
|
|
2856
|
+
if (localStorage.getItem('websiteLanguage')) {
|
|
2857
|
+
// this.translate.setDefaultLang('en')
|
|
2858
|
+
/** @type {?} */
|
|
2859
|
+
var lang = JSON.stringify(localStorage.getItem('websiteLanguage'));
|
|
2860
|
+
lang = lang.replace(/\"/g, '');
|
|
2861
|
+
this.translate.use(lang);
|
|
2862
|
+
}
|
|
2863
|
+
else {
|
|
2864
|
+
this.translate.setDefaultLang('en');
|
|
2865
|
+
localStorage.setItem('websiteLanguage', 'en');
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
else {
|
|
2870
|
+
if (localStorage.getItem('websiteLanguage')) {
|
|
2871
|
+
// this.translate.setDefaultLang('en')
|
|
2872
|
+
/** @type {?} */
|
|
2873
|
+
var lang = JSON.stringify(localStorage.getItem('websiteLanguage'));
|
|
2874
|
+
lang = lang.replace(/\"/g, '');
|
|
2875
|
+
this.translate.use(lang);
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
};
|
|
2879
|
+
/**
|
|
2880
|
+
* @param {?} label
|
|
2881
|
+
* @param {?} type
|
|
2882
|
+
* @param {?} subtype
|
|
2883
|
+
* @return {?}
|
|
2884
|
+
*/
|
|
2885
|
+
MultilingualTranslationsService.prototype.translateLabelWithoutspace = /**
|
|
2886
|
+
* @param {?} label
|
|
2887
|
+
* @param {?} type
|
|
2888
|
+
* @param {?} subtype
|
|
2889
|
+
* @return {?}
|
|
2890
|
+
*/
|
|
2891
|
+
function (label, type, subtype) {
|
|
2892
|
+
/** @type {?} */
|
|
2893
|
+
var nlabel = label;
|
|
2894
|
+
nlabel = nlabel && nlabel.replace(/\s/g, '');
|
|
2895
|
+
if (subtype) {
|
|
2896
|
+
// tslint:disable-next-line: prefer-template
|
|
2897
|
+
/** @type {?} */
|
|
2898
|
+
var translationKey = type + '.' + nlabel + subtype;
|
|
2899
|
+
return this.translate.instant(translationKey);
|
|
2900
|
+
}
|
|
2901
|
+
// tslint:disable-next-line: prefer-template
|
|
2902
|
+
/** @type {?} */
|
|
2903
|
+
var translationKeyn = type + '.' + nlabel;
|
|
2904
|
+
return this.translate.instant(translationKeyn);
|
|
2905
|
+
};
|
|
2906
|
+
/**
|
|
2907
|
+
* @param {?} label
|
|
2908
|
+
* @param {?} type
|
|
2909
|
+
* @param {?} subtype
|
|
2910
|
+
* @return {?}
|
|
2911
|
+
*/
|
|
2912
|
+
MultilingualTranslationsService.prototype.translateLabel = /**
|
|
2913
|
+
* @param {?} label
|
|
2914
|
+
* @param {?} type
|
|
2915
|
+
* @param {?} subtype
|
|
2916
|
+
* @return {?}
|
|
2917
|
+
*/
|
|
2918
|
+
function (label, type, subtype) {
|
|
2919
|
+
if (label) {
|
|
2920
|
+
/** @type {?} */
|
|
2921
|
+
var nlabel = label;
|
|
2922
|
+
nlabel = nlabel && nlabel.toLowerCase();
|
|
2923
|
+
/** @type {?} */
|
|
2924
|
+
var sl_1 = nlabel.split(' ');
|
|
2925
|
+
sl_1.forEach((/**
|
|
2926
|
+
* @param {?} w
|
|
2927
|
+
* @param {?} index
|
|
2928
|
+
* @return {?}
|
|
2929
|
+
*/
|
|
2930
|
+
function (w, index) {
|
|
2931
|
+
if (index !== 0) {
|
|
2932
|
+
sl_1[index] = w[0].toUpperCase() + w.slice(1);
|
|
2933
|
+
}
|
|
2934
|
+
}));
|
|
2935
|
+
nlabel = sl_1.join('');
|
|
2936
|
+
nlabel = nlabel.replace(/\s/g, '');
|
|
2937
|
+
if (subtype) {
|
|
2938
|
+
// tslint:disable-next-line: prefer-template
|
|
2939
|
+
/** @type {?} */
|
|
2940
|
+
var translationKey = type + '.' + nlabel + subtype;
|
|
2941
|
+
return this.translate.instant(translationKey);
|
|
2942
|
+
}
|
|
2943
|
+
// tslint:disable-next-line: prefer-template
|
|
2944
|
+
/** @type {?} */
|
|
2945
|
+
var translationKeyn = type + '.' + nlabel;
|
|
2946
|
+
return this.translate.instant(translationKeyn);
|
|
2947
|
+
}
|
|
2948
|
+
return label;
|
|
2949
|
+
};
|
|
2950
|
+
/**
|
|
2951
|
+
* @param {?} label
|
|
2952
|
+
* @param {?} type
|
|
2953
|
+
* @param {?} subtype
|
|
2954
|
+
* @return {?}
|
|
2955
|
+
*/
|
|
2956
|
+
MultilingualTranslationsService.prototype.translateActualLabel = /**
|
|
2957
|
+
* @param {?} label
|
|
2958
|
+
* @param {?} type
|
|
2959
|
+
* @param {?} subtype
|
|
2960
|
+
* @return {?}
|
|
2961
|
+
*/
|
|
2962
|
+
function (label, type, subtype) {
|
|
2963
|
+
/** @type {?} */
|
|
2964
|
+
var nlabel = label;
|
|
2965
|
+
/** @type {?} */
|
|
2966
|
+
var sl = nlabel.split(' ');
|
|
2967
|
+
sl.forEach((/**
|
|
2968
|
+
* @param {?} w
|
|
2969
|
+
* @param {?} index
|
|
2970
|
+
* @return {?}
|
|
2971
|
+
*/
|
|
2972
|
+
function (w, index) {
|
|
2973
|
+
if (index !== 0) {
|
|
2974
|
+
sl[index] = w[0].toUpperCase() + w.slice(1);
|
|
2975
|
+
}
|
|
2976
|
+
}));
|
|
2977
|
+
nlabel = sl.join('');
|
|
2978
|
+
nlabel = nlabel.replace(/\s/g, '');
|
|
2979
|
+
if (subtype) {
|
|
2980
|
+
// tslint:disable-next-line: prefer-template
|
|
2981
|
+
/** @type {?} */
|
|
2982
|
+
var translationKey = type + '.' + nlabel + subtype;
|
|
2983
|
+
return this.translate.instant(translationKey);
|
|
2984
|
+
}
|
|
2985
|
+
// tslint:disable-next-line: prefer-template
|
|
2986
|
+
/** @type {?} */
|
|
2987
|
+
var translationKeyn = type + '.' + nlabel;
|
|
2988
|
+
return this.translate.instant(translationKeyn);
|
|
2989
|
+
};
|
|
2990
|
+
/**
|
|
2991
|
+
* @param {?} data
|
|
2992
|
+
* @return {?}
|
|
2993
|
+
*/
|
|
2994
|
+
MultilingualTranslationsService.prototype.editProfileDetailsAPI = /**
|
|
2995
|
+
* @param {?} data
|
|
2996
|
+
* @return {?}
|
|
2997
|
+
*/
|
|
2998
|
+
function (data) {
|
|
2999
|
+
return this.http.post(this.editProfileDetails, data);
|
|
3000
|
+
};
|
|
3001
|
+
/**
|
|
3002
|
+
* @param {?} state
|
|
3003
|
+
* @param {?} lang
|
|
3004
|
+
* @param {?} userid
|
|
3005
|
+
* @return {?}
|
|
3006
|
+
*/
|
|
3007
|
+
MultilingualTranslationsService.prototype.updatelanguageSelected = /**
|
|
3008
|
+
* @param {?} state
|
|
3009
|
+
* @param {?} lang
|
|
3010
|
+
* @param {?} userid
|
|
3011
|
+
* @return {?}
|
|
3012
|
+
*/
|
|
3013
|
+
function (state, lang, userid) {
|
|
3014
|
+
this.languageSelected.next(state);
|
|
3015
|
+
this.translate.use(lang);
|
|
3016
|
+
this.selectedLang = lang;
|
|
3017
|
+
if (userid) {
|
|
3018
|
+
/** @type {?} */
|
|
3019
|
+
var reqUpdates = {
|
|
3020
|
+
request: {
|
|
3021
|
+
userId: userid,
|
|
3022
|
+
profileDetails: {
|
|
3023
|
+
additionalProperties: {
|
|
3024
|
+
webPortalLang: this.selectedLang,
|
|
3025
|
+
},
|
|
3026
|
+
},
|
|
3027
|
+
},
|
|
3028
|
+
};
|
|
3029
|
+
this.editProfileDetailsAPI(reqUpdates).subscribe();
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
3032
|
+
MultilingualTranslationsService.decorators = [
|
|
3033
|
+
{ type: Injectable, args: [{
|
|
3034
|
+
providedIn: 'root',
|
|
3035
|
+
},] }
|
|
3036
|
+
];
|
|
3037
|
+
/** @nocollapse */
|
|
3038
|
+
MultilingualTranslationsService.ctorParameters = function () { return [
|
|
3039
|
+
{ type: TranslateService },
|
|
3040
|
+
{ type: HttpClient },
|
|
3041
|
+
{ type: ConfigurationsService }
|
|
3042
|
+
]; };
|
|
3043
|
+
/** @nocollapse */ MultilingualTranslationsService.ngInjectableDef = ɵɵdefineInjectable({ factory: function MultilingualTranslationsService_Factory() { return new MultilingualTranslationsService(ɵɵinject(TranslateService), ɵɵinject(HttpClient), ɵɵinject(ConfigurationsService)); }, token: MultilingualTranslationsService, providedIn: "root" });
|
|
3044
|
+
return MultilingualTranslationsService;
|
|
3045
|
+
}());
|
|
3046
|
+
if (false) {
|
|
3047
|
+
/** @type {?} */
|
|
3048
|
+
MultilingualTranslationsService.prototype.selectedLang;
|
|
3049
|
+
/** @type {?} */
|
|
3050
|
+
MultilingualTranslationsService.prototype.languageSelected;
|
|
3051
|
+
/** @type {?} */
|
|
3052
|
+
MultilingualTranslationsService.prototype.languageSelectedObservable;
|
|
3053
|
+
/** @type {?} */
|
|
3054
|
+
MultilingualTranslationsService.prototype.editProfileDetails;
|
|
3055
|
+
/**
|
|
3056
|
+
* @type {?}
|
|
3057
|
+
* @private
|
|
3058
|
+
*/
|
|
3059
|
+
MultilingualTranslationsService.prototype.translate;
|
|
3060
|
+
/**
|
|
3061
|
+
* @type {?}
|
|
3062
|
+
* @private
|
|
3063
|
+
*/
|
|
3064
|
+
MultilingualTranslationsService.prototype.http;
|
|
3065
|
+
/**
|
|
3066
|
+
* @type {?}
|
|
3067
|
+
* @private
|
|
3068
|
+
*/
|
|
3069
|
+
MultilingualTranslationsService.prototype.configSvc;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
/**
|
|
3073
|
+
* @fileoverview added by tsickle
|
|
3074
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3075
|
+
*/
|
|
3076
|
+
var NsCardContent;
|
|
3077
|
+
(function (NsCardContent) {
|
|
3078
|
+
/**
|
|
3079
|
+
* @record
|
|
3080
|
+
*/
|
|
3081
|
+
function ICard() { }
|
|
3082
|
+
NsCardContent.ICard = ICard;
|
|
3083
|
+
if (false) {
|
|
3084
|
+
/** @type {?} */
|
|
3085
|
+
ICard.prototype.content;
|
|
3086
|
+
/** @type {?} */
|
|
3087
|
+
ICard.prototype.cardSubType;
|
|
3088
|
+
/** @type {?} */
|
|
3089
|
+
ICard.prototype.context;
|
|
3090
|
+
/** @type {?|undefined} */
|
|
3091
|
+
ICard.prototype.intranetMode;
|
|
3092
|
+
/** @type {?|undefined} */
|
|
3093
|
+
ICard.prototype.deletedMode;
|
|
3094
|
+
/** @type {?|undefined} */
|
|
3095
|
+
ICard.prototype.likes;
|
|
3096
|
+
/** @type {?|undefined} */
|
|
3097
|
+
ICard.prototype.contentTags;
|
|
3098
|
+
/** @type {?} */
|
|
3099
|
+
ICard.prototype.stateData;
|
|
3100
|
+
}
|
|
3101
|
+
/**
|
|
3102
|
+
* @record
|
|
3103
|
+
*/
|
|
3104
|
+
function IContentTags() { }
|
|
3105
|
+
NsCardContent.IContentTags = IContentTags;
|
|
3106
|
+
if (false) {
|
|
3107
|
+
/** @type {?|undefined} */
|
|
3108
|
+
IContentTags.prototype.daysSpan;
|
|
3109
|
+
/** @type {?|undefined} */
|
|
3110
|
+
IContentTags.prototype.excludeContentType;
|
|
3111
|
+
/** @type {?|undefined} */
|
|
3112
|
+
IContentTags.prototype.excludeMimeType;
|
|
3113
|
+
/** @type {?} */
|
|
3114
|
+
IContentTags.prototype.tag;
|
|
3115
|
+
/** @type {?|undefined} */
|
|
3116
|
+
IContentTags.prototype.criteriaField;
|
|
3117
|
+
}
|
|
3118
|
+
/**
|
|
3119
|
+
* @record
|
|
3120
|
+
*/
|
|
3121
|
+
function ICompetency() { }
|
|
3122
|
+
NsCardContent.ICompetency = ICompetency;
|
|
3123
|
+
if (false) {
|
|
3124
|
+
/** @type {?} */
|
|
3125
|
+
ICompetency.prototype.competencyArea;
|
|
3126
|
+
/** @type {?} */
|
|
3127
|
+
ICompetency.prototype.competencyObject;
|
|
3128
|
+
}
|
|
3129
|
+
var EContentStatus;
|
|
3130
|
+
(function (EContentStatus) {
|
|
3131
|
+
EContentStatus["LIVE"] = "Live";
|
|
3132
|
+
EContentStatus["EXPIRED"] = "Expired";
|
|
3133
|
+
EContentStatus["DELETED"] = "Deleted";
|
|
3134
|
+
EContentStatus["MARK_FOR_DELETION"] = "MarkedForDeletion";
|
|
3135
|
+
})(EContentStatus = NsCardContent.EContentStatus || (NsCardContent.EContentStatus = {}));
|
|
3136
|
+
var ACBPConst;
|
|
3137
|
+
(function (ACBPConst) {
|
|
3138
|
+
ACBPConst["UPCOMING"] = "upcoming";
|
|
3139
|
+
ACBPConst["ALL"] = "All";
|
|
3140
|
+
ACBPConst["OVERDUE"] = "overdue";
|
|
3141
|
+
ACBPConst["SUCCESS"] = "success";
|
|
3142
|
+
})(ACBPConst = NsCardContent.ACBPConst || (NsCardContent.ACBPConst = {}));
|
|
3143
|
+
var IGOTConst;
|
|
3144
|
+
(function (IGOTConst) {
|
|
3145
|
+
IGOTConst["COMPETENCIES"] = "competencies_v5";
|
|
3146
|
+
IGOTConst["RETIRED"] = "Retired";
|
|
3147
|
+
})(IGOTConst = NsCardContent.IGOTConst || (NsCardContent.IGOTConst = {}));
|
|
3148
|
+
})(NsCardContent || (NsCardContent = {}));
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* @fileoverview added by tsickle
|
|
3152
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3153
|
+
*/
|
|
3154
|
+
/** @type {?} */
|
|
3155
|
+
var dayjs = dayjs_
|
|
3156
|
+
// import { environment } from 'src/environments/environment'
|
|
3157
|
+
;
|
|
3158
|
+
/** @type {?} */
|
|
3159
|
+
var PROTECTED_SLAG_V8$1 = '/apis/protected/v8';
|
|
3160
|
+
var ɵ0$1 = /**
|
|
3161
|
+
* @param {?} userId
|
|
3162
|
+
* @return {?}
|
|
3163
|
+
*/
|
|
3164
|
+
function (userId) {
|
|
3165
|
+
return PROTECTED_SLAG_V8$1 + "/user/group/fetchUserGroup?userId=" + userId;
|
|
3166
|
+
}, ɵ1$1 = /**
|
|
3167
|
+
* @param {?} userId
|
|
3168
|
+
* @return {?}
|
|
3169
|
+
*/
|
|
3170
|
+
function (userId) {
|
|
3171
|
+
// tslint:disable-next-line: max-line-length
|
|
3172
|
+
return "/apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=orgName,email&licenseDetails=name,description,url&fields=contentType,primaryCategory,courseCategory,topic,name,channel,mimeType,appIcon,gradeLevel,resourceType,identifier,medium,pkgVersion,board,subject,trackable,posterImage,duration,creatorLogo,license,version,versionKey,avgRating,additionalTags," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=name,endDate,startDate,status,enrollmentType,createdBy,certificates,batchAttributes";
|
|
3173
|
+
}, ɵ2$1 = /**
|
|
3174
|
+
* @param {?} userId
|
|
3175
|
+
* @return {?}
|
|
3176
|
+
*/
|
|
3177
|
+
function (userId) {
|
|
3178
|
+
// tslint:disable-next-line: max-line-length
|
|
3179
|
+
return "/apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=orgName,email&licenseDetails=name,description,url&fields=contentType,primaryCategory,courseCategory,topic,name,channel,mimeType,appIcon,gradeLevel,resourceType,identifier,medium,pkgVersion,board,subject,trackable,posterImage,duration,creatorLogo,license,version,versionKey,avgRating,additionalTags," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=name,endDate,startDate,status,enrollmentType,createdBy,certificates,batchAttributes&retiredCoursesEnabled=true";
|
|
3180
|
+
}, ɵ3$1 = /**
|
|
3181
|
+
* @param {?} userId
|
|
3182
|
+
* @param {?} orgdetails
|
|
3183
|
+
* @param {?} licenseDetails
|
|
3184
|
+
* @param {?} fields
|
|
3185
|
+
* @param {?} batchDetails
|
|
3186
|
+
* @return {?}
|
|
3187
|
+
*/
|
|
3188
|
+
function (userId, orgdetails, licenseDetails, fields, batchDetails) {
|
|
3189
|
+
// tslint:disable-next-line: max-line-length
|
|
3190
|
+
return "apis/proxies/v8/learner/course/v2/user/enrollment/list/" + userId + "?orgdetails=" + orgdetails + "&licenseDetails=" + licenseDetails + "&fields=" + fields + ",courseCategory," + NsCardContent.IGOTConst.COMPETENCIES + "&batchDetails=" + batchDetails;
|
|
3191
|
+
};
|
|
3192
|
+
/** @type {?} */
|
|
3193
|
+
var API_END_POINTS$1 = {
|
|
3194
|
+
FETCH_USER_GROUPS: (ɵ0$1),
|
|
3195
|
+
FETCH_CPB_PLANS: "/apis/proxies/v8/user/v1/cbplan",
|
|
3196
|
+
FETCH_USER_ENROLLMENT_LIST: (ɵ1$1),
|
|
3197
|
+
FETCH_USER_ENROLLMENT_LIST_PROFILE: (ɵ2$1),
|
|
3198
|
+
// tslint:disable-next-line: max-line-length
|
|
3199
|
+
FETCH_USER_ENROLLMENT_LIST_V2: (ɵ3$1),
|
|
3200
|
+
};
|
|
3201
|
+
var WidgetUserService = /** @class */ (function () {
|
|
3202
|
+
function WidgetUserService(environment, http) {
|
|
3203
|
+
this.http = http;
|
|
3204
|
+
this.environment = environment;
|
|
3205
|
+
}
|
|
3206
|
+
/**
|
|
3207
|
+
* @param {?} error
|
|
3208
|
+
* @return {?}
|
|
3209
|
+
*/
|
|
3210
|
+
WidgetUserService.prototype.handleError = /**
|
|
3211
|
+
* @param {?} error
|
|
3212
|
+
* @return {?}
|
|
3213
|
+
*/
|
|
3214
|
+
function (error) {
|
|
3215
|
+
/** @type {?} */
|
|
3216
|
+
var errorMessage = '';
|
|
3217
|
+
if (error.error instanceof ErrorEvent) {
|
|
3218
|
+
errorMessage = "Error: " + error.error.message;
|
|
3219
|
+
}
|
|
3220
|
+
return throwError(errorMessage);
|
|
3221
|
+
};
|
|
3222
|
+
/**
|
|
3223
|
+
* @param {?} userId
|
|
3224
|
+
* @return {?}
|
|
3225
|
+
*/
|
|
3226
|
+
WidgetUserService.prototype.fetchUserGroupDetails = /**
|
|
3227
|
+
* @param {?} userId
|
|
3228
|
+
* @return {?}
|
|
3229
|
+
*/
|
|
3230
|
+
function (userId) {
|
|
3231
|
+
return this.http
|
|
3232
|
+
.get(API_END_POINTS$1.FETCH_USER_GROUPS(userId))
|
|
3233
|
+
.pipe(catchError(this.handleError));
|
|
3234
|
+
};
|
|
3235
|
+
// tslint:disable-next-line: max-line-length
|
|
3236
|
+
// tslint:disable-next-line: max-line-length
|
|
3237
|
+
/**
|
|
3238
|
+
* @param {?} userId
|
|
3239
|
+
* @param {?=} queryParams
|
|
3240
|
+
* @return {?}
|
|
3241
|
+
*/
|
|
3242
|
+
WidgetUserService.prototype.fetchUserBatchList =
|
|
3243
|
+
// tslint:disable-next-line: max-line-length
|
|
3244
|
+
/**
|
|
3245
|
+
* @param {?} userId
|
|
3246
|
+
* @param {?=} queryParams
|
|
3573
3247
|
* @return {?}
|
|
3574
3248
|
*/
|
|
3575
|
-
function () {
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
this.translate.use(lang);
|
|
3583
|
-
localStorage.setItem('websiteLanguage', lang);
|
|
3584
|
-
}
|
|
3585
|
-
else {
|
|
3586
|
-
if (localStorage.getItem('websiteLanguage')) {
|
|
3587
|
-
// this.translate.setDefaultLang('en')
|
|
3588
|
-
/** @type {?} */
|
|
3589
|
-
var lang = JSON.stringify(localStorage.getItem('websiteLanguage'));
|
|
3590
|
-
lang = lang.replace(/\"/g, '');
|
|
3591
|
-
this.translate.use(lang);
|
|
3592
|
-
}
|
|
3593
|
-
else {
|
|
3594
|
-
this.translate.setDefaultLang('en');
|
|
3595
|
-
localStorage.setItem('websiteLanguage', 'en');
|
|
3596
|
-
}
|
|
3597
|
-
}
|
|
3249
|
+
function (userId, queryParams) {
|
|
3250
|
+
var _this = this;
|
|
3251
|
+
/** @type {?} */
|
|
3252
|
+
var path = '';
|
|
3253
|
+
if (queryParams) {
|
|
3254
|
+
// tslint:disable-next-line: max-line-length
|
|
3255
|
+
path = API_END_POINTS$1.FETCH_USER_ENROLLMENT_LIST_V2(userId, queryParams.orgdetails, queryParams.licenseDetails, queryParams.fields, queryParams.batchDetails);
|
|
3598
3256
|
}
|
|
3599
3257
|
else {
|
|
3600
|
-
|
|
3601
|
-
|
|
3258
|
+
path = API_END_POINTS$1.FETCH_USER_ENROLLMENT_LIST(userId);
|
|
3259
|
+
}
|
|
3260
|
+
/** @type {?} */
|
|
3261
|
+
var headers = new HttpHeaders({
|
|
3262
|
+
'Cache-Control': 'no-cache, no-store, must-revalidate, post-check=0, pre-check=0',
|
|
3263
|
+
Pragma: 'no-cache',
|
|
3264
|
+
Expires: '0',
|
|
3265
|
+
});
|
|
3266
|
+
if (this.checkStorageData('enrollmentService', 'enrollmentData')) {
|
|
3267
|
+
/** @type {?} */
|
|
3268
|
+
var result = this.http.get(path, { headers: headers }).pipe(catchError(this.handleError), map((/**
|
|
3269
|
+
* @param {?} data
|
|
3270
|
+
* @return {?}
|
|
3271
|
+
*/
|
|
3272
|
+
function (data) {
|
|
3602
3273
|
/** @type {?} */
|
|
3603
|
-
var
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3274
|
+
var coursesData = [];
|
|
3275
|
+
if (data && data.result && data.result.courses) {
|
|
3276
|
+
data.result.courses.forEach((/**
|
|
3277
|
+
* @param {?} content
|
|
3278
|
+
* @return {?}
|
|
3279
|
+
*/
|
|
3280
|
+
function (content) {
|
|
3281
|
+
if (content.contentStatus) {
|
|
3282
|
+
delete content.contentStatus;
|
|
3283
|
+
}
|
|
3284
|
+
coursesData.push(content);
|
|
3285
|
+
}));
|
|
3286
|
+
_this.storeUserEnrollmentInfo(data.result.userCourseEnrolmentInfo, data.result.courses.length);
|
|
3287
|
+
data.result.courses = coursesData;
|
|
3288
|
+
if (data.result.courses.length < 200) {
|
|
3289
|
+
localStorage.removeItem('enrollmentData');
|
|
3290
|
+
_this.setTime('enrollmentService');
|
|
3291
|
+
localStorage.setItem('enrollmentData', JSON.stringify(data.result));
|
|
3292
|
+
_this.mapEnrollmentData(data.result);
|
|
3293
|
+
return data.result;
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
_this.mapEnrollmentData(data.result);
|
|
3297
|
+
return data.result;
|
|
3298
|
+
})));
|
|
3299
|
+
return result;
|
|
3607
3300
|
}
|
|
3301
|
+
return this.getData('enrollmentData');
|
|
3608
3302
|
};
|
|
3303
|
+
// tslint:disable-next-line: max-line-length
|
|
3304
|
+
// tslint:disable-next-line: max-line-length
|
|
3609
3305
|
/**
|
|
3610
|
-
* @param {?}
|
|
3611
|
-
* @param {
|
|
3612
|
-
* @param {?} subtype
|
|
3306
|
+
* @param {?} userId
|
|
3307
|
+
* @param {?=} queryParams
|
|
3613
3308
|
* @return {?}
|
|
3614
3309
|
*/
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
* @param {?}
|
|
3310
|
+
WidgetUserService.prototype.fetchProfileUserBatchList =
|
|
3311
|
+
// tslint:disable-next-line: max-line-length
|
|
3312
|
+
/**
|
|
3313
|
+
* @param {?} userId
|
|
3314
|
+
* @param {?=} queryParams
|
|
3619
3315
|
* @return {?}
|
|
3620
3316
|
*/
|
|
3621
|
-
function (
|
|
3317
|
+
function (userId, queryParams) {
|
|
3622
3318
|
/** @type {?} */
|
|
3623
|
-
var
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3319
|
+
var path = '';
|
|
3320
|
+
if (queryParams) {
|
|
3321
|
+
// tslint:disable-next-line: max-line-length
|
|
3322
|
+
path = API_END_POINTS$1.FETCH_USER_ENROLLMENT_LIST_V2(userId, queryParams.orgdetails, queryParams.licenseDetails, queryParams.fields, queryParams.batchDetails);
|
|
3323
|
+
}
|
|
3324
|
+
else {
|
|
3325
|
+
path = API_END_POINTS$1.FETCH_USER_ENROLLMENT_LIST_PROFILE(userId);
|
|
3630
3326
|
}
|
|
3631
|
-
// tslint:disable-next-line: prefer-template
|
|
3632
3327
|
/** @type {?} */
|
|
3633
|
-
var
|
|
3634
|
-
|
|
3328
|
+
var headers = new HttpHeaders({
|
|
3329
|
+
'Cache-Control': 'no-cache, no-store, must-revalidate, post-check=0, pre-check=0',
|
|
3330
|
+
Pragma: 'no-cache',
|
|
3331
|
+
Expires: '0',
|
|
3332
|
+
});
|
|
3333
|
+
return this.http
|
|
3334
|
+
.get(path, { headers: headers })
|
|
3335
|
+
.pipe(catchError(this.handleError), map((/**
|
|
3336
|
+
* @param {?} data
|
|
3337
|
+
* @return {?}
|
|
3338
|
+
*/
|
|
3339
|
+
function (data) { return data.result; })));
|
|
3340
|
+
// if (this.checkStorageData('enrollmentService')) {
|
|
3341
|
+
// const result: any = this.http.get(path, { headers }).pipe(catchError(this.handleError), map(
|
|
3342
|
+
// (data: any) => {
|
|
3343
|
+
// localStorage.setItem('enrollmentData', JSON.stringify(data.result))
|
|
3344
|
+
// this.mapEnrollmentData(data.result)
|
|
3345
|
+
// return data.result
|
|
3346
|
+
// }
|
|
3347
|
+
// )
|
|
3348
|
+
// )
|
|
3349
|
+
// this.setTime('enrollmentService')
|
|
3350
|
+
// return result
|
|
3351
|
+
// }
|
|
3352
|
+
// return this.getData('enrollmentData')
|
|
3635
3353
|
};
|
|
3636
3354
|
/**
|
|
3637
|
-
* @param {?}
|
|
3638
|
-
* @param {?}
|
|
3639
|
-
* @param {?} subtype
|
|
3355
|
+
* @param {?} key
|
|
3356
|
+
* @param {?} dataKey
|
|
3640
3357
|
* @return {?}
|
|
3641
3358
|
*/
|
|
3642
|
-
|
|
3643
|
-
* @param {?}
|
|
3644
|
-
* @param {?}
|
|
3645
|
-
* @param {?} subtype
|
|
3359
|
+
WidgetUserService.prototype.checkStorageData = /**
|
|
3360
|
+
* @param {?} key
|
|
3361
|
+
* @param {?} dataKey
|
|
3646
3362
|
* @return {?}
|
|
3647
3363
|
*/
|
|
3648
|
-
function (
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
nlabel = nlabel && nlabel.toLowerCase();
|
|
3364
|
+
function (key, dataKey) {
|
|
3365
|
+
/** @type {?} */
|
|
3366
|
+
var checkTime = localStorage.getItem('timeCheck');
|
|
3367
|
+
if (checkTime) {
|
|
3653
3368
|
/** @type {?} */
|
|
3654
|
-
var
|
|
3655
|
-
|
|
3656
|
-
* @param {?} w
|
|
3657
|
-
* @param {?} index
|
|
3658
|
-
* @return {?}
|
|
3659
|
-
*/
|
|
3660
|
-
function (w, index) {
|
|
3661
|
-
if (index !== 0) {
|
|
3662
|
-
sl_1[index] = w[0].toUpperCase() + w.slice(1);
|
|
3663
|
-
}
|
|
3664
|
-
}));
|
|
3665
|
-
nlabel = sl_1.join('');
|
|
3666
|
-
nlabel = nlabel.replace(/\s/g, '');
|
|
3667
|
-
if (subtype) {
|
|
3668
|
-
// tslint:disable-next-line: prefer-template
|
|
3369
|
+
var parsedData = JSON.parse(checkTime);
|
|
3370
|
+
if (parsedData[key]) {
|
|
3669
3371
|
/** @type {?} */
|
|
3670
|
-
var
|
|
3671
|
-
|
|
3372
|
+
var date = dayjs();
|
|
3373
|
+
/** @type {?} */
|
|
3374
|
+
var diffMin = date.diff(parsedData[key], 'minute');
|
|
3375
|
+
/** @type {?} */
|
|
3376
|
+
var timeCheck = this.environment.apiCache || 0;
|
|
3377
|
+
if (diffMin >= timeCheck) {
|
|
3378
|
+
return true;
|
|
3379
|
+
}
|
|
3380
|
+
return localStorage.getItem(dataKey) ? false : true;
|
|
3672
3381
|
}
|
|
3673
|
-
|
|
3674
|
-
/** @type {?} */
|
|
3675
|
-
var translationKeyn = type + '.' + nlabel;
|
|
3676
|
-
return this.translate.instant(translationKeyn);
|
|
3382
|
+
return true;
|
|
3677
3383
|
}
|
|
3678
|
-
return
|
|
3384
|
+
return true;
|
|
3679
3385
|
};
|
|
3680
3386
|
/**
|
|
3681
|
-
* @param {?}
|
|
3682
|
-
* @param {?} type
|
|
3683
|
-
* @param {?} subtype
|
|
3387
|
+
* @param {?} key
|
|
3684
3388
|
* @return {?}
|
|
3685
3389
|
*/
|
|
3686
|
-
|
|
3687
|
-
* @param {?}
|
|
3688
|
-
* @param {?} type
|
|
3689
|
-
* @param {?} subtype
|
|
3390
|
+
WidgetUserService.prototype.getData = /**
|
|
3391
|
+
* @param {?} key
|
|
3690
3392
|
* @return {?}
|
|
3691
3393
|
*/
|
|
3692
|
-
function (
|
|
3394
|
+
function (key) {
|
|
3395
|
+
return Observable.of(JSON.parse(localStorage.getItem(key) || '{}'));
|
|
3396
|
+
};
|
|
3397
|
+
/**
|
|
3398
|
+
* @param {?} key
|
|
3399
|
+
* @return {?}
|
|
3400
|
+
*/
|
|
3401
|
+
WidgetUserService.prototype.getSavedData = /**
|
|
3402
|
+
* @param {?} key
|
|
3403
|
+
* @return {?}
|
|
3404
|
+
*/
|
|
3405
|
+
function (key) {
|
|
3406
|
+
return JSON.parse(localStorage.getItem(key) || '');
|
|
3407
|
+
};
|
|
3408
|
+
/**
|
|
3409
|
+
* @param {?} key
|
|
3410
|
+
* @return {?}
|
|
3411
|
+
*/
|
|
3412
|
+
WidgetUserService.prototype.setTime = /**
|
|
3413
|
+
* @param {?} key
|
|
3414
|
+
* @return {?}
|
|
3415
|
+
*/
|
|
3416
|
+
function (key) {
|
|
3693
3417
|
/** @type {?} */
|
|
3694
|
-
var
|
|
3418
|
+
var checkTime = localStorage.getItem('timeCheck');
|
|
3419
|
+
if (checkTime) {
|
|
3420
|
+
/** @type {?} */
|
|
3421
|
+
var parsedData = JSON.parse(checkTime);
|
|
3422
|
+
parsedData[key] = new Date().getTime();
|
|
3423
|
+
localStorage.setItem('timeCheck', JSON.stringify(parsedData));
|
|
3424
|
+
}
|
|
3425
|
+
else {
|
|
3426
|
+
/** @type {?} */
|
|
3427
|
+
var data = {};
|
|
3428
|
+
data[key] = new Date().getTime();
|
|
3429
|
+
localStorage.setItem('timeCheck', JSON.stringify(data));
|
|
3430
|
+
}
|
|
3431
|
+
};
|
|
3432
|
+
/**
|
|
3433
|
+
* @param {?} key
|
|
3434
|
+
* @return {?}
|
|
3435
|
+
*/
|
|
3436
|
+
WidgetUserService.prototype.resetTime = /**
|
|
3437
|
+
* @param {?} key
|
|
3438
|
+
* @return {?}
|
|
3439
|
+
*/
|
|
3440
|
+
function (key) {
|
|
3695
3441
|
/** @type {?} */
|
|
3696
|
-
var
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
if (index !== 0) {
|
|
3704
|
-
sl[index] = w[0].toUpperCase() + w.slice(1);
|
|
3442
|
+
var checkTime = localStorage.getItem('timeCheck');
|
|
3443
|
+
if (checkTime) {
|
|
3444
|
+
/** @type {?} */
|
|
3445
|
+
var parsedData = JSON.parse(checkTime);
|
|
3446
|
+
if (parsedData[key]) {
|
|
3447
|
+
delete parsedData[key];
|
|
3448
|
+
localStorage.setItem('timeCheck', JSON.stringify(parsedData));
|
|
3705
3449
|
}
|
|
3706
|
-
}
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3450
|
+
}
|
|
3451
|
+
};
|
|
3452
|
+
/**
|
|
3453
|
+
* @return {?}
|
|
3454
|
+
*/
|
|
3455
|
+
WidgetUserService.prototype.fetchCbpPlanList = /**
|
|
3456
|
+
* @return {?}
|
|
3457
|
+
*/
|
|
3458
|
+
function () {
|
|
3459
|
+
// let data = JSON.parse(localStorage.getItem('cbpData')|| '')
|
|
3460
|
+
// if(!data) {
|
|
3461
|
+
// this.http.get(API_END_POINTS.FETCH_CPB_PLANS).pipe(catchError(this.handleError), map(
|
|
3462
|
+
// (data: any) => {
|
|
3463
|
+
// const courseData = this.mapData(data.result)
|
|
3464
|
+
// return courseData
|
|
3465
|
+
// }
|
|
3466
|
+
// )
|
|
3467
|
+
// )
|
|
3468
|
+
// } else {
|
|
3469
|
+
// return this.getData('cbpData')
|
|
3470
|
+
var _this = this;
|
|
3471
|
+
// }
|
|
3472
|
+
if (this.checkStorageData('cbpService', 'cbpData')) {
|
|
3711
3473
|
/** @type {?} */
|
|
3712
|
-
var
|
|
3713
|
-
|
|
3474
|
+
var result = this.http.get(API_END_POINTS$1.FETCH_CPB_PLANS).pipe(catchError(this.handleError), map((/**
|
|
3475
|
+
* @param {?} data
|
|
3476
|
+
* @return {?}
|
|
3477
|
+
*/
|
|
3478
|
+
function (data) { return __awaiter(_this, void 0, void 0, function () {
|
|
3479
|
+
return __generator(this, function (_a) {
|
|
3480
|
+
switch (_a.label) {
|
|
3481
|
+
case 0: return [4 /*yield*/, this.mapData(data.result)];
|
|
3482
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
3483
|
+
}
|
|
3484
|
+
});
|
|
3485
|
+
}); })));
|
|
3486
|
+
this.setTime('cbpService');
|
|
3487
|
+
return result;
|
|
3714
3488
|
}
|
|
3715
|
-
|
|
3716
|
-
/** @type {?} */
|
|
3717
|
-
var translationKeyn = type + '.' + nlabel;
|
|
3718
|
-
return this.translate.instant(translationKeyn);
|
|
3489
|
+
return this.getData('cbpData');
|
|
3719
3490
|
};
|
|
3720
3491
|
/**
|
|
3721
3492
|
* @param {?} data
|
|
3722
3493
|
* @return {?}
|
|
3723
3494
|
*/
|
|
3724
|
-
|
|
3495
|
+
WidgetUserService.prototype.mapData = /**
|
|
3725
3496
|
* @param {?} data
|
|
3726
3497
|
* @return {?}
|
|
3727
3498
|
*/
|
|
3728
3499
|
function (data) {
|
|
3729
|
-
return
|
|
3500
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3501
|
+
var contentNew, todayDate, enrollList, sortedData, uniqueUsersByID, sortedByEndDate, sortedByStatus;
|
|
3502
|
+
return __generator(this, function (_a) {
|
|
3503
|
+
contentNew = [];
|
|
3504
|
+
todayDate = dayjs().format('YYYY-MM-DD');
|
|
3505
|
+
enrollList = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
|
|
3506
|
+
if (data && data.count) {
|
|
3507
|
+
data.content.forEach((/**
|
|
3508
|
+
* @param {?} c
|
|
3509
|
+
* @return {?}
|
|
3510
|
+
*/
|
|
3511
|
+
function (c) {
|
|
3512
|
+
c.contentList.forEach((/**
|
|
3513
|
+
* @param {?} childData
|
|
3514
|
+
* @return {?}
|
|
3515
|
+
*/
|
|
3516
|
+
function (childData) {
|
|
3517
|
+
/** @type {?} */
|
|
3518
|
+
var childEnrollData = enrollList[childData.identifier];
|
|
3519
|
+
/** @type {?} */
|
|
3520
|
+
var endDate = dayjs(c.endDate).format('YYYY-MM-DD');
|
|
3521
|
+
/** @type {?} */
|
|
3522
|
+
var daysCount = dayjs(endDate).diff(todayDate, 'day');
|
|
3523
|
+
childData['planDuration'] = daysCount < 0 ? NsCardContent.ACBPConst.OVERDUE : daysCount > 29
|
|
3524
|
+
? NsCardContent.ACBPConst.SUCCESS : NsCardContent.ACBPConst.UPCOMING;
|
|
3525
|
+
childData['endDate'] = c.endDate;
|
|
3526
|
+
childData['parentId'] = c.id;
|
|
3527
|
+
childData['planType'] = 'cbPlan';
|
|
3528
|
+
if (childData.status !== NsCardContent.IGOTConst.RETIRED) {
|
|
3529
|
+
contentNew.push(childData);
|
|
3530
|
+
}
|
|
3531
|
+
else {
|
|
3532
|
+
if (childEnrollData && childEnrollData.status === 2) {
|
|
3533
|
+
contentNew.push(childData);
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
/** @type {?} */
|
|
3537
|
+
var competencyArea = [];
|
|
3538
|
+
/** @type {?} */
|
|
3539
|
+
var competencyTheme = [];
|
|
3540
|
+
/** @type {?} */
|
|
3541
|
+
var competencyThemeType = [];
|
|
3542
|
+
/** @type {?} */
|
|
3543
|
+
var competencySubTheme = [];
|
|
3544
|
+
/** @type {?} */
|
|
3545
|
+
var competencyAreaId = [];
|
|
3546
|
+
/** @type {?} */
|
|
3547
|
+
var competencyThemeId = [];
|
|
3548
|
+
/** @type {?} */
|
|
3549
|
+
var competencySubThemeId = [];
|
|
3550
|
+
childData['contentStatus'] = 0;
|
|
3551
|
+
if (childEnrollData) {
|
|
3552
|
+
childData['contentStatus'] = childEnrollData.status;
|
|
3553
|
+
}
|
|
3554
|
+
if (childData.competencies_v5) {
|
|
3555
|
+
childData.competencies_v5.forEach((/**
|
|
3556
|
+
* @param {?} element
|
|
3557
|
+
* @return {?}
|
|
3558
|
+
*/
|
|
3559
|
+
function (element) {
|
|
3560
|
+
if (!competencyArea.includes(element.competencyArea)) {
|
|
3561
|
+
competencyArea.push(element.competencyArea);
|
|
3562
|
+
competencyAreaId.push(element.competencyAreaId);
|
|
3563
|
+
}
|
|
3564
|
+
if (!competencyTheme.includes(element.competencyTheme)) {
|
|
3565
|
+
competencyTheme.push(element.competencyTheme);
|
|
3566
|
+
competencyThemeId.push(element.competencyThemeId);
|
|
3567
|
+
}
|
|
3568
|
+
if (!competencyThemeType.includes(element.competencyThemeType)) {
|
|
3569
|
+
competencyThemeType.push(element.competencyThemeType);
|
|
3570
|
+
}
|
|
3571
|
+
if (!competencySubTheme.includes(element.competencySubTheme)) {
|
|
3572
|
+
competencySubTheme.push(element.competencySubTheme);
|
|
3573
|
+
competencySubThemeId.push(element.competencySubThemeId);
|
|
3574
|
+
}
|
|
3575
|
+
}));
|
|
3576
|
+
}
|
|
3577
|
+
childData['competencyArea'] = competencyArea;
|
|
3578
|
+
childData['competencyTheme'] = competencyTheme;
|
|
3579
|
+
childData['competencyThemeType'] = competencyThemeType;
|
|
3580
|
+
childData['competencySubTheme'] = competencySubTheme;
|
|
3581
|
+
childData['competencyAreaId'] = competencyAreaId;
|
|
3582
|
+
childData['competencyThemeId'] = competencyThemeId;
|
|
3583
|
+
childData['competencySubThemeId'] = competencySubThemeId;
|
|
3584
|
+
}));
|
|
3585
|
+
}));
|
|
3586
|
+
if (contentNew.length > 1) {
|
|
3587
|
+
sortedData = contentNew.sort((/**
|
|
3588
|
+
* @param {?} a
|
|
3589
|
+
* @param {?} b
|
|
3590
|
+
* @return {?}
|
|
3591
|
+
*/
|
|
3592
|
+
function (a, b) {
|
|
3593
|
+
/** @type {?} */
|
|
3594
|
+
var firstDate = new Date(a.endDate);
|
|
3595
|
+
/** @type {?} */
|
|
3596
|
+
var secondDate = new Date(b.endDate);
|
|
3597
|
+
return secondDate > firstDate ? 1 : -1;
|
|
3598
|
+
}));
|
|
3599
|
+
uniqueUsersByID = uniqBy(sortedData, 'identifier');
|
|
3600
|
+
sortedByEndDate = orderBy(uniqueUsersByID, ['endDate'], ['asc']);
|
|
3601
|
+
sortedByStatus = orderBy(sortedByEndDate, ['contentStatus'], ['asc']);
|
|
3602
|
+
localStorage.setItem('cbpData', JSON.stringify(sortedByStatus));
|
|
3603
|
+
return [2 /*return*/, sortedByStatus];
|
|
3604
|
+
}
|
|
3605
|
+
localStorage.setItem('cbpData', JSON.stringify(contentNew));
|
|
3606
|
+
return [2 /*return*/, contentNew];
|
|
3607
|
+
}
|
|
3608
|
+
localStorage.setItem('cbpData', JSON.stringify([]));
|
|
3609
|
+
return [2 /*return*/, []];
|
|
3610
|
+
});
|
|
3611
|
+
});
|
|
3730
3612
|
};
|
|
3731
3613
|
/**
|
|
3732
|
-
* @param {?}
|
|
3733
|
-
* @param {?} lang
|
|
3734
|
-
* @param {?} userid
|
|
3614
|
+
* @param {?} courseData
|
|
3735
3615
|
* @return {?}
|
|
3736
3616
|
*/
|
|
3737
|
-
|
|
3738
|
-
* @param {?}
|
|
3739
|
-
* @param {?} lang
|
|
3740
|
-
* @param {?} userid
|
|
3617
|
+
WidgetUserService.prototype.mapEnrollmentData = /**
|
|
3618
|
+
* @param {?} courseData
|
|
3741
3619
|
* @return {?}
|
|
3742
3620
|
*/
|
|
3743
|
-
function (
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
webPortalLang: this.selectedLang,
|
|
3755
|
-
},
|
|
3756
|
-
},
|
|
3757
|
-
},
|
|
3758
|
-
};
|
|
3759
|
-
this.editProfileDetailsAPI(reqUpdates).subscribe();
|
|
3621
|
+
function (courseData) {
|
|
3622
|
+
/** @type {?} */
|
|
3623
|
+
var enrollData = {};
|
|
3624
|
+
if (courseData && courseData.courses.length) {
|
|
3625
|
+
courseData.courses.forEach((/**
|
|
3626
|
+
* @param {?} data
|
|
3627
|
+
* @return {?}
|
|
3628
|
+
*/
|
|
3629
|
+
function (data) {
|
|
3630
|
+
enrollData[data.collectionId] = data;
|
|
3631
|
+
}));
|
|
3760
3632
|
}
|
|
3633
|
+
localStorage.removeItem('enrollmentMapData');
|
|
3634
|
+
localStorage.setItem('enrollmentMapData', JSON.stringify(enrollData));
|
|
3761
3635
|
};
|
|
3762
|
-
|
|
3636
|
+
/**
|
|
3637
|
+
* @param {?} enrollmentData
|
|
3638
|
+
* @param {?} enrolledCourseCount
|
|
3639
|
+
* @return {?}
|
|
3640
|
+
*/
|
|
3641
|
+
WidgetUserService.prototype.storeUserEnrollmentInfo = /**
|
|
3642
|
+
* @param {?} enrollmentData
|
|
3643
|
+
* @param {?} enrolledCourseCount
|
|
3644
|
+
* @return {?}
|
|
3645
|
+
*/
|
|
3646
|
+
function (enrollmentData, enrolledCourseCount) {
|
|
3647
|
+
/** @type {?} */
|
|
3648
|
+
var userData = {
|
|
3649
|
+
enrolledCourseCount: enrolledCourseCount,
|
|
3650
|
+
userCourseEnrolmentInfo: enrollmentData,
|
|
3651
|
+
};
|
|
3652
|
+
localStorage.removeItem('userEnrollmentCount');
|
|
3653
|
+
localStorage.setItem('userEnrollmentCount', JSON.stringify(userData));
|
|
3654
|
+
};
|
|
3655
|
+
WidgetUserService.decorators = [
|
|
3763
3656
|
{ type: Injectable, args: [{
|
|
3764
3657
|
providedIn: 'root',
|
|
3765
3658
|
},] }
|
|
3766
3659
|
];
|
|
3767
3660
|
/** @nocollapse */
|
|
3768
|
-
|
|
3769
|
-
{ type:
|
|
3770
|
-
{ type: HttpClient }
|
|
3771
|
-
{ type: ConfigurationsService }
|
|
3661
|
+
WidgetUserService.ctorParameters = function () { return [
|
|
3662
|
+
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
3663
|
+
{ type: HttpClient }
|
|
3772
3664
|
]; };
|
|
3773
|
-
/** @nocollapse */
|
|
3774
|
-
return
|
|
3665
|
+
/** @nocollapse */ WidgetUserService.ngInjectableDef = ɵɵdefineInjectable({ factory: function WidgetUserService_Factory() { return new WidgetUserService(ɵɵinject("environment"), ɵɵinject(HttpClient)); }, token: WidgetUserService, providedIn: "root" });
|
|
3666
|
+
return WidgetUserService;
|
|
3775
3667
|
}());
|
|
3776
3668
|
if (false) {
|
|
3777
3669
|
/** @type {?} */
|
|
3778
|
-
|
|
3779
|
-
/** @type {?} */
|
|
3780
|
-
MultilingualTranslationsService.prototype.languageSelected;
|
|
3781
|
-
/** @type {?} */
|
|
3782
|
-
MultilingualTranslationsService.prototype.languageSelectedObservable;
|
|
3783
|
-
/** @type {?} */
|
|
3784
|
-
MultilingualTranslationsService.prototype.editProfileDetails;
|
|
3785
|
-
/**
|
|
3786
|
-
* @type {?}
|
|
3787
|
-
* @private
|
|
3788
|
-
*/
|
|
3789
|
-
MultilingualTranslationsService.prototype.translate;
|
|
3790
|
-
/**
|
|
3791
|
-
* @type {?}
|
|
3792
|
-
* @private
|
|
3793
|
-
*/
|
|
3794
|
-
MultilingualTranslationsService.prototype.http;
|
|
3670
|
+
WidgetUserService.prototype.environment;
|
|
3795
3671
|
/**
|
|
3796
3672
|
* @type {?}
|
|
3797
3673
|
* @private
|
|
3798
3674
|
*/
|
|
3799
|
-
|
|
3675
|
+
WidgetUserService.prototype.http;
|
|
3800
3676
|
}
|
|
3801
3677
|
|
|
3802
3678
|
/**
|
|
@@ -4357,6 +4233,9 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4357
4233
|
this.fetchAllPlaylistSearch(strip, calculateParentStatus);
|
|
4358
4234
|
this.fetchPlaylistReadData(strip, calculateParentStatus);
|
|
4359
4235
|
this.fetchCiosContentData(strip, calculateParentStatus);
|
|
4236
|
+
// this.enrollInterval = setInterval(() => {
|
|
4237
|
+
// this.fetchAllCbpPlans(strip, calculateParentStatus)
|
|
4238
|
+
// }, 1000)
|
|
4360
4239
|
};
|
|
4361
4240
|
/**
|
|
4362
4241
|
* @param {?} strip
|
|
@@ -4599,12 +4478,12 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4599
4478
|
function (strip, calculateParentStatus) {
|
|
4600
4479
|
if (calculateParentStatus === void 0) { calculateParentStatus = true; }
|
|
4601
4480
|
return __awaiter(this, void 0, void 0, function () {
|
|
4602
|
-
var originalFilters, firstTab, allTabs, currentTabFromMap,
|
|
4481
|
+
var originalFilters, firstTab, allTabs, currentTabFromMap, response_1, error_1;
|
|
4603
4482
|
var _this = this;
|
|
4604
4483
|
return __generator(this, function (_a) {
|
|
4605
4484
|
switch (_a.label) {
|
|
4606
4485
|
case 0:
|
|
4607
|
-
if (!(strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length)) return [3 /*break*/,
|
|
4486
|
+
if (!(strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length)) return [3 /*break*/, 4];
|
|
4608
4487
|
// if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
|
|
4609
4488
|
// if (this.configSvc.activeLocale) {
|
|
4610
4489
|
// strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
|
|
@@ -4633,75 +4512,44 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4633
4512
|
this.getTabDataByNewReqSearchV6(strip, 0, currentTabFromMap, calculateParentStatus);
|
|
4634
4513
|
}
|
|
4635
4514
|
}
|
|
4636
|
-
return [3 /*break*/,
|
|
4515
|
+
return [3 /*break*/, 4];
|
|
4637
4516
|
case 1:
|
|
4638
|
-
_a.trys.push([1,
|
|
4517
|
+
_a.trys.push([1, 3, , 4]);
|
|
4639
4518
|
return [4 /*yield*/, this.searchV6Request(strip, strip.request, calculateParentStatus)];
|
|
4640
4519
|
case 2:
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
if (
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
}));
|
|
4666
|
-
return [2 /*return*/, enrollData];
|
|
4667
|
-
}
|
|
4668
|
-
else {
|
|
4669
|
-
return [2 /*return*/, {}];
|
|
4670
|
-
}
|
|
4671
|
-
return [2 /*return*/];
|
|
4672
|
-
});
|
|
4673
|
-
}); })).catch((/**
|
|
4674
|
-
* @param {?} _err
|
|
4675
|
-
* @return {?}
|
|
4676
|
-
*/
|
|
4677
|
-
function (_err) {
|
|
4678
|
-
return {};
|
|
4679
|
-
}))];
|
|
4680
|
-
case 3:
|
|
4681
|
-
responseData = _a.sent();
|
|
4682
|
-
this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl, responseData);
|
|
4683
|
-
return [3 /*break*/, 5];
|
|
4684
|
-
case 4:
|
|
4685
|
-
this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
4686
|
-
_a.label = 5;
|
|
4687
|
-
case 5: return [3 /*break*/, 7];
|
|
4688
|
-
case 6:
|
|
4689
|
-
if (response.results.result.Event) {
|
|
4690
|
-
this.processStrip(strip, this.transformEventsToWidgets(response.results.result.Event, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
4520
|
+
response_1 = _a.sent();
|
|
4521
|
+
// console.log('calling after - response, ', response)
|
|
4522
|
+
if (response_1 && response_1.results) {
|
|
4523
|
+
// console.log('calling after-- ')
|
|
4524
|
+
if (response_1.results.result.content) {
|
|
4525
|
+
if (strip.key === 'scheduledAssessment') {
|
|
4526
|
+
this.enrollInterval = setInterval((/**
|
|
4527
|
+
* @return {?}
|
|
4528
|
+
*/
|
|
4529
|
+
function () {
|
|
4530
|
+
_this.checkInvitOnlyAssessments(response_1.results.result.content, strip, calculateParentStatus, response_1.viewMoreUrl);
|
|
4531
|
+
// tslint:disable-next-line
|
|
4532
|
+
}), 1000);
|
|
4533
|
+
}
|
|
4534
|
+
else {
|
|
4535
|
+
this.processStrip(strip, this.transformContentsToWidgets(response_1.results.result.content, strip), 'done', calculateParentStatus, response_1.viewMoreUrl);
|
|
4536
|
+
}
|
|
4537
|
+
}
|
|
4538
|
+
else if (response_1.results.result.Event) {
|
|
4539
|
+
this.processStrip(strip, this.transformEventsToWidgets(response_1.results.result.Event, strip), 'done', calculateParentStatus, response_1.viewMoreUrl);
|
|
4540
|
+
}
|
|
4541
|
+
else {
|
|
4542
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
4543
|
+
}
|
|
4691
4544
|
}
|
|
4692
4545
|
else {
|
|
4693
4546
|
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
4694
4547
|
}
|
|
4695
|
-
|
|
4696
|
-
case
|
|
4697
|
-
case 8:
|
|
4698
|
-
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
4699
|
-
_a.label = 9;
|
|
4700
|
-
case 9: return [3 /*break*/, 11];
|
|
4701
|
-
case 10:
|
|
4548
|
+
return [3 /*break*/, 4];
|
|
4549
|
+
case 3:
|
|
4702
4550
|
error_1 = _a.sent();
|
|
4703
|
-
return [3 /*break*/,
|
|
4704
|
-
case
|
|
4551
|
+
return [3 /*break*/, 4];
|
|
4552
|
+
case 4: return [2 /*return*/];
|
|
4705
4553
|
}
|
|
4706
4554
|
});
|
|
4707
4555
|
});
|
|
@@ -4711,7 +4559,6 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4711
4559
|
* @param {?} strip
|
|
4712
4560
|
* @param {?} calculateParentStatus
|
|
4713
4561
|
* @param {?} viewMoreUrl
|
|
4714
|
-
* @param {?} enrollmentData
|
|
4715
4562
|
* @return {?}
|
|
4716
4563
|
*/
|
|
4717
4564
|
ContentStripWithTabsLibComponent.prototype.checkInvitOnlyAssessments = /**
|
|
@@ -4719,12 +4566,12 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4719
4566
|
* @param {?} strip
|
|
4720
4567
|
* @param {?} calculateParentStatus
|
|
4721
4568
|
* @param {?} viewMoreUrl
|
|
4722
|
-
* @param {?} enrollmentData
|
|
4723
4569
|
* @return {?}
|
|
4724
4570
|
*/
|
|
4725
|
-
function (content, strip, calculateParentStatus, viewMoreUrl
|
|
4726
|
-
|
|
4727
|
-
|
|
4571
|
+
function (content, strip, calculateParentStatus, viewMoreUrl) {
|
|
4572
|
+
var _this = this;
|
|
4573
|
+
if (localStorage.getItem('enrollmentMapData')) {
|
|
4574
|
+
this.enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
|
|
4728
4575
|
/** @type {?} */
|
|
4729
4576
|
var filteredArray_1 = [];
|
|
4730
4577
|
/** @type {?} */
|
|
@@ -4734,10 +4581,10 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4734
4581
|
* @return {?}
|
|
4735
4582
|
*/
|
|
4736
4583
|
function (data) {
|
|
4737
|
-
if (
|
|
4738
|
-
if (
|
|
4584
|
+
if (_this.enrollmentMapData[data.identifier]) {
|
|
4585
|
+
if (_this.enrollmentMapData[data.identifier].status !== 2 && _this.enrollmentMapData[data.identifier].batch) {
|
|
4739
4586
|
/** @type {?} */
|
|
4740
|
-
var enrollData =
|
|
4587
|
+
var enrollData = _this.enrollmentMapData[data.identifier].batch;
|
|
4741
4588
|
/** @type {?} */
|
|
4742
4589
|
var endDate = new Date(enrollData.endDate).getTime()
|
|
4743
4590
|
// let endDate:any = '2024-07-7T00:00:00.000Z'
|
|
@@ -4746,8 +4593,8 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4746
4593
|
/** @type {?} */
|
|
4747
4594
|
var timeDuration = endDate - now_1;
|
|
4748
4595
|
if (timeDuration > 0) {
|
|
4749
|
-
data['batch'] =
|
|
4750
|
-
data['completionPercentage'] =
|
|
4596
|
+
data['batch'] = _this.enrollmentMapData[data.identifier].batch;
|
|
4597
|
+
data['completionPercentage'] = _this.enrollmentMapData[data.identifier].completionPercentage;
|
|
4751
4598
|
filteredArray_1.push(data);
|
|
4752
4599
|
}
|
|
4753
4600
|
}
|
|
@@ -4766,6 +4613,7 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
4766
4613
|
return dateA - dateB;
|
|
4767
4614
|
}));
|
|
4768
4615
|
this.processStrip(strip, this.transformContentsToWidgets(filteredArray_1, strip), 'done', calculateParentStatus, viewMoreUrl);
|
|
4616
|
+
clearInterval(this.enrollInterval);
|
|
4769
4617
|
}
|
|
4770
4618
|
};
|
|
4771
4619
|
/**
|
|
@@ -5481,15 +5329,14 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
5481
5329
|
function (strip, calculateParentStatus) {
|
|
5482
5330
|
if (calculateParentStatus === void 0) { calculateParentStatus = true; }
|
|
5483
5331
|
return __awaiter(this, void 0, void 0, function () {
|
|
5484
|
-
var courses, tabResults,
|
|
5332
|
+
var courses, tabResults, response;
|
|
5485
5333
|
return __generator(this, function (_a) {
|
|
5486
5334
|
switch (_a.label) {
|
|
5487
5335
|
case 0:
|
|
5488
|
-
if (!(strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length)) return [3 /*break*/,
|
|
5336
|
+
if (!(strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length)) return [3 /*break*/, 5];
|
|
5489
5337
|
courses = void 0;
|
|
5490
5338
|
tabResults = [];
|
|
5491
|
-
|
|
5492
|
-
return [4 /*yield*/, this.userSvc.fetchCbpPlanList(userId).toPromise()];
|
|
5339
|
+
return [4 /*yield*/, this.userSvc.fetchCbpPlanList().toPromise()];
|
|
5493
5340
|
case 1:
|
|
5494
5341
|
response = _a.sent();
|
|
5495
5342
|
if (!response) return [3 /*break*/, 4];
|
|
@@ -5503,7 +5350,36 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
5503
5350
|
case 3:
|
|
5504
5351
|
this.processStrip(strip, this.transformContentsToWidgets(courses, strip), 'done', calculateParentStatus, 'viewMoreUrl');
|
|
5505
5352
|
_a.label = 4;
|
|
5506
|
-
case 4:
|
|
5353
|
+
case 4:
|
|
5354
|
+
// this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
|
|
5355
|
+
// if (res) {
|
|
5356
|
+
// console.log(res,'===============================>')
|
|
5357
|
+
// courses = res
|
|
5358
|
+
// if (strip.tabs && strip.tabs.length) {
|
|
5359
|
+
// tabResults = this.splitCbpTabsData(courses, strip)
|
|
5360
|
+
// await this.processStrip(
|
|
5361
|
+
// strip,
|
|
5362
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
5363
|
+
// 'done',
|
|
5364
|
+
// calculateParentStatus,
|
|
5365
|
+
// '',
|
|
5366
|
+
// tabResults
|
|
5367
|
+
// )
|
|
5368
|
+
// } else {
|
|
5369
|
+
// this.processStrip(
|
|
5370
|
+
// strip,
|
|
5371
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
5372
|
+
// 'done',
|
|
5373
|
+
// calculateParentStatus,
|
|
5374
|
+
// 'viewMoreUrl',
|
|
5375
|
+
// )
|
|
5376
|
+
// }
|
|
5377
|
+
// }
|
|
5378
|
+
// }, (_err: any) => {
|
|
5379
|
+
// })
|
|
5380
|
+
clearInterval(this.enrollInterval);
|
|
5381
|
+
_a.label = 5;
|
|
5382
|
+
case 5: return [2 /*return*/];
|
|
5507
5383
|
}
|
|
5508
5384
|
});
|
|
5509
5385
|
});
|
|
@@ -6637,13 +6513,13 @@ var ContentStripWithTabsLibComponent = /** @class */ (function (_super) {
|
|
|
6637
6513
|
/** @nocollapse */
|
|
6638
6514
|
ContentStripWithTabsLibComponent.ctorParameters = function () { return [
|
|
6639
6515
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
6640
|
-
{ type:
|
|
6516
|
+
{ type: WidgetContentService },
|
|
6641
6517
|
{ type: LoggerService },
|
|
6642
6518
|
{ type: EventService },
|
|
6643
6519
|
{ type: ConfigurationsService$1 },
|
|
6644
6520
|
{ type: UtilityService },
|
|
6645
6521
|
{ type: Router },
|
|
6646
|
-
{ type:
|
|
6522
|
+
{ type: WidgetUserService },
|
|
6647
6523
|
{ type: TranslateService },
|
|
6648
6524
|
{ type: MultilingualTranslationsService }
|
|
6649
6525
|
]; };
|
|
@@ -6707,7 +6583,11 @@ if (false) {
|
|
|
6707
6583
|
/** @type {?} */
|
|
6708
6584
|
ContentStripWithTabsLibComponent.prototype.defaultMaxWidgets;
|
|
6709
6585
|
/** @type {?} */
|
|
6586
|
+
ContentStripWithTabsLibComponent.prototype.enrollInterval;
|
|
6587
|
+
/** @type {?} */
|
|
6710
6588
|
ContentStripWithTabsLibComponent.prototype.todaysEvents;
|
|
6589
|
+
/** @type {?} */
|
|
6590
|
+
ContentStripWithTabsLibComponent.prototype.enrollmentMapData;
|
|
6711
6591
|
/**
|
|
6712
6592
|
* @type {?}
|
|
6713
6593
|
* @private
|
|
@@ -8925,12 +8805,12 @@ var CommonStripComponent = /** @class */ (function (_super) {
|
|
|
8925
8805
|
/** @nocollapse */
|
|
8926
8806
|
CommonStripComponent.ctorParameters = function () { return [
|
|
8927
8807
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
8928
|
-
{ type:
|
|
8808
|
+
{ type: WidgetContentService },
|
|
8929
8809
|
{ type: LoggerService },
|
|
8930
8810
|
{ type: EventService },
|
|
8931
8811
|
{ type: ConfigurationsService$1 },
|
|
8932
8812
|
{ type: UtilityService },
|
|
8933
|
-
{ type:
|
|
8813
|
+
{ type: WidgetUserService },
|
|
8934
8814
|
{ type: TranslateService },
|
|
8935
8815
|
{ type: MultilingualTranslationsService },
|
|
8936
8816
|
{ type: CommonMethodsService }
|
|
@@ -10140,6 +10020,13 @@ var CardsComponent = /** @class */ (function (_super) {
|
|
|
10140
10020
|
function () {
|
|
10141
10021
|
_this.getCbPlanData();
|
|
10142
10022
|
}), 1000);
|
|
10023
|
+
this.enrollInterval = setInterval((/**
|
|
10024
|
+
* @return {?}
|
|
10025
|
+
*/
|
|
10026
|
+
function () {
|
|
10027
|
+
_this.getEnrollmentData();
|
|
10028
|
+
// tslint:disable-next-line
|
|
10029
|
+
}), 1000);
|
|
10143
10030
|
};
|
|
10144
10031
|
Object.defineProperty(CardsComponent.prototype, "isLiveOrMarkForDeletion", {
|
|
10145
10032
|
get: /**
|
|
@@ -10224,6 +10111,18 @@ var CardsComponent = /** @class */ (function (_super) {
|
|
|
10224
10111
|
clearInterval(this.cbPlanInterval);
|
|
10225
10112
|
}
|
|
10226
10113
|
};
|
|
10114
|
+
/**
|
|
10115
|
+
* @return {?}
|
|
10116
|
+
*/
|
|
10117
|
+
CardsComponent.prototype.getEnrollmentData = /**
|
|
10118
|
+
* @return {?}
|
|
10119
|
+
*/
|
|
10120
|
+
function () {
|
|
10121
|
+
if (localStorage.getItem('enrollmentMapData')) {
|
|
10122
|
+
this.enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
|
|
10123
|
+
clearInterval(this.enrollInterval);
|
|
10124
|
+
}
|
|
10125
|
+
};
|
|
10227
10126
|
/**
|
|
10228
10127
|
* @param {?} data
|
|
10229
10128
|
* @return {?}
|
|
@@ -10238,14 +10137,14 @@ var CardsComponent = /** @class */ (function (_super) {
|
|
|
10238
10137
|
CardsComponent.decorators = [
|
|
10239
10138
|
{ type: Component, args: [{
|
|
10240
10139
|
selector: 'sb-uic-cards',
|
|
10241
|
-
template: "<div class=\"widget-card-content-new\">\n <ng-container *ngIf=\"widgetData && (((widgetData?.deletedMode || 'none') === 'hide' && !!!isLiveOrMarkForDeletion)\n ? false\n : !((widgetData?.intranetMode || 'none') === 'hide' && !!showIntranetContent))\"\n [ngSwitch]=\"( (widgetData && widgetData?.cardSubType) || 'cardPortraitLib')\">\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"cardPortraitLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'user-card'\" [ngTemplateOutlet]=\"cardUser\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-lib-skeleton'\" [ngTemplateOutlet]=\"cardPortraitLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-lib'\" [ngTemplateOutlet]=\"cardPortraitLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-landscape-lib-skeleton'\" [ngTemplateOutlet]=\"cardLandscapeLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-landscape-lib'\" [ngTemplateOutlet]=\"cardLandscapeLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-lib-skeleton'\" [ngTemplateOutlet]=\"cardWideLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-lib'\" [ngTemplateOutlet]=\"cardWideLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-v2'\" [ngTemplateOutlet]=\"cardWideV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-v2-skeleton'\" [ngTemplateOutlet]=\"cardWideV2Skeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-lib'\" [ngTemplateOutlet]=\"cardMdo\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-home-lib'\" [ngTemplateOutlet]=\"cardMdoHome\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-home-lib-skeleton'\" [ngTemplateOutlet]=\"cardMdoHomeSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-lib-skeleton'\" [ngTemplateOutlet]=\"cardMdoSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-scheduled-assessment'\" [ngTemplateOutlet]=\"cardScheduledAssessment\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-scheduled-assessment-skeleton'\" [ngTemplateOutlet]=\"cardScheduledAssessmentSkelton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib'\" [ngTemplateOutlet]=\"cardKarmaProgram\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-skeleton'\" [ngTemplateOutlet]=\"cardKarmaProgramSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-progress-portrait-lib'\" [ngTemplateOutlet]=\"cardProgressLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-progress-portrait-lib-skeleton'\" [ngTemplateOutlet]=\"cardProgressLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-v2'\" [ngTemplateOutlet]=\"cardKarmaProgramV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-v2-skeleton'\" [ngTemplateOutlet]=\"cardKarmaProgramV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-providers-lib'\" [ngTemplateOutlet]=\"cardProvider\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-providers-lib-skeleton'\" [ngTemplateOutlet]=\"cardProviderSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-ext-lib-skeleton'\" [ngTemplateOutlet]=\"cardPortraitExtLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-ext-lib'\" [ngTemplateOutlet]=\"cardPortraitExtLib\"></ng-container>\n\n </ng-container>\n</div>\n\n<ng-template #cardPortraitLibSkeleton>\n <sb-uic-card-portrait [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-portrait>\n</ng-template>\n<ng-template #cardPortraitLib>\n <sb-uic-card-portrait \n [cbPlanMapData]=\"cbPlanMapData\"\n (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\" [isCardLoading]=\"false\"></sb-uic-card-portrait>\n</ng-template>\n<ng-template #cardLandscapeLibSkeleton>\n <sb-uic-card-landscape [widgetData]=\"widgetData\" \n [cbPlanMapData]=\"cbPlanMapData\" [isCardLoading]=\"true\"></sb-uic-card-landscape>\n</ng-template>\n<ng-template #cardLandscapeLib>\n <sb-uic-card-landscape\n (contentData)=\"getRedirectUrlData($event)\"\n (triggerTelemetry)=\"raiseCardClick($event)\"\n [widgetData]=\"widgetData\"\n [cbPlanMapData]=\"cbPlanMapData\"\n [isCardLoading]=\"false\">\n </sb-uic-card-landscape>\n</ng-template>\n\n<ng-template #cardWideLib>\n <sb-uic-card-wide (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\"></sb-uic-card-wide>\n</ng-template>\n<ng-template #cardWideLibSkeleton>\n <sb-uic-card-wide [widgetData]=\"widgetData\"></sb-uic-card-wide>\n</ng-template>\n\n<ng-template #cardWideV2Skeleton>\n <sb-uic-card-wide-v2 [widgetData]=\"widgetData\" [isCardLoading]=\"true\" ></sb-uic-card-wide-v2>\n</ng-template>\n<ng-template #cardWideV2>\n <sb-uic-card-wide-v2\n (contentData)=\"getRedirectUrlData($event)\"\n (triggerTelemetry)=\"raiseCardClick($event)\"\n [cbPlanMapData]=\"cbPlanMapData\"\n [isCardLoading]=\"false\"\n [widgetData]=\"widgetData\">\n </sb-uic-card-wide-v2>\n</ng-template>\n\n<ng-template #cardUser>\n <sb-uic-card-user [widgetData]=\"widgetData\"></sb-uic-card-user>\n</ng-template>\n<ng-template #cardMdoHome>\n <sb-uic-card-mdo-channel-v1 [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel-v1>\n</ng-template>\n<ng-template #cardMdoHomeSkeleton>\n <sb-uic-card-mdo-channel-v1 [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel-v1>\n</ng-template>\n<ng-template #cardMdo>\n <sb-uic-card-mdo-channel [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel>\n</ng-template>\n<ng-template #cardMdoSkeleton>\n <sb-uic-card-mdo-channel [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel>\n</ng-template>\n<ng-template #cardKarmaProgramSkeleton>\n <sb-uic-card-karma-programs [randomColorApply]=\"true\" \n [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-karma-programs>\n</ng-template>\n<ng-template #cardKarmaProgram>\n <sb-uic-card-karma-programs [randomColorApply]=\"true\" \n [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-card-karma-programs>\n</ng-template>\n<ng-template #cardScheduledAssessmentSkelton>\n <sb-uic-card-assessment [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-assessment>\n</ng-template>\n<ng-template #cardScheduledAssessment>\n <sb-uic-card-assessment [widgetData]=\"widgetData\" (contentData)=\"getRedirectUrlData($event)\" [isCardLoading]=\"false\" ></sb-uic-card-assessment>\n</ng-template>\n<ng-template #cardProgressLibSkeleton>\n <sb-uic-card-progress-portrait-lib \n [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-progress-portrait-lib>\n</ng-template>\n<ng-template #cardProgressLib>\n <sb-uic-card-progress-portrait-lib \n [isCardLoading]=\"false\" (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\"></sb-uic-card-progress-portrait-lib>\n</ng-template>\n<ng-template #cardKarmaProgramV2>\n <!-- <sb-uic-card-karma-programs-v2 [widgetData]=\"widgetData\"><sb-uic-card-karma-programs-v2> -->\n</ng-template>\n<ng-template #cardProvider>\n <sb-uic-provider-card [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-provider-card>\n</ng-template>\n<ng-template #cardProviderSkeleton>\n <sb-uic-provider-card [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-provider-card>\n</ng-template>\n\n<!-- cios card -->\n<ng-template #cardPortraitExtLibSkeleton>\n <sb-uic-card-portrait-ext [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-portrait-ext>\n</ng-template>\n<ng-template #cardPortraitExtLib>\n <sb-uic-card-portrait-ext \n [cbPlanMapData]=\"cbPlanMapData\"\n (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\" [isCardLoading]=\"false\"></sb-uic-card-portrait-ext>\n</ng-template>\n",
|
|
10140
|
+
template: "<div class=\"widget-card-content-new\">\n <ng-container *ngIf=\"widgetData && (((widgetData?.deletedMode || 'none') === 'hide' && !!!isLiveOrMarkForDeletion)\n ? false\n : !((widgetData?.intranetMode || 'none') === 'hide' && !!showIntranetContent))\"\n [ngSwitch]=\"( (widgetData && widgetData?.cardSubType) || 'cardPortraitLib')\">\n <ng-container *ngSwitchDefault [ngTemplateOutlet]=\"cardPortraitLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'user-card'\" [ngTemplateOutlet]=\"cardUser\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-lib-skeleton'\" [ngTemplateOutlet]=\"cardPortraitLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-lib'\" [ngTemplateOutlet]=\"cardPortraitLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-landscape-lib-skeleton'\" [ngTemplateOutlet]=\"cardLandscapeLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-landscape-lib'\" [ngTemplateOutlet]=\"cardLandscapeLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-lib-skeleton'\" [ngTemplateOutlet]=\"cardWideLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-lib'\" [ngTemplateOutlet]=\"cardWideLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-v2'\" [ngTemplateOutlet]=\"cardWideV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-wide-v2-skeleton'\" [ngTemplateOutlet]=\"cardWideV2Skeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-lib'\" [ngTemplateOutlet]=\"cardMdo\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-home-lib'\" [ngTemplateOutlet]=\"cardMdoHome\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-home-lib-skeleton'\" [ngTemplateOutlet]=\"cardMdoHomeSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-mdo-lib-skeleton'\" [ngTemplateOutlet]=\"cardMdoSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-scheduled-assessment'\" [ngTemplateOutlet]=\"cardScheduledAssessment\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-scheduled-assessment-skeleton'\" [ngTemplateOutlet]=\"cardScheduledAssessmentSkelton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib'\" [ngTemplateOutlet]=\"cardKarmaProgram\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-skeleton'\" [ngTemplateOutlet]=\"cardKarmaProgramSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-progress-portrait-lib'\" [ngTemplateOutlet]=\"cardProgressLib\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-progress-portrait-lib-skeleton'\" [ngTemplateOutlet]=\"cardProgressLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-v2'\" [ngTemplateOutlet]=\"cardKarmaProgramV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-karma-program-lib-v2-skeleton'\" [ngTemplateOutlet]=\"cardKarmaProgramV2\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-providers-lib'\" [ngTemplateOutlet]=\"cardProvider\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-providers-lib-skeleton'\" [ngTemplateOutlet]=\"cardProviderSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-ext-lib-skeleton'\" [ngTemplateOutlet]=\"cardPortraitExtLibSkeleton\"></ng-container>\n <ng-container *ngSwitchCase=\"'card-portrait-ext-lib'\" [ngTemplateOutlet]=\"cardPortraitExtLib\"></ng-container>\n\n </ng-container>\n</div>\n\n<ng-template #cardPortraitLibSkeleton>\n <sb-uic-card-portrait [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-portrait>\n</ng-template>\n<ng-template #cardPortraitLib>\n <sb-uic-card-portrait \n [cbPlanMapData]=\"cbPlanMapData\"\n (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\" [isCardLoading]=\"false\"></sb-uic-card-portrait>\n</ng-template>\n<ng-template #cardLandscapeLibSkeleton>\n <sb-uic-card-landscape [widgetData]=\"widgetData\" \n [cbPlanMapData]=\"cbPlanMapData\" [isCardLoading]=\"true\"></sb-uic-card-landscape>\n</ng-template>\n<ng-template #cardLandscapeLib>\n <sb-uic-card-landscape\n (contentData)=\"getRedirectUrlData($event)\"\n (triggerTelemetry)=\"raiseCardClick($event)\"\n [widgetData]=\"widgetData\"\n [cbPlanMapData]=\"cbPlanMapData\"\n [isCardLoading]=\"false\">\n </sb-uic-card-landscape>\n</ng-template>\n\n<ng-template #cardWideLib>\n <sb-uic-card-wide (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\"></sb-uic-card-wide>\n</ng-template>\n<ng-template #cardWideLibSkeleton>\n <sb-uic-card-wide [widgetData]=\"widgetData\"></sb-uic-card-wide>\n</ng-template>\n\n<ng-template #cardWideV2Skeleton>\n <sb-uic-card-wide-v2 [widgetData]=\"widgetData\" [isCardLoading]=\"true\" ></sb-uic-card-wide-v2>\n</ng-template>\n<ng-template #cardWideV2>\n <sb-uic-card-wide-v2\n (contentData)=\"getRedirectUrlData($event)\"\n (triggerTelemetry)=\"raiseCardClick($event)\"\n [cbPlanMapData]=\"cbPlanMapData\"\n [isCardLoading]=\"false\"\n [widgetData]=\"widgetData\">\n </sb-uic-card-wide-v2>\n</ng-template>\n\n<ng-template #cardUser>\n <sb-uic-card-user [widgetData]=\"widgetData\"></sb-uic-card-user>\n</ng-template>\n<ng-template #cardMdoHome>\n <sb-uic-card-mdo-channel-v1 [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel-v1>\n</ng-template>\n<ng-template #cardMdoHomeSkeleton>\n <sb-uic-card-mdo-channel-v1 [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel-v1>\n</ng-template>\n<ng-template #cardMdo>\n <sb-uic-card-mdo-channel [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel>\n</ng-template>\n<ng-template #cardMdoSkeleton>\n <sb-uic-card-mdo-channel [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-mdo-channel>\n</ng-template>\n<ng-template #cardKarmaProgramSkeleton>\n <sb-uic-card-karma-programs [randomColorApply]=\"true\" \n [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-karma-programs>\n</ng-template>\n<ng-template #cardKarmaProgram>\n <sb-uic-card-karma-programs [randomColorApply]=\"true\" \n [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-card-karma-programs>\n</ng-template>\n<ng-template #cardScheduledAssessmentSkelton>\n <sb-uic-card-assessment [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-assessment>\n</ng-template>\n<ng-template #cardScheduledAssessment>\n <sb-uic-card-assessment [widgetData]=\"widgetData\" (contentData)=\"getRedirectUrlData($event)\" [isCardLoading]=\"false\" [enrollmentMapData]=\"enrollmentMapData\"></sb-uic-card-assessment>\n</ng-template>\n<ng-template #cardProgressLibSkeleton>\n <sb-uic-card-progress-portrait-lib \n [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-card-progress-portrait-lib>\n</ng-template>\n<ng-template #cardProgressLib>\n <sb-uic-card-progress-portrait-lib \n [isCardLoading]=\"false\" (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\"></sb-uic-card-progress-portrait-lib>\n</ng-template>\n<ng-template #cardKarmaProgramV2>\n <!-- <sb-uic-card-karma-programs-v2 [widgetData]=\"widgetData\"><sb-uic-card-karma-programs-v2> -->\n</ng-template>\n<ng-template #cardProvider>\n <sb-uic-provider-card [isCardLoading]=\"false\" [widgetData]=\"widgetData\"></sb-uic-provider-card>\n</ng-template>\n<ng-template #cardProviderSkeleton>\n <sb-uic-provider-card [isCardLoading]=\"true\" [widgetData]=\"widgetData\"></sb-uic-provider-card>\n</ng-template>\n\n<!-- cios card -->\n<ng-template #cardPortraitExtLibSkeleton>\n <sb-uic-card-portrait-ext [widgetData]=\"widgetData\" [isCardLoading]=\"true\"></sb-uic-card-portrait-ext>\n</ng-template>\n<ng-template #cardPortraitExtLib>\n <sb-uic-card-portrait-ext \n [cbPlanMapData]=\"cbPlanMapData\"\n (contentData)=\"getRedirectUrlData($event)\" [widgetData]=\"widgetData\" [isCardLoading]=\"false\"></sb-uic-card-portrait-ext>\n</ng-template>\n",
|
|
10242
10141
|
styles: [""]
|
|
10243
10142
|
}] }
|
|
10244
10143
|
];
|
|
10245
10144
|
/** @nocollapse */
|
|
10246
10145
|
CardsComponent.ctorParameters = function () { return [
|
|
10247
10146
|
{ type: UtilityService },
|
|
10248
|
-
{ type:
|
|
10147
|
+
{ type: WidgetContentService },
|
|
10249
10148
|
{ type: Router }
|
|
10250
10149
|
]; };
|
|
10251
10150
|
CardsComponent.propDecorators = {
|
|
@@ -10265,6 +10164,10 @@ if (false) {
|
|
|
10265
10164
|
CardsComponent.prototype.cbPlanMapData;
|
|
10266
10165
|
/** @type {?} */
|
|
10267
10166
|
CardsComponent.prototype.cbPlanInterval;
|
|
10167
|
+
/** @type {?} */
|
|
10168
|
+
CardsComponent.prototype.enrollInterval;
|
|
10169
|
+
/** @type {?} */
|
|
10170
|
+
CardsComponent.prototype.enrollmentMapData;
|
|
10268
10171
|
/**
|
|
10269
10172
|
* @type {?}
|
|
10270
10173
|
* @private
|
|
@@ -10409,7 +10312,7 @@ var CardPortraitComponent = /** @class */ (function () {
|
|
|
10409
10312
|
{ type: TranslateService },
|
|
10410
10313
|
{ type: MultilingualTranslationsService },
|
|
10411
10314
|
{ type: ConfigurationsService$1 },
|
|
10412
|
-
{ type:
|
|
10315
|
+
{ type: WidgetContentService }
|
|
10413
10316
|
]; };
|
|
10414
10317
|
CardPortraitComponent.propDecorators = {
|
|
10415
10318
|
widgetData: [{ type: Input }],
|
|
@@ -11540,7 +11443,7 @@ var CardMDOChannelComponent = /** @class */ (function () {
|
|
|
11540
11443
|
{ type: TranslateService },
|
|
11541
11444
|
{ type: MultilingualTranslationsService$1 },
|
|
11542
11445
|
{ type: ConfigurationsService$1 },
|
|
11543
|
-
{ type:
|
|
11446
|
+
{ type: WidgetContentService },
|
|
11544
11447
|
{ type: Router }
|
|
11545
11448
|
]; };
|
|
11546
11449
|
CardMDOChannelComponent.propDecorators = {
|
|
@@ -11890,7 +11793,7 @@ var CardKarmaProgramsComponent = /** @class */ (function () {
|
|
|
11890
11793
|
{ type: TranslateService },
|
|
11891
11794
|
{ type: MultilingualTranslationsService$1 },
|
|
11892
11795
|
{ type: ConfigurationsService$1 },
|
|
11893
|
-
{ type:
|
|
11796
|
+
{ type: WidgetContentService },
|
|
11894
11797
|
{ type: Router }
|
|
11895
11798
|
]; };
|
|
11896
11799
|
CardKarmaProgramsComponent.propDecorators = {
|
|
@@ -12308,7 +12211,7 @@ var CardPortraitExtComponent = /** @class */ (function () {
|
|
|
12308
12211
|
{ type: TranslateService },
|
|
12309
12212
|
{ type: MultilingualTranslationsService },
|
|
12310
12213
|
{ type: ConfigurationsService$1 },
|
|
12311
|
-
{ type:
|
|
12214
|
+
{ type: WidgetContentService }
|
|
12312
12215
|
]; };
|
|
12313
12216
|
CardPortraitExtComponent.propDecorators = {
|
|
12314
12217
|
widgetData: [{ type: Input }],
|
|
@@ -12498,10 +12401,11 @@ var CardAssessmentComponent = /** @class */ (function () {
|
|
|
12498
12401
|
/** @nocollapse */
|
|
12499
12402
|
CardAssessmentComponent.ctorParameters = function () { return [
|
|
12500
12403
|
{ type: ConfigurationsService$1 },
|
|
12501
|
-
{ type:
|
|
12404
|
+
{ type: WidgetContentService }
|
|
12502
12405
|
]; };
|
|
12503
12406
|
CardAssessmentComponent.propDecorators = {
|
|
12504
12407
|
widgetData: [{ type: Input }],
|
|
12408
|
+
enrollmentMapData: [{ type: Input }],
|
|
12505
12409
|
contentData: [{ type: Output }],
|
|
12506
12410
|
isCardLoading: [{ type: Input }]
|
|
12507
12411
|
};
|
|
@@ -12511,6 +12415,8 @@ if (false) {
|
|
|
12511
12415
|
/** @type {?} */
|
|
12512
12416
|
CardAssessmentComponent.prototype.widgetData;
|
|
12513
12417
|
/** @type {?} */
|
|
12418
|
+
CardAssessmentComponent.prototype.enrollmentMapData;
|
|
12419
|
+
/** @type {?} */
|
|
12514
12420
|
CardAssessmentComponent.prototype.contentData;
|
|
12515
12421
|
/** @type {?} */
|
|
12516
12422
|
CardAssessmentComponent.prototype.isCardLoading;
|
|
@@ -13039,7 +12945,7 @@ var CardProgressPortraitLibComponent = /** @class */ (function () {
|
|
|
13039
12945
|
{ type: EventService },
|
|
13040
12946
|
{ type: MultilingualTranslationsService },
|
|
13041
12947
|
{ type: ConfigurationsService$1 },
|
|
13042
|
-
{ type:
|
|
12948
|
+
{ type: WidgetContentService },
|
|
13043
12949
|
{ type: CertificateService },
|
|
13044
12950
|
{ type: MatDialog }
|
|
13045
12951
|
]; };
|
|
@@ -13378,7 +13284,7 @@ var CardMdoChannelV1Component = /** @class */ (function () {
|
|
|
13378
13284
|
{ type: TranslateService },
|
|
13379
13285
|
{ type: MultilingualTranslationsService$1 },
|
|
13380
13286
|
{ type: ConfigurationsService$1 },
|
|
13381
|
-
{ type:
|
|
13287
|
+
{ type: WidgetContentService },
|
|
13382
13288
|
{ type: Router }
|
|
13383
13289
|
]; };
|
|
13384
13290
|
CardMdoChannelV1Component.propDecorators = {
|
|
@@ -14032,7 +13938,7 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
14032
13938
|
_this._fb = _fb;
|
|
14033
13939
|
_this.emptyResponse = new EventEmitter();
|
|
14034
13940
|
_this.viewAllResponse = new EventEmitter();
|
|
14035
|
-
_this.
|
|
13941
|
+
_this.telemtryLearningContentResponse = new EventEmitter();
|
|
14036
13942
|
_this.providerId = '';
|
|
14037
13943
|
_this.emitViewAll = false;
|
|
14038
13944
|
_this.channnelName = '';
|
|
@@ -14077,15 +13983,10 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
14077
13983
|
* @return {?}
|
|
14078
13984
|
*/
|
|
14079
13985
|
function () {
|
|
14080
|
-
var _this = this;
|
|
14081
13986
|
this.initData();
|
|
14082
|
-
this.contentSvc.telemetryData$.subscribe((
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
*/
|
|
14086
|
-
function (data) {
|
|
14087
|
-
_this.telemtryResponse.emit(data);
|
|
14088
|
-
}));
|
|
13987
|
+
// this.contentSvc.telemetryData$.subscribe((data: any) => {
|
|
13988
|
+
// this.telemtryLearningContentResponse.emit(data)
|
|
13989
|
+
// })
|
|
14089
13990
|
this.facetForm = this._fb.group({
|
|
14090
13991
|
org: ['0']
|
|
14091
13992
|
});
|
|
@@ -14421,7 +14322,7 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
14421
14322
|
* @return {?}
|
|
14422
14323
|
*/
|
|
14423
14324
|
function (stripData) {
|
|
14424
|
-
this.
|
|
14325
|
+
this.telemtryLearningContentResponse.emit(stripData);
|
|
14425
14326
|
};
|
|
14426
14327
|
/**
|
|
14427
14328
|
* @param {?} key
|
|
@@ -14505,7 +14406,7 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
14505
14406
|
};
|
|
14506
14407
|
this.eventSvc.raiseInteractTelemetry({
|
|
14507
14408
|
type: WsEvents.EnumInteractTypes.CLICK,
|
|
14508
|
-
subType:
|
|
14409
|
+
subType: 'explore-learning-content',
|
|
14509
14410
|
id: camelCase(data.label) + "-tab",
|
|
14510
14411
|
}, {}, {
|
|
14511
14412
|
module: WsEvents.EnumTelemetrymodules.HOME,
|
|
@@ -14997,7 +14898,7 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
14997
14898
|
response = _a.sent();
|
|
14998
14899
|
tabIndex = 0;
|
|
14999
14900
|
pillIndex = 0;
|
|
15000
|
-
if (response.results && response.results.result) {
|
|
14901
|
+
if (response.results && response.results.result && response.results.result.content && response.results.result.content.length > 0) {
|
|
15001
14902
|
this.mapAllDataWithFacets(strip, response.results.result.content, response.results.result.facets, calculateParentStatus);
|
|
15002
14903
|
widgets = this.transformContentsToWidgets(response.results.result.content, strip);
|
|
15003
14904
|
tabResults = [];
|
|
@@ -15031,6 +14932,9 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
15031
14932
|
// tabResults // tabResults as widgets
|
|
15032
14933
|
// );
|
|
15033
14934
|
}
|
|
14935
|
+
else {
|
|
14936
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
14937
|
+
}
|
|
15034
14938
|
return [3 /*break*/, 4];
|
|
15035
14939
|
case 3:
|
|
15036
14940
|
error_1 = _a.sent();
|
|
@@ -15263,13 +15167,13 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
15263
15167
|
/** @nocollapse */
|
|
15264
15168
|
ContentStripFacetFilterComponent.ctorParameters = function () { return [
|
|
15265
15169
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
15266
|
-
{ type:
|
|
15170
|
+
{ type: WidgetContentService },
|
|
15267
15171
|
{ type: LoggerService },
|
|
15268
15172
|
{ type: EventService },
|
|
15269
15173
|
{ type: ConfigurationsService$1 },
|
|
15270
15174
|
{ type: UtilityService },
|
|
15271
15175
|
{ type: Router },
|
|
15272
|
-
{ type:
|
|
15176
|
+
{ type: WidgetUserService },
|
|
15273
15177
|
{ type: TranslateService },
|
|
15274
15178
|
{ type: MultilingualTranslationsService },
|
|
15275
15179
|
{ type: FormBuilder }
|
|
@@ -15278,7 +15182,7 @@ var ContentStripFacetFilterComponent = /** @class */ (function (_super) {
|
|
|
15278
15182
|
widgetData: [{ type: Input }],
|
|
15279
15183
|
emptyResponse: [{ type: Output }],
|
|
15280
15184
|
viewAllResponse: [{ type: Output }],
|
|
15281
|
-
|
|
15185
|
+
telemtryLearningContentResponse: [{ type: Output }],
|
|
15282
15186
|
providerId: [{ type: Input }],
|
|
15283
15187
|
emitViewAll: [{ type: Input }],
|
|
15284
15188
|
channnelName: [{ type: Input }],
|
|
@@ -15294,7 +15198,7 @@ if (false) {
|
|
|
15294
15198
|
/** @type {?} */
|
|
15295
15199
|
ContentStripFacetFilterComponent.prototype.viewAllResponse;
|
|
15296
15200
|
/** @type {?} */
|
|
15297
|
-
ContentStripFacetFilterComponent.prototype.
|
|
15201
|
+
ContentStripFacetFilterComponent.prototype.telemtryLearningContentResponse;
|
|
15298
15202
|
/** @type {?} */
|
|
15299
15203
|
ContentStripFacetFilterComponent.prototype.providerId;
|
|
15300
15204
|
/** @type {?} */
|
|
@@ -15338,6 +15242,8 @@ if (false) {
|
|
|
15338
15242
|
/** @type {?} */
|
|
15339
15243
|
ContentStripFacetFilterComponent.prototype.todaysEvents;
|
|
15340
15244
|
/** @type {?} */
|
|
15245
|
+
ContentStripFacetFilterComponent.prototype.enrollmentMapData;
|
|
15246
|
+
/** @type {?} */
|
|
15341
15247
|
ContentStripFacetFilterComponent.prototype.facetForm;
|
|
15342
15248
|
/**
|
|
15343
15249
|
* @type {?}
|
|
@@ -16893,15 +16799,14 @@ var ContentStripWithTabsPillsComponent = /** @class */ (function (_super) {
|
|
|
16893
16799
|
function (strip, calculateParentStatus) {
|
|
16894
16800
|
if (calculateParentStatus === void 0) { calculateParentStatus = true; }
|
|
16895
16801
|
return __awaiter(this, void 0, void 0, function () {
|
|
16896
|
-
var courses, tabResults,
|
|
16802
|
+
var courses, tabResults, response, countOfWidget_1;
|
|
16897
16803
|
return __generator(this, function (_a) {
|
|
16898
16804
|
switch (_a.label) {
|
|
16899
16805
|
case 0:
|
|
16900
16806
|
if (!(strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length)) return [3 /*break*/, 5];
|
|
16901
16807
|
courses = void 0;
|
|
16902
16808
|
tabResults = [];
|
|
16903
|
-
|
|
16904
|
-
return [4 /*yield*/, this.userSvc.fetchCbpPlanList(userId).toPromise()];
|
|
16809
|
+
return [4 /*yield*/, this.userSvc.fetchCbpPlanList().toPromise()];
|
|
16905
16810
|
case 1:
|
|
16906
16811
|
response = _a.sent();
|
|
16907
16812
|
if (!response) return [3 /*break*/, 4];
|
|
@@ -17146,13 +17051,13 @@ var ContentStripWithTabsPillsComponent = /** @class */ (function (_super) {
|
|
|
17146
17051
|
/** @nocollapse */
|
|
17147
17052
|
ContentStripWithTabsPillsComponent.ctorParameters = function () { return [
|
|
17148
17053
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
17149
|
-
{ type:
|
|
17054
|
+
{ type: WidgetContentService },
|
|
17150
17055
|
{ type: LoggerService },
|
|
17151
17056
|
{ type: EventService },
|
|
17152
17057
|
{ type: ConfigurationsService$1 },
|
|
17153
17058
|
{ type: UtilityService },
|
|
17154
17059
|
{ type: Router },
|
|
17155
|
-
{ type:
|
|
17060
|
+
{ type: WidgetUserService },
|
|
17156
17061
|
{ type: TranslateService },
|
|
17157
17062
|
{ type: MultilingualTranslationsService }
|
|
17158
17063
|
]; };
|
|
@@ -17219,6 +17124,8 @@ if (false) {
|
|
|
17219
17124
|
ContentStripWithTabsPillsComponent.prototype.enrollInterval;
|
|
17220
17125
|
/** @type {?} */
|
|
17221
17126
|
ContentStripWithTabsPillsComponent.prototype.todaysEvents;
|
|
17127
|
+
/** @type {?} */
|
|
17128
|
+
ContentStripWithTabsPillsComponent.prototype.enrollmentMapData;
|
|
17222
17129
|
/**
|
|
17223
17130
|
* @type {?}
|
|
17224
17131
|
* @private
|
|
@@ -18068,7 +17975,7 @@ var CompetencyPassbookComponent = /** @class */ (function () {
|
|
|
18068
17975
|
/** @nocollapse */
|
|
18069
17976
|
CompetencyPassbookComponent.ctorParameters = function () { return [
|
|
18070
17977
|
{ type: ConfigurationsService$1 },
|
|
18071
|
-
{ type:
|
|
17978
|
+
{ type: WidgetContentService },
|
|
18072
17979
|
{ type: CompetencyPassbookService },
|
|
18073
17980
|
{ type: Router },
|
|
18074
17981
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] }
|
|
@@ -18627,7 +18534,7 @@ var CompetencyPassbookMdoComponent = /** @class */ (function () {
|
|
|
18627
18534
|
/** @nocollapse */
|
|
18628
18535
|
CompetencyPassbookMdoComponent.ctorParameters = function () { return [
|
|
18629
18536
|
{ type: ConfigurationsService$1 },
|
|
18630
|
-
{ type:
|
|
18537
|
+
{ type: WidgetContentService },
|
|
18631
18538
|
{ type: CompetencyPassbookMdoService },
|
|
18632
18539
|
{ type: Router },
|
|
18633
18540
|
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] }
|
|
@@ -19985,15 +19892,23 @@ var NationalLearningComponent = /** @class */ (function () {
|
|
|
19985
19892
|
* @return {?}
|
|
19986
19893
|
*/
|
|
19987
19894
|
function (event) {
|
|
19895
|
+
/** @type {?} */
|
|
19896
|
+
var _subType = 'mandatory-courses';
|
|
19897
|
+
/** @type {?} */
|
|
19898
|
+
var _id = 'mandatory-courses-card';
|
|
19899
|
+
if (event.typeOfTelemetry === 'learningContent') {
|
|
19900
|
+
_subType = 'explore-learning-content';
|
|
19901
|
+
_id = 'explore-learning-content-card';
|
|
19902
|
+
}
|
|
19988
19903
|
this.events.raiseInteractTelemetry({
|
|
19989
19904
|
type: 'click',
|
|
19990
|
-
subType:
|
|
19991
|
-
id:
|
|
19905
|
+
subType: _subType,
|
|
19906
|
+
id: _id,
|
|
19992
19907
|
}, {
|
|
19993
19908
|
id: event.identifier,
|
|
19994
19909
|
type: event.primaryCategory,
|
|
19995
19910
|
}, {
|
|
19996
|
-
pageIdExt:
|
|
19911
|
+
pageIdExt: _id,
|
|
19997
19912
|
module: 'National Learning Week',
|
|
19998
19913
|
});
|
|
19999
19914
|
};
|
|
@@ -20955,6 +20870,7 @@ var UserProgressComponent = /** @class */ (function () {
|
|
|
20955
20870
|
*/
|
|
20956
20871
|
function () {
|
|
20957
20872
|
var _this = this;
|
|
20873
|
+
debugger;
|
|
20958
20874
|
this.insightSvc.fetchUserProgress().subscribe((/**
|
|
20959
20875
|
* @param {?} res
|
|
20960
20876
|
* @return {?}
|
|
@@ -21195,5 +21111,5 @@ var NationalLearningModule = /** @class */ (function () {
|
|
|
21195
21111
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
21196
21112
|
*/
|
|
21197
21113
|
|
|
21198
|
-
export { AnnouncementsModule, CalenderModule, CardsModule, CbpPlanModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripFacetFilterModule, ContentStripWithTabsLibModule, ContentStripWithTabsPillsModule, DataPointsModule, DialogComponentsModule, EventsModule, HighlightsOfWeekModule, HttpLoaderFactory, HttpLoaderFactory1, KeyHighlightsModule, MDOChannelModule, MdoLeaderboardModule, MyHammerConfig, NationalLearningModule, ProvidersModule, ROOT_WIDGET_CONFIG, SlidersLibModule, SpeakersModule, TopLearnersModule, UserContentRatingLibModule, UserProgressModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG,
|
|
21114
|
+
export { AnnouncementsModule, CalenderModule, CardsModule, CbpPlanModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripFacetFilterModule, ContentStripWithTabsLibModule, ContentStripWithTabsPillsModule, DataPointsModule, DialogComponentsModule, EventsModule, HighlightsOfWeekModule, HttpLoaderFactory, HttpLoaderFactory1, KeyHighlightsModule, MDOChannelModule, MdoLeaderboardModule, MyHammerConfig, NationalLearningModule, ProvidersModule, ROOT_WIDGET_CONFIG, SlidersLibModule, SpeakersModule, TopLearnersModule, UserContentRatingLibModule, UserProgressModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG, WidgetContentService, ContentStripWithTabsLibComponent as ɵa, WidgetUserService as ɵb, CardResourceComponent as ɵba, CardsComponent as ɵbb, CardPortraitComponent as ɵbc, CardUserComponent as ɵbd, CardLandscapeComponent as ɵbe, CardWideComponent as ɵbf, CardMDOChannelComponent as ɵbg, CardWideV2Component as ɵbh, CardKarmaProgramsComponent as ɵbi, CardKarmaProgramsV2Component as ɵbj, ProviderCardComponent as ɵbk, CardPortraitExtComponent as ɵbl, CardAssessmentComponent as ɵbm, CardProgressPortraitLibComponent as ɵbn, CertificateService as ɵbo, CardMdoChannelV1Component as ɵbp, PipePublicURLModule as ɵbq, PipePublicURL as ɵbr, ObjectToArrayPipeModule as ɵbs, ObjectToArrayPipe as ɵbt, DisplayContentTypeLibModule as ɵbu, DisplayContentTypeLibComponent as ɵbv, DefaultThumbnailModule as ɵbw, DefaultThumbnailDirective as ɵbx, PipeDurationTransformModule as ɵby, PipeDurationTransformPipe as ɵbz, MultilingualTranslationsService as ɵc, ContentProgressComponent as ɵca, CertificateDialogComponent as ɵcb, AvatarPhotoLibModule as ɵcc, AvatarPhotoLibComponent as ɵcd, ContentStripFacetFilterComponent as ɵce, ContentStripWithTabsPillsComponent as ɵcf, CompetencyPassbookComponent as ɵcg, CompetencyPassbookService as ɵch, PillsModule as ɵci, PillsComponent as ɵcj, CompetencyPassbookMdoComponent as ɵck, CompetencyPassbookMdoService as ɵcl, UserContentRatingLibComponent as ɵcm, RatingService as ɵcn, UserContentRatingLibService as ɵco, MdoChannelV1Component as ɵcp, MdoChannelV2Component as ɵcq, ProvidersV2Component as ɵcr, NationalLearningComponent as ɵcs, KeyHighlightsComponent as ɵct, EventsComponent as ɵcu, EventCardComponent as ɵcv, MdoLeaderboardComponent as ɵcw, HighlightsOfWeekComponent as ɵcx, SpeakersComponent as ɵcy, UserProgressComponent as ɵcz, ConfigurationsService as ɵd, HorizontalScrollerV2Module as ɵe, HorizontalScrollerV2Component as ɵf, SlidersLibComponent as ɵg, NavigationModule as ɵh, NavigationDirective as ɵi, ImageResponsiveModule as ɵj, ImageResponsiveDirective as ɵk, DataPointsComponent as ɵl, InsiteDataService as ɵm, SkeletonLoaderLibModule as ɵn, SkeletonLoaderLibComponent as ɵo, CalenderComponent as ɵp, CalenderDayComponent as ɵq, CommonStripComponent as ɵr, AnnouncementsComponent as ɵs, TopLearnersComponent as ɵt, CbpPlanComponent as ɵu, ScrollableItemDirective as ɵv, ScrollableItemModule as ɵw, MyHammerConfig$1 as ɵx, SlidersNgContentLibModule as ɵy, SlidersNgContentLibComponent as ɵz };
|
|
21199
21115
|
//# sourceMappingURL=sunbird-cb-consumption.js.map
|