Fix broken links on subscriptions page

This commit is contained in:
Tim Donohue
2024-05-03 11:06:35 -05:00
parent 2a422ba9c5
commit b86c7075df
2 changed files with 5 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
<td class="dso-info"> <td class="dso-info">
<ng-container *ngIf="!!dso"> <ng-container *ngIf="!!dso">
<ds-type-badge [object]="dso"></ds-type-badge> <ds-type-badge [object]="dso"></ds-type-badge>
<p><a [routerLink]="[getPageRoutePrefix(), dso.id]">{{ dsoNameService.getName(dso) }}</a></p> <p><a [routerLink]="getPageRoute(dso)">{{ dsoNameService.getName(dso) }}</a></p>
</ng-container> </ng-container>
<ng-container *ngIf="!dso"> <ng-container *ngIf="!dso">
<p class="my-0">{{ 'subscriptions.table.not-available' | translate }}</p> <p class="my-0">{{ 'subscriptions.table.not-available' | translate }}</p>

View File

@@ -15,12 +15,10 @@ import {
} from '@ng-bootstrap/ng-bootstrap'; } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { take } from 'rxjs/operators'; import { take } from 'rxjs/operators';
import { getDSORoute } from 'src/app/app-routing-paths';
import { getCollectionModuleRoute } from '../../../collection-page/collection-page-routing-paths';
import { getCommunityModuleRoute } from '../../../community-page/community-page-routing-paths';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
import { DSpaceObject } from '../../../core/shared/dspace-object.model'; import { DSpaceObject } from '../../../core/shared/dspace-object.model';
import { getItemModuleRoute } from '../../../item-page/item-page-routing-paths';
import { ConfirmationModalComponent } from '../../confirmation-modal/confirmation-modal.component'; import { ConfirmationModalComponent } from '../../confirmation-modal/confirmation-modal.component';
import { hasValue } from '../../empty.util'; import { hasValue } from '../../empty.util';
import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component'; import { ThemedTypeBadgeComponent } from '../../object-collection/shared/badges/type-badge/themed-type-badge.component';
@@ -73,22 +71,10 @@ export class SubscriptionViewComponent {
) { } ) { }
/** /**
* Return the prefix of the route to the dso object page ( e.g. "items") * Return the route to the dso object page
*/ */
getPageRoutePrefix(): string { getPageRoute(dso: DSpaceObject): string {
let routePrefix; return getDSORoute(dso);
switch (this.dso.type.value) {
case 'community':
routePrefix = getCommunityModuleRoute();
break;
case 'collection':
routePrefix = getCollectionModuleRoute();
break;
case 'item':
routePrefix = getItemModuleRoute();
break;
}
return routePrefix;
} }
/** /**