diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index 3dd4c3f93..0c7123d8c 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -215,22 +215,19 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread } openTour() { - console.log(!this.isPublic && !this.hasListingItems) - // if (!this.isPublic && !this.hasListingItems) { - this.language.get('DMP-LISTING.TEXT-INFO').pipe(takeUntil(this._destroyed)).subscribe((x: string) => { - this.dashboardTour.steps[0].title = x + '\n\n' + - this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' + - this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' + - this.language.instant('DMP-LISTING.GET-IDEA'); + this.language.get('DMP-LISTING.TEXT-INFO').pipe(takeUntil(this._destroyed)).subscribe((x: string) => { + this.dashboardTour.steps[0].title = x + '\n\n' + + this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' + + 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.language.instant('DATASET-LISTING.LINK-PUBLIC-DATASETS') + ' ' + - this.language.instant('DATASET-LISTING.TEXT-INFO-REST') + '\n\n' + - this.language.instant('DATASET-LISTING.TEXT-INFO-PAR'); + 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.TEXT-INFO-REST') + '\n\n' + + this.language.instant('DATASET-LISTING.TEXT-INFO-PAR'); - this.guidedTourService.startTour(this.dashboardTour); - }); - // } + this.guidedTourService.startTour(this.dashboardTour); + }); } public refresh(resetPages = false) { @@ -260,7 +257,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread }); this.listingItems = result.data; this.hasListingItems = true; - if(!this.isPublic && this.listingItems.length === 0) { + if (!this.isPublic && this.listingItems.length === 0 && !this.hasCriteria()) { this.openTour(); } this.totalCount = result.totalCount; @@ -295,6 +292,15 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread 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 { // this.clearErrorModel(); // if (this.refreshCallback != null &&