Skip to content

Commit

Permalink
Issue #SB-19243 merge: Merge pull request #1097 from raghav14/release…
Browse files Browse the repository at this point in the history
…-3.0.1

Issue #SB-19243 fix: no data check
  • Loading branch information
swayangjit authored Jul 15, 2020
2 parents bc845eb + 25b0470 commit 9456861
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
<div style="margin-top: 2rem; margin-bottom: 4rem">
<p>{{'THANKING_NOTE' | translate: {'%s': appName} }}</p>
</div>
<p style="margin-top: 2rem; color: #333333">{{'EXPLORE_HEADING' | translate: {'%s': appName} }}</p>
<div class="sb-textbook-container">
<sb-library-cards-stack [contentList]="storyAndWorksheets"
[isOffline]="!commonUtilService.networkInfo.isNetworkAvailable" [maxCardCount]="3"
[viewMoreButtonText]="'SEE_MORE_CONTENT' | translate"
(viewMoreClick)="navigateToTextbookPage(storyAndWorksheets)" (cardClick)="navigateToTextBookDetailPage($event)">
</sb-library-cards-stack>
<div *ngIf="storyAndWorksheets && storyAndWorksheets.length">
<p style="margin-top: 2rem; color: #333333">{{'EXPLORE_HEADING' | translate: {'%s': appName} }}</p>
<div class="sb-textbook-container">
<sb-library-cards-stack [contentList]="storyAndWorksheets"
[isOffline]="!commonUtilService.networkInfo.isNetworkAvailable" [maxCardCount]="5"
[viewMoreButtonText]="'SEE_MORE_CONTENT' | translate"
(viewMoreClick)="navigateToTextbookPage(storyAndWorksheets)"
(cardClick)="navigateToTextBookDetailPage($event)">
</sb-library-cards-stack>
</div>
</div>
</ion-content>
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,23 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
.then((result: ContentSearchResult) => {
this.ngZone.run(() => {
this.storyAndWorksheets = result.contentDataList;
for (let i = 0; i < this.storyAndWorksheets.length; i++) {
// check if locally available
const content = this.storyAndWorksheets[i];
if (content.appIcon) {
if (content.appIcon.includes('http:') || content.appIcon.includes('https:')) {
if (this.commonUtilService.networkInfo.isNetworkAvailable) {
content.cardImg = content.appIcon;
} else {
this.imageSrcMap.set(content.identifier, content.appIcon);
content.appIcon = this.defaultImg;
if (this.storyAndWorksheets.length) {
for (let i = 0; i < this.storyAndWorksheets.length; i++) {
// check if locally available
const content = this.storyAndWorksheets[i];
if (content.appIcon) {
if (content.appIcon.includes('http:') || content.appIcon.includes('https:')) {
if (this.commonUtilService.networkInfo.isNetworkAvailable) {
content.cardImg = content.appIcon;
} else {
this.imageSrcMap.set(content.identifier, content.appIcon);
content.appIcon = this.defaultImg;
}
} else if (content.basePath) {
content.appIcon = content.basePath + '/' + content.appIcon;
}
} else if (content.basePath) {
content.appIcon = content.basePath + '/' + content.appIcon;
}
}
}
}
});
});
Expand Down Expand Up @@ -132,7 +134,7 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
this.telemetryGeneratorService.generateInteractTelemetry(InteractType.TOUCH,
InteractSubtype.CONTENT_CLICKED,
Environment.HOME,
PageId.LIBRARY,
PageId.EXPLORE_MORE_CONTENT,
telemetryObject,
values,
ContentUtil.generateRollUp(undefined, identifier),
Expand All @@ -151,7 +153,7 @@ export class ExploreBooksSortComponent implements OnInit, OnDestroy {
this.telemetryGeneratorService.generateInteractTelemetry(InteractType.TOUCH,
InteractSubtype.VIEW_MORE_CLICKED,
Environment.HOME,
PageId.LIBRARY,
PageId.EXPLORE_MORE_CONTENT,
telemetryObject);
if (this.commonUtilService.networkInfo.isNetworkAvailable || items.isAvailableLocally) {
this.modalCtrl.dismiss(null);
Expand Down

0 comments on commit 9456861

Please sign in to comment.