Fixes bug: tour opened on empty filters result
This commit is contained in:
parent
1b13b5f0bf
commit
c4b3070edb
|
@ -215,22 +215,19 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
||||||
}
|
}
|
||||||
|
|
||||||
openTour() {
|
openTour() {
|
||||||
console.log(!this.isPublic && !this.hasListingItems)
|
this.language.get('DMP-LISTING.TEXT-INFO').pipe(takeUntil(this._destroyed)).subscribe((x: string) => {
|
||||||
// if (!this.isPublic && !this.hasListingItems) {
|
this.dashboardTour.steps[0].title = x + '\n\n' +
|
||||||
this.language.get('DMP-LISTING.TEXT-INFO').pipe(takeUntil(this._destroyed)).subscribe((x: string) => {
|
this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' +
|
||||||
this.dashboardTour.steps[0].title = x + '\n\n' +
|
this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' +
|
||||||
this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' +
|
this.language.instant('DMP-LISTING.GET-IDEA');
|
||||||
this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' +
|
|
||||||
this.language.instant('DMP-LISTING.GET-IDEA');
|
|
||||||
|
|
||||||
this.dashboardTour.steps[1].title = this.language.instant('DATASET-LISTING.TEXT-INFO') +
|
this.dashboardTour.steps[1].title = this.language.instant('DATASET-LISTING.TEXT-INFO') +
|
||||||
this.language.instant('DATASET-LISTING.LINK-PUBLIC-DATASETS') + ' ' +
|
this.language.instant('DATASET-LISTING.LINK-PUBLIC-DATASETS') + ' ' +
|
||||||
this.language.instant('DATASET-LISTING.TEXT-INFO-REST') + '\n\n' +
|
this.language.instant('DATASET-LISTING.TEXT-INFO-REST') + '\n\n' +
|
||||||
this.language.instant('DATASET-LISTING.TEXT-INFO-PAR');
|
this.language.instant('DATASET-LISTING.TEXT-INFO-PAR');
|
||||||
|
|
||||||
this.guidedTourService.startTour(this.dashboardTour);
|
this.guidedTourService.startTour(this.dashboardTour);
|
||||||
});
|
});
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public refresh(resetPages = false) {
|
public refresh(resetPages = false) {
|
||||||
|
@ -260,7 +257,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
||||||
});
|
});
|
||||||
this.listingItems = result.data;
|
this.listingItems = result.data;
|
||||||
this.hasListingItems = true;
|
this.hasListingItems = true;
|
||||||
if(!this.isPublic && this.listingItems.length === 0) {
|
if (!this.isPublic && this.listingItems.length === 0 && !this.hasCriteria()) {
|
||||||
this.openTour();
|
this.openTour();
|
||||||
}
|
}
|
||||||
this.totalCount = result.totalCount;
|
this.totalCount = result.totalCount;
|
||||||
|
@ -295,6 +292,15 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasCriteria(): boolean {
|
||||||
|
if (this.criteria.organisations && this.criteria.organisations.length > 0 ||
|
||||||
|
this.criteria.grants && this.criteria.grants.length > 0 ||
|
||||||
|
this.criteria.collaborators && this.criteria.collaborators.length > 0 ||
|
||||||
|
this.criteria.datasetTemplates && this.criteria.datasetTemplates.length > 0 ||
|
||||||
|
this.criteria.onlyPublic === true
|
||||||
|
) { return true; } else { return false; }
|
||||||
|
}
|
||||||
|
|
||||||
controlModified(): void {
|
controlModified(): void {
|
||||||
// this.clearErrorModel();
|
// this.clearErrorModel();
|
||||||
// if (this.refreshCallback != null &&
|
// if (this.refreshCallback != null &&
|
||||||
|
|
Loading…
Reference in New Issue