Merge remote-tracking branch 'origin/ui-redesign' into ui-redesign

This commit is contained in:
George Kalampokis 2020-08-03 17:01:27 +03:00
commit 58b193ff20
8 changed files with 61 additions and 60 deletions

View File

@ -23,7 +23,8 @@
<div *ngFor="let activity of allRecentActivities">
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dmp.valueOf()">
<div class="dmp-card">
<a (click)="goToDMPOverview(activity.id)" class="pointer">
<!-- <a (click)="redirect(activity.id, activity.type)" class="pointer"> -->
<a [routerLink]="navigateToUrl(activity.id, activity.type)" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dmp-label">{{ 'DMP-LISTING.DMP' | translate }}</div>
<div *ngIf="!publicMode" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ activity.modified | date: "longDate" }}</div>
@ -49,7 +50,8 @@
<div class="col-auto dmp-dataset-descriptions-name" *ngIf="last || i == 2">{{dataset.label}}</div>
</div>
</div>
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="getDatasets(activity).length > 3" (click)="goToDMPOverview(activity.id)"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
<!-- <a class="d-flex justify-content-center pb-3 show-more" *ngIf="getDatasets(activity).length > 3" (click)="redirect(activity.id, activity.type)"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a> -->
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="getDatasets(activity).length > 3" [routerLink]="navigateToUrl(activity.id, activity.type)"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
</a>
<div class="dmp-card-actions">
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>
@ -92,7 +94,8 @@
</div>
<div *ngIf="activity && activity.type === recentActivityTypeEnum.Dataset.valueOf()">
<div class="dataset-card">
<a (click)="goToDatasetOverview(activity.id)" class="pointer">
<!-- <a (click)="redirect(activity.id, activity.type)" class="pointer"> -->
<a [routerLink]="navigateToUrl(activity.id, activity.type)" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
<div *ngIf="!publicMode" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}</div>

View File

@ -264,11 +264,19 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
return;
}
case RecentActivityType.Dataset: {
this.router.navigate(["datasets/edit/" + id]);
if (this.isAuthenticated()) {
this.router.navigate(['../datasets/overview/' + id]);
} else {
this.router.navigate(['../explore/publicOverview', id]);
}
return;
}
case RecentActivityType.Dmp: {
this.router.navigate(["plans/overview/" + id]);
if (this.isAuthenticated()) {
this.router.navigate(['../plans/overview/' + id]);
} else {
this.router.navigate(['../explore-plans/publicOverview', id]);
}
return;
}
default:
@ -276,9 +284,29 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
}
}
// navigateToUrl() {
// this.router.navigate(["plans/"]);
// }
navigateToUrl(id: string, type: RecentActivityType): string[] {
switch (type) {
case RecentActivityType.Grant: {
return ["grants/edit/" + id];
}
case RecentActivityType.Dataset: {
if (this.isAuthenticated()) {
return ['../datasets/overview/' + id];
} else {
return ['../explore/publicOverview', id];
}
}
case RecentActivityType.Dmp: {
if (this.isAuthenticated()) {
return ['../plans/overview/' + id];
} else {
return ['../explore-plans/publicOverview', id];
}
}
default:
throw new Error("Unsupported Activity Type ");
}
}
roleDisplay(value: any) {
const principal: Principal = this.authentication.current();
@ -492,22 +520,6 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
});
}
goToDMPOverview(id: string) {
if (this.isAuthenticated()) {
this.router.navigate(['../plans/overview/' + id]);
} else {
this.router.navigate(['../explore-plans/publicOverview', id]);
}
}
goToDatasetOverview(id: string) {
if (this.isAuthenticated()) {
this.router.navigate(['../datasets/overview/' + id]);
} else {
this.router.navigate(['../explore/publicOverview', id]);
}
}
refresh(): void {
const fields: Array<string> = [((this.formGroup.get('order').value === 'status') || (this.formGroup.get('order').value === 'label') ? '+' : "-") + this.formGroup.get('order').value];
// const fields: Array<string> = ["-modified"];

View File

@ -22,7 +22,7 @@
</div>
<div *ngFor="let activity of datasetActivities">
<div class="dataset-card">
<a (click)="goToOverview(activity.id)" class="pointer">
<a [routerLink]="goToOverview(activity.id)" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
<div *ngIf="!publicMode" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}</div>

View File

@ -159,11 +159,11 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen
if (principal) return principal.id === activity.users.find(x => x.role === Role.Owner).id;
}
goToOverview(id: string) {
goToOverview(id: string): string[] {
if (this.isAuthenticated()) {
this.router.navigate(['../datasets/overview/' + id]);
return ['../datasets/overview/' + id];
} else {
this.router.navigate(['../explore/publicOverview', id]);
return ['../explore/publicOverview', id];
}
}

View File

@ -22,7 +22,7 @@
</div>
<div *ngFor="let activity of dmpActivities">
<div class="dmp-card">
<a (click)="goToOverview(activity.id)" class="pointer">
<a [routerLink]="navigateToUrl(activity.id)" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dmp-label">{{ 'DMP-LISTING.DMP' | translate }}</div>
<div *ngIf="!publicMode" class="col-auto ml-auto edited-date">{{ 'DMP-LISTING.EDITED' | translate }}: {{ activity.modifiedTime | date: "longDate" }}</div>
@ -48,7 +48,7 @@
<div class="col-auto dmp-dataset-descriptions-name" *ngIf="last || i == 2">{{dataset.label}}</div>
</div>
</div>
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="activity.datasets.length > 3" (click)="goToOverview(activity.id)"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
<a class="d-flex justify-content-center pb-3 show-more" *ngIf="activity.datasets.length > 3" [routerLink]="navigateToUrl(activity.id)"><u>{{'GENERAL.ACTIONS.SHOW-MORE' | translate}}</u></a>
</a>
<div class="dmp-card-actions">
<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DMP-LISTING.ACTIONS.EXPORT' | translate}}</a>

View File

@ -95,7 +95,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
.subscribe(x => this.refresh());
this.formGroup.get('order').valueChanges
.pipe(takeUntil(this._destroyed))
.subscribe(x => this.refresh());
.subscribe(x => this.refresh());
// const datasetDataTableRequest: DataTableRequest<DatasetCriteria> = new DataTableRequest(0, 5, { fields: fields });
// datasetDataTableRequest.criteria = new DatasetCriteria();
// datasetDataTableRequest.criteria.like = "";
@ -173,14 +173,6 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
});
}
goToOverview(id: string) {
if (this.isAuthenticated()) {
this.router.navigate(['../plans/overview/' + id]);
} else {
this.router.navigate(['../explore-plans/publicOverview', id]);
}
}
openDeleteDialog(id: string) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
maxWidth: '300px',
@ -251,28 +243,21 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
}
redirect(id: string, type: RecentActivityType) {
switch (type) {
case RecentActivityType.Grant: {
this.router.navigate(["grants/edit/" + id]);
return;
}
case RecentActivityType.Dataset: {
this.router.navigate(["datasets/edit/" + id]);
return;
}
case RecentActivityType.Dmp: {
this.router.navigate(["plans/overview/" + id]);
return;
}
default:
throw new Error("Unsupported Activity Type ");
redirect(id: string) {
if (this.isAuthenticated()) {
this.router.navigate(['../plans/overview/' + id]);
} else {
this.router.navigate(['../explore-plans/publicOverview', id]);
}
}
// navigateToUrl() {
// this.router.navigate(["plans/"]);
// }
navigateToUrl(id: string): string[] {
if (this.isAuthenticated()) {
return ['../plans/overview/' + id];
} else {
return ['../explore-plans/publicOverview', id];
}
}
roleDisplay(value: any) {
const principal: Principal = this.authentication.current();

View File

@ -1,5 +1,5 @@
<div class="dataset-card">
<a [routerLink]="isPublic ? ['/datasets/publicOverview/' + dataset.id] : ['/datasets/overview/' + dataset.id]" class="pointer">
<a [routerLink]="getItemLink()" class="pointer">
<div class="d-flex flex-direction-row">
<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{dataset.modified | date:"longDate"}}</div>

View File

@ -78,7 +78,8 @@ export class DatasetListingItemComponent extends BaseComponent implements OnInit
}
getItemLink(): string[] {
return this.isPublic ? [`/datasets/publicEdit/${this.dataset.id}`] : [`/datasets/edit/${this.dataset.id}`];
// return this.isPublic ? [`/datasets/publicEdit/${this.dataset.id}`] : [`/datasets/edit/${this.dataset.id}`];
return this.isPublic ? ['/datasets/publicOverview/' + this.dataset.id] : ['/datasets/overview/' + this.dataset.id];
}
getDmpLink(): string[] {