Refactors logic and language on Breadcrumbs.

This commit is contained in:
gkolokythas 2019-05-23 16:00:11 +03:00
parent fadaa9bbcb
commit 3d316176f8
5 changed files with 10 additions and 15 deletions

View File

@ -136,7 +136,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.breadCrumbs = Observable.of([
{
parentComponentName: null,
label: this.language.instant('NAV-BAR.DATASETS'),
label: this.language.instant('NAV-BAR.DATASET'),
url: '/datasets',
notFoundResolver: [
{

View File

@ -139,7 +139,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
}
rowClicked(dmp: DmpListingModel) {
this.router.navigate(['/plans/overview/' + dmp.id, { dmpLabel: dmp.label }]);
this.router.navigate(['/plans/overview/' + dmp.id]);
// this.router.navigate(['/plans/edit/' + dmp.id]);
}

View File

@ -53,13 +53,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this._destroyed))
.subscribe(data => {
this.dmp = data;
const breadCrumbs = [];
breadCrumbs.push({ parentComponentName: null, label: 'DMPs', url: "/plans" });
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/overview/' + this.dmp.id });
this.breadCrumbs = Observable.of(breadCrumbs);
})
if (params['dmpLabel'] !== undefined) {
const breadCrumbs = [];
breadCrumbs.push({ parentComponentName: null, label: 'DMPs', url: "/plans" });
breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: params['dmpLabel'], url: '/overview/' + itemId });
this.breadCrumbs = Observable.of(breadCrumbs);
}
}
});
}
@ -102,8 +100,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
this.dmpService.delete(this.dmp.id)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => { this.onCallbackSuccess() },
error => this.onDeleteCallbackError(error)
complete => { this.onCallbackSuccess() },
error => this.onDeleteCallbackError(error)
);
}
});

View File

@ -49,10 +49,6 @@ export class BreadcrumbComponent implements OnInit {
}
currentUrl(breadcrumb) {
if (breadcrumb.url == this.router.url) {
return true;
} else {
false
}
return (breadcrumb.url === this.router.url);
}
}

View File

@ -55,6 +55,7 @@
"DMP": "Dmp",
"DMPS": "DMPs",
"DATASETS": "Datasets",
"DATASET": "Dataset",
"PUBLIC-DATASETS": "Explore OpenDMP",
"USERS": "Users",
"DATASETS-ADMIN": "Dataset Profiles",