@sunbird-cb/consumption 0.0.45 → 0.0.46
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 +4227 -43
- package/bundles/sunbird-cb-consumption.umd.js.map +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js +1 -1
- package/bundles/sunbird-cb-consumption.umd.min.js.map +1 -1
- package/esm2015/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +34 -24
- package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +2794 -0
- package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.js +218 -0
- package/esm2015/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.js +69 -0
- package/esm2015/public-api.js +2 -1
- package/esm2015/sunbird-cb-consumption.js +16 -15
- package/esm5/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.js +46 -30
- package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.js +4119 -0
- package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.js +218 -0
- package/esm5/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.js +73 -0
- package/esm5/public-api.js +2 -1
- package/esm5/sunbird-cb-consumption.js +16 -15
- package/fesm2015/sunbird-cb-consumption.js +2872 -24
- package/fesm2015/sunbird-cb-consumption.js.map +1 -1
- package/fesm5/sunbird-cb-consumption.js +4211 -30
- package/fesm5/sunbird-cb-consumption.js.map +1 -1
- package/lib/_common/cards/card-assessment/card-assessment/card-assessment.component.d.ts +4 -3
- package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.component.d.ts +202 -0
- package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.model.d.ts +149 -0
- package/lib/_common/strips/content-strip-with-tabs-pills/content-strip-with-tabs-pills.module.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/sunbird-cb-consumption.d.ts +14 -13
- package/sunbird-cb-consumption.metadata.json +1 -1
|
@@ -9784,6 +9784,7 @@ class CardAssessmentComponent {
|
|
|
9784
9784
|
this.activeResource = [];
|
|
9785
9785
|
this.daysRemaining = 0;
|
|
9786
9786
|
this.daysPending = false;
|
|
9787
|
+
this.daysFinish = false;
|
|
9787
9788
|
}
|
|
9788
9789
|
/**
|
|
9789
9790
|
* @return {?}
|
|
@@ -9793,49 +9794,47 @@ class CardAssessmentComponent {
|
|
|
9793
9794
|
const instanceConfig = this.configSvc.instanceConfig;
|
|
9794
9795
|
if (instanceConfig) {
|
|
9795
9796
|
this.defaultThumbnail = instanceConfig.logos.defaultContent || '';
|
|
9796
|
-
this.defaultSLogo = instanceConfig.logos.defaultSourceLogo || '
|
|
9797
|
-
}
|
|
9798
|
-
else {
|
|
9799
|
-
this.defaultThumbnail = '/assets/instances/eagle/app_logos/default.png';
|
|
9800
|
-
this.defaultSLogo = '/assets/instances/eagle/app_logos/KarmayogiBharat_Logo.svg';
|
|
9797
|
+
this.defaultSLogo = instanceConfig.logos.defaultSourceLogo || '';
|
|
9801
9798
|
}
|
|
9799
|
+
// console.log( this.daysPending, " this.daysPending===")
|
|
9802
9800
|
}
|
|
9801
|
+
// updateStartDate(data: any ):void {
|
|
9802
|
+
// // this.startDate = startDate;
|
|
9803
|
+
// this.startCountdown(data)
|
|
9804
|
+
// }
|
|
9803
9805
|
/**
|
|
9804
|
-
* @param {?}
|
|
9805
|
-
* @return {?}
|
|
9806
|
-
*/
|
|
9807
|
-
updateStartDate(startDate) {
|
|
9808
|
-
this.startDate = startDate;
|
|
9809
|
-
this.startCountdown(this.startDate);
|
|
9810
|
-
}
|
|
9811
|
-
/**
|
|
9812
|
-
* @param {?} date
|
|
9806
|
+
* @param {?} data
|
|
9813
9807
|
* @return {?}
|
|
9814
9808
|
*/
|
|
9815
|
-
startCountdown(
|
|
9816
|
-
|
|
9817
|
-
this.updateCountdown(date);
|
|
9809
|
+
startCountdown(data) {
|
|
9810
|
+
this.updateCountdown(data.startDate, data.endDate);
|
|
9818
9811
|
// Update the countdown every second
|
|
9819
9812
|
this.intervalId = setInterval((/**
|
|
9820
9813
|
* @return {?}
|
|
9821
9814
|
*/
|
|
9822
9815
|
() => {
|
|
9823
|
-
this.updateCountdown(
|
|
9816
|
+
this.updateCountdown(data.startDate, data.endDate);
|
|
9824
9817
|
}), 1000);
|
|
9825
9818
|
}
|
|
9826
9819
|
// Method to update the countdown values
|
|
9827
9820
|
/**
|
|
9828
|
-
* @param {?}
|
|
9821
|
+
* @param {?} startDate
|
|
9822
|
+
* @param {?} endDate
|
|
9829
9823
|
* @return {?}
|
|
9830
9824
|
*/
|
|
9831
|
-
updateCountdown(
|
|
9825
|
+
updateCountdown(startDate, endDate) {
|
|
9832
9826
|
/** @type {?} */
|
|
9833
9827
|
const now = new Date().getTime();
|
|
9834
9828
|
// Current time in milliseconds
|
|
9835
9829
|
/** @type {?} */
|
|
9836
|
-
const targetTime = new Date(
|
|
9830
|
+
const targetTime = new Date(startDate).getTime();
|
|
9831
|
+
/** @type {?} */
|
|
9832
|
+
const targetEndDate = new Date(endDate).getTime();
|
|
9837
9833
|
/** @type {?} */
|
|
9838
9834
|
const distance = targetTime - now;
|
|
9835
|
+
// Distance in milliseconds
|
|
9836
|
+
/** @type {?} */
|
|
9837
|
+
const endDistance = now - targetEndDate;
|
|
9839
9838
|
if (distance > 0) {
|
|
9840
9839
|
this.daysRemaining = Math.ceil(distance / (1000 * 60 * 60 * 24));
|
|
9841
9840
|
this.daysPending = true;
|
|
@@ -9845,6 +9844,13 @@ class CardAssessmentComponent {
|
|
|
9845
9844
|
this.daysPending = false;
|
|
9846
9845
|
this.clearTimer();
|
|
9847
9846
|
}
|
|
9847
|
+
if (endDistance > 0) {
|
|
9848
|
+
this.daysFinish = true;
|
|
9849
|
+
this.clearTimer();
|
|
9850
|
+
}
|
|
9851
|
+
else {
|
|
9852
|
+
this.daysFinish = false;
|
|
9853
|
+
}
|
|
9848
9854
|
}
|
|
9849
9855
|
// Method to clear the interval
|
|
9850
9856
|
/**
|
|
@@ -9876,8 +9882,8 @@ class CardAssessmentComponent {
|
|
|
9876
9882
|
CardAssessmentComponent.decorators = [
|
|
9877
9883
|
{ type: Component, args: [{
|
|
9878
9884
|
selector: 'sb-uic-card-assessment',
|
|
9879
|
-
template: "<ng-container *ngIf=\"!isCardLoading\">\n<ng-container >\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t<a (click)=\"getRedirectUrlData(widgetData?.content); $event.stopPropagation()\">\n\t\t<div class=\"display-contents\">\n\t\t\t<ng-container *ngIf=\"widgetData\">\n\t\t\t\t<mat-card-content>\n\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<img mat-card-image class=\"margin-remove assess-img\" [src]=\"widgetData?.content?.posterImage | pipePublicURL\"\n\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\">\n\t\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"!widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<ng-template #defaultImg>\n\t\t\t\t\t\t\t\t\t\t<img mat-card-image [src]=\"defaultThumbnail\" loading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"card-wide-img ws-mat-primary-lite-background margin-remove assess-img\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\" />\n\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"flex title-container flex-col\">\n\t\t\t\t\t\t\t\t<div class=\"flex title-text mat-subheading-1\">\n\t\t\t\t\t\t\t\t\t{{ widgetData?.content?.name }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-s font-normal mat-caption sub-title-text\">\n\t\t\t\t\t\t\t\t\t<div class=\"course_logo_box\">\n\t\t\t\t\t\t\t\t\t\t<img [src]=\"widgetData?.content?.creatorLogo | pipePublicURL \" class=\"source-icon\"\n\t\t\t\t\t\t\t\t\t\t\t[wsUtilsDefaultThumbnail]=\"defaultSLogo\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"(widgetData?.content?.sourceName + '_' + widgetData?.content?.identifier)\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span class=\"sub-title-text\">\n\t\t\t\t\t\t\t\t\t\t{{ (widgetData?.content?.organisation && widgetData?.content?.organisation[0]) ?\n\t\t\t\t\t\t\t\t\t\twidgetData?.content?.organisation[0] : 'Karmayogi Bharat' }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"start-span\">Assessment starts in </span>\n\t\t\t\t\t\t<mat-card-footer class=\"assessment-card-footer padding-m\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"daysPending\"> {{ startCountdown(widgetData?.content?.batch?.startDate) }}<div id=\"demo\"></div> </span>\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"!daysPending\" class=\"start-btn\"> Start Assessment
|
|
9880
|
-
styles: [".card-assessment{width:100%;min-height:190px;box-sizing:border-box;min-width:
|
|
9885
|
+
template: "\n<ng-container *ngIf=\"!isCardLoading\">\n\t<ng-container *ngIf=\"!daysFinish\">\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t<a (click)=\"getRedirectUrlData(widgetData?.content); $event.stopPropagation()\">\n\t\t<div class=\"display-contents\">\n\t\t\t<ng-container *ngIf=\"widgetData\">\n\t\t\t\t<mat-card-content>\n\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<img mat-card-image class=\"margin-remove assess-img\" [src]=\"widgetData?.content?.posterImage | pipePublicURL\"\n\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\">\n\t\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t\t<ng-container *ngIf=\"!widgetData?.content?.posterImage\">\n\t\t\t\t\t\t\t\t\t<ng-template #defaultImg>\n\t\t\t\t\t\t\t\t\t\t<img mat-card-image [src]=\"defaultThumbnail\" loading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\tclass=\"card-wide-img ws-mat-primary-lite-background margin-remove assess-img\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"widgetData?.content?.name\" />\n\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"flex title-container flex-col\">\n\t\t\t\t\t\t\t\t<div class=\"flex title-text mat-subheading-1\">\n\t\t\t\t\t\t\t\t\t{{ widgetData?.content?.name }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-s font-normal mat-caption sub-title-text\">\n\t\t\t\t\t\t\t\t\t<div class=\"course_logo_box\">\n\t\t\t\t\t\t\t\t\t\t<img [src]=\"widgetData?.content?.creatorLogo | pipePublicURL \" class=\"source-icon\"\n\t\t\t\t\t\t\t\t\t\t\t[wsUtilsDefaultThumbnail]=\"defaultSLogo\"\n\t\t\t\t\t\t\t\t\t\t\t[alt]=\"(widgetData?.content?.sourceName + '_' + widgetData?.content?.identifier)\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span class=\"sub-title-text\">\n\t\t\t\t\t\t\t\t\t\t{{ (widgetData?.content?.organisation && widgetData?.content?.organisation[0]) ?\n\t\t\t\t\t\t\t\t\t\twidgetData?.content?.organisation[0] : 'Karmayogi Bharat' }}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class=\"start-span\">Assessment starts in </span>\n\t\t\t\t\t\t<mat-card-footer class=\"assessment-card-footer padding-m\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"daysPending\"> {{ startCountdown(widgetData?.content?.batch?.startDate) }}<div id=\"demo\"></div> </span>\n\t\t\t\t\t\t\t\t\t<span *ngIf=\"!daysPending\" class=\"start-btn\"> Start Assessment </span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<span class=\"time-span flex items-center justify-center\">{{widgetData?.content?.batch?.startDate | date: 'd MMM, y' }}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t</div>\n\t\t\t\t</mat-card-content>\n\t\t\t</ng-container>\n\t\t</div>\n\t</a>\n</mat-card>\n</ng-container>\n</ng-container>\n\n\n\n<ng-container *ngIf=\"isCardLoading\">\n\t<ng-container [ngTemplateOutlet]=\"skeltonLoader\"></ng-container>\n</ng-container>\n\n<ng-template #skeltonLoader>\n\n\t<mat-card class=\"card-assessment card-scheduled-assessment card-users-container padding-remove cursor-pointer mr-4\">\n\t\t<a>\n\t\t\t<div class=\"display-contents\">\n\t\t\t\t<ng-container>\n\t\t\t\t\t<mat-card-content>\n\t\t\t\t\t\t<div class=\"flex flex-col h-full\">\n\t\t\t\t\t\t\t<div class=\"flex flex-1 flex-row padding-s\">\n\t\t\t\t\t\t\t\t<div class=\"flex image-container\">\n\t\t\t\t\t\t\t\t\t<ng-container>\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'300px'\" [height]=\"'155px'\"\n\t\t\t\t\t\t\t\t\t\t\t></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</ng-container>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex title-container flex-col margin-top-m\">\n\t\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"flex margin-remove margin-top-l font-normal\">\n\t\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- <span class=\"text-center\"><sb-uic-skeleton-loader [width]=\"'90px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader> </span> -->\n\t\t\t\t\t\t\t<mat-card-footer\n\t\t\t\t\t\t\t\tclass=\"assessment-card-footer col-row padding-l\">\n\t\t\t\t\t\t\t\t<div class=\"flex flex-1 items-center justify-center col-row margin-top-m\">\n\t\t\t\t\t\t\t\t<div class=\"flex margin-right-m\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"flex\">\n\t\t\t\t\t\t\t\t\t<sb-uic-skeleton-loader [width]=\"'100px'\" [height]=\"'16px'\"\n\t\t\t\t\t\t\t\t\t\t[bindingClass]=\"'flex rounded br-8'\"></sb-uic-skeleton-loader>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</mat-card-footer>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</mat-card-content>\n\t\t\t\t</ng-container>\n\t\t\t</div>\n\t\t</a>\n\t</mat-card>\n</ng-template>\n\n",
|
|
9886
|
+
styles: [".card-assessment{width:100%;min-height:190px;box-sizing:border-box;min-width:340px;margin-top:16px;margin-right:12px;border-radius:12px}.image-container{width:145px;height:120px;border-radius:8px;overflow:hidden;border:1px solid rgba(0,0,0,.08)}.image-container img{border-radius:8px;opacity:1;background-size:100%;width:145px!important;height:120px!important;display:flex}.title-container{width:155px;margin-left:12px}.title-text{word-break:break-word;white-space:initial;margin:8px 0;position:relative;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:48px;font:600 14px/24px Montserrat}.sub-title-text{width:75%;word-break:break-word;white-space:initial;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.course_logo_box{width:38px;height:38px;background:#fff;border-radius:8px;box-sizing:border-box;margin-right:4px;box-shadow:0 2px 1px -1px rgb(0 0 0 / 20%),0 1px 1px 0 rgb(0 0 0 / 14%),0 1px 3px 0 rgb(0 0 0 / 12%)}.course_logo_box img.source-icon{height:28px;width:28px;padding:5px;display:inline-block}.mat-card-footer{margin:0!important}.time-span{padding:2px 8px;color:#fff;border-radius:4px;text-align:center;font-size:12px;background-color:green;width:75px}span.start-span{border-radius:50px;border:2px solid rgba(0,0,0,.08);font-size:12px;text-align:center;position:absolute;bottom:0;width:140px;left:50%;margin-left:-70px;background-color:#fff;margin-bottom:62px;margin-right:8px}.assessment-card-footer{background:rgba(239,149,30,.16)!important;text-align:center;box-sizing:border-box;border-radius:0 0 8px 8px}.start-btn{background:#1b4ca1!important;color:#fff;font-size:14px;font-weight:600;border-radius:25px;text-align:center;padding:4px 12px}.dots-container{display:none}"]
|
|
9881
9887
|
}] }
|
|
9882
9888
|
];
|
|
9883
9889
|
/** @nocollapse */
|
|
@@ -9915,7 +9921,11 @@ if (false) {
|
|
|
9915
9921
|
/** @type {?} */
|
|
9916
9922
|
CardAssessmentComponent.prototype.startDate;
|
|
9917
9923
|
/** @type {?} */
|
|
9924
|
+
CardAssessmentComponent.prototype.endDate;
|
|
9925
|
+
/** @type {?} */
|
|
9918
9926
|
CardAssessmentComponent.prototype.daysPending;
|
|
9927
|
+
/** @type {?} */
|
|
9928
|
+
CardAssessmentComponent.prototype.daysFinish;
|
|
9919
9929
|
/**
|
|
9920
9930
|
* @type {?}
|
|
9921
9931
|
* @private
|
|
@@ -11010,6 +11020,2844 @@ const WIDGET_REGISTRATION_LIB_CONFIG = [
|
|
|
11010
11020
|
}
|
|
11011
11021
|
];
|
|
11012
11022
|
|
|
11023
|
+
/**
|
|
11024
|
+
* @fileoverview added by tsickle
|
|
11025
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
11026
|
+
*/
|
|
11027
|
+
/**
|
|
11028
|
+
* @record
|
|
11029
|
+
*/
|
|
11030
|
+
function IStripUnitContentData$1() { }
|
|
11031
|
+
if (false) {
|
|
11032
|
+
/** @type {?} */
|
|
11033
|
+
IStripUnitContentData$1.prototype.key;
|
|
11034
|
+
/** @type {?} */
|
|
11035
|
+
IStripUnitContentData$1.prototype.canHideStrip;
|
|
11036
|
+
/** @type {?|undefined} */
|
|
11037
|
+
IStripUnitContentData$1.prototype.mode;
|
|
11038
|
+
/** @type {?} */
|
|
11039
|
+
IStripUnitContentData$1.prototype.showStrip;
|
|
11040
|
+
/** @type {?} */
|
|
11041
|
+
IStripUnitContentData$1.prototype.disableTranslate;
|
|
11042
|
+
/** @type {?|undefined} */
|
|
11043
|
+
IStripUnitContentData$1.prototype.widgets;
|
|
11044
|
+
/** @type {?} */
|
|
11045
|
+
IStripUnitContentData$1.prototype.stripTitle;
|
|
11046
|
+
/** @type {?|undefined} */
|
|
11047
|
+
IStripUnitContentData$1.prototype.stripTitleLink;
|
|
11048
|
+
/** @type {?|undefined} */
|
|
11049
|
+
IStripUnitContentData$1.prototype.sliderConfig;
|
|
11050
|
+
/** @type {?} */
|
|
11051
|
+
IStripUnitContentData$1.prototype.stripConfig;
|
|
11052
|
+
/** @type {?|undefined} */
|
|
11053
|
+
IStripUnitContentData$1.prototype.tabs;
|
|
11054
|
+
/** @type {?|undefined} */
|
|
11055
|
+
IStripUnitContentData$1.prototype.stripName;
|
|
11056
|
+
/** @type {?|undefined} */
|
|
11057
|
+
IStripUnitContentData$1.prototype.stripLogo;
|
|
11058
|
+
/** @type {?|undefined} */
|
|
11059
|
+
IStripUnitContentData$1.prototype.description;
|
|
11060
|
+
/** @type {?|undefined} */
|
|
11061
|
+
IStripUnitContentData$1.prototype.stripInfo;
|
|
11062
|
+
/** @type {?|undefined} */
|
|
11063
|
+
IStripUnitContentData$1.prototype.noDataWidget;
|
|
11064
|
+
/** @type {?|undefined} */
|
|
11065
|
+
IStripUnitContentData$1.prototype.errorWidget;
|
|
11066
|
+
/** @type {?} */
|
|
11067
|
+
IStripUnitContentData$1.prototype.showOnNoData;
|
|
11068
|
+
/** @type {?} */
|
|
11069
|
+
IStripUnitContentData$1.prototype.showOnLoader;
|
|
11070
|
+
/** @type {?} */
|
|
11071
|
+
IStripUnitContentData$1.prototype.showOnError;
|
|
11072
|
+
/** @type {?|undefined} */
|
|
11073
|
+
IStripUnitContentData$1.prototype.loaderWidgets;
|
|
11074
|
+
/** @type {?|undefined} */
|
|
11075
|
+
IStripUnitContentData$1.prototype.stripBackground;
|
|
11076
|
+
/** @type {?|undefined} */
|
|
11077
|
+
IStripUnitContentData$1.prototype.secondaryHeading;
|
|
11078
|
+
/** @type {?} */
|
|
11079
|
+
IStripUnitContentData$1.prototype.viewMoreUrl;
|
|
11080
|
+
/** @type {?|undefined} */
|
|
11081
|
+
IStripUnitContentData$1.prototype.request;
|
|
11082
|
+
}
|
|
11083
|
+
class ContentStripWithTabsPillsComponent extends WidgetBaseComponent {
|
|
11084
|
+
/**
|
|
11085
|
+
* @param {?} environment
|
|
11086
|
+
* @param {?} contentSvc
|
|
11087
|
+
* @param {?} loggerSvc
|
|
11088
|
+
* @param {?} eventSvc
|
|
11089
|
+
* @param {?} configSvc
|
|
11090
|
+
* @param {?} utilitySvc
|
|
11091
|
+
* @param {?} router
|
|
11092
|
+
* @param {?} userSvc
|
|
11093
|
+
* @param {?} translate
|
|
11094
|
+
* @param {?} langtranslations
|
|
11095
|
+
*/
|
|
11096
|
+
constructor(
|
|
11097
|
+
// private contentStripSvc: ContentStripNewMultipleService,
|
|
11098
|
+
environment, contentSvc, loggerSvc, eventSvc, configSvc, utilitySvc, router, userSvc, translate, langtranslations) {
|
|
11099
|
+
super();
|
|
11100
|
+
this.contentSvc = contentSvc;
|
|
11101
|
+
this.loggerSvc = loggerSvc;
|
|
11102
|
+
this.eventSvc = eventSvc;
|
|
11103
|
+
this.configSvc = configSvc;
|
|
11104
|
+
this.utilitySvc = utilitySvc;
|
|
11105
|
+
this.router = router;
|
|
11106
|
+
this.userSvc = userSvc;
|
|
11107
|
+
this.translate = translate;
|
|
11108
|
+
this.langtranslations = langtranslations;
|
|
11109
|
+
this.emptyResponse = new EventEmitter();
|
|
11110
|
+
this.viewAllResponse = new EventEmitter();
|
|
11111
|
+
this.telemtryResponse = new EventEmitter();
|
|
11112
|
+
this.providerId = '';
|
|
11113
|
+
this.emitViewAll = false;
|
|
11114
|
+
this.channnelName = '';
|
|
11115
|
+
this.id = `ws-strip-miltiple_${Math.random()}`;
|
|
11116
|
+
this.stripsResultDataMap = {};
|
|
11117
|
+
this.stripsKeyOrder = [];
|
|
11118
|
+
this.showAccordionData = true;
|
|
11119
|
+
this.showParentLoader = false;
|
|
11120
|
+
this.showParentError = false;
|
|
11121
|
+
this.showParentNoData = false;
|
|
11122
|
+
this.errorDataCount = 0;
|
|
11123
|
+
this.noDataCount = 0;
|
|
11124
|
+
this.successDataCount = 0;
|
|
11125
|
+
this.contentAvailable = true;
|
|
11126
|
+
this.baseUrl = this.configSvc.sitePath || '';
|
|
11127
|
+
this.veifiedKarmayogi = false;
|
|
11128
|
+
this.changeEventSubscription = null;
|
|
11129
|
+
this.defaultMaxWidgets = 12;
|
|
11130
|
+
this.todaysEvents = [];
|
|
11131
|
+
if (localStorage.getItem('websiteLanguage')) {
|
|
11132
|
+
this.translate.setDefaultLang('en');
|
|
11133
|
+
/** @type {?} */
|
|
11134
|
+
let lang = JSON.stringify(localStorage.getItem('websiteLanguage'));
|
|
11135
|
+
lang = lang.replace(/\"/g, '');
|
|
11136
|
+
this.translate.use(lang);
|
|
11137
|
+
}
|
|
11138
|
+
this.environment = environment;
|
|
11139
|
+
}
|
|
11140
|
+
/**
|
|
11141
|
+
* @return {?}
|
|
11142
|
+
*/
|
|
11143
|
+
ngOnInit() {
|
|
11144
|
+
// const url = window.location.href
|
|
11145
|
+
this.initData();
|
|
11146
|
+
this.contentSvc.telemetryData$.subscribe((/**
|
|
11147
|
+
* @param {?} data
|
|
11148
|
+
* @return {?}
|
|
11149
|
+
*/
|
|
11150
|
+
(data) => {
|
|
11151
|
+
this.telemtryResponse.emit(data);
|
|
11152
|
+
}));
|
|
11153
|
+
}
|
|
11154
|
+
/**
|
|
11155
|
+
* @return {?}
|
|
11156
|
+
*/
|
|
11157
|
+
ngOnDestroy() {
|
|
11158
|
+
if (this.changeEventSubscription) {
|
|
11159
|
+
this.changeEventSubscription.unsubscribe();
|
|
11160
|
+
}
|
|
11161
|
+
}
|
|
11162
|
+
/**
|
|
11163
|
+
* @param {?} key
|
|
11164
|
+
* @return {?}
|
|
11165
|
+
*/
|
|
11166
|
+
showAccordion(key) {
|
|
11167
|
+
if (this.utilitySvc.isMobile && this.stripsResultDataMap[key].mode === 'accordion') {
|
|
11168
|
+
return this.showAccordionData;
|
|
11169
|
+
}
|
|
11170
|
+
return true;
|
|
11171
|
+
}
|
|
11172
|
+
/**
|
|
11173
|
+
* @param {?} key
|
|
11174
|
+
* @return {?}
|
|
11175
|
+
*/
|
|
11176
|
+
setHiddenForStrip(key) {
|
|
11177
|
+
this.stripsResultDataMap[key].showStrip = false;
|
|
11178
|
+
sessionStorage.setItem(`cstrip_${key}`, '1');
|
|
11179
|
+
}
|
|
11180
|
+
/**
|
|
11181
|
+
* @private
|
|
11182
|
+
* @param {?} key
|
|
11183
|
+
* @return {?}
|
|
11184
|
+
*/
|
|
11185
|
+
getIfStripHidden(key) {
|
|
11186
|
+
/** @type {?} */
|
|
11187
|
+
const storageItem = sessionStorage.getItem(`cstrip_${key}`);
|
|
11188
|
+
return Boolean(storageItem !== '1');
|
|
11189
|
+
}
|
|
11190
|
+
/**
|
|
11191
|
+
* @private
|
|
11192
|
+
* @return {?}
|
|
11193
|
+
*/
|
|
11194
|
+
initData() {
|
|
11195
|
+
this.stripsKeyOrder = this.widgetData && this.widgetData.strips && this.widgetData.strips.map((/**
|
|
11196
|
+
* @param {?} strip
|
|
11197
|
+
* @return {?}
|
|
11198
|
+
*/
|
|
11199
|
+
strip => strip.key)) || [];
|
|
11200
|
+
if (this.widgetData.loader && this.widgetData.strips.length) {
|
|
11201
|
+
this.showParentLoader = true;
|
|
11202
|
+
}
|
|
11203
|
+
// Fetch the data
|
|
11204
|
+
for (const strip of this.widgetData.strips) {
|
|
11205
|
+
if (this.checkForEmptyWidget(strip)) {
|
|
11206
|
+
this.fetchStripFromRequestData(strip, false);
|
|
11207
|
+
}
|
|
11208
|
+
else {
|
|
11209
|
+
this.processStrip(strip, [], 'done', true, null);
|
|
11210
|
+
}
|
|
11211
|
+
}
|
|
11212
|
+
// Subscription for changes
|
|
11213
|
+
/** @type {?} */
|
|
11214
|
+
const keyAndEvent = this.widgetData.strips
|
|
11215
|
+
.map((/**
|
|
11216
|
+
* @param {?} strip
|
|
11217
|
+
* @return {?}
|
|
11218
|
+
*/
|
|
11219
|
+
strip => ({
|
|
11220
|
+
key: strip.key,
|
|
11221
|
+
type: (strip.refreshEvent && strip.refreshEvent.eventType) || '',
|
|
11222
|
+
from: (strip.refreshEvent && strip.refreshEvent.from.toString()) || '',
|
|
11223
|
+
})))
|
|
11224
|
+
.filter((/**
|
|
11225
|
+
* @param {?} __0
|
|
11226
|
+
* @return {?}
|
|
11227
|
+
*/
|
|
11228
|
+
({ key, type, from }) => key && type && from));
|
|
11229
|
+
/** @type {?} */
|
|
11230
|
+
const eventTypeSet = new Set(keyAndEvent.map((/**
|
|
11231
|
+
* @param {?} e
|
|
11232
|
+
* @return {?}
|
|
11233
|
+
*/
|
|
11234
|
+
e => e.type)));
|
|
11235
|
+
this.changeEventSubscription = this.eventSvc.events$
|
|
11236
|
+
.pipe(filter((/**
|
|
11237
|
+
* @param {?} event
|
|
11238
|
+
* @return {?}
|
|
11239
|
+
*/
|
|
11240
|
+
event => eventTypeSet.has(event.eventType))))
|
|
11241
|
+
.subscribe((/**
|
|
11242
|
+
* @param {?} event
|
|
11243
|
+
* @return {?}
|
|
11244
|
+
*/
|
|
11245
|
+
event => {
|
|
11246
|
+
keyAndEvent
|
|
11247
|
+
.filter((/**
|
|
11248
|
+
* @param {?} e
|
|
11249
|
+
* @return {?}
|
|
11250
|
+
*/
|
|
11251
|
+
e => e.type === event.eventType && e.from === event.from))
|
|
11252
|
+
.map((/**
|
|
11253
|
+
* @param {?} e
|
|
11254
|
+
* @return {?}
|
|
11255
|
+
*/
|
|
11256
|
+
e => e.key))
|
|
11257
|
+
.forEach((/**
|
|
11258
|
+
* @param {?} k
|
|
11259
|
+
* @return {?}
|
|
11260
|
+
*/
|
|
11261
|
+
k => this.fetchStripFromKey(k, false)));
|
|
11262
|
+
}));
|
|
11263
|
+
}
|
|
11264
|
+
/**
|
|
11265
|
+
* @private
|
|
11266
|
+
* @param {?} key
|
|
11267
|
+
* @param {?=} calculateParentStatus
|
|
11268
|
+
* @return {?}
|
|
11269
|
+
*/
|
|
11270
|
+
fetchStripFromKey(key, calculateParentStatus = true) {
|
|
11271
|
+
/** @type {?} */
|
|
11272
|
+
const stripData = this.widgetData.strips.find((/**
|
|
11273
|
+
* @param {?} strip
|
|
11274
|
+
* @return {?}
|
|
11275
|
+
*/
|
|
11276
|
+
strip => strip.key === key));
|
|
11277
|
+
if (stripData) {
|
|
11278
|
+
this.fetchStripFromRequestData(stripData, calculateParentStatus);
|
|
11279
|
+
}
|
|
11280
|
+
}
|
|
11281
|
+
/**
|
|
11282
|
+
* @param {?} data
|
|
11283
|
+
* @return {?}
|
|
11284
|
+
*/
|
|
11285
|
+
isStripShowing(data) {
|
|
11286
|
+
/** @type {?} */
|
|
11287
|
+
let count = 0;
|
|
11288
|
+
if (data && data.key === this.environment.programStripKey && (!data.tabs || !data.tabs.length) &&
|
|
11289
|
+
data.stripTitle === this.environment.programStripName && data.widgets.length > 0) {
|
|
11290
|
+
data.widgets.forEach((/**
|
|
11291
|
+
* @param {?} key
|
|
11292
|
+
* @return {?}
|
|
11293
|
+
*/
|
|
11294
|
+
(key) => {
|
|
11295
|
+
if (key && key.widgetData.content.primaryCategory === this.environment.programStripPrimaryCategory) {
|
|
11296
|
+
count = count + 1;
|
|
11297
|
+
}
|
|
11298
|
+
}));
|
|
11299
|
+
if (count > 0) {
|
|
11300
|
+
data.showStrip = true;
|
|
11301
|
+
}
|
|
11302
|
+
else {
|
|
11303
|
+
data.showStrip = false;
|
|
11304
|
+
}
|
|
11305
|
+
}
|
|
11306
|
+
// console.log('data.key', data, data.key, data.widgets);
|
|
11307
|
+
return data.showStrip;
|
|
11308
|
+
}
|
|
11309
|
+
/**
|
|
11310
|
+
* @return {?}
|
|
11311
|
+
*/
|
|
11312
|
+
get isMobile() {
|
|
11313
|
+
return this.utilitySvc.isMobile || false;
|
|
11314
|
+
}
|
|
11315
|
+
/**
|
|
11316
|
+
* @param {?} data
|
|
11317
|
+
* @return {?}
|
|
11318
|
+
*/
|
|
11319
|
+
getdata(data) {
|
|
11320
|
+
if (data.stripInfo) {
|
|
11321
|
+
return data.stripInfo.widget;
|
|
11322
|
+
}
|
|
11323
|
+
return {};
|
|
11324
|
+
}
|
|
11325
|
+
/**
|
|
11326
|
+
* @param {?} wData
|
|
11327
|
+
* @param {?} data
|
|
11328
|
+
* @return {?}
|
|
11329
|
+
*/
|
|
11330
|
+
checkCondition(wData, data) {
|
|
11331
|
+
if (wData.strips[0].stripConfig && wData.strips[0].stripConfig.hideShowAll) {
|
|
11332
|
+
return !wData.strips[0].stripConfig.hideShowAll;
|
|
11333
|
+
}
|
|
11334
|
+
return wData.strips[0].viewMoreUrl && data.widgets && data.widgets.length >= 4;
|
|
11335
|
+
}
|
|
11336
|
+
/**
|
|
11337
|
+
* @param {?} data
|
|
11338
|
+
* @return {?}
|
|
11339
|
+
*/
|
|
11340
|
+
checkVisible(data) {
|
|
11341
|
+
return data.stripInfo && data.stripInfo.visibilityMode === 'visible';
|
|
11342
|
+
}
|
|
11343
|
+
/**
|
|
11344
|
+
* @param {?} data
|
|
11345
|
+
* @return {?}
|
|
11346
|
+
*/
|
|
11347
|
+
getContineuLearningLenth(data) {
|
|
11348
|
+
return data.widgets ? data.widgets.length : 0;
|
|
11349
|
+
}
|
|
11350
|
+
/**
|
|
11351
|
+
* @param {?} data
|
|
11352
|
+
* @return {?}
|
|
11353
|
+
*/
|
|
11354
|
+
getLength(data) {
|
|
11355
|
+
if (!data.tabs || !data.tabs.length) {
|
|
11356
|
+
return data.widgets ? data.widgets.length : 0;
|
|
11357
|
+
}
|
|
11358
|
+
{
|
|
11359
|
+
// if tabs are there check if each tab has widgets and get the tab with max widgets
|
|
11360
|
+
/** @type {?} */
|
|
11361
|
+
let tabWithMaxWidgets = {};
|
|
11362
|
+
data.tabs.forEach((/**
|
|
11363
|
+
* @param {?} tab
|
|
11364
|
+
* @return {?}
|
|
11365
|
+
*/
|
|
11366
|
+
(tab) => {
|
|
11367
|
+
if (tab.pillsData && tab.pillsData.length) {
|
|
11368
|
+
tabWithMaxWidgets = tab.pillsData.reduce((/**
|
|
11369
|
+
* @param {?} prev
|
|
11370
|
+
* @param {?} current
|
|
11371
|
+
* @return {?}
|
|
11372
|
+
*/
|
|
11373
|
+
(prev, current) => {
|
|
11374
|
+
if (!prev.widgets && !current.widgets) {
|
|
11375
|
+
return current;
|
|
11376
|
+
}
|
|
11377
|
+
if (prev.widgets && current.widgets) {
|
|
11378
|
+
return (prev.widgets.length > current.widgets.length) ? prev : current;
|
|
11379
|
+
}
|
|
11380
|
+
if (current.widgets && !prev.widgets) {
|
|
11381
|
+
return current;
|
|
11382
|
+
}
|
|
11383
|
+
if (!current.widgets && prev.widgets) {
|
|
11384
|
+
return prev;
|
|
11385
|
+
}
|
|
11386
|
+
return current;
|
|
11387
|
+
// return (prev.widgets && current.widgets && (prev.widgets.length > current.widgets.length) ) ? prev : current
|
|
11388
|
+
// tslint:disable-next-line: align
|
|
11389
|
+
}), data.tabs[0]);
|
|
11390
|
+
}
|
|
11391
|
+
}));
|
|
11392
|
+
// if tabs has atleast 1 widgets then strip will show or else not
|
|
11393
|
+
return tabWithMaxWidgets.widgets ? tabWithMaxWidgets.widgets.length : 0;
|
|
11394
|
+
}
|
|
11395
|
+
}
|
|
11396
|
+
/**
|
|
11397
|
+
* @private
|
|
11398
|
+
* @param {?} v6filters
|
|
11399
|
+
* @return {?}
|
|
11400
|
+
*/
|
|
11401
|
+
getFiltersFromArray(v6filters) {
|
|
11402
|
+
/** @type {?} */
|
|
11403
|
+
const filters = {};
|
|
11404
|
+
if (v6filters.constructor === Array) {
|
|
11405
|
+
v6filters.forEach(((/**
|
|
11406
|
+
* @param {?} f
|
|
11407
|
+
* @return {?}
|
|
11408
|
+
*/
|
|
11409
|
+
(f) => {
|
|
11410
|
+
Object.keys(f).forEach((/**
|
|
11411
|
+
* @param {?} key
|
|
11412
|
+
* @return {?}
|
|
11413
|
+
*/
|
|
11414
|
+
key => {
|
|
11415
|
+
filters[key] = f[key];
|
|
11416
|
+
}));
|
|
11417
|
+
})));
|
|
11418
|
+
return filters;
|
|
11419
|
+
}
|
|
11420
|
+
return v6filters;
|
|
11421
|
+
}
|
|
11422
|
+
/**
|
|
11423
|
+
* @private
|
|
11424
|
+
* @param {?} v6filters
|
|
11425
|
+
* @return {?}
|
|
11426
|
+
*/
|
|
11427
|
+
transformSearchV6FiltersV2(v6filters) {
|
|
11428
|
+
/** @type {?} */
|
|
11429
|
+
const filters = {};
|
|
11430
|
+
if (v6filters.constructor === Array) {
|
|
11431
|
+
v6filters.forEach(((/**
|
|
11432
|
+
* @param {?} f
|
|
11433
|
+
* @return {?}
|
|
11434
|
+
*/
|
|
11435
|
+
(f) => {
|
|
11436
|
+
Object.keys(f).forEach((/**
|
|
11437
|
+
* @param {?} key
|
|
11438
|
+
* @return {?}
|
|
11439
|
+
*/
|
|
11440
|
+
key => {
|
|
11441
|
+
filters[key] = f[key];
|
|
11442
|
+
}));
|
|
11443
|
+
})));
|
|
11444
|
+
return filters;
|
|
11445
|
+
}
|
|
11446
|
+
return v6filters;
|
|
11447
|
+
}
|
|
11448
|
+
/**
|
|
11449
|
+
* @param {?} filters
|
|
11450
|
+
* @return {?}
|
|
11451
|
+
*/
|
|
11452
|
+
checkForDateFilters(filters) {
|
|
11453
|
+
/** @type {?} */
|
|
11454
|
+
let userData;
|
|
11455
|
+
if (this.configSvc.userProfile) {
|
|
11456
|
+
userData = this.configSvc.userProfile;
|
|
11457
|
+
}
|
|
11458
|
+
if (filters && filters.hasOwnProperty('batches.endDate')) {
|
|
11459
|
+
// tslint:disable-next-line
|
|
11460
|
+
filters['batches.endDate']['>='] = eval(filters['batches.endDate']['>=']);
|
|
11461
|
+
}
|
|
11462
|
+
else if (filters && filters.hasOwnProperty('batches.enrollmentEndDate')) {
|
|
11463
|
+
// tslint:disable-next-line
|
|
11464
|
+
filters['batches.enrollmentEndDate']['>='] = eval(filters['batches.enrollmentEndDate']['>=']);
|
|
11465
|
+
}
|
|
11466
|
+
else if (filters.organisation &&
|
|
11467
|
+
filters.organisation.indexOf('<orgID>') >= 0) {
|
|
11468
|
+
if (this.providerId) {
|
|
11469
|
+
filters.organisation = this.providerId;
|
|
11470
|
+
}
|
|
11471
|
+
else {
|
|
11472
|
+
filters.organisation = userData && userData.rootOrgId;
|
|
11473
|
+
if (filters && filters.hasOwnProperty('designation')) {
|
|
11474
|
+
filters.designation = userData.professionalDetails.length > 0 ?
|
|
11475
|
+
userData.professionalDetails[0].designation : '';
|
|
11476
|
+
}
|
|
11477
|
+
}
|
|
11478
|
+
}
|
|
11479
|
+
return filters;
|
|
11480
|
+
}
|
|
11481
|
+
/**
|
|
11482
|
+
* @private
|
|
11483
|
+
* @param {?} strip
|
|
11484
|
+
* @param {?=} calculateParentStatus
|
|
11485
|
+
* @return {?}
|
|
11486
|
+
*/
|
|
11487
|
+
fetchStripFromRequestData(strip, calculateParentStatus = true) {
|
|
11488
|
+
// setting initial values
|
|
11489
|
+
strip.loaderWidgets = this.transformSkeletonToWidgets(strip);
|
|
11490
|
+
this.processStrip(strip, [], 'fetching', false, null);
|
|
11491
|
+
this.fetchFromEnrollmentList(strip, calculateParentStatus);
|
|
11492
|
+
this.fetchFromSearchV6(strip, calculateParentStatus);
|
|
11493
|
+
this.fetchFromTrendingContent(strip, calculateParentStatus);
|
|
11494
|
+
this.fetchAllTopContent(strip, calculateParentStatus);
|
|
11495
|
+
this.fetchAllFeaturedContent(strip, calculateParentStatus);
|
|
11496
|
+
this.fetchAllBookMarkData(strip, calculateParentStatus);
|
|
11497
|
+
this.fetchAllPlaylistSearch(strip, calculateParentStatus);
|
|
11498
|
+
this.fetchPlaylistReadData(strip, calculateParentStatus);
|
|
11499
|
+
this.fetchCiosContentData(strip, calculateParentStatus);
|
|
11500
|
+
this.fetchForYouData(strip, calculateParentStatus);
|
|
11501
|
+
this.fetchAllCbpPlans(strip, calculateParentStatus);
|
|
11502
|
+
// this.enrollInterval = setInterval(() => {
|
|
11503
|
+
// this.fetchAllCbpPlans(strip, calculateParentStatus)
|
|
11504
|
+
// }, 1000)
|
|
11505
|
+
}
|
|
11506
|
+
/**
|
|
11507
|
+
* @param {?} strip
|
|
11508
|
+
* @param {?=} calculateParentStatus
|
|
11509
|
+
* @return {?}
|
|
11510
|
+
*/
|
|
11511
|
+
fetchFromEnrollmentList(strip, calculateParentStatus = true) {
|
|
11512
|
+
if (strip.request && strip.request.enrollmentList && Object.keys(strip.request.enrollmentList).length) {
|
|
11513
|
+
/** @type {?} */
|
|
11514
|
+
let userId = '';
|
|
11515
|
+
/** @type {?} */
|
|
11516
|
+
let content;
|
|
11517
|
+
/** @type {?} */
|
|
11518
|
+
let contentNew;
|
|
11519
|
+
/** @type {?} */
|
|
11520
|
+
let tabResults = [];
|
|
11521
|
+
/** @type {?} */
|
|
11522
|
+
const queryParams = get(strip.request.enrollmentList, 'queryParams');
|
|
11523
|
+
if (this.configSvc.userProfile) {
|
|
11524
|
+
userId = this.configSvc.userProfile.userId;
|
|
11525
|
+
}
|
|
11526
|
+
// tslint:disable-next-line: deprecation
|
|
11527
|
+
this.userSvc.fetchUserBatchList(userId, queryParams).subscribe((/**
|
|
11528
|
+
* @param {?} result
|
|
11529
|
+
* @return {?}
|
|
11530
|
+
*/
|
|
11531
|
+
(result) => {
|
|
11532
|
+
/** @type {?} */
|
|
11533
|
+
const courses = result && result.courses;
|
|
11534
|
+
/** @type {?} */
|
|
11535
|
+
const showViewMore = Boolean(courses.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
11536
|
+
/** @type {?} */
|
|
11537
|
+
const viewMoreUrl = showViewMore
|
|
11538
|
+
? {
|
|
11539
|
+
path: (strip.viewMoreUrl && strip.viewMoreUrl.path) || '',
|
|
11540
|
+
queryParams: {
|
|
11541
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
11542
|
+
f: strip.request && strip.request.searchV6 && strip.request.searchV6.filters
|
|
11543
|
+
? JSON.stringify(
|
|
11544
|
+
// this.searchServSvc.transformSearchV6Filters(
|
|
11545
|
+
strip.request.searchV6.filters
|
|
11546
|
+
// ),
|
|
11547
|
+
)
|
|
11548
|
+
: {},
|
|
11549
|
+
},
|
|
11550
|
+
}
|
|
11551
|
+
: null;
|
|
11552
|
+
if (courses && courses.length) {
|
|
11553
|
+
content = courses.map((/**
|
|
11554
|
+
* @param {?} c
|
|
11555
|
+
* @return {?}
|
|
11556
|
+
*/
|
|
11557
|
+
(c) => {
|
|
11558
|
+
/** @type {?} */
|
|
11559
|
+
const contentTemp = c.content;
|
|
11560
|
+
contentTemp.completionPercentage = c.completionPercentage || c.progress || 0;
|
|
11561
|
+
contentTemp.completionStatus = c.completionStatus || c.status || 0;
|
|
11562
|
+
contentTemp.enrolledDate = c.enrolledDate || '';
|
|
11563
|
+
contentTemp.lastContentAccessTime = c.lastContentAccessTime || '';
|
|
11564
|
+
contentTemp.lastReadContentStatus = c.lastReadContentStatus || '';
|
|
11565
|
+
contentTemp.lastReadContentId = c.lastReadContentId || '';
|
|
11566
|
+
contentTemp.lrcProgressDetails = c.lrcProgressDetails || '';
|
|
11567
|
+
contentTemp.issuedCertificates = c.issuedCertificates || [];
|
|
11568
|
+
contentTemp.batchId = c.batchId || '';
|
|
11569
|
+
return contentTemp;
|
|
11570
|
+
}));
|
|
11571
|
+
}
|
|
11572
|
+
// To filter content with completionPercentage > 0,
|
|
11573
|
+
// so that only those content will show in home page
|
|
11574
|
+
// continue learing strip
|
|
11575
|
+
// if (content && content.length) {
|
|
11576
|
+
// contentNew = content.filter((c: any) => {
|
|
11577
|
+
// /** commented as both are 0 after enrolll */
|
|
11578
|
+
// if (c.completionPercentage && c.completionPercentage > 0) {
|
|
11579
|
+
// return c
|
|
11580
|
+
// }
|
|
11581
|
+
// })
|
|
11582
|
+
// }
|
|
11583
|
+
// To sort in descending order of the enrolled date
|
|
11584
|
+
contentNew = (content || []).sort((/**
|
|
11585
|
+
* @param {?} a
|
|
11586
|
+
* @param {?} b
|
|
11587
|
+
* @return {?}
|
|
11588
|
+
*/
|
|
11589
|
+
(a, b) => {
|
|
11590
|
+
/** @type {?} */
|
|
11591
|
+
const dateA = new Date(a.lastContentAccessTime || 0);
|
|
11592
|
+
/** @type {?} */
|
|
11593
|
+
const dateB = new Date(b.lastContentAccessTime || 0);
|
|
11594
|
+
return dateB - dateA;
|
|
11595
|
+
}));
|
|
11596
|
+
if (strip.tabs && strip.tabs.length) {
|
|
11597
|
+
tabResults = this.splitEnrollmentTabsData(contentNew, strip);
|
|
11598
|
+
this.processStrip(strip, this.transformContentsToWidgets(contentNew, strip), 'done', calculateParentStatus, viewMoreUrl, tabResults);
|
|
11599
|
+
}
|
|
11600
|
+
else {
|
|
11601
|
+
this.processStrip(strip, this.transformContentsToWidgets(contentNew, strip), 'done', calculateParentStatus, viewMoreUrl);
|
|
11602
|
+
}
|
|
11603
|
+
}), (/**
|
|
11604
|
+
* @return {?}
|
|
11605
|
+
*/
|
|
11606
|
+
() => {
|
|
11607
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
11608
|
+
}));
|
|
11609
|
+
}
|
|
11610
|
+
}
|
|
11611
|
+
/**
|
|
11612
|
+
* @param {?} contentNew
|
|
11613
|
+
* @param {?} strip
|
|
11614
|
+
* @return {?}
|
|
11615
|
+
*/
|
|
11616
|
+
splitEnrollmentTabsData(contentNew, strip) {
|
|
11617
|
+
/** @type {?} */
|
|
11618
|
+
const tabResults = [];
|
|
11619
|
+
/** @type {?} */
|
|
11620
|
+
const splitData = this.getInprogressAndCompleted(contentNew, (/**
|
|
11621
|
+
* @param {?} e
|
|
11622
|
+
* @return {?}
|
|
11623
|
+
*/
|
|
11624
|
+
(e) => e.completionStatus === 1 || e.completionPercentage < 100), strip);
|
|
11625
|
+
if (strip.tabs && strip.tabs.length) {
|
|
11626
|
+
for (let i = 0; i < strip.tabs.length; i += 1) {
|
|
11627
|
+
if (strip.tabs[i]) {
|
|
11628
|
+
tabResults.push(Object.assign({}, strip.tabs[i], { fetchTabStatus: 'done' }, (splitData.find((/**
|
|
11629
|
+
* @param {?} itmInner
|
|
11630
|
+
* @return {?}
|
|
11631
|
+
*/
|
|
11632
|
+
itmInner => {
|
|
11633
|
+
if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
|
|
11634
|
+
return itmInner;
|
|
11635
|
+
}
|
|
11636
|
+
return undefined;
|
|
11637
|
+
})))));
|
|
11638
|
+
}
|
|
11639
|
+
}
|
|
11640
|
+
}
|
|
11641
|
+
return tabResults;
|
|
11642
|
+
}
|
|
11643
|
+
/**
|
|
11644
|
+
* @param {?} array
|
|
11645
|
+
* @param {?} customFilter
|
|
11646
|
+
* @param {?} strip
|
|
11647
|
+
* @return {?}
|
|
11648
|
+
*/
|
|
11649
|
+
getInprogressAndCompleted(array, customFilter, strip) {
|
|
11650
|
+
/** @type {?} */
|
|
11651
|
+
const inprogress = [];
|
|
11652
|
+
/** @type {?} */
|
|
11653
|
+
const completed = [];
|
|
11654
|
+
array.forEach((/**
|
|
11655
|
+
* @param {?} e
|
|
11656
|
+
* @param {?} idx
|
|
11657
|
+
* @param {?} arr
|
|
11658
|
+
* @return {?}
|
|
11659
|
+
*/
|
|
11660
|
+
(e, idx, arr) => (customFilter(e, idx, arr) ? inprogress : completed).push(e)));
|
|
11661
|
+
return [
|
|
11662
|
+
{ value: 'inprogress', widgets: this.transformContentsToWidgets(inprogress, strip) },
|
|
11663
|
+
{ value: 'completed', widgets: this.transformContentsToWidgets(completed, strip) }
|
|
11664
|
+
];
|
|
11665
|
+
}
|
|
11666
|
+
// async fetchFromSearchV6(strip: NsContentStripWithTabs.IContentStripUnit, calculateParentStatus = true) {
|
|
11667
|
+
// if (strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length) {
|
|
11668
|
+
// // if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
|
|
11669
|
+
// // if (this.configSvc.activeLocale) {
|
|
11670
|
+
// // strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
|
|
11671
|
+
// // } else {
|
|
11672
|
+
// // strip.request.searchV6.locale = ['en']
|
|
11673
|
+
// // }
|
|
11674
|
+
// // }
|
|
11675
|
+
// let originalFilters: any = [];
|
|
11676
|
+
// // tslint:disable:no-console
|
|
11677
|
+
// console.log(originalFilters);
|
|
11678
|
+
// if (strip.request &&
|
|
11679
|
+
// strip.request.searchV6 &&
|
|
11680
|
+
// strip.request.searchV6.request &&
|
|
11681
|
+
// strip.request.searchV6.request.filters) {
|
|
11682
|
+
// originalFilters = strip.request.searchV6.request.filters;
|
|
11683
|
+
// strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
|
|
11684
|
+
// strip.request.searchV6.request.filters = this.getFiltersFromArray(
|
|
11685
|
+
// strip.request.searchV6.request.filters,
|
|
11686
|
+
// );
|
|
11687
|
+
// }
|
|
11688
|
+
// if (strip.tabs && strip.tabs.length) {
|
|
11689
|
+
// // TODO: Have to extract requestRequired to outer level of tabs config
|
|
11690
|
+
// const firstTab = strip.tabs[0];
|
|
11691
|
+
// if (firstTab.requestRequired) {
|
|
11692
|
+
// if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
11693
|
+
// const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
11694
|
+
// const currentTabFromMap = (allTabs && allTabs.length && allTabs[0]) as NsContentStripWithTabs.IContentStripTab;
|
|
11695
|
+
// this.getTabDataByNewReqSearchV6(strip, 0, currentTabFromMap, calculateParentStatus);
|
|
11696
|
+
// }
|
|
11697
|
+
// }
|
|
11698
|
+
// } else {
|
|
11699
|
+
// try {
|
|
11700
|
+
// const response = await this.searchV6Request(strip, strip.request, calculateParentStatus);
|
|
11701
|
+
// // console.log('calling after - response, ', response)
|
|
11702
|
+
// if (response && response.results) {
|
|
11703
|
+
// // console.log('calling after-- ')
|
|
11704
|
+
// if (response.results.result.content) {
|
|
11705
|
+
// if(strip.key === 'scheduledAssessment') {
|
|
11706
|
+
// this.enrollInterval = setInterval(() => {
|
|
11707
|
+
// this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl)
|
|
11708
|
+
// // tslint:disable-next-line
|
|
11709
|
+
// }, 1000)
|
|
11710
|
+
// } else {
|
|
11711
|
+
// this.processStrip(
|
|
11712
|
+
// strip,
|
|
11713
|
+
// this.transformContentsToWidgets(response.results.result.content, strip),
|
|
11714
|
+
// 'done',
|
|
11715
|
+
// calculateParentStatus,
|
|
11716
|
+
// response.viewMoreUrl,
|
|
11717
|
+
// );
|
|
11718
|
+
// }
|
|
11719
|
+
// } else if (response.results.result.Event) {
|
|
11720
|
+
// this.processStrip(
|
|
11721
|
+
// strip,
|
|
11722
|
+
// this.transformEventsToWidgets(response.results.result.Event, strip),
|
|
11723
|
+
// 'done',
|
|
11724
|
+
// calculateParentStatus,
|
|
11725
|
+
// response.viewMoreUrl,
|
|
11726
|
+
// );
|
|
11727
|
+
// } else {
|
|
11728
|
+
// this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
11729
|
+
// }
|
|
11730
|
+
// } else {
|
|
11731
|
+
// this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
11732
|
+
// }
|
|
11733
|
+
// } catch (error) {
|
|
11734
|
+
// // Handle errors
|
|
11735
|
+
// // console.error('Error:', error);
|
|
11736
|
+
// }
|
|
11737
|
+
// }
|
|
11738
|
+
// }
|
|
11739
|
+
// }
|
|
11740
|
+
/**
|
|
11741
|
+
* @param {?} content
|
|
11742
|
+
* @param {?} strip
|
|
11743
|
+
* @param {?} calculateParentStatus
|
|
11744
|
+
* @param {?} viewMoreUrl
|
|
11745
|
+
* @return {?}
|
|
11746
|
+
*/
|
|
11747
|
+
checkInvitOnlyAssessments(content, strip, calculateParentStatus, viewMoreUrl) {
|
|
11748
|
+
if (localStorage.getItem('enrollmentMapData')) {
|
|
11749
|
+
this.enrollmentMapData = JSON.parse(localStorage.getItem('enrollmentMapData') || '{}');
|
|
11750
|
+
/** @type {?} */
|
|
11751
|
+
let filteredArray = [];
|
|
11752
|
+
content.forEach((/**
|
|
11753
|
+
* @param {?} data
|
|
11754
|
+
* @return {?}
|
|
11755
|
+
*/
|
|
11756
|
+
(data) => {
|
|
11757
|
+
if (this.enrollmentMapData[data.identifier]) {
|
|
11758
|
+
data['batch'] = this.enrollmentMapData[data.identifier].batch;
|
|
11759
|
+
data['completionPercentage'] = this.enrollmentMapData[data.identifier].completionPercentage;
|
|
11760
|
+
filteredArray.push(data);
|
|
11761
|
+
}
|
|
11762
|
+
}));
|
|
11763
|
+
this.processStrip(strip, this.transformContentsToWidgets(filteredArray, strip), 'done', calculateParentStatus, viewMoreUrl);
|
|
11764
|
+
clearInterval(this.enrollInterval);
|
|
11765
|
+
}
|
|
11766
|
+
}
|
|
11767
|
+
// async searchV6Request(strip: NsContentStripWithTabs.IContentStripUnit,
|
|
11768
|
+
// request: NsContentStripWithTabs.IContentStripUnit['request'],
|
|
11769
|
+
// calculateParentStatus: boolean
|
|
11770
|
+
// ): Promise<any> {
|
|
11771
|
+
// const originalFilters: any = [];
|
|
11772
|
+
// return new Promise<any>((resolve, reject) => {
|
|
11773
|
+
// if (request && request.searchV6) {
|
|
11774
|
+
// this.contentSvc.searchV6(request.searchV6).subscribe(results => {
|
|
11775
|
+
// const showViewMore = Boolean(
|
|
11776
|
+
// results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch,
|
|
11777
|
+
// );
|
|
11778
|
+
// const viewMoreUrl = showViewMore
|
|
11779
|
+
// ? {
|
|
11780
|
+
// path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
11781
|
+
// queryParams: {
|
|
11782
|
+
// tab: 'Learn',
|
|
11783
|
+
// q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
11784
|
+
// f:
|
|
11785
|
+
// request &&
|
|
11786
|
+
// request.searchV6 &&
|
|
11787
|
+
// request.searchV6.request &&
|
|
11788
|
+
// request.searchV6.request.filters
|
|
11789
|
+
// ? JSON.stringify(
|
|
11790
|
+
// this.transformSearchV6FiltersV2(
|
|
11791
|
+
// originalFilters,
|
|
11792
|
+
// )
|
|
11793
|
+
// )
|
|
11794
|
+
// : {},
|
|
11795
|
+
// },
|
|
11796
|
+
// }
|
|
11797
|
+
// : null;
|
|
11798
|
+
// // if (viewMoreUrl && viewMoreUrl.queryParams) {
|
|
11799
|
+
// // viewMoreUrl.queryParams = viewMoreUrl.queryParams
|
|
11800
|
+
// // }
|
|
11801
|
+
// resolve({ results, viewMoreUrl });
|
|
11802
|
+
// }, (error: any) => {
|
|
11803
|
+
// this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
11804
|
+
// reject(error);
|
|
11805
|
+
// },
|
|
11806
|
+
// );
|
|
11807
|
+
// }
|
|
11808
|
+
// });
|
|
11809
|
+
// }
|
|
11810
|
+
/**
|
|
11811
|
+
* @param {?} strip
|
|
11812
|
+
* @param {?=} calculateParentStatus
|
|
11813
|
+
* @return {?}
|
|
11814
|
+
*/
|
|
11815
|
+
fetchFromTrendingContent(strip, calculateParentStatus = true) {
|
|
11816
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11817
|
+
if (strip.request && strip.request.trendingSearch && Object.keys(strip.request.trendingSearch).length) {
|
|
11818
|
+
// if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
|
|
11819
|
+
// if (this.configSvc.activeLocale) {
|
|
11820
|
+
// strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
|
|
11821
|
+
// } else {
|
|
11822
|
+
// strip.request.searchV6.locale = ['en']
|
|
11823
|
+
// }
|
|
11824
|
+
// }
|
|
11825
|
+
/** @type {?} */
|
|
11826
|
+
let originalFilters = [];
|
|
11827
|
+
// tslint:disable:no-console
|
|
11828
|
+
if (strip.request &&
|
|
11829
|
+
strip.request.trendingSearch &&
|
|
11830
|
+
strip.request.trendingSearch.request &&
|
|
11831
|
+
strip.request.trendingSearch.request.filters) {
|
|
11832
|
+
originalFilters = strip.request.trendingSearch.request.filters;
|
|
11833
|
+
strip.request.trendingSearch.request.filters = this.checkForDateFilters(strip.request.trendingSearch.request.filters);
|
|
11834
|
+
strip.request.trendingSearch.request.filters = this.getFiltersFromArray(strip.request.trendingSearch.request.filters);
|
|
11835
|
+
}
|
|
11836
|
+
if (strip.tabs && strip.tabs.length) {
|
|
11837
|
+
// TODO: Have to extract requestRequired to outer level of tabs config
|
|
11838
|
+
/** @type {?} */
|
|
11839
|
+
const firstTab = strip.tabs[0];
|
|
11840
|
+
if (firstTab.requestRequired) {
|
|
11841
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
11842
|
+
/** @type {?} */
|
|
11843
|
+
const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
11844
|
+
/** @type {?} */
|
|
11845
|
+
const currentTabFromMap = (/** @type {?} */ ((allTabs && allTabs.length && allTabs[0])));
|
|
11846
|
+
this.getTabDataByNewReqTrending(strip, 0, 0, currentTabFromMap, calculateParentStatus);
|
|
11847
|
+
}
|
|
11848
|
+
}
|
|
11849
|
+
}
|
|
11850
|
+
else {
|
|
11851
|
+
try {
|
|
11852
|
+
/** @type {?} */
|
|
11853
|
+
const response = yield this.trendingSearchRequest(strip, strip.request, calculateParentStatus);
|
|
11854
|
+
if (response && response.results && response.results.response) {
|
|
11855
|
+
/** @type {?} */
|
|
11856
|
+
const content = response.results.response[strip.request.trendingSearch.responseKey] || [];
|
|
11857
|
+
this.processStrip(strip, this.transformContentsToWidgets(content, strip), 'done', calculateParentStatus, response.viewMoreUrl || '');
|
|
11858
|
+
if (!content.length) {
|
|
11859
|
+
this.emptyResponse.emit(true);
|
|
11860
|
+
}
|
|
11861
|
+
}
|
|
11862
|
+
else {
|
|
11863
|
+
this.emptyResponse.emit(true);
|
|
11864
|
+
this.processStrip(strip, [], 'done', calculateParentStatus, null);
|
|
11865
|
+
}
|
|
11866
|
+
}
|
|
11867
|
+
catch (error) {
|
|
11868
|
+
// Handle errors
|
|
11869
|
+
this.emptyResponse.emit(true);
|
|
11870
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
11871
|
+
}
|
|
11872
|
+
}
|
|
11873
|
+
}
|
|
11874
|
+
});
|
|
11875
|
+
}
|
|
11876
|
+
// async trendingSearchRequest(strip: NsContentStripWithTabs.IContentStripUnit,
|
|
11877
|
+
// request: NsContentStripWithTabs.IContentStripUnit['request'],
|
|
11878
|
+
// calculateParentStatus: boolean
|
|
11879
|
+
// ): Promise<any> {
|
|
11880
|
+
// const originalFilters: any = [];
|
|
11881
|
+
// return new Promise<any>((resolve, reject) => {
|
|
11882
|
+
// if (request && request.trendingSearch) {
|
|
11883
|
+
// // check for the request if it has dynamic values]
|
|
11884
|
+
// if (request.trendingSearch.request.filters.organisation &&
|
|
11885
|
+
// request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0
|
|
11886
|
+
// ) {
|
|
11887
|
+
// let userRootOrgId;
|
|
11888
|
+
// if (this.configSvc.userProfile) {
|
|
11889
|
+
// userRootOrgId = this.configSvc.userProfile.rootOrgId;
|
|
11890
|
+
// }
|
|
11891
|
+
// request.trendingSearch.request.filters.organisation = userRootOrgId;
|
|
11892
|
+
// }
|
|
11893
|
+
// this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe(results => {
|
|
11894
|
+
// const showViewMore = Boolean(
|
|
11895
|
+
// results.result &&
|
|
11896
|
+
// strip.request &&
|
|
11897
|
+
// results.result[strip.request.trendingSearch.responseKey] &&
|
|
11898
|
+
// results.result[strip.request.trendingSearch.responseKey].length > 5 &&
|
|
11899
|
+
// strip.stripConfig && strip.stripConfig.postCardForSearch,
|
|
11900
|
+
// );
|
|
11901
|
+
// const viewMoreUrl = showViewMore
|
|
11902
|
+
// ? {
|
|
11903
|
+
// path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
11904
|
+
// queryParams: {
|
|
11905
|
+
// tab: 'Learn',
|
|
11906
|
+
// q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
11907
|
+
// f:
|
|
11908
|
+
// request &&
|
|
11909
|
+
// request.trendingSearch &&
|
|
11910
|
+
// request.trendingSearch.request &&
|
|
11911
|
+
// request.trendingSearch.request.filters
|
|
11912
|
+
// ? JSON.stringify(
|
|
11913
|
+
// this.transformSearchV6FiltersV2(
|
|
11914
|
+
// originalFilters,
|
|
11915
|
+
// )
|
|
11916
|
+
// )
|
|
11917
|
+
// : {},
|
|
11918
|
+
// },
|
|
11919
|
+
// }
|
|
11920
|
+
// : null;
|
|
11921
|
+
// let proccesedResult: any = []
|
|
11922
|
+
// if (results && results.response && results.response.certifications) {
|
|
11923
|
+
// results.response.certifications.map((result: any) => {
|
|
11924
|
+
// if (result.source === this.channnelName) {
|
|
11925
|
+
// proccesedResult.push(result)
|
|
11926
|
+
// }
|
|
11927
|
+
// })
|
|
11928
|
+
// }
|
|
11929
|
+
// results = {response: {certifications: proccesedResult}}
|
|
11930
|
+
// resolve({ results, viewMoreUrl });
|
|
11931
|
+
// }, (error: any) => {
|
|
11932
|
+
// if (error.error && error.error.status === 400) {
|
|
11933
|
+
// this.processStrip(strip, [], 'done', calculateParentStatus, null);
|
|
11934
|
+
// }
|
|
11935
|
+
// // this.processStrip(strip, [], 'done', calculateParentStatus, null)
|
|
11936
|
+
// reject(error);
|
|
11937
|
+
// },
|
|
11938
|
+
// );
|
|
11939
|
+
// }
|
|
11940
|
+
// });
|
|
11941
|
+
// }
|
|
11942
|
+
/**
|
|
11943
|
+
* @param {?} data
|
|
11944
|
+
* @return {?}
|
|
11945
|
+
*/
|
|
11946
|
+
toggleInfo(data) {
|
|
11947
|
+
/** @type {?} */
|
|
11948
|
+
const stripInfo = this.stripsResultDataMap[data.key].stripInfo;
|
|
11949
|
+
if (stripInfo) {
|
|
11950
|
+
if (stripInfo.mode !== 'below') {
|
|
11951
|
+
this.loggerSvc.warn(`strip info mode: ${stripInfo.mode} not implemented yet`);
|
|
11952
|
+
stripInfo.mode = 'below';
|
|
11953
|
+
}
|
|
11954
|
+
if (stripInfo.mode === 'below') {
|
|
11955
|
+
this.stripsResultDataMap[data.key].stripInfo = Object.assign({}, stripInfo, { visibilityMode: stripInfo.visibilityMode === 'hidden' ? 'visible' : 'hidden' });
|
|
11956
|
+
}
|
|
11957
|
+
}
|
|
11958
|
+
}
|
|
11959
|
+
/**
|
|
11960
|
+
* @private
|
|
11961
|
+
* @param {?} contents
|
|
11962
|
+
* @param {?} strip
|
|
11963
|
+
* @return {?}
|
|
11964
|
+
*/
|
|
11965
|
+
transformContentsToWidgets(contents, strip) {
|
|
11966
|
+
return (contents || []).map((/**
|
|
11967
|
+
* @param {?} content
|
|
11968
|
+
* @param {?} idx
|
|
11969
|
+
* @return {?}
|
|
11970
|
+
*/
|
|
11971
|
+
(content, idx) => (content ? {
|
|
11972
|
+
widgetType: 'cardLib',
|
|
11973
|
+
widgetSubType: 'cardContentLib',
|
|
11974
|
+
widgetHostClass: 'mb-2',
|
|
11975
|
+
widgetData: Object.assign({ content }, (content.batch && { batch: content.batch }), { cardSubType: strip.stripConfig && strip.stripConfig.cardSubType, cardCustomeClass: strip.customeClass ? strip.customeClass : '', context: { pageSection: strip.key, position: idx }, intranetMode: strip.stripConfig && strip.stripConfig.intranetMode, deletedMode: strip.stripConfig && strip.stripConfig.deletedMode, contentTags: strip.stripConfig && strip.stripConfig.contentTags }),
|
|
11976
|
+
} : {
|
|
11977
|
+
widgetType: 'card',
|
|
11978
|
+
widgetSubType: 'cardContent',
|
|
11979
|
+
widgetHostClass: 'mb-2',
|
|
11980
|
+
widgetData: {},
|
|
11981
|
+
})));
|
|
11982
|
+
}
|
|
11983
|
+
/**
|
|
11984
|
+
* @private
|
|
11985
|
+
* @param {?} contents
|
|
11986
|
+
* @param {?} strip
|
|
11987
|
+
* @return {?}
|
|
11988
|
+
*/
|
|
11989
|
+
transformEventsToWidgets(contents, strip) {
|
|
11990
|
+
this.eventSvc.setEventListData(contents);
|
|
11991
|
+
return (this.eventSvc.todaysEvents || []).map((/**
|
|
11992
|
+
* @param {?} content
|
|
11993
|
+
* @param {?} idx
|
|
11994
|
+
* @return {?}
|
|
11995
|
+
*/
|
|
11996
|
+
(content, idx) => (content ? {
|
|
11997
|
+
widgetType: 'card',
|
|
11998
|
+
widgetSubType: 'eventHubCard',
|
|
11999
|
+
widgetHostClass: 'mb-2',
|
|
12000
|
+
widgetData: {
|
|
12001
|
+
content,
|
|
12002
|
+
cardSubType: strip.stripConfig && strip.stripConfig.cardSubType,
|
|
12003
|
+
cardCustomeClass: strip.customeClass ? strip.customeClass : '',
|
|
12004
|
+
context: { pageSection: strip.key, position: idx },
|
|
12005
|
+
intranetMode: strip.stripConfig && strip.stripConfig.intranetMode,
|
|
12006
|
+
deletedMode: strip.stripConfig && strip.stripConfig.deletedMode,
|
|
12007
|
+
contentTags: strip.stripConfig && strip.stripConfig.contentTags,
|
|
12008
|
+
},
|
|
12009
|
+
} : {
|
|
12010
|
+
widgetType: 'card',
|
|
12011
|
+
widgetSubType: 'eventHubCard',
|
|
12012
|
+
widgetHostClass: 'mb-2',
|
|
12013
|
+
widgetData: {},
|
|
12014
|
+
})));
|
|
12015
|
+
}
|
|
12016
|
+
/**
|
|
12017
|
+
* @private
|
|
12018
|
+
* @param {?} strip
|
|
12019
|
+
* @return {?}
|
|
12020
|
+
*/
|
|
12021
|
+
transformSkeletonToWidgets(strip) {
|
|
12022
|
+
return [1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10].map((/**
|
|
12023
|
+
* @param {?} _content
|
|
12024
|
+
* @return {?}
|
|
12025
|
+
*/
|
|
12026
|
+
_content => ({
|
|
12027
|
+
widgetType: 'cardLib',
|
|
12028
|
+
widgetSubType: 'cardContentLib',
|
|
12029
|
+
widgetHostClass: 'mb-2',
|
|
12030
|
+
widgetData: {
|
|
12031
|
+
cardSubType: strip.loaderConfig && strip.loaderConfig.cardSubType || 'card-standard-skeleton',
|
|
12032
|
+
cardCustomeClass: strip.customeClass ? strip.customeClass : '',
|
|
12033
|
+
},
|
|
12034
|
+
})));
|
|
12035
|
+
}
|
|
12036
|
+
/**
|
|
12037
|
+
* @private
|
|
12038
|
+
* @param {?} strip
|
|
12039
|
+
* @param {?=} results
|
|
12040
|
+
* @param {?=} fetchStatus
|
|
12041
|
+
* @param {?=} calculateParentStatus
|
|
12042
|
+
* @param {?=} _viewMoreUrl
|
|
12043
|
+
* @param {?=} tabsResults
|
|
12044
|
+
* @return {?}
|
|
12045
|
+
*/
|
|
12046
|
+
processStrip(strip, results = [], fetchStatus, calculateParentStatus = true, _viewMoreUrl, tabsResults) {
|
|
12047
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12048
|
+
/** @type {?} */
|
|
12049
|
+
const stripData = {
|
|
12050
|
+
viewMoreUrl: strip.viewMoreUrl,
|
|
12051
|
+
key: strip.key,
|
|
12052
|
+
canHideStrip: Boolean(strip.canHideStrip),
|
|
12053
|
+
showStrip: this.getIfStripHidden(strip.key),
|
|
12054
|
+
noDataWidget: strip.noDataWidget,
|
|
12055
|
+
errorWidget: strip.errorWidget,
|
|
12056
|
+
stripInfo: strip.info,
|
|
12057
|
+
stripTitle: strip.title,
|
|
12058
|
+
stripTitleLink: strip.stripTitleLink,
|
|
12059
|
+
disableTranslate: strip.disableTranslate,
|
|
12060
|
+
sliderConfig: strip.sliderConfig,
|
|
12061
|
+
tabs: tabsResults ? tabsResults : strip.tabs,
|
|
12062
|
+
stripName: strip.name,
|
|
12063
|
+
mode: strip.mode,
|
|
12064
|
+
stripConfig: strip.stripConfig,
|
|
12065
|
+
stripBackground: strip.stripBackground,
|
|
12066
|
+
secondaryHeading: strip.secondaryHeading,
|
|
12067
|
+
loaderWidgets: strip.loaderWidgets || [],
|
|
12068
|
+
widgets: fetchStatus === 'done'
|
|
12069
|
+
? [
|
|
12070
|
+
...(strip.preWidgets || []).map((/**
|
|
12071
|
+
* @param {?} w
|
|
12072
|
+
* @return {?}
|
|
12073
|
+
*/
|
|
12074
|
+
w => (Object.assign({}, w, { widgetHostClass: `mb-2 ${w.widgetHostClass}` })))),
|
|
12075
|
+
...results,
|
|
12076
|
+
...(strip.postWidgets || []).map((/**
|
|
12077
|
+
* @param {?} w
|
|
12078
|
+
* @return {?}
|
|
12079
|
+
*/
|
|
12080
|
+
w => (Object.assign({}, w, { widgetHostClass: `mb-2 ${w.widgetHostClass}` })))),
|
|
12081
|
+
]
|
|
12082
|
+
: [],
|
|
12083
|
+
showOnNoData: Boolean(strip.noDataWidget &&
|
|
12084
|
+
!((strip.preWidgets || []).length + results.length + (strip.postWidgets || []).length) &&
|
|
12085
|
+
fetchStatus === 'done'),
|
|
12086
|
+
showOnLoader: Boolean(strip.loader && fetchStatus === 'fetching'),
|
|
12087
|
+
showOnError: Boolean(strip.errorWidget && fetchStatus === 'error'),
|
|
12088
|
+
};
|
|
12089
|
+
// const stripData = this.stripsResultDataMap[strip.key]
|
|
12090
|
+
this.stripsResultDataMap = Object.assign({}, this.stripsResultDataMap, { [strip.key]: stripData });
|
|
12091
|
+
if (!tabsResults) {
|
|
12092
|
+
if (calculateParentStatus &&
|
|
12093
|
+
(fetchStatus === 'done' || fetchStatus === 'error') &&
|
|
12094
|
+
stripData.widgets) {
|
|
12095
|
+
this.checkParentStatus(fetchStatus, stripData.widgets.length);
|
|
12096
|
+
}
|
|
12097
|
+
if (calculateParentStatus && !(results && results.length > 0)) {
|
|
12098
|
+
this.contentAvailable = false;
|
|
12099
|
+
}
|
|
12100
|
+
else if (results && results.length > 0) {
|
|
12101
|
+
this.contentAvailable = true;
|
|
12102
|
+
}
|
|
12103
|
+
}
|
|
12104
|
+
else {
|
|
12105
|
+
this.contentAvailable = true;
|
|
12106
|
+
}
|
|
12107
|
+
});
|
|
12108
|
+
}
|
|
12109
|
+
/**
|
|
12110
|
+
* @private
|
|
12111
|
+
* @param {?} fetchStatus
|
|
12112
|
+
* @param {?} stripWidgetsCount
|
|
12113
|
+
* @return {?}
|
|
12114
|
+
*/
|
|
12115
|
+
checkParentStatus(fetchStatus, stripWidgetsCount) {
|
|
12116
|
+
if (fetchStatus === 'done' && !stripWidgetsCount) {
|
|
12117
|
+
this.noDataCount += 1;
|
|
12118
|
+
}
|
|
12119
|
+
else if (fetchStatus === 'done' && stripWidgetsCount) {
|
|
12120
|
+
this.successDataCount += 1;
|
|
12121
|
+
}
|
|
12122
|
+
else if (fetchStatus === 'error') {
|
|
12123
|
+
this.errorDataCount += 1;
|
|
12124
|
+
}
|
|
12125
|
+
/** @type {?} */
|
|
12126
|
+
const settledCount = this.noDataCount + this.successDataCount + this.errorDataCount;
|
|
12127
|
+
/** @type {?} */
|
|
12128
|
+
const totalCount = this.widgetData.strips.length;
|
|
12129
|
+
if (this.successDataCount > 0 && settledCount < totalCount) {
|
|
12130
|
+
return;
|
|
12131
|
+
}
|
|
12132
|
+
this.showParentLoader = settledCount !== totalCount;
|
|
12133
|
+
this.showParentNoData =
|
|
12134
|
+
this.noDataCount > 0 && this.noDataCount + this.errorDataCount === totalCount;
|
|
12135
|
+
this.showParentError = this.errorDataCount === totalCount;
|
|
12136
|
+
}
|
|
12137
|
+
/**
|
|
12138
|
+
* @param {?} strip
|
|
12139
|
+
* @return {?}
|
|
12140
|
+
*/
|
|
12141
|
+
checkForEmptyWidget(strip) {
|
|
12142
|
+
if (strip.request &&
|
|
12143
|
+
((strip.request.api && Object.keys(strip.request.api).length) ||
|
|
12144
|
+
(strip.request.search && Object.keys(strip.request.search).length) ||
|
|
12145
|
+
(strip.request.searchRegionRecommendation &&
|
|
12146
|
+
Object.keys(strip.request.searchRegionRecommendation).length) ||
|
|
12147
|
+
(strip.request.searchV6 && Object.keys(strip.request.searchV6).length) ||
|
|
12148
|
+
(strip.request.enrollmentList && Object.keys(strip.request.enrollmentList).length) ||
|
|
12149
|
+
(strip.request.cbpList && Object.keys(strip.request.cbpList).length) ||
|
|
12150
|
+
(strip.request.trendingSearch && Object.keys(strip.request.trendingSearch).length) ||
|
|
12151
|
+
(strip.request.topContent && Object.keys(strip.request.topContent).length) ||
|
|
12152
|
+
(strip.request.featureContent && Object.keys(strip.request.featureContent).length) ||
|
|
12153
|
+
(strip.request.bookmarkRead && Object.keys(strip.request.bookmarkRead).length) ||
|
|
12154
|
+
(strip.request.playlistSearch && Object.keys(strip.request.playlistSearch).length) ||
|
|
12155
|
+
(strip.request.playlistRead && Object.keys(strip.request.playlistRead).length) ||
|
|
12156
|
+
(strip.request.ciosContent && Object.keys(strip.request.ciosContent).length) ||
|
|
12157
|
+
(strip && strip.tabs.length))) {
|
|
12158
|
+
return true;
|
|
12159
|
+
}
|
|
12160
|
+
return false;
|
|
12161
|
+
}
|
|
12162
|
+
// public tabClicked(tabEvent: MatTabChangeEvent, stripMap: IStripUnitContentData, stripKey: string) {
|
|
12163
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
12164
|
+
// stripMap.tabs[tabEvent.index].fetchTabStatus = 'inprogress';
|
|
12165
|
+
// stripMap.tabs[tabEvent.index].tabLoading = true;
|
|
12166
|
+
// stripMap.showOnLoader = true;
|
|
12167
|
+
// }
|
|
12168
|
+
// const data: WsEvents.ITelemetryTabData = {
|
|
12169
|
+
// label: `${tabEvent.tab.textLabel}`,
|
|
12170
|
+
// index: tabEvent.index,
|
|
12171
|
+
// };
|
|
12172
|
+
// this.eventSvc.raiseInteractTelemetry(
|
|
12173
|
+
// {
|
|
12174
|
+
// type: WsEvents.EnumInteractTypes.CLICK,
|
|
12175
|
+
// subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
|
|
12176
|
+
// id: `${_.camelCase(data.label)}-tab`,
|
|
12177
|
+
// },
|
|
12178
|
+
// {},
|
|
12179
|
+
// {
|
|
12180
|
+
// module: WsEvents.EnumTelemetrymodules.HOME,
|
|
12181
|
+
// }
|
|
12182
|
+
// );
|
|
12183
|
+
// const currentTabFromMap: any = stripMap.tabs && stripMap.tabs[tabEvent.index];
|
|
12184
|
+
// const currentStrip = this.widgetData.strips.find(s => s.key === stripKey);
|
|
12185
|
+
// if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
|
|
12186
|
+
// this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = {
|
|
12187
|
+
// ...this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams,
|
|
12188
|
+
// tabSelected: currentTabFromMap.label,
|
|
12189
|
+
// };
|
|
12190
|
+
// }
|
|
12191
|
+
// if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick) {
|
|
12192
|
+
// if (currentTabFromMap.requestRequired && currentTabFromMap.request) {
|
|
12193
|
+
// // call API to get tab data and process
|
|
12194
|
+
// // this.processStrip(currentStrip, [], 'fetching', true, null)
|
|
12195
|
+
// if (currentTabFromMap.request.searchV6) {
|
|
12196
|
+
// this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, currentTabFromMap, true);
|
|
12197
|
+
// } else if (currentTabFromMap.request.trendingSearch) {
|
|
12198
|
+
// this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentTabFromMap, true);
|
|
12199
|
+
// }
|
|
12200
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
12201
|
+
// stripMap.tabs[tabEvent.index].tabLoading = false;
|
|
12202
|
+
// }
|
|
12203
|
+
// } else {
|
|
12204
|
+
// this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
|
|
12205
|
+
// setTimeout(() => {
|
|
12206
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
12207
|
+
// stripMap.tabs[tabEvent.index].tabLoading = false;
|
|
12208
|
+
// stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
|
|
12209
|
+
// stripMap.showOnLoader = false;
|
|
12210
|
+
// }
|
|
12211
|
+
// }, 200);
|
|
12212
|
+
// }
|
|
12213
|
+
// }
|
|
12214
|
+
// }
|
|
12215
|
+
// async getTabDataByNewReqSearchV6(
|
|
12216
|
+
// strip: NsContentStripWithTabs.IContentStripUnit,
|
|
12217
|
+
// tabIndex: number,
|
|
12218
|
+
// currentTab: NsContentStripWithTabs.IContentStripTab,
|
|
12219
|
+
// calculateParentStatus: boolean
|
|
12220
|
+
// ) {
|
|
12221
|
+
// try {
|
|
12222
|
+
// const response = await this.searchV6Request(strip, currentTab.request, calculateParentStatus);
|
|
12223
|
+
// if (response && response.results) {
|
|
12224
|
+
// const widgets = this.transformContentsToWidgets(response.results.result.content, strip);
|
|
12225
|
+
// let tabResults: any[] = [];
|
|
12226
|
+
// if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
12227
|
+
// const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
12228
|
+
// if (allTabs && allTabs.length && allTabs[tabIndex]) {
|
|
12229
|
+
// allTabs[tabIndex] = {
|
|
12230
|
+
// ...allTabs[tabIndex],
|
|
12231
|
+
// widgets,
|
|
12232
|
+
// fetchTabStatus: 'done',
|
|
12233
|
+
// };
|
|
12234
|
+
// tabResults = allTabs;
|
|
12235
|
+
// }
|
|
12236
|
+
// }
|
|
12237
|
+
// this.processStrip(
|
|
12238
|
+
// strip,
|
|
12239
|
+
// widgets,
|
|
12240
|
+
// 'done',
|
|
12241
|
+
// calculateParentStatus,
|
|
12242
|
+
// response.viewMoreUrl,
|
|
12243
|
+
// tabResults // tabResults as widgets
|
|
12244
|
+
// );
|
|
12245
|
+
// } else {
|
|
12246
|
+
// this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12247
|
+
// }
|
|
12248
|
+
// } catch (error) {
|
|
12249
|
+
// // Handle errors
|
|
12250
|
+
// // console.error('Error:', error);
|
|
12251
|
+
// }
|
|
12252
|
+
// }
|
|
12253
|
+
// async getTabDataByNewReqTrending(
|
|
12254
|
+
// strip: NsContentStripWithTabs.IContentStripUnit,
|
|
12255
|
+
// tabIndex: number,
|
|
12256
|
+
// currentTab: NsContentStripWithTabs.IContentStripTab,
|
|
12257
|
+
// calculateParentStatus: boolean
|
|
12258
|
+
// ) {
|
|
12259
|
+
// try {
|
|
12260
|
+
// const response = await this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus);
|
|
12261
|
+
// if (response && response.results && response.results.response) {
|
|
12262
|
+
// const content = response.results.response[currentTab.value] || [];
|
|
12263
|
+
// const widgets = this.transformContentsToWidgets(content, strip);
|
|
12264
|
+
// // console.log('currentTab --- widgets', widgets)
|
|
12265
|
+
// let tabResults: any[] = [];
|
|
12266
|
+
// if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
12267
|
+
// const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
12268
|
+
// if (allTabs && allTabs.length && allTabs[tabIndex]) {
|
|
12269
|
+
// allTabs[tabIndex] = {
|
|
12270
|
+
// ...allTabs[tabIndex],
|
|
12271
|
+
// widgets,
|
|
12272
|
+
// fetchTabStatus: 'done',
|
|
12273
|
+
// };
|
|
12274
|
+
// tabResults = allTabs;
|
|
12275
|
+
// }
|
|
12276
|
+
// }
|
|
12277
|
+
// // console.log('tabResults -++++***--', tabResults)
|
|
12278
|
+
// // console.log('calling after-- ')
|
|
12279
|
+
// this.processStrip(
|
|
12280
|
+
// strip,
|
|
12281
|
+
// widgets,
|
|
12282
|
+
// 'done',
|
|
12283
|
+
// calculateParentStatus,
|
|
12284
|
+
// response.viewMoreUrl,
|
|
12285
|
+
// tabResults // tabResults as widgets
|
|
12286
|
+
// );
|
|
12287
|
+
// } else {
|
|
12288
|
+
// this.processStrip(strip, [], 'done', calculateParentStatus, null);
|
|
12289
|
+
// }
|
|
12290
|
+
// } catch (error) {
|
|
12291
|
+
// // Handle errors
|
|
12292
|
+
// this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12293
|
+
// }
|
|
12294
|
+
// }
|
|
12295
|
+
/**
|
|
12296
|
+
* @param {?} strip
|
|
12297
|
+
* @param {?} currentTab
|
|
12298
|
+
* @param {?} calculateParentStatus
|
|
12299
|
+
* @return {?}
|
|
12300
|
+
*/
|
|
12301
|
+
getTabDataByfilter(strip, currentTab, calculateParentStatus) {
|
|
12302
|
+
// tslint:disable:no-console
|
|
12303
|
+
console.log('strip -- ', strip);
|
|
12304
|
+
// tslint:disable:no-console
|
|
12305
|
+
console.log('currentTab -- ', currentTab);
|
|
12306
|
+
// tslint:disable:no-console
|
|
12307
|
+
console.log('calculateParentStatus-- ', calculateParentStatus);
|
|
12308
|
+
// TODO: Write logic for individual filter if passed in config
|
|
12309
|
+
// add switch case based on config key passed
|
|
12310
|
+
}
|
|
12311
|
+
// async fetchAllCbpPlans(strip: any, calculateParentStatus = true) {
|
|
12312
|
+
// if (strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length) {
|
|
12313
|
+
// let courses: NsContent.IContent[];
|
|
12314
|
+
// let tabResults: any[] = [];
|
|
12315
|
+
// const response = await this.userSvc.fetchCbpPlanList().toPromise();
|
|
12316
|
+
// if (response) {
|
|
12317
|
+
// courses = response;
|
|
12318
|
+
// if (strip.tabs && strip.tabs.length) {
|
|
12319
|
+
// tabResults = this.splitCbpTabsData(courses, strip);
|
|
12320
|
+
// await this.processStrip(
|
|
12321
|
+
// strip,
|
|
12322
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
12323
|
+
// 'done',
|
|
12324
|
+
// calculateParentStatus,
|
|
12325
|
+
// '',
|
|
12326
|
+
// tabResults
|
|
12327
|
+
// );
|
|
12328
|
+
// } else {
|
|
12329
|
+
// this.processStrip(
|
|
12330
|
+
// strip,
|
|
12331
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
12332
|
+
// 'done',
|
|
12333
|
+
// calculateParentStatus,
|
|
12334
|
+
// 'viewMoreUrl',
|
|
12335
|
+
// );
|
|
12336
|
+
// }
|
|
12337
|
+
// }
|
|
12338
|
+
// // this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
|
|
12339
|
+
// // if (res) {
|
|
12340
|
+
// // console.log(res,'===============================>')
|
|
12341
|
+
// // courses = res
|
|
12342
|
+
// // if (strip.tabs && strip.tabs.length) {
|
|
12343
|
+
// // tabResults = this.splitCbpTabsData(courses, strip)
|
|
12344
|
+
// // await this.processStrip(
|
|
12345
|
+
// // strip,
|
|
12346
|
+
// // this.transformContentsToWidgets(courses, strip),
|
|
12347
|
+
// // 'done',
|
|
12348
|
+
// // calculateParentStatus,
|
|
12349
|
+
// // '',
|
|
12350
|
+
// // tabResults
|
|
12351
|
+
// // )
|
|
12352
|
+
// // } else {
|
|
12353
|
+
// // this.processStrip(
|
|
12354
|
+
// // strip,
|
|
12355
|
+
// // this.transformContentsToWidgets(courses, strip),
|
|
12356
|
+
// // 'done',
|
|
12357
|
+
// // calculateParentStatus,
|
|
12358
|
+
// // 'viewMoreUrl',
|
|
12359
|
+
// // )
|
|
12360
|
+
// // }
|
|
12361
|
+
// // }
|
|
12362
|
+
// // }, (_err: any) => {
|
|
12363
|
+
// // })
|
|
12364
|
+
// clearInterval(this.enrollInterval);
|
|
12365
|
+
// }
|
|
12366
|
+
// }
|
|
12367
|
+
// splitCbpTabsData(contentNew: NsContent.IContent[], strip: NsContentStripWithTabs.IContentStripUnit) {
|
|
12368
|
+
// const tabResults: any[] = [];
|
|
12369
|
+
// const splitData = this.getTabsList(
|
|
12370
|
+
// contentNew,
|
|
12371
|
+
// strip,
|
|
12372
|
+
// );
|
|
12373
|
+
// if (strip.tabs && strip.tabs.length) {
|
|
12374
|
+
// for (let i = 0; i < strip.tabs.length; i += 1) {
|
|
12375
|
+
// if (strip.tabs[i]) {
|
|
12376
|
+
// tabResults.push(
|
|
12377
|
+
// {
|
|
12378
|
+
// ...strip.tabs[i],
|
|
12379
|
+
// fetchTabStatus: 'done',
|
|
12380
|
+
// ...(splitData.find(itmInner => {
|
|
12381
|
+
// if (strip.tabs && strip.tabs[i] && itmInner.value === strip.tabs[i].value) {
|
|
12382
|
+
// return itmInner;
|
|
12383
|
+
// }
|
|
12384
|
+
// return undefined;
|
|
12385
|
+
// })),
|
|
12386
|
+
// }
|
|
12387
|
+
// );
|
|
12388
|
+
// }
|
|
12389
|
+
// }
|
|
12390
|
+
// }
|
|
12391
|
+
// return tabResults;
|
|
12392
|
+
// }
|
|
12393
|
+
// getTabsList(array: NsContent.IContent[],
|
|
12394
|
+
// strip: NsContentStripWithTabs.IContentStripUnit) {
|
|
12395
|
+
// let all: any[] = [];
|
|
12396
|
+
// let upcoming: any[] = [];
|
|
12397
|
+
// let overdue: any[] = [];
|
|
12398
|
+
// array.forEach((e: any) => {
|
|
12399
|
+
// all.push(e);
|
|
12400
|
+
// if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
12401
|
+
// overdue.push(e);
|
|
12402
|
+
// } else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
|
|
12403
|
+
// upcoming.push(e);
|
|
12404
|
+
// }
|
|
12405
|
+
// });
|
|
12406
|
+
// const allCompleted = all.filter((allData: any) => allData.contentStatus === 2);
|
|
12407
|
+
// let allInCompleted = all.filter((allData: any) => allData.contentStatus < 2);
|
|
12408
|
+
// let allCompletedOverDue = allCompleted.filter((allData: any) => allData.planDuration === NsCardContent.ACBPConst.OVERDUE);
|
|
12409
|
+
// const allCompletedAll = allCompleted.filter((allData: any) => allData.planDuration !== NsCardContent.ACBPConst.OVERDUE);
|
|
12410
|
+
// allCompletedOverDue = allCompletedOverDue.sort((a: any, b: any): any => {
|
|
12411
|
+
// if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
12412
|
+
// const firstDate: any = new Date(a.endDate);
|
|
12413
|
+
// const secondDate: any = new Date(b.endDate);
|
|
12414
|
+
// return firstDate > secondDate ? -1 : 1;
|
|
12415
|
+
// }
|
|
12416
|
+
// });
|
|
12417
|
+
// allInCompleted = allInCompleted.sort((a: any, b: any): any => {
|
|
12418
|
+
// if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
12419
|
+
// const firstDate: any = new Date(a.endDate);
|
|
12420
|
+
// const secondDate: any = new Date(b.endDate);
|
|
12421
|
+
// return firstDate > secondDate ? -1 : 1;
|
|
12422
|
+
// }
|
|
12423
|
+
// });
|
|
12424
|
+
// all = [...allInCompleted, ...allCompletedAll, ...allCompletedOverDue];
|
|
12425
|
+
// overdue = overdue.filter((data: any): any => {
|
|
12426
|
+
// return data.contentStatus < 2;
|
|
12427
|
+
// });
|
|
12428
|
+
// overdue = overdue.sort((a: any, b: any): any => {
|
|
12429
|
+
// const firstDate: any = new Date(a.endDate);
|
|
12430
|
+
// const secondDate: any = new Date(b.endDate);
|
|
12431
|
+
// return firstDate > secondDate ? -1 : 1;
|
|
12432
|
+
// });
|
|
12433
|
+
// upcoming = upcoming.filter((data: any): any => {
|
|
12434
|
+
// return data.contentStatus < 2;
|
|
12435
|
+
// });
|
|
12436
|
+
// // this.getSelectedIndex(1)
|
|
12437
|
+
// return [
|
|
12438
|
+
// { value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
|
|
12439
|
+
// { value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
|
|
12440
|
+
// { value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }];
|
|
12441
|
+
// }
|
|
12442
|
+
/**
|
|
12443
|
+
* @param {?} stripsResultDataMap
|
|
12444
|
+
* @param {?} key
|
|
12445
|
+
* @return {?}
|
|
12446
|
+
*/
|
|
12447
|
+
getSelectedIndex(stripsResultDataMap, key) {
|
|
12448
|
+
/** @type {?} */
|
|
12449
|
+
let returnValue = 0;
|
|
12450
|
+
// if (key === 'cbpPlan') {
|
|
12451
|
+
// if (stripsResultDataMap.tabs.length) {
|
|
12452
|
+
// const data = stripsResultDataMap.tabs.filter((ele: any) => ele.value === 'upcoming');
|
|
12453
|
+
// returnValue = data[0].widgets && data[0].widgets.length > 0 ? 1 : 0;
|
|
12454
|
+
// }
|
|
12455
|
+
// }
|
|
12456
|
+
return returnValue;
|
|
12457
|
+
}
|
|
12458
|
+
/**
|
|
12459
|
+
* @param {?} label
|
|
12460
|
+
* @param {?} type
|
|
12461
|
+
* @return {?}
|
|
12462
|
+
*/
|
|
12463
|
+
translateLabels(label, type) {
|
|
12464
|
+
return this.langtranslations.translateLabel(label, type, '');
|
|
12465
|
+
}
|
|
12466
|
+
/**
|
|
12467
|
+
* @param {?} index
|
|
12468
|
+
* @param {?} item
|
|
12469
|
+
* @return {?}
|
|
12470
|
+
*/
|
|
12471
|
+
identify(index, item) {
|
|
12472
|
+
if (index >= 0) { }
|
|
12473
|
+
return item;
|
|
12474
|
+
}
|
|
12475
|
+
/**
|
|
12476
|
+
* @param {?} index
|
|
12477
|
+
* @param {?} item
|
|
12478
|
+
* @return {?}
|
|
12479
|
+
*/
|
|
12480
|
+
tracker(index, item) {
|
|
12481
|
+
if (index >= 0) { }
|
|
12482
|
+
return get(item, 'widgetData.content.identifier');
|
|
12483
|
+
}
|
|
12484
|
+
/**
|
|
12485
|
+
* @param {?} strip
|
|
12486
|
+
* @param {?=} calculateParentStatus
|
|
12487
|
+
* @return {?}
|
|
12488
|
+
*/
|
|
12489
|
+
fetchAllTopContent(strip, calculateParentStatus = true) {
|
|
12490
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12491
|
+
if (strip.request && strip.request.topContent && Object.keys(strip.request.topContent).length) {
|
|
12492
|
+
/** @type {?} */
|
|
12493
|
+
let originalFilters = [];
|
|
12494
|
+
if (strip.request &&
|
|
12495
|
+
strip.request.topContent &&
|
|
12496
|
+
strip.request.topContent.request &&
|
|
12497
|
+
strip.request.topContent.request.filters) {
|
|
12498
|
+
originalFilters = strip.request.topContent.request.filters;
|
|
12499
|
+
strip.request.topContent.request.filters = this.postMethodFilters(strip.request.topContent.request.filters);
|
|
12500
|
+
}
|
|
12501
|
+
try {
|
|
12502
|
+
/** @type {?} */
|
|
12503
|
+
const response = yield this.postRequestMethod(strip, strip.request.topContent, strip.request.apiUrl, calculateParentStatus);
|
|
12504
|
+
// console.log('calling after - response, ', response)
|
|
12505
|
+
if (response && response.results) {
|
|
12506
|
+
// console.log('calling after-- ')
|
|
12507
|
+
if (response.results.result.content && response.results.result.content.length) {
|
|
12508
|
+
this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
12509
|
+
}
|
|
12510
|
+
else {
|
|
12511
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12512
|
+
this.emptyResponse.emit(true);
|
|
12513
|
+
}
|
|
12514
|
+
}
|
|
12515
|
+
else {
|
|
12516
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12517
|
+
this.emptyResponse.emit(true);
|
|
12518
|
+
}
|
|
12519
|
+
}
|
|
12520
|
+
catch (error) {
|
|
12521
|
+
// Handle errors
|
|
12522
|
+
// console.error('Error:', error);
|
|
12523
|
+
}
|
|
12524
|
+
}
|
|
12525
|
+
});
|
|
12526
|
+
}
|
|
12527
|
+
/**
|
|
12528
|
+
* @param {?} strip
|
|
12529
|
+
* @param {?=} calculateParentStatus
|
|
12530
|
+
* @return {?}
|
|
12531
|
+
*/
|
|
12532
|
+
fetchAllFeaturedContent(strip, calculateParentStatus = true) {
|
|
12533
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12534
|
+
if (strip.request && strip.request.featureContent && Object.keys(strip.request.featureContent).length) {
|
|
12535
|
+
/** @type {?} */
|
|
12536
|
+
let originalFilters = [];
|
|
12537
|
+
if (strip.request &&
|
|
12538
|
+
strip.request.featureContent &&
|
|
12539
|
+
strip.request.featureContent.request &&
|
|
12540
|
+
strip.request.featureContent.request.filters) {
|
|
12541
|
+
originalFilters = strip.request.featureContent.request.filters;
|
|
12542
|
+
strip.request.featureContent.request.filters = this.postMethodFilters(strip.request.featureContent.request.filters);
|
|
12543
|
+
}
|
|
12544
|
+
try {
|
|
12545
|
+
/** @type {?} */
|
|
12546
|
+
const response = yield this.postRequestMethod(strip, strip.request.featureContent, strip.request.apiUrl, calculateParentStatus);
|
|
12547
|
+
// console.log('calling after - response, ', response)
|
|
12548
|
+
if (response && response.results) {
|
|
12549
|
+
// console.log('calling after-- ')
|
|
12550
|
+
if (response.results.result.content && response.results.result.content.length) {
|
|
12551
|
+
this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
12552
|
+
}
|
|
12553
|
+
else {
|
|
12554
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12555
|
+
this.emptyResponse.emit(true);
|
|
12556
|
+
}
|
|
12557
|
+
}
|
|
12558
|
+
else {
|
|
12559
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12560
|
+
this.emptyResponse.emit(true);
|
|
12561
|
+
}
|
|
12562
|
+
}
|
|
12563
|
+
catch (error) {
|
|
12564
|
+
this.emptyResponse.emit(true);
|
|
12565
|
+
// Handle errors
|
|
12566
|
+
// console.error('Error:', error);
|
|
12567
|
+
}
|
|
12568
|
+
}
|
|
12569
|
+
});
|
|
12570
|
+
}
|
|
12571
|
+
/**
|
|
12572
|
+
* @param {?} stripData
|
|
12573
|
+
* @return {?}
|
|
12574
|
+
*/
|
|
12575
|
+
raiseTelemetry(stripData) {
|
|
12576
|
+
this.telemtryResponse.emit(stripData);
|
|
12577
|
+
}
|
|
12578
|
+
/**
|
|
12579
|
+
* @param {?} strip
|
|
12580
|
+
* @param {?} request
|
|
12581
|
+
* @param {?} apiUrl
|
|
12582
|
+
* @param {?} calculateParentStatus
|
|
12583
|
+
* @return {?}
|
|
12584
|
+
*/
|
|
12585
|
+
postRequestMethod(strip, request, apiUrl, calculateParentStatus) {
|
|
12586
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12587
|
+
return new Promise((/**
|
|
12588
|
+
* @param {?} resolve
|
|
12589
|
+
* @param {?} reject
|
|
12590
|
+
* @return {?}
|
|
12591
|
+
*/
|
|
12592
|
+
(resolve, reject) => {
|
|
12593
|
+
if (request && request) {
|
|
12594
|
+
this.contentSvc.postApiMethod(apiUrl, request).subscribe((/**
|
|
12595
|
+
* @param {?} results
|
|
12596
|
+
* @return {?}
|
|
12597
|
+
*/
|
|
12598
|
+
results => {
|
|
12599
|
+
if (results.result && results.result.content) {
|
|
12600
|
+
/** @type {?} */
|
|
12601
|
+
const showViewMore = Boolean(results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
12602
|
+
/** @type {?} */
|
|
12603
|
+
const viewMoreUrl = showViewMore
|
|
12604
|
+
? {
|
|
12605
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
12606
|
+
queryParams: {
|
|
12607
|
+
tab: 'Learn',
|
|
12608
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
12609
|
+
f: {},
|
|
12610
|
+
},
|
|
12611
|
+
}
|
|
12612
|
+
: null;
|
|
12613
|
+
resolve({ results, viewMoreUrl });
|
|
12614
|
+
}
|
|
12615
|
+
else if (results && results.data) {
|
|
12616
|
+
/** @type {?} */
|
|
12617
|
+
const showViewMore = Boolean(results.data && results.data.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
12618
|
+
/** @type {?} */
|
|
12619
|
+
const viewMoreUrl = showViewMore ? {
|
|
12620
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
12621
|
+
queryParams: {
|
|
12622
|
+
tab: 'Learn',
|
|
12623
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
12624
|
+
f: {},
|
|
12625
|
+
},
|
|
12626
|
+
}
|
|
12627
|
+
: null;
|
|
12628
|
+
resolve({ results, viewMoreUrl });
|
|
12629
|
+
}
|
|
12630
|
+
else if (results.result && results.result.data) {
|
|
12631
|
+
/** @type {?} */
|
|
12632
|
+
const showViewMore = Boolean(results.data && results.result.data && results.result.data.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
12633
|
+
/** @type {?} */
|
|
12634
|
+
const viewMoreUrl = showViewMore ? {
|
|
12635
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
12636
|
+
queryParams: {
|
|
12637
|
+
tab: 'Learn',
|
|
12638
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
12639
|
+
f: {},
|
|
12640
|
+
},
|
|
12641
|
+
}
|
|
12642
|
+
: null;
|
|
12643
|
+
resolve({ results, viewMoreUrl });
|
|
12644
|
+
}
|
|
12645
|
+
}), (/**
|
|
12646
|
+
* @param {?} error
|
|
12647
|
+
* @return {?}
|
|
12648
|
+
*/
|
|
12649
|
+
(error) => {
|
|
12650
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12651
|
+
reject(error);
|
|
12652
|
+
}));
|
|
12653
|
+
}
|
|
12654
|
+
}));
|
|
12655
|
+
});
|
|
12656
|
+
}
|
|
12657
|
+
/**
|
|
12658
|
+
* @param {?} strip
|
|
12659
|
+
* @param {?} request
|
|
12660
|
+
* @param {?} apiUrl
|
|
12661
|
+
* @param {?} calculateParentStatus
|
|
12662
|
+
* @return {?}
|
|
12663
|
+
*/
|
|
12664
|
+
getRequestMethod(strip, request, apiUrl, calculateParentStatus) {
|
|
12665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12666
|
+
/** @type {?} */
|
|
12667
|
+
const originalFilters = [];
|
|
12668
|
+
return new Promise((/**
|
|
12669
|
+
* @param {?} resolve
|
|
12670
|
+
* @param {?} reject
|
|
12671
|
+
* @return {?}
|
|
12672
|
+
*/
|
|
12673
|
+
(resolve, reject) => {
|
|
12674
|
+
if (request && request) {
|
|
12675
|
+
this.contentSvc.getApiMethod(apiUrl).subscribe((/**
|
|
12676
|
+
* @param {?} results
|
|
12677
|
+
* @return {?}
|
|
12678
|
+
*/
|
|
12679
|
+
results => {
|
|
12680
|
+
/** @type {?} */
|
|
12681
|
+
const showViewMore = Boolean(results.result.data && results.result.data.orgList.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
12682
|
+
/** @type {?} */
|
|
12683
|
+
const viewMoreUrl = showViewMore
|
|
12684
|
+
? {
|
|
12685
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
12686
|
+
}
|
|
12687
|
+
: null;
|
|
12688
|
+
resolve({ results, viewMoreUrl });
|
|
12689
|
+
}), (/**
|
|
12690
|
+
* @param {?} error
|
|
12691
|
+
* @return {?}
|
|
12692
|
+
*/
|
|
12693
|
+
(error) => {
|
|
12694
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12695
|
+
reject(error);
|
|
12696
|
+
}));
|
|
12697
|
+
}
|
|
12698
|
+
}));
|
|
12699
|
+
});
|
|
12700
|
+
}
|
|
12701
|
+
/**
|
|
12702
|
+
* @param {?} filters
|
|
12703
|
+
* @return {?}
|
|
12704
|
+
*/
|
|
12705
|
+
postMethodFilters(filters) {
|
|
12706
|
+
if (filters.organisation &&
|
|
12707
|
+
filters.organisation.indexOf('<orgID>') >= 0) {
|
|
12708
|
+
filters.organisation = this.providerId;
|
|
12709
|
+
}
|
|
12710
|
+
return filters;
|
|
12711
|
+
}
|
|
12712
|
+
/**
|
|
12713
|
+
* @param {?} apiUrl
|
|
12714
|
+
* @param {?} id
|
|
12715
|
+
* @return {?}
|
|
12716
|
+
*/
|
|
12717
|
+
getFullUrl(apiUrl, id) {
|
|
12718
|
+
/** @type {?} */
|
|
12719
|
+
let formedUrl = '';
|
|
12720
|
+
if (apiUrl.indexOf('<bookmarkId>') >= 0) {
|
|
12721
|
+
formedUrl = apiUrl.replace('<bookmarkId>', this.environment.mdoChannelsBookmarkId);
|
|
12722
|
+
}
|
|
12723
|
+
else if (apiUrl.indexOf('<playlistKey>') >= 0 && apiUrl.indexOf('<orgID>') >= 0) {
|
|
12724
|
+
formedUrl = apiUrl.replace('<playlistKey>', this.providerId + id);
|
|
12725
|
+
formedUrl = formedUrl.replace('<orgID>', this.providerId);
|
|
12726
|
+
}
|
|
12727
|
+
return formedUrl;
|
|
12728
|
+
}
|
|
12729
|
+
/**
|
|
12730
|
+
* @param {?} stripData
|
|
12731
|
+
* @param {?} path
|
|
12732
|
+
* @param {?} queryParamsData
|
|
12733
|
+
* @return {?}
|
|
12734
|
+
*/
|
|
12735
|
+
redirectViewAll(stripData, path, queryParamsData) {
|
|
12736
|
+
if (this.emitViewAll) {
|
|
12737
|
+
this.viewAllResponse.emit(stripData);
|
|
12738
|
+
}
|
|
12739
|
+
else {
|
|
12740
|
+
this.router.navigate([path], { queryParams: queryParamsData });
|
|
12741
|
+
}
|
|
12742
|
+
}
|
|
12743
|
+
/**
|
|
12744
|
+
* @param {?} strip
|
|
12745
|
+
* @param {?=} calculateParentStatus
|
|
12746
|
+
* @return {?}
|
|
12747
|
+
*/
|
|
12748
|
+
fetchAllBookMarkData(strip, calculateParentStatus = true) {
|
|
12749
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12750
|
+
if (strip.request && strip.request.bookmarkRead && Object.keys(strip.request.bookmarkRead).length) {
|
|
12751
|
+
/** @type {?} */
|
|
12752
|
+
let originalFilters = [];
|
|
12753
|
+
if (strip.request &&
|
|
12754
|
+
strip.request.bookmarkRead &&
|
|
12755
|
+
strip.request.bookmarkRead.bookmarkId) {
|
|
12756
|
+
strip.request.apiUrl = this.getFullUrl(strip.request.apiUrl, strip.request.bookmarkRead.bookmarkId);
|
|
12757
|
+
}
|
|
12758
|
+
try {
|
|
12759
|
+
/** @type {?} */
|
|
12760
|
+
const response = yield this.getRequestMethod(strip, strip.request.bookmarkRead, strip.request.apiUrl, calculateParentStatus);
|
|
12761
|
+
/** @type {?} */
|
|
12762
|
+
let content = response.results.result.data.orgList;
|
|
12763
|
+
if (response) {
|
|
12764
|
+
this.processStrip(strip, this.transformAllContentsToWidgets(content, strip), 'done', calculateParentStatus, response);
|
|
12765
|
+
}
|
|
12766
|
+
else {
|
|
12767
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12768
|
+
this.emptyResponse.emit(true);
|
|
12769
|
+
}
|
|
12770
|
+
}
|
|
12771
|
+
catch (error) {
|
|
12772
|
+
this.emptyResponse.emit(true);
|
|
12773
|
+
// Handle errors
|
|
12774
|
+
// console.error('Error:', error);
|
|
12775
|
+
}
|
|
12776
|
+
}
|
|
12777
|
+
});
|
|
12778
|
+
}
|
|
12779
|
+
/**
|
|
12780
|
+
* @private
|
|
12781
|
+
* @param {?} contents
|
|
12782
|
+
* @param {?} strip
|
|
12783
|
+
* @return {?}
|
|
12784
|
+
*/
|
|
12785
|
+
transformAllContentsToWidgets(contents, strip) {
|
|
12786
|
+
return (contents || []).map((/**
|
|
12787
|
+
* @param {?} content
|
|
12788
|
+
* @param {?} idx
|
|
12789
|
+
* @return {?}
|
|
12790
|
+
*/
|
|
12791
|
+
(content, idx) => (content ? {
|
|
12792
|
+
widgetType: 'cardLib',
|
|
12793
|
+
widgetSubType: 'cardContentLib',
|
|
12794
|
+
widgetHostClass: 'mb-2',
|
|
12795
|
+
widgetData: Object.assign({ content }, (content.batch && { batch: content.batch }), { cardSubType: strip.stripConfig && strip.stripConfig.cardSubType, cardCustomeClass: strip.customeClass ? strip.customeClass : '', context: { pageSection: strip.key, position: idx }, intranetMode: strip.stripConfig && strip.stripConfig.intranetMode, deletedMode: strip.stripConfig && strip.stripConfig.deletedMode, contentTags: strip.stripConfig && strip.stripConfig.contentTags }),
|
|
12796
|
+
} : {
|
|
12797
|
+
widgetType: 'card',
|
|
12798
|
+
widgetSubType: 'cardContent',
|
|
12799
|
+
widgetHostClass: 'mb-2',
|
|
12800
|
+
widgetData: {},
|
|
12801
|
+
})));
|
|
12802
|
+
}
|
|
12803
|
+
/**
|
|
12804
|
+
* @param {?} strip
|
|
12805
|
+
* @param {?=} calculateParentStatus
|
|
12806
|
+
* @return {?}
|
|
12807
|
+
*/
|
|
12808
|
+
fetchAllPlaylistSearch(strip, calculateParentStatus = true) {
|
|
12809
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12810
|
+
if (strip.request && strip.request.playlistSearch && Object.keys(strip.request.playlistSearch).length) {
|
|
12811
|
+
/** @type {?} */
|
|
12812
|
+
let originalFilters = [];
|
|
12813
|
+
if (strip.request &&
|
|
12814
|
+
strip.request.playlistSearch &&
|
|
12815
|
+
strip.request.playlistSearch.request &&
|
|
12816
|
+
strip.request.playlistSearch.request.filters) {
|
|
12817
|
+
originalFilters = strip.request.playlistSearch.request.filters;
|
|
12818
|
+
strip.request.playlistSearch.request.filters = this.postMethodFilters(strip.request.playlistSearch.request.filters);
|
|
12819
|
+
}
|
|
12820
|
+
try {
|
|
12821
|
+
/** @type {?} */
|
|
12822
|
+
const response = yield this.postRequestMethod(strip, strip.request.playlistSearch.request, strip.request.apiUrl, calculateParentStatus);
|
|
12823
|
+
// console.log('calling after - response, ', response)
|
|
12824
|
+
if (response && response.results) {
|
|
12825
|
+
// console.log('calling after-- ')
|
|
12826
|
+
if (response.results.result.data && response.results.result.data.length) {
|
|
12827
|
+
/** @type {?} */
|
|
12828
|
+
let finalPlaylistData = [];
|
|
12829
|
+
/** @type {?} */
|
|
12830
|
+
let programData = response.results.result.data;
|
|
12831
|
+
programData.forEach((/**
|
|
12832
|
+
* @param {?} prgData
|
|
12833
|
+
* @return {?}
|
|
12834
|
+
*/
|
|
12835
|
+
(prgData) => {
|
|
12836
|
+
if (prgData.children && prgData.children.length) {
|
|
12837
|
+
finalPlaylistData.push(prgData);
|
|
12838
|
+
}
|
|
12839
|
+
}));
|
|
12840
|
+
if (finalPlaylistData.length) {
|
|
12841
|
+
this.processStrip(strip, this.transformContentsToWidgets(finalPlaylistData, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
12842
|
+
}
|
|
12843
|
+
else {
|
|
12844
|
+
this.emptyResponse.emit(true);
|
|
12845
|
+
}
|
|
12846
|
+
}
|
|
12847
|
+
else {
|
|
12848
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12849
|
+
this.emptyResponse.emit(true);
|
|
12850
|
+
}
|
|
12851
|
+
}
|
|
12852
|
+
else {
|
|
12853
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12854
|
+
this.emptyResponse.emit(true);
|
|
12855
|
+
}
|
|
12856
|
+
}
|
|
12857
|
+
catch (error) {
|
|
12858
|
+
this.emptyResponse.emit(true);
|
|
12859
|
+
// Handle errors
|
|
12860
|
+
// console.error('Error:', error);
|
|
12861
|
+
}
|
|
12862
|
+
}
|
|
12863
|
+
});
|
|
12864
|
+
}
|
|
12865
|
+
/**
|
|
12866
|
+
* @param {?} strip
|
|
12867
|
+
* @param {?=} calculateParentStatus
|
|
12868
|
+
* @return {?}
|
|
12869
|
+
*/
|
|
12870
|
+
fetchPlaylistReadData(strip, calculateParentStatus = true) {
|
|
12871
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12872
|
+
if (strip.request && strip.request.playlistRead && Object.keys(strip.request.playlistRead).length) {
|
|
12873
|
+
/** @type {?} */
|
|
12874
|
+
let originalFilters = [];
|
|
12875
|
+
if (strip.request &&
|
|
12876
|
+
strip.request.playlistRead &&
|
|
12877
|
+
strip.request.playlistRead.type) {
|
|
12878
|
+
strip.request.apiUrl = this.getFullUrl(strip.request.apiUrl, strip.request.playlistRead.type);
|
|
12879
|
+
}
|
|
12880
|
+
try {
|
|
12881
|
+
/** @type {?} */
|
|
12882
|
+
const response = yield this.getRequestMethod(strip, strip.request.playlistRead, strip.request.apiUrl, calculateParentStatus);
|
|
12883
|
+
if (response && response.results.result.content) {
|
|
12884
|
+
/** @type {?} */
|
|
12885
|
+
let content = response.results.result.content;
|
|
12886
|
+
this.processStrip(strip, this.transformAllContentsToWidgets(content, strip), 'done', calculateParentStatus, response);
|
|
12887
|
+
}
|
|
12888
|
+
else {
|
|
12889
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12890
|
+
this.emptyResponse.emit(true);
|
|
12891
|
+
}
|
|
12892
|
+
}
|
|
12893
|
+
catch (error) {
|
|
12894
|
+
this.emptyResponse.emit(true);
|
|
12895
|
+
// Handle errors
|
|
12896
|
+
// console.error('Error:', error);
|
|
12897
|
+
}
|
|
12898
|
+
}
|
|
12899
|
+
});
|
|
12900
|
+
}
|
|
12901
|
+
/**
|
|
12902
|
+
* @param {?} strip
|
|
12903
|
+
* @param {?=} calculateParentStatus
|
|
12904
|
+
* @return {?}
|
|
12905
|
+
*/
|
|
12906
|
+
fetchCiosContentData(strip, calculateParentStatus = true) {
|
|
12907
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12908
|
+
if (strip.request && strip.request.ciosContent && Object.keys(strip.request.ciosContent).length) {
|
|
12909
|
+
/** @type {?} */
|
|
12910
|
+
let originalFilters = [];
|
|
12911
|
+
if (strip.request &&
|
|
12912
|
+
strip.request.ciosContent &&
|
|
12913
|
+
strip.request.ciosContent.filterCriteriaMap) {
|
|
12914
|
+
originalFilters = strip.request.ciosContent.filterCriteriaMap;
|
|
12915
|
+
strip.request.ciosContent.filterCriteriaMap = this.postMethodFilters(strip.request.ciosContent.filterCriteriaMap);
|
|
12916
|
+
}
|
|
12917
|
+
try {
|
|
12918
|
+
/** @type {?} */
|
|
12919
|
+
const response = yield this.postRequestMethod(strip, strip.request.ciosContent, strip.request.apiUrl, calculateParentStatus);
|
|
12920
|
+
// console.log('calling after - response, ', response)
|
|
12921
|
+
if (response && response.results) {
|
|
12922
|
+
// console.log('calling after-- ')
|
|
12923
|
+
if (response.results.data && response.results.data.length) {
|
|
12924
|
+
/** @type {?} */
|
|
12925
|
+
let extContentData = response.results.data;
|
|
12926
|
+
if (extContentData.length) {
|
|
12927
|
+
this.processStrip(strip, this.transformContentsToWidgets(extContentData, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
12928
|
+
}
|
|
12929
|
+
else {
|
|
12930
|
+
this.emptyResponse.emit(true);
|
|
12931
|
+
}
|
|
12932
|
+
}
|
|
12933
|
+
else {
|
|
12934
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12935
|
+
this.emptyResponse.emit(true);
|
|
12936
|
+
}
|
|
12937
|
+
}
|
|
12938
|
+
else {
|
|
12939
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
12940
|
+
this.emptyResponse.emit(true);
|
|
12941
|
+
}
|
|
12942
|
+
}
|
|
12943
|
+
catch (error) {
|
|
12944
|
+
this.emptyResponse.emit(true);
|
|
12945
|
+
// Handle errors
|
|
12946
|
+
// console.error('Error:', error);
|
|
12947
|
+
}
|
|
12948
|
+
}
|
|
12949
|
+
});
|
|
12950
|
+
}
|
|
12951
|
+
// new code writting from here====new====
|
|
12952
|
+
/**
|
|
12953
|
+
* @param {?} strip
|
|
12954
|
+
* @param {?=} calculateParentStatus
|
|
12955
|
+
* @return {?}
|
|
12956
|
+
*/
|
|
12957
|
+
fetchForYouData(strip, calculateParentStatus = true) {
|
|
12958
|
+
if (strip && strip.type === 'forYou') {
|
|
12959
|
+
if (strip.tabs && strip.tabs.length) {
|
|
12960
|
+
/** @type {?} */
|
|
12961
|
+
const firstTab = strip.tabs[0];
|
|
12962
|
+
/** @type {?} */
|
|
12963
|
+
const pillData = firstTab.pillsData[0];
|
|
12964
|
+
if (pillData.requestRequired) {
|
|
12965
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
12966
|
+
/** @type {?} */
|
|
12967
|
+
const allPills = this.stripsResultDataMap[strip.key].tabs[0].pillsData;
|
|
12968
|
+
/** @type {?} */
|
|
12969
|
+
const currenPillsFromMap = (/** @type {?} */ ((allPills && allPills.length && allPills[0])));
|
|
12970
|
+
this.getTabDataByNewReqTrending(strip, 0, 0, currenPillsFromMap, calculateParentStatus);
|
|
12971
|
+
if (this.stripsResultDataMap[strip.key] && currenPillsFromMap) {
|
|
12972
|
+
this.stripsResultDataMap[strip.key].viewMoreUrl.queryParams = Object.assign({}, this.stripsResultDataMap[strip.key].viewMoreUrl.queryParams, { key: strip.key, tabSelected: firstTab.value, pillSelected: pillData.value });
|
|
12973
|
+
}
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
}
|
|
12977
|
+
}
|
|
12978
|
+
}
|
|
12979
|
+
/**
|
|
12980
|
+
* @param {?} strip
|
|
12981
|
+
* @param {?=} calculateParentStatus
|
|
12982
|
+
* @return {?}
|
|
12983
|
+
*/
|
|
12984
|
+
fetchFromSearchV6(strip, calculateParentStatus = true) {
|
|
12985
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12986
|
+
if (strip.request && strip.request.searchV6 && Object.keys(strip.request.searchV6).length) {
|
|
12987
|
+
// if (!(strip.request.searchV6.locale && strip.request.searchV6.locale.length > 0)) {
|
|
12988
|
+
// if (this.configSvc.activeLocale) {
|
|
12989
|
+
// strip.request.searchV6.locale = [this.configSvc.activeLocale.locals[0]]
|
|
12990
|
+
// } else {
|
|
12991
|
+
// strip.request.searchV6.locale = ['en']
|
|
12992
|
+
// }
|
|
12993
|
+
// }
|
|
12994
|
+
/** @type {?} */
|
|
12995
|
+
let originalFilters = [];
|
|
12996
|
+
// tslint:disable:no-console
|
|
12997
|
+
if (strip.request &&
|
|
12998
|
+
strip.request.searchV6 &&
|
|
12999
|
+
strip.request.searchV6.request &&
|
|
13000
|
+
strip.request.searchV6.request.filters) {
|
|
13001
|
+
originalFilters = strip.request.searchV6.request.filters;
|
|
13002
|
+
strip.request.searchV6.request.filters = this.checkForDateFilters(strip.request.searchV6.request.filters);
|
|
13003
|
+
strip.request.searchV6.request.filters = this.getFiltersFromArray(strip.request.searchV6.request.filters);
|
|
13004
|
+
}
|
|
13005
|
+
if (strip.tabs && strip.tabs.length) {
|
|
13006
|
+
// TODO: Have to extract requestRequired to outer level of tabs config
|
|
13007
|
+
/** @type {?} */
|
|
13008
|
+
const firstTab = strip.tabs[0];
|
|
13009
|
+
if (firstTab.requestRequired) {
|
|
13010
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
13011
|
+
/** @type {?} */
|
|
13012
|
+
const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
13013
|
+
/** @type {?} */
|
|
13014
|
+
const currentTabFromMap = (/** @type {?} */ ((allTabs && allTabs.length && allTabs[0])));
|
|
13015
|
+
this.getTabDataByNewReqSearchV6(strip, 0, 0, currentTabFromMap, calculateParentStatus);
|
|
13016
|
+
}
|
|
13017
|
+
}
|
|
13018
|
+
}
|
|
13019
|
+
else {
|
|
13020
|
+
try {
|
|
13021
|
+
/** @type {?} */
|
|
13022
|
+
const response = yield this.searchV6Request(strip, strip.request, calculateParentStatus);
|
|
13023
|
+
// console.log('calling after - response, ', response)
|
|
13024
|
+
if (response && response.results) {
|
|
13025
|
+
// console.log('calling after-- ')
|
|
13026
|
+
if (response.results.result.content) {
|
|
13027
|
+
if (strip.key === 'scheduledAssessment') {
|
|
13028
|
+
this.enrollInterval = setInterval((/**
|
|
13029
|
+
* @return {?}
|
|
13030
|
+
*/
|
|
13031
|
+
() => {
|
|
13032
|
+
this.checkInvitOnlyAssessments(response.results.result.content, strip, calculateParentStatus, response.viewMoreUrl);
|
|
13033
|
+
// tslint:disable-next-line
|
|
13034
|
+
}), 1000);
|
|
13035
|
+
}
|
|
13036
|
+
else {
|
|
13037
|
+
this.processStrip(strip, this.transformContentsToWidgets(response.results.result.content, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
13038
|
+
}
|
|
13039
|
+
}
|
|
13040
|
+
else if (response.results.result.Event) {
|
|
13041
|
+
this.processStrip(strip, this.transformEventsToWidgets(response.results.result.Event, strip), 'done', calculateParentStatus, response.viewMoreUrl);
|
|
13042
|
+
}
|
|
13043
|
+
else {
|
|
13044
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
13045
|
+
}
|
|
13046
|
+
}
|
|
13047
|
+
else {
|
|
13048
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
13049
|
+
}
|
|
13050
|
+
}
|
|
13051
|
+
catch (error) {
|
|
13052
|
+
// Handle errors
|
|
13053
|
+
// console.error('Error:', error);
|
|
13054
|
+
}
|
|
13055
|
+
}
|
|
13056
|
+
}
|
|
13057
|
+
});
|
|
13058
|
+
}
|
|
13059
|
+
/**
|
|
13060
|
+
* @param {?} strip
|
|
13061
|
+
* @param {?} tabIndex
|
|
13062
|
+
* @param {?} pillIndex
|
|
13063
|
+
* @param {?} currentTab
|
|
13064
|
+
* @param {?} calculateParentStatus
|
|
13065
|
+
* @return {?}
|
|
13066
|
+
*/
|
|
13067
|
+
getTabDataByNewReqTrending(strip, tabIndex, pillIndex, currentTab, calculateParentStatus) {
|
|
13068
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13069
|
+
try {
|
|
13070
|
+
/** @type {?} */
|
|
13071
|
+
const response = yield this.trendingSearchRequest(strip, currentTab.request, calculateParentStatus);
|
|
13072
|
+
/** @type {?} */
|
|
13073
|
+
let tabResults = [];
|
|
13074
|
+
if (response && response.results && response.results.response) {
|
|
13075
|
+
/** @type {?} */
|
|
13076
|
+
const content = response.results.response[currentTab.value] || [];
|
|
13077
|
+
/** @type {?} */
|
|
13078
|
+
const widgets = this.transformContentsToWidgets(content, strip);
|
|
13079
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
13080
|
+
/** @type {?} */
|
|
13081
|
+
const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
13082
|
+
/** @type {?} */
|
|
13083
|
+
const allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
|
|
13084
|
+
this.resetSelectedPill(allPills);
|
|
13085
|
+
if (allTabs && allTabs.length && allTabs[tabIndex]) {
|
|
13086
|
+
if (allPills && allPills.length && allPills[pillIndex]) {
|
|
13087
|
+
allPills[pillIndex] = Object.assign({}, allPills[pillIndex], { widgets, fetchTabStatus: 'done', selected: true });
|
|
13088
|
+
}
|
|
13089
|
+
allTabs[tabIndex] = Object.assign({}, allTabs[tabIndex], { widgets, fetchTabStatus: 'done' });
|
|
13090
|
+
tabResults = allTabs;
|
|
13091
|
+
}
|
|
13092
|
+
}
|
|
13093
|
+
this.processStrip(strip, widgets, 'done', calculateParentStatus, response.viewMoreUrl, tabResults // tabResults as widgets
|
|
13094
|
+
);
|
|
13095
|
+
}
|
|
13096
|
+
else {
|
|
13097
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
13098
|
+
/** @type {?} */
|
|
13099
|
+
const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
13100
|
+
/** @type {?} */
|
|
13101
|
+
const allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
|
|
13102
|
+
this.resetSelectedPill(allPills);
|
|
13103
|
+
if (allTabs && allTabs.length && allTabs[tabIndex]) {
|
|
13104
|
+
if (allPills && allPills.length && allPills[pillIndex]) {
|
|
13105
|
+
allPills[pillIndex] = Object.assign({}, allPills[pillIndex], { widgets: [], fetchTabStatus: 'done', selected: true });
|
|
13106
|
+
}
|
|
13107
|
+
allTabs[tabIndex] = Object.assign({}, allTabs[tabIndex], { widgets: [], fetchTabStatus: 'done' });
|
|
13108
|
+
tabResults = allTabs;
|
|
13109
|
+
}
|
|
13110
|
+
}
|
|
13111
|
+
this.processStrip(strip, [], 'done', calculateParentStatus, null);
|
|
13112
|
+
}
|
|
13113
|
+
}
|
|
13114
|
+
catch (error) {
|
|
13115
|
+
// Handle errors
|
|
13116
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
13117
|
+
}
|
|
13118
|
+
});
|
|
13119
|
+
}
|
|
13120
|
+
/**
|
|
13121
|
+
* @param {?} strip
|
|
13122
|
+
* @param {?} tabIndex
|
|
13123
|
+
* @param {?} pillIndex
|
|
13124
|
+
* @param {?} currentTab
|
|
13125
|
+
* @param {?} calculateParentStatus
|
|
13126
|
+
* @return {?}
|
|
13127
|
+
*/
|
|
13128
|
+
getTabDataByNewReqSearchV6(strip, tabIndex, pillIndex, currentTab, calculateParentStatus) {
|
|
13129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13130
|
+
try {
|
|
13131
|
+
/** @type {?} */
|
|
13132
|
+
const response = yield this.searchV6Request(strip, currentTab.request, calculateParentStatus);
|
|
13133
|
+
if (response && response.results) {
|
|
13134
|
+
/** @type {?} */
|
|
13135
|
+
const widgets = this.transformContentsToWidgets(response.results.result.content, strip);
|
|
13136
|
+
/** @type {?} */
|
|
13137
|
+
let tabResults = [];
|
|
13138
|
+
if (this.stripsResultDataMap[strip.key] && this.stripsResultDataMap[strip.key].tabs) {
|
|
13139
|
+
/** @type {?} */
|
|
13140
|
+
const allTabs = this.stripsResultDataMap[strip.key].tabs;
|
|
13141
|
+
/** @type {?} */
|
|
13142
|
+
const allPills = this.stripsResultDataMap[strip.key].tabs[tabIndex].pillsData;
|
|
13143
|
+
this.resetSelectedPill(allPills);
|
|
13144
|
+
if (allTabs && allTabs.length && allTabs[tabIndex]) {
|
|
13145
|
+
if (allPills && allPills.length && allPills[pillIndex]) {
|
|
13146
|
+
allPills[pillIndex] = Object.assign({}, allPills[pillIndex], { widgets, fetchTabStatus: 'done', selected: true });
|
|
13147
|
+
}
|
|
13148
|
+
allTabs[tabIndex] = Object.assign({}, allTabs[tabIndex], { widgets, fetchTabStatus: 'done' });
|
|
13149
|
+
tabResults = allTabs;
|
|
13150
|
+
}
|
|
13151
|
+
}
|
|
13152
|
+
this.processStrip(strip, widgets, 'done', calculateParentStatus, response.viewMoreUrl, tabResults // tabResults as widgets
|
|
13153
|
+
);
|
|
13154
|
+
}
|
|
13155
|
+
else {
|
|
13156
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
13157
|
+
}
|
|
13158
|
+
}
|
|
13159
|
+
catch (error) {
|
|
13160
|
+
// Handle errors
|
|
13161
|
+
// console.error('Error:', error);
|
|
13162
|
+
}
|
|
13163
|
+
});
|
|
13164
|
+
}
|
|
13165
|
+
/**
|
|
13166
|
+
* @param {?} strip
|
|
13167
|
+
* @param {?} request
|
|
13168
|
+
* @param {?} calculateParentStatus
|
|
13169
|
+
* @return {?}
|
|
13170
|
+
*/
|
|
13171
|
+
trendingSearchRequest(strip, request, calculateParentStatus) {
|
|
13172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13173
|
+
/** @type {?} */
|
|
13174
|
+
const originalFilters = [];
|
|
13175
|
+
return new Promise((/**
|
|
13176
|
+
* @param {?} resolve
|
|
13177
|
+
* @param {?} reject
|
|
13178
|
+
* @return {?}
|
|
13179
|
+
*/
|
|
13180
|
+
(resolve, reject) => {
|
|
13181
|
+
if (request && request.trendingSearch) {
|
|
13182
|
+
// check for the request if it has dynamic values]
|
|
13183
|
+
if (request.trendingSearch.request.filters.organisation &&
|
|
13184
|
+
request.trendingSearch.request.filters.organisation.indexOf('<orgID>') >= 0) {
|
|
13185
|
+
/** @type {?} */
|
|
13186
|
+
let userRootOrgId;
|
|
13187
|
+
if (this.configSvc.userProfile) {
|
|
13188
|
+
userRootOrgId = this.configSvc.userProfile.rootOrgId;
|
|
13189
|
+
}
|
|
13190
|
+
request.trendingSearch.request.filters.organisation = userRootOrgId;
|
|
13191
|
+
}
|
|
13192
|
+
this.contentSvc.trendingContentSearch(request.trendingSearch).subscribe((/**
|
|
13193
|
+
* @param {?} results
|
|
13194
|
+
* @return {?}
|
|
13195
|
+
*/
|
|
13196
|
+
results => {
|
|
13197
|
+
/** @type {?} */
|
|
13198
|
+
const showViewMore = Boolean(results.result &&
|
|
13199
|
+
strip.request &&
|
|
13200
|
+
results.result[strip.request.trendingSearch.responseKey] &&
|
|
13201
|
+
results.result[strip.request.trendingSearch.responseKey].length > 5 &&
|
|
13202
|
+
strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
13203
|
+
/** @type {?} */
|
|
13204
|
+
const viewMoreUrl = showViewMore
|
|
13205
|
+
? {
|
|
13206
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
13207
|
+
queryParams: {
|
|
13208
|
+
tab: 'Learn',
|
|
13209
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
13210
|
+
f: request &&
|
|
13211
|
+
request.trendingSearch &&
|
|
13212
|
+
request.trendingSearch.request &&
|
|
13213
|
+
request.trendingSearch.request.filters
|
|
13214
|
+
? JSON.stringify(this.transformSearchV6FiltersV2(originalFilters))
|
|
13215
|
+
: {},
|
|
13216
|
+
},
|
|
13217
|
+
}
|
|
13218
|
+
: null;
|
|
13219
|
+
/** @type {?} */
|
|
13220
|
+
let proccesedResult = [];
|
|
13221
|
+
if (results && results.response && results.response.certifications) {
|
|
13222
|
+
results.response.certifications.map((/**
|
|
13223
|
+
* @param {?} result
|
|
13224
|
+
* @return {?}
|
|
13225
|
+
*/
|
|
13226
|
+
(result) => {
|
|
13227
|
+
if (result.source === this.channnelName) {
|
|
13228
|
+
proccesedResult.push(result);
|
|
13229
|
+
}
|
|
13230
|
+
}));
|
|
13231
|
+
results = { response: { certifications: proccesedResult } };
|
|
13232
|
+
}
|
|
13233
|
+
resolve({ results, viewMoreUrl });
|
|
13234
|
+
}), (/**
|
|
13235
|
+
* @param {?} error
|
|
13236
|
+
* @return {?}
|
|
13237
|
+
*/
|
|
13238
|
+
(error) => {
|
|
13239
|
+
if (error.error && error.error.status === 400) {
|
|
13240
|
+
this.processStrip(strip, [], 'done', calculateParentStatus, null);
|
|
13241
|
+
}
|
|
13242
|
+
// this.processStrip(strip, [], 'done', calculateParentStatus, null)
|
|
13243
|
+
reject(error);
|
|
13244
|
+
}));
|
|
13245
|
+
}
|
|
13246
|
+
}));
|
|
13247
|
+
});
|
|
13248
|
+
}
|
|
13249
|
+
/**
|
|
13250
|
+
* @param {?} tabEvent
|
|
13251
|
+
* @param {?} pillIndex
|
|
13252
|
+
* @param {?} stripMap
|
|
13253
|
+
* @param {?} stripKey
|
|
13254
|
+
* @return {?}
|
|
13255
|
+
*/
|
|
13256
|
+
tabClicked(tabEvent, pillIndex, stripMap, stripKey) {
|
|
13257
|
+
if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
13258
|
+
stripMap.tabs[tabEvent.index].pillsData[pillIndex].fetchTabStatus = 'inprogress';
|
|
13259
|
+
stripMap.tabs[tabEvent.index].pillsData[pillIndex].tabLoading = true;
|
|
13260
|
+
stripMap.showOnLoader = true;
|
|
13261
|
+
}
|
|
13262
|
+
/** @type {?} */
|
|
13263
|
+
const data = {
|
|
13264
|
+
label: `${tabEvent.tab.textLabel}`,
|
|
13265
|
+
index: tabEvent.index,
|
|
13266
|
+
};
|
|
13267
|
+
this.eventSvc.raiseInteractTelemetry({
|
|
13268
|
+
type: WsEvents.EnumInteractTypes.CLICK,
|
|
13269
|
+
subType: WsEvents.EnumInteractSubTypes.HOME_PAGE_STRIP_TABS,
|
|
13270
|
+
id: `${camelCase(data.label)}-tab`,
|
|
13271
|
+
}, {}, {
|
|
13272
|
+
module: WsEvents.EnumTelemetrymodules.HOME,
|
|
13273
|
+
});
|
|
13274
|
+
/** @type {?} */
|
|
13275
|
+
const currentTabFromMap = stripMap.tabs && stripMap.tabs[tabEvent.index];
|
|
13276
|
+
/** @type {?} */
|
|
13277
|
+
const currentPillFromMap = stripMap.tabs && stripMap.tabs[tabEvent.index].pillsData[pillIndex];
|
|
13278
|
+
/** @type {?} */
|
|
13279
|
+
const currentStrip = this.widgetData.strips.find((/**
|
|
13280
|
+
* @param {?} s
|
|
13281
|
+
* @return {?}
|
|
13282
|
+
*/
|
|
13283
|
+
s => s.key === stripKey));
|
|
13284
|
+
if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
|
|
13285
|
+
this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = Object.assign({}, this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams, { tabSelected: currentTabFromMap.value, pillSelected: currentPillFromMap.value });
|
|
13286
|
+
}
|
|
13287
|
+
if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick && currentPillFromMap) {
|
|
13288
|
+
if (currentPillFromMap.requestRequired && currentPillFromMap.request) {
|
|
13289
|
+
// call API to get tab data and process
|
|
13290
|
+
// this.processStrip(currentStrip, [], 'fetching', true, null)
|
|
13291
|
+
if (currentPillFromMap.request.searchV6) {
|
|
13292
|
+
this.getTabDataByNewReqSearchV6(currentStrip, tabEvent.index, 0, currentPillFromMap, true);
|
|
13293
|
+
}
|
|
13294
|
+
else if (currentPillFromMap.request.trendingSearch) {
|
|
13295
|
+
this.getTabDataByNewReqTrending(currentStrip, tabEvent.index, 0, currentPillFromMap, true);
|
|
13296
|
+
}
|
|
13297
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
13298
|
+
// stripMap.tabs[tabEvent.index].tabLoading = false;
|
|
13299
|
+
// }
|
|
13300
|
+
stripMap.tabs[tabEvent.index].pillsData[pillIndex].tabLoading = false;
|
|
13301
|
+
}
|
|
13302
|
+
else {
|
|
13303
|
+
// this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
|
|
13304
|
+
// setTimeout(() => {
|
|
13305
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
13306
|
+
// stripMap.tabs[tabEvent.index].tabLoading = false;
|
|
13307
|
+
// stripMap.tabs[tabEvent.index].fetchTabStatus = 'done';
|
|
13308
|
+
// stripMap.showOnLoader = false;
|
|
13309
|
+
// }
|
|
13310
|
+
// }, 200);
|
|
13311
|
+
}
|
|
13312
|
+
}
|
|
13313
|
+
}
|
|
13314
|
+
/**
|
|
13315
|
+
* @param {?} event
|
|
13316
|
+
* @param {?} stripMap
|
|
13317
|
+
* @param {?} stripKey
|
|
13318
|
+
* @param {?} pillIndex
|
|
13319
|
+
* @param {?} tabIndex
|
|
13320
|
+
* @return {?}
|
|
13321
|
+
*/
|
|
13322
|
+
pillClicked(event, stripMap, stripKey, pillIndex, tabIndex) {
|
|
13323
|
+
if (stripMap && stripMap.tabs && stripMap.tabs[tabIndex]) {
|
|
13324
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex].fetchTabStatus = 'inprogress';
|
|
13325
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = true;
|
|
13326
|
+
stripMap.showOnLoader = true;
|
|
13327
|
+
}
|
|
13328
|
+
/** @type {?} */
|
|
13329
|
+
const currentTabFromMap = stripMap.tabs && stripMap.tabs[tabIndex];
|
|
13330
|
+
/** @type {?} */
|
|
13331
|
+
const currentPillFromMap = stripMap.tabs && stripMap.tabs[tabIndex].pillsData[pillIndex];
|
|
13332
|
+
/** @type {?} */
|
|
13333
|
+
const currentStrip = this.widgetData.strips.find((/**
|
|
13334
|
+
* @param {?} s
|
|
13335
|
+
* @return {?}
|
|
13336
|
+
*/
|
|
13337
|
+
s => s.key === stripKey));
|
|
13338
|
+
if (this.stripsResultDataMap[stripKey] && currentTabFromMap) {
|
|
13339
|
+
this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams = Object.assign({}, this.stripsResultDataMap[stripKey].viewMoreUrl.queryParams, { tabSelected: currentTabFromMap.value, pillSelected: currentPillFromMap.value });
|
|
13340
|
+
}
|
|
13341
|
+
if (currentStrip && currentTabFromMap && !currentTabFromMap.computeDataOnClick && currentPillFromMap) {
|
|
13342
|
+
if (currentPillFromMap.requestRequired && currentPillFromMap.request) {
|
|
13343
|
+
// call API to get tab data and process
|
|
13344
|
+
// this.processStrip(currentStrip, [], 'fetching', true, null)
|
|
13345
|
+
if (currentPillFromMap.request.searchV6) {
|
|
13346
|
+
this.getTabDataByNewReqSearchV6(currentStrip, tabIndex, pillIndex, currentPillFromMap, true);
|
|
13347
|
+
}
|
|
13348
|
+
else if (currentPillFromMap.request.trendingSearch) {
|
|
13349
|
+
this.getTabDataByNewReqTrending(currentStrip, tabIndex, pillIndex, currentPillFromMap, true);
|
|
13350
|
+
}
|
|
13351
|
+
// if (stripMap && stripMap.tabs && stripMap.tabs[tabEvent.index]) {
|
|
13352
|
+
// stripMap.tabs[tabEvent.index].tabLoading = false;
|
|
13353
|
+
// }
|
|
13354
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = false;
|
|
13355
|
+
}
|
|
13356
|
+
else {
|
|
13357
|
+
this.getTabDataByfilter(currentStrip, currentTabFromMap, true);
|
|
13358
|
+
setTimeout((/**
|
|
13359
|
+
* @return {?}
|
|
13360
|
+
*/
|
|
13361
|
+
() => {
|
|
13362
|
+
if (stripMap && stripMap.tabs && stripMap.tabs[tabIndex]) {
|
|
13363
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex].fetchTabStatus = 'inprogress';
|
|
13364
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex].tabLoading = false;
|
|
13365
|
+
stripMap.showOnLoader = false;
|
|
13366
|
+
this.resetSelectedPill(stripMap.tabs[tabIndex].pillsData);
|
|
13367
|
+
stripMap.tabs[tabIndex].pillsData[pillIndex]['selected'] = true;
|
|
13368
|
+
}
|
|
13369
|
+
}), 200);
|
|
13370
|
+
}
|
|
13371
|
+
}
|
|
13372
|
+
}
|
|
13373
|
+
/**
|
|
13374
|
+
* @param {?} strip
|
|
13375
|
+
* @param {?} request
|
|
13376
|
+
* @param {?} calculateParentStatus
|
|
13377
|
+
* @return {?}
|
|
13378
|
+
*/
|
|
13379
|
+
searchV6Request(strip, request, calculateParentStatus) {
|
|
13380
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13381
|
+
/** @type {?} */
|
|
13382
|
+
const originalFilters = [];
|
|
13383
|
+
return new Promise((/**
|
|
13384
|
+
* @param {?} resolve
|
|
13385
|
+
* @param {?} reject
|
|
13386
|
+
* @return {?}
|
|
13387
|
+
*/
|
|
13388
|
+
(resolve, reject) => {
|
|
13389
|
+
if (request && request.searchV6) {
|
|
13390
|
+
this.contentSvc.searchV6(request.searchV6).subscribe((/**
|
|
13391
|
+
* @param {?} results
|
|
13392
|
+
* @return {?}
|
|
13393
|
+
*/
|
|
13394
|
+
results => {
|
|
13395
|
+
/** @type {?} */
|
|
13396
|
+
const showViewMore = Boolean(results.result.content && results.result.content.length > 5 && strip.stripConfig && strip.stripConfig.postCardForSearch);
|
|
13397
|
+
/** @type {?} */
|
|
13398
|
+
const viewMoreUrl = showViewMore
|
|
13399
|
+
? {
|
|
13400
|
+
path: strip.viewMoreUrl && strip.viewMoreUrl.path || '',
|
|
13401
|
+
queryParams: {
|
|
13402
|
+
tab: 'Learn',
|
|
13403
|
+
q: strip.viewMoreUrl && strip.viewMoreUrl.queryParams,
|
|
13404
|
+
f: request &&
|
|
13405
|
+
request.searchV6 &&
|
|
13406
|
+
request.searchV6.request &&
|
|
13407
|
+
request.searchV6.request.filters
|
|
13408
|
+
? JSON.stringify(this.transformSearchV6FiltersV2(originalFilters))
|
|
13409
|
+
: {},
|
|
13410
|
+
},
|
|
13411
|
+
}
|
|
13412
|
+
: null;
|
|
13413
|
+
// if (viewMoreUrl && viewMoreUrl.queryParams) {
|
|
13414
|
+
// viewMoreUrl.queryParams = viewMoreUrl.queryParams
|
|
13415
|
+
// }
|
|
13416
|
+
resolve({ results, viewMoreUrl });
|
|
13417
|
+
}), (/**
|
|
13418
|
+
* @param {?} error
|
|
13419
|
+
* @return {?}
|
|
13420
|
+
*/
|
|
13421
|
+
(error) => {
|
|
13422
|
+
this.processStrip(strip, [], 'error', calculateParentStatus, null);
|
|
13423
|
+
reject(error);
|
|
13424
|
+
}));
|
|
13425
|
+
}
|
|
13426
|
+
}));
|
|
13427
|
+
});
|
|
13428
|
+
}
|
|
13429
|
+
/**
|
|
13430
|
+
* @param {?} tabdata
|
|
13431
|
+
* @param {?} tabIndex
|
|
13432
|
+
* @return {?}
|
|
13433
|
+
*/
|
|
13434
|
+
getSelectedPillIndex(tabdata, tabIndex) {
|
|
13435
|
+
if (tabdata.pillsData && tabdata.pillsData.length) {
|
|
13436
|
+
// tabdata.pillsData.forEach((ele: any, index: any) => {
|
|
13437
|
+
// if(ele.selected) {
|
|
13438
|
+
// console.log(ele,'---------')
|
|
13439
|
+
// return index
|
|
13440
|
+
// }
|
|
13441
|
+
// // })
|
|
13442
|
+
// console.log(tabdata,'==========123')
|
|
13443
|
+
/** @type {?} */
|
|
13444
|
+
let index = tabdata.pillsData.findIndex((/**
|
|
13445
|
+
* @param {?} pill
|
|
13446
|
+
* @return {?}
|
|
13447
|
+
*/
|
|
13448
|
+
(pill) => {
|
|
13449
|
+
// if(pill.selected){
|
|
13450
|
+
return pill.selected;
|
|
13451
|
+
// }
|
|
13452
|
+
}));
|
|
13453
|
+
return index;
|
|
13454
|
+
}
|
|
13455
|
+
return 0;
|
|
13456
|
+
}
|
|
13457
|
+
// cbp plans
|
|
13458
|
+
/**
|
|
13459
|
+
* @param {?} strip
|
|
13460
|
+
* @param {?=} calculateParentStatus
|
|
13461
|
+
* @return {?}
|
|
13462
|
+
*/
|
|
13463
|
+
fetchAllCbpPlans(strip, calculateParentStatus = true) {
|
|
13464
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13465
|
+
if (strip.request && strip.request.cbpList && Object.keys(strip.request.cbpList).length) {
|
|
13466
|
+
/** @type {?} */
|
|
13467
|
+
let courses;
|
|
13468
|
+
/** @type {?} */
|
|
13469
|
+
let tabResults = [];
|
|
13470
|
+
/** @type {?} */
|
|
13471
|
+
const response = yield this.userSvc.fetchCbpPlanList().toPromise();
|
|
13472
|
+
if (response) {
|
|
13473
|
+
courses = response;
|
|
13474
|
+
if (strip.tabs && strip.tabs.length) {
|
|
13475
|
+
tabResults = this.splitCbpTabsData(courses, strip);
|
|
13476
|
+
yield this.processStrip(strip, this.transformContentsToWidgets(courses, strip), 'done', calculateParentStatus, '', tabResults);
|
|
13477
|
+
}
|
|
13478
|
+
else {
|
|
13479
|
+
this.processStrip(strip, this.transformContentsToWidgets(courses, strip), 'done', calculateParentStatus, 'viewMoreUrl');
|
|
13480
|
+
}
|
|
13481
|
+
}
|
|
13482
|
+
// this.userSvc.fetchCbpPlanList().subscribe( async (res: any) => {
|
|
13483
|
+
// if (res) {
|
|
13484
|
+
// console.log(res,'===============================>')
|
|
13485
|
+
// courses = res
|
|
13486
|
+
// if (strip.tabs && strip.tabs.length) {
|
|
13487
|
+
// tabResults = this.splitCbpTabsData(courses, strip)
|
|
13488
|
+
// await this.processStrip(
|
|
13489
|
+
// strip,
|
|
13490
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
13491
|
+
// 'done',
|
|
13492
|
+
// calculateParentStatus,
|
|
13493
|
+
// '',
|
|
13494
|
+
// tabResults
|
|
13495
|
+
// )
|
|
13496
|
+
// } else {
|
|
13497
|
+
// this.processStrip(
|
|
13498
|
+
// strip,
|
|
13499
|
+
// this.transformContentsToWidgets(courses, strip),
|
|
13500
|
+
// 'done',
|
|
13501
|
+
// calculateParentStatus,
|
|
13502
|
+
// 'viewMoreUrl',
|
|
13503
|
+
// )
|
|
13504
|
+
// }
|
|
13505
|
+
// }
|
|
13506
|
+
// }, (_err: any) => {
|
|
13507
|
+
// })
|
|
13508
|
+
clearInterval(this.enrollInterval);
|
|
13509
|
+
}
|
|
13510
|
+
});
|
|
13511
|
+
}
|
|
13512
|
+
/**
|
|
13513
|
+
* @param {?} contentNew
|
|
13514
|
+
* @param {?} strip
|
|
13515
|
+
* @return {?}
|
|
13516
|
+
*/
|
|
13517
|
+
splitCbpTabsData(contentNew, strip) {
|
|
13518
|
+
/** @type {?} */
|
|
13519
|
+
let tabResults = [];
|
|
13520
|
+
/** @type {?} */
|
|
13521
|
+
const splitData = this.getTabsList(contentNew, strip);
|
|
13522
|
+
if (strip.tabs && strip.tabs.length) {
|
|
13523
|
+
for (let i = 0; i < strip.tabs.length; i += 1) {
|
|
13524
|
+
if (strip.tabs[i].value === "myIgotPlans") {
|
|
13525
|
+
if (strip.tabs[i].pillsData && strip.tabs[i].pillsData.length) {
|
|
13526
|
+
for (let j = 0; j < strip.tabs[i].pillsData.length; j += 1) {
|
|
13527
|
+
if (j === 0) {
|
|
13528
|
+
strip.tabs[i].pillsData[j].selected = true;
|
|
13529
|
+
}
|
|
13530
|
+
if (strip.tabs[i].pillsData[j]) {
|
|
13531
|
+
tabResults.push(Object.assign({}, strip.tabs[i].pillsData[j], { fetchTabStatus: 'done' }, (splitData.find((/**
|
|
13532
|
+
* @param {?} itmInner
|
|
13533
|
+
* @return {?}
|
|
13534
|
+
*/
|
|
13535
|
+
itmInner => {
|
|
13536
|
+
if (strip.tabs[i].pillsData && strip.tabs[i].pillsData[j] && itmInner.value === strip.tabs[i].pillsData[j].value) {
|
|
13537
|
+
return itmInner;
|
|
13538
|
+
}
|
|
13539
|
+
return undefined;
|
|
13540
|
+
})))));
|
|
13541
|
+
}
|
|
13542
|
+
}
|
|
13543
|
+
strip.tabs[i].pillsData = tabResults;
|
|
13544
|
+
}
|
|
13545
|
+
}
|
|
13546
|
+
}
|
|
13547
|
+
}
|
|
13548
|
+
return strip.tabs;
|
|
13549
|
+
}
|
|
13550
|
+
/**
|
|
13551
|
+
* @param {?} array
|
|
13552
|
+
* @param {?} strip
|
|
13553
|
+
* @return {?}
|
|
13554
|
+
*/
|
|
13555
|
+
getTabsList(array, strip) {
|
|
13556
|
+
/** @type {?} */
|
|
13557
|
+
let all = [];
|
|
13558
|
+
/** @type {?} */
|
|
13559
|
+
let upcoming = [];
|
|
13560
|
+
/** @type {?} */
|
|
13561
|
+
let overdue = [];
|
|
13562
|
+
array.forEach((/**
|
|
13563
|
+
* @param {?} e
|
|
13564
|
+
* @return {?}
|
|
13565
|
+
*/
|
|
13566
|
+
(e) => {
|
|
13567
|
+
all.push(e);
|
|
13568
|
+
if (e.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
13569
|
+
overdue.push(e);
|
|
13570
|
+
}
|
|
13571
|
+
else if (e.planDuration === NsCardContent.ACBPConst.UPCOMING) {
|
|
13572
|
+
upcoming.push(e);
|
|
13573
|
+
}
|
|
13574
|
+
}));
|
|
13575
|
+
/** @type {?} */
|
|
13576
|
+
const allCompleted = all.filter((/**
|
|
13577
|
+
* @param {?} allData
|
|
13578
|
+
* @return {?}
|
|
13579
|
+
*/
|
|
13580
|
+
(allData) => allData.contentStatus === 2));
|
|
13581
|
+
/** @type {?} */
|
|
13582
|
+
let allInCompleted = all.filter((/**
|
|
13583
|
+
* @param {?} allData
|
|
13584
|
+
* @return {?}
|
|
13585
|
+
*/
|
|
13586
|
+
(allData) => allData.contentStatus < 2));
|
|
13587
|
+
/** @type {?} */
|
|
13588
|
+
let allCompletedOverDue = allCompleted.filter((/**
|
|
13589
|
+
* @param {?} allData
|
|
13590
|
+
* @return {?}
|
|
13591
|
+
*/
|
|
13592
|
+
(allData) => allData.planDuration === NsCardContent.ACBPConst.OVERDUE));
|
|
13593
|
+
/** @type {?} */
|
|
13594
|
+
const allCompletedAll = allCompleted.filter((/**
|
|
13595
|
+
* @param {?} allData
|
|
13596
|
+
* @return {?}
|
|
13597
|
+
*/
|
|
13598
|
+
(allData) => allData.planDuration !== NsCardContent.ACBPConst.OVERDUE));
|
|
13599
|
+
allCompletedOverDue = allCompletedOverDue.sort((/**
|
|
13600
|
+
* @param {?} a
|
|
13601
|
+
* @param {?} b
|
|
13602
|
+
* @return {?}
|
|
13603
|
+
*/
|
|
13604
|
+
(a, b) => {
|
|
13605
|
+
if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
13606
|
+
/** @type {?} */
|
|
13607
|
+
const firstDate = new Date(a.endDate);
|
|
13608
|
+
/** @type {?} */
|
|
13609
|
+
const secondDate = new Date(b.endDate);
|
|
13610
|
+
return firstDate > secondDate ? -1 : 1;
|
|
13611
|
+
}
|
|
13612
|
+
}));
|
|
13613
|
+
allInCompleted = allInCompleted.sort((/**
|
|
13614
|
+
* @param {?} a
|
|
13615
|
+
* @param {?} b
|
|
13616
|
+
* @return {?}
|
|
13617
|
+
*/
|
|
13618
|
+
(a, b) => {
|
|
13619
|
+
if (a.planDuration === NsCardContent.ACBPConst.OVERDUE && b.planDuration === NsCardContent.ACBPConst.OVERDUE) {
|
|
13620
|
+
/** @type {?} */
|
|
13621
|
+
const firstDate = new Date(a.endDate);
|
|
13622
|
+
/** @type {?} */
|
|
13623
|
+
const secondDate = new Date(b.endDate);
|
|
13624
|
+
return firstDate > secondDate ? -1 : 1;
|
|
13625
|
+
}
|
|
13626
|
+
}));
|
|
13627
|
+
all = [...allInCompleted, ...allCompletedAll, ...allCompletedOverDue];
|
|
13628
|
+
overdue = overdue.filter((/**
|
|
13629
|
+
* @param {?} data
|
|
13630
|
+
* @return {?}
|
|
13631
|
+
*/
|
|
13632
|
+
(data) => {
|
|
13633
|
+
return data.contentStatus < 2;
|
|
13634
|
+
}));
|
|
13635
|
+
overdue = overdue.sort((/**
|
|
13636
|
+
* @param {?} a
|
|
13637
|
+
* @param {?} b
|
|
13638
|
+
* @return {?}
|
|
13639
|
+
*/
|
|
13640
|
+
(a, b) => {
|
|
13641
|
+
/** @type {?} */
|
|
13642
|
+
const firstDate = new Date(a.endDate);
|
|
13643
|
+
/** @type {?} */
|
|
13644
|
+
const secondDate = new Date(b.endDate);
|
|
13645
|
+
return firstDate > secondDate ? -1 : 1;
|
|
13646
|
+
}));
|
|
13647
|
+
upcoming = upcoming.filter((/**
|
|
13648
|
+
* @param {?} data
|
|
13649
|
+
* @return {?}
|
|
13650
|
+
*/
|
|
13651
|
+
(data) => {
|
|
13652
|
+
return data.contentStatus < 2;
|
|
13653
|
+
}));
|
|
13654
|
+
// this.getSelectedIndex(1)
|
|
13655
|
+
return [
|
|
13656
|
+
{ value: 'all', widgets: this.transformContentsToWidgets(all, strip) },
|
|
13657
|
+
{ value: 'upcoming', widgets: this.transformContentsToWidgets(upcoming, strip) },
|
|
13658
|
+
{ value: 'completed', widgets: this.transformContentsToWidgets(allCompleted, strip) },
|
|
13659
|
+
{ value: 'overdue', widgets: this.transformContentsToWidgets(overdue, strip) }
|
|
13660
|
+
];
|
|
13661
|
+
}
|
|
13662
|
+
/**
|
|
13663
|
+
* @param {?} pillData
|
|
13664
|
+
* @return {?}
|
|
13665
|
+
*/
|
|
13666
|
+
resetSelectedPill(pillData) {
|
|
13667
|
+
if (pillData && pillData.length) {
|
|
13668
|
+
pillData.forEach((/**
|
|
13669
|
+
* @param {?} pill
|
|
13670
|
+
* @return {?}
|
|
13671
|
+
*/
|
|
13672
|
+
(pill) => {
|
|
13673
|
+
pill['selected'] = false;
|
|
13674
|
+
}));
|
|
13675
|
+
}
|
|
13676
|
+
}
|
|
13677
|
+
}
|
|
13678
|
+
ContentStripWithTabsPillsComponent.decorators = [
|
|
13679
|
+
{ type: Component, args: [{
|
|
13680
|
+
selector: 'sb-uic-content-strip-with-tabs-pills',
|
|
13681
|
+
template: "<ng-container *ngIf=\"!contentAvailable; else otherTemplate\"></ng-container>\n<ng-template #otherTemplate>\n <!-- <div *ngIf=\"showParentLoader\" class=\"text-center my-2\">\n <mat-spinner class=\"inline-block\"></mat-spinner>\n </div> -->\n <ng-container *ngIf=\"showParentError\" [sbUiResolverWidget]=\"widgetData.errorWidget\"></ng-container>\n <ng-container *ngIf=\"showParentNoData\" [sbUiResolverWidget]=\"widgetData.noDataWidget\"></ng-container>\n <ng-container *ngFor=\"let key of stripsKeyOrder; let i = index; trackBy: identify\">\n <ng-container *ngIf=\"isStripShowing(stripsResultDataMap[key])\">\n <a name=\"{{stripsResultDataMap[key]?.stripTitle}}\" [class]=\"key\">\n <div *ngIf=\"stripsResultDataMap && (getLength(stripsResultDataMap[key]) ||\n stripsResultDataMap[key]?.showOnNoData ||\n stripsResultDataMap[key]?.showOnLoader ||\n stripsResultDataMap[key]?.showOnError)\n \" [ngClass]=\"\n !widgetData?.isChannelStrip ? 'xs:px-8 sx:px-10ss' : i > 0 ? 'mt-12' : ''\n \" [id]=\"key\" [ngClass]=\"!widgetData?.isChannelStrip ? margin-bottom-custom : margin-bottom-xs\">\n <div [ngClass]=\"{ pad: stripsResultDataMap[key]?.stripBackground }\"\n [ngStyle]=\"{ 'background-color': stripsResultDataMap[key]?.stripBackground }\">\n <div class=\"flex flex-col pl-4 pr-4 md:pr-0 md:pl-0 \" [ngClass]=\"\n !widgetData?.isChannelStrip\n ? ''\n : stripsResultDataMap[key]?.stripTitle\n ? 'mb-8'\n : ''\n \">\n <div class=\"flex flex-1 items-center\">\n <p class=\"mat-subheading-1 margin-remove inline-block \" *ngIf=\"stripsResultDataMap[key]?.stripTitle\">\n <span class=\"capitalize\" *ngIf=\"stripsResultDataMap[key]?.disableTranslate\">\n {{stripsResultDataMap[key]?.stripTitle}}\n </span>\n <span *ngIf=\"!stripsResultDataMap[key]?.disableTranslate\">\n {{ translateLabels(stripsResultDataMap[key]?.stripTitle, 'home') }}\n </span>\n </p>\n\n <button *ngIf=\"stripsResultDataMap[key]?.stripInfo?.icon\" type=\"button\" mat-icon-button\n (click)=\"toggleInfo(stripsResultDataMap[key])\" i18n-matTooltip matTooltip=\"info\"\n class=\"margin-left-xs\">\n <mat-icon>{{ stripsResultDataMap[key]?.stripInfo?.icon.icon }}</mat-icon>\n </button>\n <a *ngIf=\"stripsResultDataMap[key]?.stripTitleLink?.link\"\n [routerLink]=\"stripsResultDataMap[key]?.stripTitleLink?.link\"\n [queryParams]=\"stripsResultDataMap[key]?.stripTitleLink?.link?.queryParams\">\n <mat-icon class=\"ws-mat-primary-primary-text ws-mat-default-text\" [color]=\"'accent'\">{{\n stripsResultDataMap[key]?.stripTitleLink?.icon }}</mat-icon>\n </a>\n <span class=\"spacer\"></span>\n <!-- viewAll start-->\n <!-- <div *ngIf=\"checkCondition(widgetData , stripsResultDataMap[key])\"\n class=\"ml-4 pl-2 view-more ws-mat-default-text\">\n <a class=\"flex ws-mat-default-text items-center justify-center mat-body-1 cursor-pointer\" \n (click)=\"raiseTelemetry(stripsResultDataMap[key]);redirectViewAll(stripsResultDataMap[key], stripsResultDataMap[key]?.viewMoreUrl?.path, stripsResultDataMap[key]?.viewMoreUrl?.queryParams )\">\n <span i18n class=\"ws-mat-default-text\">{{translateLabels(widgetData.strips[0].viewMoreUrl.viewMoreText,'home') || 'See all'}}</span>\n <mat-icon class=\"ws-mat-default-text mat-icon notranslate material-icons mat-icon-no-color\" color=\"accent\">navigate_next</mat-icon>\n </a>\n </div> -->\n <!-- viewAll end-->\n </div>\n <button mat-icon-button (click)=\"setHiddenForStrip(key)\" *ngIf=\"stripsResultDataMap[key]?.canHideStrip\">\n <mat-icon>close</mat-icon>\n </button>\n <mat-icon class=\"cursor-pointer\" *ngIf=\"stripsResultDataMap[key]?.mode === 'accordion' && isMobile\"\n (click)=\"showAccordionData = !showAccordionData\">{{ showAccordionData ? 'expand_less' : 'expand_more' }}\n </mat-icon>\n </div>\n\n <div class=\"mb-4\" *ngIf=\"checkVisible(stripsResultDataMap[key])\">\n <ng-container [sbUiResolverWidget]=\"getdata(stripsResultDataMap[key])\">\n </ng-container>\n </div>\n <ng-container *ngIf=\"stripsResultDataMap[key]?.showOnNoData\"\n [sbUiResolverWidget]=\"stripsResultDataMap[key]?.noDataWidget\"></ng-container>\n <ng-container *ngIf=\"stripsResultDataMap[key]?.showOnError\"\n [sbUiResolverWidget]=\"stripsResultDataMap[key]?.errorWidget\"></ng-container>\n <!-- IF no errors then proceed to show tabs or non tabs strip -->\n <ng-container *ngIf=\"!stripsResultDataMap[key]?.showOnNoData && !stripsResultDataMap[key]?.showOnError\">\n <ng-container *ngIf=\"stripsResultDataMap[key].tabs && stripsResultDataMap[key].tabs.length\">\n <mat-tab-group animationDuration=\"0ms\" [selectedIndex]=\"getSelectedIndex(stripsResultDataMap[key], key)\"\n class=\"mat-tab-labels w-full strips-tabgroup\" dynamicHeight\n (selectedTabChange)=\"tabClicked($event, 0, stripsResultDataMap[key], key)\">\n <mat-tab label=\"{{tab?.label}}\" *ngFor=\"let tab of stripsResultDataMap[key].tabs; let last = last;let tabIndex = index\">\n <ng-template mat-tab-label>\n <span>{{ translateLabels(tab?.label, 'home') }} </span>\n <span *ngIf=\"tab?.showTabDataCount && tab?.widgets?.length\">({{tab?.widgets?.length}})</span>\n </ng-template>\n\n <div class=\"wfull\" *ngIf=\"tab?.pillsData && tab?.pillsData?.length\">\n <div class=\"flex justify-between\">\n <div>\n <ng-container >\n <mat-chip-list class=\"content-pill\" aria-label=\"Fish selection\">\n <ng-container *ngFor=\"let pill of tab?.pillsData;let p = index\">\n <mat-chip [selected]=\"pill?.selected\" (click)=\"pillClicked($event, stripsResultDataMap[key], key, p, tabIndex)\">\n <span class=\"pill-name\">{{pill?.label}}</span></mat-chip>\n </ng-container>\n </mat-chip-list>\n </ng-container>\n </div>\n <!-- viewAll start-->\n <!-- <div *ngIf=\"checkCondition(widgetData , stripsResultDataMap[key])\"\n class=\"ml-4 pl-2 view-more ws-mat-default-text\">\n <a class=\"flex ws-mat-default-text items-center justify-center mat-body-1 cursor-pointer\" \n (click)=\"raiseTelemetry(stripsResultDataMap[key]);redirectViewAll(stripsResultDataMap[key], stripsResultDataMap[key]?.viewMoreUrl?.path, stripsResultDataMap[key]?.viewMoreUrl?.queryParams )\">\n <span i18n class=\"ws-mat-default-text\">{{translateLabels(widgetData.strips[0].viewMoreUrl.viewMoreText,'home') || 'See all'}}</span>\n <mat-icon class=\"ws-mat-default-text mat-icon notranslate material-icons mat-icon-no-color\" color=\"accent\">navigate_next</mat-icon>\n </a>\n </div> -->\n <!-- viewAll end-->\n </div>\n <div *ngIf=\"stripsResultDataMap && stripsResultDataMap[key]?.showOnLoader ||\n !tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus\"\n class=\"text-center my-2\">\n <sb-uic-horizontal-scroller-v2 [sliderConfig]=\"stripsResultDataMap[key]?.sliderConfig\" [id]=\"key+'-scroller'\"\n [loadStatus]=\"'fetching'\" [stripConfig]=\"stripsResultDataMap[key]?.stripConfig\">\n <ng-container *ngFor=\"let widget of stripsResultDataMap[key]?.loaderWidgets; trackBy: tracker\">\n <ng-container [sbUiResolverWidget]=\"widget\"></ng-container>\n </ng-container>\n </sb-uic-horizontal-scroller-v2>\n </div>\n <ng-container *ngIf=\"tab?.pillsData && tab?.pillsData.length && tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]\">\n <div *ngIf=\"((tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus && tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus === 'done') &&\n (!tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets || !tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length))\">\n <ng-container *ngIf=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.value === 'inprogress'; else msgTemp\">\n <div class=\"w-full flex flex-col items-center justify-center\">\n <img alt=\"\" class=\"mt-4 mb-4\" src=\"assets/icons/home/nodataDefault.svg\">\n <div class=\"mat-subheading-1 text-center info-content\">{{ 'contentstripmultiple.getReadyForLearningAdventure' | translate }} -\n <a class=\"click-here\" [routerLink]=\"'/page/learn'\">{{ 'contentstripmultiple.clickHere' | translate }}</a> {{ 'contentstripmultiple.toEnrollNextCourse' | translate }}</div>\n </div>\n </ng-container>\n <ng-template #msgTemp>\n <div class=\"w-full flex flex-col items-center justify-center\">\n <img alt=\"\" class=\"mt-4 mb-4\" src=\"assets/icons/home/nodataDefault.png\">\n <div class=\"mat-subheading-1 text-center\">{{ translateLabels(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.nodataMsg, 'home') }}</div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n <ng-container *ngIf=\"(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.fetchTabStatus === 'done' || tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length)\">\n <ng-container *ngIf=\"!tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.tabLoading\">\n <sb-uic-horizontal-scroller-v2 [id]=\"key+'-scroller'\" [sliderConfig]=\"stripsResultDataMap[key]?.sliderConfig\" [widgetsLength]=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets?.length\"\n *ngIf=\"getContineuLearningLenth(stripsResultDataMap[key]) && showAccordion(key)\"\n [loadStatus]=\"'done'\" [defaultMaxWidgets]=\"tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.maxWidgets ||\n stripsResultDataMap[key]?.sliderConfig?.maxWidgets || defaultMaxWidgets\" [stripConfig]=\"stripsResultDataMap[key]?.stripConfig\">\n <ng-container *ngFor=\"let widget of tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.widgets| slice:0:(tab?.pillsData[getSelectedPillIndex(tab ,tabIndex)]?.maxWidgets ||\n stripsResultDataMap[key]?.sliderConfig?.maxWidgets || defaultMaxWidgets); trackBy: tracker\">\n <ng-container [sbUiResolverWidget]=\"widget\"></ng-container>\n </ng-container>\n </sb-uic-horizontal-scroller-v2>\n </ng-container>\n </ng-container>\n </div>\n </mat-tab>\n </mat-tab-group>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </a>\n\n </ng-container>\n </ng-container>\n</ng-template>",
|
|
13682
|
+
styles: [".view-more{display:flex;align-items:center;text-align:center;height:40px;justify-content:center}.view-more .icon{font-size:24px;width:24px;height:24px;border:1px solid;border-radius:50%;padding:8px;margin-bottom:8px}.margin-bottom-custom{margin-bottom:60px}.view-more:hover{background-color:#dcdfe5}::ng-deep.strips-tabgroup .mat-tab-header{border-bottom:2px solid rgba(0,0,0,.12)}::ng-deep.strips-tabgroup .mat-tab-body{padding:20px 0!important;box-sizing:border-box;overflow-y:initial!important}::ng-deep.strips-tabgroup .mat-tab-body-wrapper{overflow:inherit!important}::ng-deep.strips-tabgroup .mat-tab-label{border-bottom:0 solid rgba(0,0,0,.1);margin-right:0;opacity:1}::ng-deep.strips-tabgroup .mat-tab-label .mat-tab-label-content{text-transform:inherit;font:400 14px/20px Lato}::ng-deep.strips-tabgroup .mat-tab-label-active .mat-tab-label-content{font-weight:700!important}.click-here{color:#1b4ca1}.info-content{opacity:1;color:rgba(0,0,0,.87);font:700 14px/20px Lato-Bold;text-align:center}.active{background:#1b4ca1!important}.active .pill-name{color:#fff!important}::ng-deep .content-pill .mat-chip-selected{background-color:#1b4ca1!important}::ng-deep .content-pill .mat-chip-selected .pill-name{color:#fff!important}"]
|
|
13683
|
+
}] }
|
|
13684
|
+
];
|
|
13685
|
+
/** @nocollapse */
|
|
13686
|
+
ContentStripWithTabsPillsComponent.ctorParameters = () => [
|
|
13687
|
+
{ type: undefined, decorators: [{ type: Inject, args: ['environment',] }] },
|
|
13688
|
+
{ type: WidgetContentService },
|
|
13689
|
+
{ type: LoggerService },
|
|
13690
|
+
{ type: EventService },
|
|
13691
|
+
{ type: ConfigurationsService$1 },
|
|
13692
|
+
{ type: UtilityService },
|
|
13693
|
+
{ type: Router },
|
|
13694
|
+
{ type: WidgetUserService },
|
|
13695
|
+
{ type: TranslateService },
|
|
13696
|
+
{ type: MultilingualTranslationsService }
|
|
13697
|
+
];
|
|
13698
|
+
ContentStripWithTabsPillsComponent.propDecorators = {
|
|
13699
|
+
widgetData: [{ type: Input }],
|
|
13700
|
+
emptyResponse: [{ type: Output }],
|
|
13701
|
+
viewAllResponse: [{ type: Output }],
|
|
13702
|
+
telemtryResponse: [{ type: Output }],
|
|
13703
|
+
providerId: [{ type: Input }],
|
|
13704
|
+
emitViewAll: [{ type: Input }],
|
|
13705
|
+
channnelName: [{ type: Input }],
|
|
13706
|
+
id: [{ type: HostBinding, args: ['id',] }]
|
|
13707
|
+
};
|
|
13708
|
+
if (false) {
|
|
13709
|
+
/** @type {?} */
|
|
13710
|
+
ContentStripWithTabsPillsComponent.prototype.widgetData;
|
|
13711
|
+
/** @type {?} */
|
|
13712
|
+
ContentStripWithTabsPillsComponent.prototype.emptyResponse;
|
|
13713
|
+
/** @type {?} */
|
|
13714
|
+
ContentStripWithTabsPillsComponent.prototype.viewAllResponse;
|
|
13715
|
+
/** @type {?} */
|
|
13716
|
+
ContentStripWithTabsPillsComponent.prototype.telemtryResponse;
|
|
13717
|
+
/** @type {?} */
|
|
13718
|
+
ContentStripWithTabsPillsComponent.prototype.providerId;
|
|
13719
|
+
/** @type {?} */
|
|
13720
|
+
ContentStripWithTabsPillsComponent.prototype.emitViewAll;
|
|
13721
|
+
/** @type {?} */
|
|
13722
|
+
ContentStripWithTabsPillsComponent.prototype.channnelName;
|
|
13723
|
+
/** @type {?} */
|
|
13724
|
+
ContentStripWithTabsPillsComponent.prototype.id;
|
|
13725
|
+
/** @type {?} */
|
|
13726
|
+
ContentStripWithTabsPillsComponent.prototype.stripsResultDataMap;
|
|
13727
|
+
/** @type {?} */
|
|
13728
|
+
ContentStripWithTabsPillsComponent.prototype.stripsKeyOrder;
|
|
13729
|
+
/** @type {?} */
|
|
13730
|
+
ContentStripWithTabsPillsComponent.prototype.showAccordionData;
|
|
13731
|
+
/** @type {?} */
|
|
13732
|
+
ContentStripWithTabsPillsComponent.prototype.showParentLoader;
|
|
13733
|
+
/** @type {?} */
|
|
13734
|
+
ContentStripWithTabsPillsComponent.prototype.showParentError;
|
|
13735
|
+
/** @type {?} */
|
|
13736
|
+
ContentStripWithTabsPillsComponent.prototype.showParentNoData;
|
|
13737
|
+
/** @type {?} */
|
|
13738
|
+
ContentStripWithTabsPillsComponent.prototype.errorDataCount;
|
|
13739
|
+
/** @type {?} */
|
|
13740
|
+
ContentStripWithTabsPillsComponent.prototype.noDataCount;
|
|
13741
|
+
/** @type {?} */
|
|
13742
|
+
ContentStripWithTabsPillsComponent.prototype.successDataCount;
|
|
13743
|
+
/** @type {?} */
|
|
13744
|
+
ContentStripWithTabsPillsComponent.prototype.contentAvailable;
|
|
13745
|
+
/** @type {?} */
|
|
13746
|
+
ContentStripWithTabsPillsComponent.prototype.baseUrl;
|
|
13747
|
+
/** @type {?} */
|
|
13748
|
+
ContentStripWithTabsPillsComponent.prototype.veifiedKarmayogi;
|
|
13749
|
+
/** @type {?} */
|
|
13750
|
+
ContentStripWithTabsPillsComponent.prototype.environment;
|
|
13751
|
+
/** @type {?} */
|
|
13752
|
+
ContentStripWithTabsPillsComponent.prototype.changeEventSubscription;
|
|
13753
|
+
/** @type {?} */
|
|
13754
|
+
ContentStripWithTabsPillsComponent.prototype.defaultMaxWidgets;
|
|
13755
|
+
/** @type {?} */
|
|
13756
|
+
ContentStripWithTabsPillsComponent.prototype.enrollInterval;
|
|
13757
|
+
/** @type {?} */
|
|
13758
|
+
ContentStripWithTabsPillsComponent.prototype.todaysEvents;
|
|
13759
|
+
/** @type {?} */
|
|
13760
|
+
ContentStripWithTabsPillsComponent.prototype.enrollmentMapData;
|
|
13761
|
+
/**
|
|
13762
|
+
* @type {?}
|
|
13763
|
+
* @private
|
|
13764
|
+
*/
|
|
13765
|
+
ContentStripWithTabsPillsComponent.prototype.contentSvc;
|
|
13766
|
+
/**
|
|
13767
|
+
* @type {?}
|
|
13768
|
+
* @private
|
|
13769
|
+
*/
|
|
13770
|
+
ContentStripWithTabsPillsComponent.prototype.loggerSvc;
|
|
13771
|
+
/**
|
|
13772
|
+
* @type {?}
|
|
13773
|
+
* @private
|
|
13774
|
+
*/
|
|
13775
|
+
ContentStripWithTabsPillsComponent.prototype.eventSvc;
|
|
13776
|
+
/**
|
|
13777
|
+
* @type {?}
|
|
13778
|
+
* @private
|
|
13779
|
+
*/
|
|
13780
|
+
ContentStripWithTabsPillsComponent.prototype.configSvc;
|
|
13781
|
+
/** @type {?} */
|
|
13782
|
+
ContentStripWithTabsPillsComponent.prototype.utilitySvc;
|
|
13783
|
+
/** @type {?} */
|
|
13784
|
+
ContentStripWithTabsPillsComponent.prototype.router;
|
|
13785
|
+
/**
|
|
13786
|
+
* @type {?}
|
|
13787
|
+
* @private
|
|
13788
|
+
*/
|
|
13789
|
+
ContentStripWithTabsPillsComponent.prototype.userSvc;
|
|
13790
|
+
/**
|
|
13791
|
+
* @type {?}
|
|
13792
|
+
* @private
|
|
13793
|
+
*/
|
|
13794
|
+
ContentStripWithTabsPillsComponent.prototype.translate;
|
|
13795
|
+
/**
|
|
13796
|
+
* @type {?}
|
|
13797
|
+
* @private
|
|
13798
|
+
*/
|
|
13799
|
+
ContentStripWithTabsPillsComponent.prototype.langtranslations;
|
|
13800
|
+
}
|
|
13801
|
+
|
|
13802
|
+
/**
|
|
13803
|
+
* @fileoverview added by tsickle
|
|
13804
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
13805
|
+
*/
|
|
13806
|
+
// tslint:disable-next-line:function-name
|
|
13807
|
+
/**
|
|
13808
|
+
* @param {?} http
|
|
13809
|
+
* @return {?}
|
|
13810
|
+
*/
|
|
13811
|
+
function HttpLoaderFactory1(http) {
|
|
13812
|
+
return new TranslateHttpLoader(http);
|
|
13813
|
+
}
|
|
13814
|
+
class ContentStripWithTabsPillsModule {
|
|
13815
|
+
}
|
|
13816
|
+
ContentStripWithTabsPillsModule.decorators = [
|
|
13817
|
+
{ type: NgModule, args: [{
|
|
13818
|
+
declarations: [ContentStripWithTabsPillsComponent],
|
|
13819
|
+
imports: [
|
|
13820
|
+
SbUiResolverModule,
|
|
13821
|
+
CommonModule,
|
|
13822
|
+
RouterModule,
|
|
13823
|
+
HorizontalScrollerV2Module,
|
|
13824
|
+
MatProgressSpinnerModule,
|
|
13825
|
+
MatToolbarModule,
|
|
13826
|
+
MatIconModule,
|
|
13827
|
+
MatButtonModule,
|
|
13828
|
+
MatTooltipModule,
|
|
13829
|
+
MatListModule,
|
|
13830
|
+
MatSidenavModule,
|
|
13831
|
+
MatCardModule,
|
|
13832
|
+
MatExpansionModule,
|
|
13833
|
+
MatRadioModule,
|
|
13834
|
+
MatChipsModule,
|
|
13835
|
+
MatInputModule,
|
|
13836
|
+
MatFormFieldModule,
|
|
13837
|
+
MatDialogModule,
|
|
13838
|
+
MatSnackBarModule,
|
|
13839
|
+
MatSelectModule,
|
|
13840
|
+
MatDatepickerModule,
|
|
13841
|
+
MatNativeDateModule,
|
|
13842
|
+
MatTableModule,
|
|
13843
|
+
MatCheckboxModule,
|
|
13844
|
+
MatProgressSpinnerModule,
|
|
13845
|
+
MatButtonToggleModule,
|
|
13846
|
+
MatTabsModule,
|
|
13847
|
+
MatAutocompleteModule,
|
|
13848
|
+
TranslateModule.forRoot({
|
|
13849
|
+
loader: {
|
|
13850
|
+
provide: TranslateLoader,
|
|
13851
|
+
useFactory: HttpLoaderFactory1,
|
|
13852
|
+
deps: [HttpClient],
|
|
13853
|
+
},
|
|
13854
|
+
}),
|
|
13855
|
+
],
|
|
13856
|
+
entryComponents: [ContentStripWithTabsPillsComponent],
|
|
13857
|
+
exports: [ContentStripWithTabsPillsComponent],
|
|
13858
|
+
},] }
|
|
13859
|
+
];
|
|
13860
|
+
|
|
11013
13861
|
/**
|
|
11014
13862
|
* @fileoverview added by tsickle
|
|
11015
13863
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -12612,5 +15460,5 @@ UserContentRatingLibModule.decorators = [
|
|
|
12612
15460
|
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
12613
15461
|
*/
|
|
12614
15462
|
|
|
12615
|
-
export { AnnouncementsModule, CalenderModule, CardsModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripWithTabsLibModule, DataPointsModule, HttpLoaderFactory, MyHammerConfig, ROOT_WIDGET_CONFIG, SlidersLibModule, UserContentRatingLibModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG, WidgetContentService, ContentStripWithTabsLibComponent as ɵa, WidgetUserService as ɵb, CardWideV2Component as ɵba, CardKarmaProgramsComponent as ɵbb, CardKarmaProgramsV2Component as ɵbc, ProviderCardComponent as ɵbd, CardPortraitExtComponent as ɵbe, CardAssessmentComponent as ɵbf, CardProgressPortraitLibComponent as ɵbg, CertificateService as ɵbh, CardMdoChannelV1Component as ɵbi, PipePublicURLModule as ɵbj, PipePublicURL as ɵbk, ObjectToArrayPipeModule as ɵbl, ObjectToArrayPipe as ɵbm, DisplayContentTypeLibModule as ɵbn, DisplayContentTypeLibComponent as ɵbo, DefaultThumbnailModule as ɵbp, DefaultThumbnailDirective as ɵbq, PipeDurationTransformModule as ɵbr, PipeDurationTransformPipe as ɵbs, ContentProgressComponent as ɵbt, DialogComponentsModule as ɵbu, CertificateDialogComponent as ɵbv, AvatarPhotoLibModule as ɵbw, AvatarPhotoLibComponent as ɵbx,
|
|
15463
|
+
export { AnnouncementsModule, CalenderModule, CardsModule, CommonMethodsService, CommonStripModule, CompetencyPassbookMdoModule, CompetencyPassbookModule, ConsumptionComponent, ConsumptionModule, ConsumptionService, ContentProgressModule, ContentStripWithTabsLibModule, ContentStripWithTabsPillsModule, DataPointsModule, HttpLoaderFactory, HttpLoaderFactory1, MyHammerConfig, ROOT_WIDGET_CONFIG, SlidersLibModule, UserContentRatingLibModule, WIDGET_REGISTERED_LIB_MODULES, WIDGET_REGISTRATION_LIB_CONFIG, WidgetContentService, ContentStripWithTabsLibComponent as ɵa, WidgetUserService as ɵb, CardWideV2Component as ɵba, CardKarmaProgramsComponent as ɵbb, CardKarmaProgramsV2Component as ɵbc, ProviderCardComponent as ɵbd, CardPortraitExtComponent as ɵbe, CardAssessmentComponent as ɵbf, CardProgressPortraitLibComponent as ɵbg, CertificateService as ɵbh, CardMdoChannelV1Component as ɵbi, PipePublicURLModule as ɵbj, PipePublicURL as ɵbk, ObjectToArrayPipeModule as ɵbl, ObjectToArrayPipe as ɵbm, DisplayContentTypeLibModule as ɵbn, DisplayContentTypeLibComponent as ɵbo, DefaultThumbnailModule as ɵbp, DefaultThumbnailDirective as ɵbq, PipeDurationTransformModule as ɵbr, PipeDurationTransformPipe as ɵbs, ContentProgressComponent as ɵbt, DialogComponentsModule as ɵbu, CertificateDialogComponent as ɵbv, AvatarPhotoLibModule as ɵbw, AvatarPhotoLibComponent as ɵbx, ContentStripWithTabsPillsComponent as ɵby, CompetencyPassbookComponent as ɵbz, MultilingualTranslationsService as ɵc, CompetencyPassbookService as ɵca, PillsModule as ɵcb, PillsComponent as ɵcc, CompetencyPassbookMdoComponent as ɵcd, CompetencyPassbookMdoService as ɵce, UserContentRatingLibComponent as ɵcf, ScrollableItemDirective as ɵcg, RatingService as ɵch, UserContentRatingLibService as ɵci, MyHammerConfig$1 as ɵcj, SlidersNgContentLibModule as ɵck, SlidersNgContentLibComponent as ɵcl, ScrollableItemModule as ɵcm, 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, CardResourceComponent as ɵt, CardsComponent as ɵu, CardPortraitComponent as ɵv, CardUserComponent as ɵw, CardLandscapeComponent as ɵx, CardWideComponent as ɵy, CardMDOChannelComponent as ɵz };
|
|
12616
15464
|
//# sourceMappingURL=sunbird-cb-consumption.js.map
|