2019-09-23 10:17:03 +02:00
|
|
|
|
2023-10-06 10:10:53 +02:00
|
|
|
import { HttpClient } from '@angular/common/http';
|
2018-11-27 18:33:17 +01:00
|
|
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
2023-12-01 18:18:41 +01:00
|
|
|
import { UntypedFormBuilder, UntypedFormControl } from '@angular/forms';
|
2023-10-06 10:10:53 +02:00
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
2019-09-23 10:17:03 +02:00
|
|
|
import { MatSort } from '@angular/material/sort';
|
2018-11-27 18:33:17 +01:00
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
2023-10-06 10:10:53 +02:00
|
|
|
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
|
|
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
2023-10-06 10:10:53 +02:00
|
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
2023-12-01 18:18:41 +01:00
|
|
|
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
2023-10-06 10:10:53 +02:00
|
|
|
import { GuidedTour, Orientation } from '@app/library/guided-tour/guided-tour.constants';
|
|
|
|
import { GuidedTourService } from '@app/library/guided-tour/guided-tour.service';
|
2023-10-20 17:01:09 +02:00
|
|
|
// import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
|
|
|
|
// import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
|
2023-12-01 18:18:41 +01:00
|
|
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
2023-12-05 21:36:00 +01:00
|
|
|
import { Description } from '@app/core/model/description/description';
|
2024-03-01 17:50:46 +01:00
|
|
|
import { DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
|
2023-12-01 18:18:41 +01:00
|
|
|
import { Dmp, DmpUser } from '@app/core/model/dmp/dmp';
|
|
|
|
import { DmpLookup } from '@app/core/query/dmp.lookup';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { BaseComponent } from '@common/base/base.component';
|
2023-12-01 18:18:41 +01:00
|
|
|
import { Guid } from '@common/types/guid';
|
2019-05-23 11:40:24 +02:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2023-10-06 10:10:53 +02:00
|
|
|
import { NgDialogAnimationService } from "ng-dialog-animation";
|
2020-10-30 16:51:07 +01:00
|
|
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
2023-11-29 14:26:40 +01:00
|
|
|
import { nameof } from 'ts-simple-nameof';
|
2024-03-05 16:37:01 +01:00
|
|
|
import { DmpVersionStatus } from '@app/core/common/enum/dmp-version-status';
|
|
|
|
import { DmpReference } from '@app/core/model/dmp/dmp-reference';
|
|
|
|
import { Reference } from '@app/core/model/reference/reference';
|
|
|
|
import { ReferenceType } from '@app/core/model/reference-type/reference-type';
|
2024-03-14 10:41:32 +01:00
|
|
|
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
2024-03-15 08:39:36 +01:00
|
|
|
import { DmpStatus } from '@app/core/common/enum/dmp-status';
|
|
|
|
import { DescriptionStatus } from '@app/core/common/enum/description-status';
|
2017-12-14 18:13:28 +01:00
|
|
|
|
|
|
|
@Component({
|
2018-10-05 17:00:54 +02:00
|
|
|
selector: 'app-dmp-listing-component',
|
|
|
|
templateUrl: 'dmp-listing.component.html',
|
|
|
|
styleUrls: ['./dmp-listing.component.scss'],
|
2017-12-14 18:13:28 +01:00
|
|
|
})
|
2023-10-20 17:01:09 +02:00
|
|
|
export class DmpListingComponent extends BaseComponent implements OnInit { //IBreadCrumbComponent
|
2017-12-14 18:13:28 +01:00
|
|
|
|
2019-09-23 10:17:03 +02:00
|
|
|
@ViewChild(MatPaginator, { static: true }) _paginator: MatPaginator;
|
2021-09-24 20:52:14 +02:00
|
|
|
@ViewChild(MatSort) sort: MatSort;
|
2023-12-01 18:18:41 +01:00
|
|
|
lookup: DmpLookup = new DmpLookup();
|
|
|
|
groupId: string;
|
2019-04-25 16:04:54 +02:00
|
|
|
totalCount: number;
|
2024-03-11 08:47:03 +01:00
|
|
|
listingItems: any[] = [];
|
2020-04-01 17:16:06 +02:00
|
|
|
isPublic: boolean = false;
|
2020-09-14 13:28:26 +02:00
|
|
|
hasListingItems = null;
|
2020-07-03 16:17:23 +02:00
|
|
|
pageSize: number = 5;
|
2023-10-05 15:39:17 +02:00
|
|
|
public formGroup = new UntypedFormBuilder().group({
|
|
|
|
like: new UntypedFormControl(),
|
|
|
|
order: new UntypedFormControl()
|
2020-07-08 16:54:41 +02:00
|
|
|
});
|
2020-07-07 12:12:57 +02:00
|
|
|
|
2020-07-09 09:53:17 +02:00
|
|
|
scrollbar: boolean;
|
2020-07-13 12:01:03 +02:00
|
|
|
order = RecentActivityOrder;
|
2020-07-09 09:53:17 +02:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
constructor(
|
2019-01-18 18:03:45 +01:00
|
|
|
private dmpService: DmpService,
|
2018-10-05 17:00:54 +02:00
|
|
|
private router: Router,
|
|
|
|
private route: ActivatedRoute,
|
2020-09-11 10:27:29 +02:00
|
|
|
public dialogAnimation: NgDialogAnimationService,
|
2020-07-07 12:12:57 +02:00
|
|
|
public dialog: MatDialog,
|
2019-05-23 11:40:24 +02:00
|
|
|
public enumUtils: EnumUtils,
|
|
|
|
private language: TranslateService,
|
2020-04-01 17:16:06 +02:00
|
|
|
private uiNotificationService: UiNotificationService,
|
2020-07-30 17:29:20 +02:00
|
|
|
private authService: AuthService,
|
2020-12-14 18:28:13 +01:00
|
|
|
private guidedTourService: GuidedTourService,
|
|
|
|
private httpClient: HttpClient,
|
|
|
|
private matomoService: MatomoService
|
2018-10-05 17:00:54 +02:00
|
|
|
) {
|
2018-11-27 18:33:17 +01:00
|
|
|
super();
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
2020-12-14 18:28:13 +01:00
|
|
|
this.matomoService.trackPageView('DMPs');
|
2020-04-01 17:16:06 +02:00
|
|
|
this.isPublic = this.router.url.startsWith('/explore-plans');
|
2020-08-03 10:40:38 +02:00
|
|
|
if (this.isPublic) {
|
2023-12-29 16:04:16 +01:00
|
|
|
//TODO refactor
|
|
|
|
// this.formGroup.get('order').setValue(this.order.PUBLISHED);
|
2020-08-03 10:40:38 +02:00
|
|
|
} else {
|
2024-03-06 17:41:26 +01:00
|
|
|
this.formGroup.get('order').setValue(this.order.UpdatedAt);
|
2020-08-03 10:40:38 +02:00
|
|
|
}
|
2023-10-11 16:53:12 +02:00
|
|
|
if (!this.isPublic && !this.authService.currentAccountIsAuthenticated()) {
|
2020-04-01 17:16:06 +02:00
|
|
|
this.router.navigateByUrl("/explore-plans");
|
|
|
|
}
|
2018-11-27 18:33:17 +01:00
|
|
|
this.route.params
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(async params => {
|
2018-10-05 17:00:54 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
this.groupId = params['groupId'];
|
|
|
|
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: 0 };
|
|
|
|
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
|
|
|
this.lookup.metadata = { countAll: true };
|
|
|
|
this.lookup.isActive = [IsActive.Active];
|
|
|
|
|
|
|
|
if (this.groupId != null && Guid.isGuid(this.groupId)) {
|
2023-12-06 22:10:01 +01:00
|
|
|
this.lookup.groupIds = [Guid.parse(this.groupId)];
|
2024-03-05 16:37:01 +01:00
|
|
|
this.lookup.versionStatuses = null;
|
2024-03-06 13:39:10 +01:00
|
|
|
} else {
|
|
|
|
this.lookup.versionStatuses = [DmpVersionStatus.Current];
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
2019-05-22 11:52:53 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
this.refresh(this.lookup);
|
2018-11-27 18:33:17 +01:00
|
|
|
});
|
2020-07-07 14:54:12 +02:00
|
|
|
|
|
|
|
this.formGroup.get('like').valueChanges
|
2020-10-30 16:51:07 +01:00
|
|
|
.pipe(takeUntil(this._destroyed), debounceTime(500))
|
2020-07-07 14:54:12 +02:00
|
|
|
.subscribe(x => this.controlModified());
|
2020-07-13 12:01:03 +02:00
|
|
|
this.formGroup.get('order').valueChanges
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
2023-12-01 18:18:41 +01:00
|
|
|
.subscribe(x => this.refresh(this.lookup));
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
|
2020-07-30 17:29:20 +02:00
|
|
|
public dashboardTour: GuidedTour = {
|
|
|
|
tourId: 'dmp-dataset-tour',
|
|
|
|
useOrb: true,
|
|
|
|
steps: [
|
2020-08-03 10:40:38 +02:00
|
|
|
{
|
2020-07-30 17:29:20 +02:00
|
|
|
selector: '.dmp-tour',
|
|
|
|
content: 'Step 1',
|
2020-08-04 17:27:13 +02:00
|
|
|
orientation: Orientation.Right,
|
|
|
|
isStepUnique: false
|
2020-07-30 17:29:20 +02:00
|
|
|
},
|
2020-08-03 10:40:38 +02:00
|
|
|
{
|
2020-07-30 17:29:20 +02:00
|
|
|
selector: '.dataset-tour',
|
|
|
|
content: 'Step 2',
|
2020-08-04 17:27:13 +02:00
|
|
|
orientation: Orientation.Right,
|
|
|
|
isStepUnique: false
|
2020-07-30 17:29:20 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
2020-08-03 10:40:38 +02:00
|
|
|
|
2020-07-30 17:29:20 +02:00
|
|
|
public isAuthenticated(): boolean {
|
2023-10-11 16:53:12 +02:00
|
|
|
return this.authService.currentAccountIsAuthenticated();
|
2020-07-30 17:29:20 +02:00
|
|
|
}
|
2020-07-31 16:39:57 +02:00
|
|
|
|
2020-07-09 09:53:17 +02:00
|
|
|
ngAfterContentChecked(): void {
|
|
|
|
this.scrollbar = this.hasScrollbar();
|
|
|
|
}
|
|
|
|
|
2020-10-01 15:05:38 +02:00
|
|
|
openTour() {
|
2020-10-02 17:25:53 +02:00
|
|
|
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);
|
|
|
|
});
|
2020-10-01 15:05:38 +02:00
|
|
|
}
|
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
loadMore() {
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: this.lookup.page.offset + this.pageSize };
|
|
|
|
this.refresh(this.lookup);
|
|
|
|
}
|
2020-07-07 12:12:57 +02:00
|
|
|
|
2024-03-06 17:41:26 +01:00
|
|
|
orderByChanged(){
|
|
|
|
if (this.formGroup.get('order').value == RecentActivityOrder.Status){
|
|
|
|
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.status)] };
|
|
|
|
} else if(this.formGroup.get('order').value == RecentActivityOrder.Label){
|
|
|
|
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.label)] };
|
|
|
|
}else{
|
|
|
|
this.lookup.order = { items: ['-' + nameof<Dmp>(x => x.updatedAt)] };
|
|
|
|
}
|
|
|
|
this.refresh(this.lookup);
|
|
|
|
}
|
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
private refresh(lookup: DmpLookup) {
|
2023-11-29 14:26:40 +01:00
|
|
|
lookup.project = {
|
|
|
|
fields: [
|
|
|
|
nameof<Dmp>(x => x.id),
|
|
|
|
nameof<Dmp>(x => x.label),
|
2023-12-29 16:04:16 +01:00
|
|
|
nameof<Dmp>(x => x.description),
|
2023-12-01 18:18:41 +01:00
|
|
|
nameof<Dmp>(x => x.status),
|
|
|
|
nameof<Dmp>(x => x.accessType),
|
|
|
|
nameof<Dmp>(x => x.version),
|
|
|
|
nameof<Dmp>(x => x.groupId),
|
|
|
|
nameof<Dmp>(x => x.updatedAt),
|
2024-03-04 11:42:14 +01:00
|
|
|
nameof<Dmp>(x => x.hash),
|
2024-03-14 10:41:32 +01:00
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.CreateNewVersionDmp].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.DeleteDmp].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.CloneDmp].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.FinalizeDmp].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.ExportDmp].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.InviteDmpUsers].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.AssignDmpUsers].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.authorizationFlags), AppPermission.EditDmp].join('.'),
|
2024-03-04 11:42:14 +01:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
[nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.label)].join('.'),
|
2024-03-15 08:39:36 +01:00
|
|
|
[nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.status)].join('.'),
|
2024-03-11 08:47:03 +01:00
|
|
|
[nameof<Dmp>(x => x.descriptions), nameof<Description>(x => x.isActive)].join('.'),
|
2023-12-29 16:04:16 +01:00
|
|
|
|
|
|
|
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.label)].join('.'),
|
2024-03-01 17:50:46 +01:00
|
|
|
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.blueprint), nameof<DmpBlueprint>(x => x.definition), nameof<DmpBlueprintDefinition>(x => x.sections), nameof<DmpBlueprintDefinitionSection>(x => x.label)].join('.'),
|
2023-12-29 16:04:16 +01:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// [nameof<Description>(x => x.descriptionTemplate), nameof<DescriptionTemplate>(x => x.label)].join('.'),
|
|
|
|
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.id)].join('.'),
|
|
|
|
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.label)].join('.'),
|
|
|
|
// [nameof<Description>(x => x.dmp), nameof<Dmp>(x => x.accessType)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.user.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.role)].join('.'),
|
2024-03-11 08:47:03 +01:00
|
|
|
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.dmp.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpUsers), nameof<DmpUser>(x => x.isActive)].join('.'),
|
|
|
|
|
2024-03-05 16:37:01 +01:00
|
|
|
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.id)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.label)].join('.'),
|
|
|
|
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.type), nameof<ReferenceType>(x => x.id)].join('.'),
|
2024-03-11 14:20:09 +01:00
|
|
|
[nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.isActive)].join('.'),
|
2024-03-05 16:37:01 +01:00
|
|
|
// [nameof<Dmp>(x => x.dmpReferences), nameof<DmpReference>(x => x.reference), nameof<Reference>(x => x.reference)].join('.'),
|
2023-11-29 14:26:40 +01:00
|
|
|
]
|
|
|
|
};
|
2024-03-11 08:47:03 +01:00
|
|
|
|
|
|
|
if(this.isPublic){
|
|
|
|
this.dmpService.publicQuery(lookup).pipe(takeUntil(this._destroyed))
|
2023-12-01 18:18:41 +01:00
|
|
|
.subscribe(result => {
|
|
|
|
if (!result) { return []; }
|
|
|
|
this.totalCount = result.count;
|
|
|
|
if (lookup?.page?.offset === 0) this.listingItems = [];
|
|
|
|
this.listingItems.push(...result.items);
|
|
|
|
this.hasListingItems = true;
|
|
|
|
});
|
2024-03-11 08:47:03 +01:00
|
|
|
}else{
|
|
|
|
this.dmpService.query(lookup).pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(result => {
|
|
|
|
if (!result) { return []; }
|
|
|
|
this.totalCount = result.count;
|
|
|
|
if (lookup?.page?.offset === 0) this.listingItems = [];
|
|
|
|
result.items.forEach(x=> {
|
2024-03-15 08:39:36 +01:00
|
|
|
if (x.descriptions) {
|
|
|
|
if (x.status == DmpStatus.Finalized) {
|
|
|
|
x.descriptions = x.descriptions.filter(x => x.isActive === IsActive.Active && x.status === DescriptionStatus.Finalized);
|
|
|
|
} else {
|
|
|
|
x.descriptions = x.descriptions.filter(x => x.isActive === IsActive.Active && x.status !== DescriptionStatus.Canceled);
|
|
|
|
}
|
|
|
|
}
|
2024-03-11 08:47:03 +01:00
|
|
|
x.dmpUsers = x.dmpUsers.filter(x=> x.isActive === IsActive.Active);
|
|
|
|
this.listingItems.push(x);
|
|
|
|
})
|
|
|
|
// this.listingItems.push(...result.items);
|
|
|
|
this.hasListingItems = true;
|
|
|
|
});
|
|
|
|
}
|
2024-03-14 10:41:32 +01:00
|
|
|
|
2020-10-02 17:25:53 +02:00
|
|
|
}
|
|
|
|
|
2020-07-07 14:54:12 +02:00
|
|
|
controlModified(): void {
|
2023-12-01 18:18:41 +01:00
|
|
|
this.lookup.like = this.formGroup.get("like").value;
|
|
|
|
this.lookup.page = { size: this.pageSize, offset: 0 };
|
|
|
|
this.refresh(this.lookup);
|
2020-07-03 16:17:23 +02:00
|
|
|
}
|
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
|
|
|
|
openShareDialog(rowId: any, rowName: any) {
|
2023-12-01 18:18:41 +01:00
|
|
|
//TODO: add this
|
|
|
|
// const dialogRef = this.dialog.open(DmpInvitationDialogComponent, {
|
|
|
|
// autoFocus: false,
|
|
|
|
// data: {
|
|
|
|
// dmpId: rowId,
|
|
|
|
// dmpName: rowName
|
|
|
|
// }
|
|
|
|
// });
|
2020-03-03 10:16:02 +01:00
|
|
|
}
|
2020-07-03 17:51:27 +02:00
|
|
|
|
|
|
|
openFiltersDialog(): void {
|
2023-12-01 18:18:41 +01:00
|
|
|
//TODO: Add filters dialog
|
|
|
|
// const dialogRef = this.dialog.open(DmpCriteriaDialogComponent, {
|
|
|
|
// width: '456px',
|
|
|
|
// height: '100%',
|
|
|
|
// id: 'filters',
|
|
|
|
// restoreFocus: false,
|
|
|
|
// data: {
|
|
|
|
// showGrant: this.showGrant,
|
|
|
|
// isPublic: this.isPublic,
|
|
|
|
// criteria: this.criteria,
|
|
|
|
// formGroup: this.criteriaFormGroup,
|
|
|
|
// // criteria: this.grantId ? this.criteria : this.getDefaultCriteria(),
|
|
|
|
// updateDataFn: this.updateDataFn.bind(this)
|
|
|
|
// },
|
|
|
|
// position: { right: '0px;' },
|
|
|
|
// panelClass: 'dialog-side-panel',
|
|
|
|
// // may remove NgDialogAnimationService package
|
|
|
|
// // animation: {
|
|
|
|
// // to: "left",
|
|
|
|
// // incomingOptions: {
|
|
|
|
// // keyframeAnimationOptions: { duration: 300, easing: "ease-in-out" }
|
|
|
|
// // }
|
|
|
|
// // }
|
|
|
|
// });
|
2020-07-03 17:51:27 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// dialogRef.afterClosed().subscribe(result => {
|
|
|
|
// });
|
2020-07-03 17:51:27 +02:00
|
|
|
}
|
2020-07-07 12:12:57 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// updateDataFn(criteria: DmpCriteriaComponent): void {
|
|
|
|
// this.criteriaFormGroup = criteria.formGroup;
|
|
|
|
// this.toDmpCriteria(criteria);
|
|
|
|
// this.refresh();
|
|
|
|
// }
|
2020-07-07 12:12:57 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// toDmpCriteria(criteria: DmpCriteriaComponent): void {
|
|
|
|
// let formGroup = criteria.formGroup;
|
|
|
|
// this.criteria = {
|
|
|
|
// like: formGroup.get('like').value,
|
|
|
|
// grants: formGroup.get('grants').value,
|
|
|
|
// role: formGroup.get('role').value
|
|
|
|
// }
|
|
|
|
// this.criteria.status = formGroup.get('status').value;
|
|
|
|
// this.setPublicCriteria(formGroup);
|
|
|
|
// if (formGroup.get('datasetTemplates').value)
|
|
|
|
// this.criteria.datasetTemplates = formGroup.get('datasetTemplates').value.map(x => x.id);
|
|
|
|
// if (formGroup.get('collaborators').value)
|
|
|
|
// this.criteria.collaborators = formGroup.get('collaborators').value.map(x => x.id);
|
|
|
|
// if (formGroup.get('organisations').value)
|
|
|
|
// this.criteria.organisations = formGroup.get('organisations').value.map(x => x.id);
|
|
|
|
// if (this.itemId) {
|
|
|
|
// this.criteria.groupIds = [this.itemId];
|
|
|
|
// this.criteria.allVersions = true;
|
|
|
|
// }
|
|
|
|
// this.criteria.grantStatus = formGroup.get('grantStatus').value;
|
|
|
|
// }
|
2020-07-07 12:12:57 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// setPublicCriteria(formGroup?: UntypedFormGroup): void {
|
|
|
|
// if (!isNullOrUndefined(formGroup)) {
|
|
|
|
// if (formGroup.get('status').value == 2) {
|
|
|
|
// this.criteria.status = 1;
|
|
|
|
// this.criteria.isPublic = true;
|
|
|
|
// } else {
|
|
|
|
// this.criteria.isPublic = false;
|
|
|
|
// }
|
|
|
|
// }
|
2020-07-08 17:28:34 +02:00
|
|
|
|
2023-12-01 18:18:41 +01:00
|
|
|
// this.criteria.onlyPublic = this.isPublic;
|
|
|
|
// if (this.isPublic) {
|
|
|
|
// this.criteria.isPublic = true;
|
|
|
|
// }
|
|
|
|
// // } else {
|
|
|
|
// // this.criteria.isPublic = false;
|
|
|
|
// // }
|
|
|
|
// }
|
2020-07-08 17:28:34 +02:00
|
|
|
|
2020-07-07 12:12:57 +02:00
|
|
|
hasScrollbar(): boolean {
|
2020-07-08 17:28:34 +02:00
|
|
|
return document.getElementById("main-page").scrollHeight > document.documentElement.clientHeight
|
2020-07-07 12:12:57 +02:00
|
|
|
}
|
2020-07-28 14:54:21 +02:00
|
|
|
|
2020-07-30 17:29:20 +02:00
|
|
|
public setDashboardTourDmpText(): void {
|
2023-12-01 18:18:41 +01:00
|
|
|
const dmpText = this.language.instant('DMP-LISTING.TEXT-INFO') + '\n\n' +
|
2020-08-03 15:56:36 +02:00
|
|
|
this.language.instant('DMP-LISTING.TEXT-INFO-QUESTION') + ' ' +
|
|
|
|
this.language.instant('DMP-LISTING.LINK-ZENODO') + ' ' +
|
|
|
|
this.language.instant('DMP-LISTING.GET-IDEA');
|
2023-12-01 18:18:41 +01:00
|
|
|
this.dashboardTour.steps[0].title = dmpText;
|
2020-07-30 17:29:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public setDashboardTourDatasetText(): void {
|
2023-12-01 18:18:41 +01:00
|
|
|
const datasetText = this.language.instant('DATASET-LISTING.TEXT-INFO') +
|
2020-08-03 15:56:36 +02:00
|
|
|
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');
|
2023-12-01 18:18:41 +01:00
|
|
|
this.dashboardTour.steps[1].title = datasetText;
|
2020-07-30 17:29:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public restartTour(): void {
|
|
|
|
this.setDashboardTourDmpText();
|
|
|
|
this.setDashboardTourDatasetText();
|
|
|
|
this.guidedTourService.startTour(this.dashboardTour);
|
|
|
|
}
|
2020-11-02 17:00:42 +01:00
|
|
|
|
|
|
|
public hasLikeCriteria(): boolean {
|
2023-12-01 18:18:41 +01:00
|
|
|
return this.lookup.like !== undefined && this.lookup.like !== null;
|
2020-11-02 17:00:42 +01:00
|
|
|
}
|
2023-12-19 17:09:09 +01:00
|
|
|
}
|