From 3815dc4e17910a9dd586a8ed5bc1e9f2e8644b83 Mon Sep 17 00:00:00 2001 From: vishnubansaltarento Date: Sun, 11 Aug 2024 13:24:22 +0530 Subject: [PATCH] update for public preview changes --- .../app-toc-content-card-v2.component.ts | 7 +++++-- .../app-toc-home/app-toc-home.component.html | 2 +- .../viewer-secondary-top-bar.component.ts | 7 ++++++- .../viewer-top-bar/viewer-top-bar.component.html | 12 ++++++------ .../viewer-top-bar/viewer-top-bar.component.ts | 2 +- .../viewer/src/lib/plugins/html/html.component.ts | 15 ++++++++++----- project/ws/viewer/src/lib/viewer.component.html | 12 ++++-------- project/ws/viewer/src/lib/viewer.component.scss | 4 +++- 8 files changed, 36 insertions(+), 25 deletions(-) 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') }}
-
+ 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..458cd078ea 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}}
-