63669: Hide return button for metadata edit on com/col

This commit is contained in:
Kristof De Langhe
2019-10-03 14:39:46 +02:00
parent 97de2b8ef3
commit e10a5bb8f8
3 changed files with 12 additions and 2 deletions

View File

@@ -28,7 +28,10 @@ import { CollectionCurateComponent } from './collection-curate/collection-curate
{
path: 'metadata',
component: CollectionMetadataComponent,
data: { title: 'collection.edit.tabs.metadata.title' }
data: {
title: 'collection.edit.tabs.metadata.title',
hideReturnButton: true
}
},
{
path: 'roles',

View File

@@ -16,7 +16,7 @@
<div class="mb-4">
<router-outlet></router-outlet>
</div>
<a [routerLink]="getPageUrl((dsoRD$ | async)?.payload)" class="btn btn-outline-secondary">{{ type + '.edit.return' | translate }}</a>
<a *ngIf="!hideReturnButton" [routerLink]="getPageUrl((dsoRD$ | async)?.payload)" class="btn btn-outline-secondary">{{ type + '.edit.return' | translate }}</a>
</div>
</div>
</div>

View File

@@ -36,12 +36,19 @@ export class EditComColPageComponent<TDomain extends DSpaceObject> implements On
*/
public dsoRD$: Observable<RemoteData<TDomain>>;
/**
* Hide the default return button?
*/
public hideReturnButton: boolean;
public constructor(
protected router: Router,
protected route: ActivatedRoute
) {
this.router.events.subscribe(() => {
this.currentPage = this.route.snapshot.firstChild.routeConfig.path;
this.hideReturnButton = this.route.routeConfig.children
.find((child: any) => child.path === this.currentPage).data.hideReturnButton;
});
}