mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 18:44:14 +00:00
63669: Hide return button for metadata edit on com/col
This commit is contained in:
@@ -28,7 +28,10 @@ import { CollectionCurateComponent } from './collection-curate/collection-curate
|
|||||||
{
|
{
|
||||||
path: 'metadata',
|
path: 'metadata',
|
||||||
component: CollectionMetadataComponent,
|
component: CollectionMetadataComponent,
|
||||||
data: { title: 'collection.edit.tabs.metadata.title' }
|
data: {
|
||||||
|
title: 'collection.edit.tabs.metadata.title',
|
||||||
|
hideReturnButton: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'roles',
|
path: 'roles',
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -36,12 +36,19 @@ export class EditComColPageComponent<TDomain extends DSpaceObject> implements On
|
|||||||
*/
|
*/
|
||||||
public dsoRD$: Observable<RemoteData<TDomain>>;
|
public dsoRD$: Observable<RemoteData<TDomain>>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the default return button?
|
||||||
|
*/
|
||||||
|
public hideReturnButton: boolean;
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
protected router: Router,
|
protected router: Router,
|
||||||
protected route: ActivatedRoute
|
protected route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
this.router.events.subscribe(() => {
|
this.router.events.subscribe(() => {
|
||||||
this.currentPage = this.route.snapshot.firstChild.routeConfig.path;
|
this.currentPage = this.route.snapshot.firstChild.routeConfig.path;
|
||||||
|
this.hideReturnButton = this.route.routeConfig.children
|
||||||
|
.find((child: any) => child.path === this.currentPage).data.hideReturnButton;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user