diff --git a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts index f7e50e4d11..3cd099a184 100644 --- a/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts +++ b/library/ws-widget/collection/src/lib/_common/content-toc/app-toc-content-card-v2/app-toc-content-card-v2.component.ts @@ -374,11 +374,14 @@ export class AppTocContentCardV2Component implements OnInit { if(localContentData.primaryCategory === NsContent.EPrimaryCategory.MODULE) { this.hierarchyMapData[identifier]['duration'] = this.hierarchyMapData[identifier].leafNodes.reduce( (sum: any, childID: any) => { - return sum + Number(this.hierarchyMapData[childID].duration || this.hierarchyMapData[childID].expectedDuration || 0) + if(this.hierarchyMapData && this.hierarchyMapData[childID]) { + return sum + Number(this.hierarchyMapData[childID].duration || this.hierarchyMapData[childID].expectedDuration || 0) + } + }, 0) } // tslint:disable - const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100) + const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => (this.hierarchyMapData[r] && (this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100))) const totalCount = _.toInteger(_.get(this.hierarchyMapData[identifier], 'leafNodesCount')) || 1 this.hierarchyMapData[identifier]['completionPercentage'] = Number(((completedItems.length / totalCount) * 100).toFixed()) this.hierarchyMapData[identifier]['completionStatus'] = (this.hierarchyMapData[identifier].completionPercentage >= 100) ? 2 : 1 diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html index 13cbd36f84..7210b4f17a 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.html @@ -439,7 +439,7 @@
{{ translateLabel(content?.primaryCategory, 'searchfilters') }}
-
+
share
{{ 'apptocsinglepage.share' | translate }}
diff --git a/project/ws/viewer/src/lib/components/viewer-secondary-top-bar/viewer-secondary-top-bar.component.ts b/project/ws/viewer/src/lib/components/viewer-secondary-top-bar/viewer-secondary-top-bar.component.ts index fcf139c90b..98d00b50c0 100644 --- a/project/ws/viewer/src/lib/components/viewer-secondary-top-bar/viewer-secondary-top-bar.component.ts +++ b/project/ws/viewer/src/lib/components/viewer-secondary-top-bar/viewer-secondary-top-bar.component.ts @@ -352,7 +352,12 @@ export class ViewerSecondaryTopBarComponent implements OnInit, OnDestroy { }) } } else { - this.router.navigateByUrl(`public/toc/${this.collectionId}/overview`) + if (window.location.href.includes('editMode=true')) { + this.router.navigateByUrl(`public/toc/${this.collectionId}/overview?editMode=true`) + } else { + this.router.navigateByUrl(`public/toc/${this.collectionId}/overview`) + } + } } diff --git a/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.html b/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.html index e3e2876d89..31a629ea45 100755 --- a/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.html +++ b/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.html @@ -75,9 +75,9 @@
- star - + {{'apptocsinglepage.rateNow' | translate}} - + {{'apptocsinglepage.editRating' | translate}}
-
share {{'apptocsinglepage.share' | translate}} @@ -152,7 +152,7 @@
star - + {{'apptocsinglepage.rateNow' | translate}} - + {{'apptocsinglepage.editRating' | translate}}
diff --git a/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.ts b/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.ts index a68e27dadf..9eed613420 100755 --- a/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.ts +++ b/project/ws/viewer/src/lib/components/viewer-top-bar/viewer-top-bar.component.ts @@ -247,7 +247,7 @@ export class ViewerTopBarComponent implements OnInit, OnDestroy, OnChanges { ComputeCompletedNodesAndPercent(identifier: string) { if(this.hierarchyMapData && this.hierarchyMapData[identifier]) { // tslint:disable - const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100) + const completedItems = _.filter(this.hierarchyMapData[identifier].leafNodes, r => (this.hierarchyMapData[r] && (this.hierarchyMapData[r].completionStatus === 2 || this.hierarchyMapData[r].completionPercentage === 100))) this.completedCount = completedItems.length this.completedCountOutput.emit(this.completedCount) this.overallLeafNodes = _.toInteger(_.get(this.hierarchyMapData[identifier], 'leafNodesCount')) || 1 diff --git a/project/ws/viewer/src/lib/plugins/html/html.component.ts b/project/ws/viewer/src/lib/plugins/html/html.component.ts index 213540ef01..e086f1005e 100755 --- a/project/ws/viewer/src/lib/plugins/html/html.component.ts +++ b/project/ws/viewer/src/lib/plugins/html/html.component.ts @@ -133,7 +133,9 @@ export class HtmlComponent implements OnInit, OnChanges, OnDestroy { // this.fireRealTimeProgress(this.htmlContent) // // this.store.clearAll() // } - this.sub.unsubscribe() + if (this.sub) { + this.sub.unsubscribe() + } } private fireRealTimeProgress(htmlContent: any) { @@ -250,7 +252,10 @@ export class HtmlComponent implements OnInit, OnChanges, OnDestroy { // } // call fireRealTimeProgress func for LMS data and non-LMS data also this.fireRealTimeProgress(this.oldData) - this.sub.unsubscribe() + if (this.sub) { + this.sub.unsubscribe() + } + this.ticks = 0 this.timer = timer(1000, 1000) // subscribing to a observable returns a subscription object @@ -358,7 +363,7 @@ export class HtmlComponent implements OnInit, OnChanges, OnDestroy { // `${this.htmlContent.streamingUrl}/${this.htmlContent.initFile}?timestamp='${new Date().getTime()}`) this.iframeUrl = this.domSanitizer.bypassSecurityTrustResourceUrl( // tslint:disable-next-line:max-line-length - `${this.generateUrl(this.htmlContent.streamingUrl)}/${this.htmlContent.initFile}?timestamp='${new Date().getTime()}` + `${this.generateUrl(this.htmlContent.streamingUrl)}?timestamp='${new Date().getTime()}` ) } } else { @@ -536,7 +541,7 @@ export class HtmlComponent implements OnInit, OnChanges, OnDestroy { newLink.push(chunk[i]) } } - const newUrl = newLink.join('/') - return newUrl + // const newUrl = newLink.join('/') + return oldUrl } } diff --git a/project/ws/viewer/src/lib/viewer.component.html b/project/ws/viewer/src/lib/viewer.component.html index 0da90d225e..93d7bc34dd 100755 --- a/project/ws/viewer/src/lib/viewer.component.html +++ b/project/ws/viewer/src/lib/viewer.component.html @@ -79,12 +79,13 @@
-