This commit is contained in:
George Kalampokis 2020-10-01 16:08:59 +03:00
commit 8ea356bcdc
2 changed files with 23 additions and 0 deletions

View File

@ -7,6 +7,7 @@
<div class="card-content info-text mb-0">
<p>{{'DMP-LISTING.TEXT-INFO' | translate}}</p>
<p class="mt-4 pt-2">{{'DMP-LISTING.TEXT-INFO-QUESTION' | translate}} <a class="zenodo-link" href="https://zenodo.org/communities/liber-dmp-cat/?page=1&size=20" target="_blank">{{'DMP-LISTING.LINK-ZENODO' | translate}}</a> {{'DMP-LISTING.GET-IDEA' | translate}}</p>
<div *ngIf="!isPublic" class="center-content" (click)="restartTour()">{{ 'GENERAL.ACTIONS.TAKE-A-TOUR'| translate }}</div>
</div>
</div>
<p *ngIf="listingItems && listingItems.length > 0" class="col-auto header-title">{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}</p>

View File

@ -214,6 +214,25 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
this.scrollbar = this.hasScrollbar();
}
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.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);
});
// }
}
public refresh(resetPages = false) {
// if (this._paginator.pageSize === undefined) this._paginator.pageSize = 10;
// if (resetPages) this._paginator.pageIndex = 0;
@ -241,6 +260,9 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
});
this.listingItems = result.data;
this.hasListingItems = true;
if(!this.isPublic && this.listingItems.length === 0) {
this.openTour();
}
this.totalCount = result.totalCount;
});
}