From 0d40bf82619516e6356be43107c80146b7455d18 Mon Sep 17 00:00:00 2001 From: Amit Sengar Date: Wed, 23 Mar 2022 23:33:55 +0530 Subject: [PATCH 1/3] quiz related UI updated #6: small --- .../components/result/result.component.html | 2 +- .../components/result/result.component.scss | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html b/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html index fc3e30722..891bc84c8 100755 --- a/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html +++ b/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html @@ -20,7 +20,7 @@ {{'Insights'}} - + Date: Thu, 24 Mar 2022 10:41:35 +0530 Subject: [PATCH 2/3] Task #57719: continue learning section in lean home page --- .../content-strip-multiple.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts index 9f6651c2c..1abfaa7a0 100644 --- a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts @@ -418,9 +418,9 @@ export class ContentStripMultipleComponent extends WidgetBaseComponent // continue learing strip if (content && content.length) { contentNew = content.filter((c: any) => { - if (c.completionPercentage && c.completionPercentage > 0) { + // if (c.completionPercentage && c.completionPercentage > 0) { return c - } + // } }) } this.processStrip( From e46a789b5a570017b627bfec26e8ec402c75b8b3 Mon Sep 17 00:00:00 2001 From: Amit Sengar Date: Thu, 24 Mar 2022 13:00:05 +0530 Subject: [PATCH 3/3] quiz related UI updated #7:routing related --- .../app-toc-banner.component.ts | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts index 37f700e35..77ae7f786 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts @@ -10,7 +10,7 @@ import { viewerRouteGenerator, WidgetContentService, } from '@sunbird-cb/collection' -import { TFetchStatus, UtilityService, ConfigurationsService } from '@sunbird-cb/utils' +import { TFetchStatus, UtilityService, ConfigurationsService, LoggerService } from '@sunbird-cb/utils' import { AccessControlService } from '@ws/author' import { Subscription } from 'rxjs' import { NsAnalytics } from '../../models/app-toc-analytics.model' @@ -88,6 +88,7 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { public configSvc: ConfigurationsService, private tagSvc: TitleTagService, private actionSVC: ActionService, + private logger: LoggerService, ) { } @@ -211,6 +212,9 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { } if (this.resumeData && this.content) { const resumeDataV2 = this.getResumeDataFromList() + if (!resumeDataV2.mimeType) { + resumeDataV2.mimeType = this.getMimeType(this.content, resumeDataV2.identifier) + } this.resumeDataLink = viewerRouteGenerator( resumeDataV2.identifier, resumeDataV2.mimeType, @@ -261,6 +265,26 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { } }) } + getMimeType(content: NsContent.IContent, identifier: string): NsContent.EMimeTypes { + if (content.identifier === identifier) { + return content.mimeType + } else if (content.children.length === 0) { + if (content.children[0].identifier === identifier) { + return content.mimeType + } else { + // big blunder in data + this.logger.log(content.identifier, 'Wrong mimetypes for resume') + return content.mimeType + } + } else { + for (let i = 0; i < content.children.length; i++) { + if (content.children[i].identifier === identifier) { + return this.getMimeType(content.children[i], identifier) + } + } + } + return content.mimeType + } private getBatchId(): string { let batchId = ''