Refactors logic and language on Breadcrumbs.
This commit is contained in:
parent
fadaa9bbcb
commit
3d316176f8
|
@ -136,7 +136,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
this.breadCrumbs = Observable.of([
|
this.breadCrumbs = Observable.of([
|
||||||
{
|
{
|
||||||
parentComponentName: null,
|
parentComponentName: null,
|
||||||
label: this.language.instant('NAV-BAR.DATASETS'),
|
label: this.language.instant('NAV-BAR.DATASET'),
|
||||||
url: '/datasets',
|
url: '/datasets',
|
||||||
notFoundResolver: [
|
notFoundResolver: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,7 +139,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
||||||
}
|
}
|
||||||
|
|
||||||
rowClicked(dmp: DmpListingModel) {
|
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]);
|
// this.router.navigate(['/plans/edit/' + dmp.id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,13 +53,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(data => {
|
.subscribe(data => {
|
||||||
this.dmp = 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)
|
this.dmpService.delete(this.dmp.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onCallbackSuccess() },
|
complete => { this.onCallbackSuccess() },
|
||||||
error => this.onDeleteCallbackError(error)
|
error => this.onDeleteCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,10 +49,6 @@ export class BreadcrumbComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
currentUrl(breadcrumb) {
|
currentUrl(breadcrumb) {
|
||||||
if (breadcrumb.url == this.router.url) {
|
return (breadcrumb.url === this.router.url);
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
"DMP": "Dmp",
|
"DMP": "Dmp",
|
||||||
"DMPS": "DMPs",
|
"DMPS": "DMPs",
|
||||||
"DATASETS": "Datasets",
|
"DATASETS": "Datasets",
|
||||||
|
"DATASET": "Dataset",
|
||||||
"PUBLIC-DATASETS": "Explore OpenDMP",
|
"PUBLIC-DATASETS": "Explore OpenDMP",
|
||||||
"USERS": "Users",
|
"USERS": "Users",
|
||||||
"DATASETS-ADMIN": "Dataset Profiles",
|
"DATASETS-ADMIN": "Dataset Profiles",
|
||||||
|
|
Loading…
Reference in New Issue