fixed routerLink (in progess)

This commit is contained in:
Sofia Papacharalampous 2024-06-12 17:03:24 +03:00
parent 355920fd6a
commit 92ca0d46a5
23 changed files with 62 additions and 45 deletions

View File

@ -14,7 +14,7 @@ export class RouterUtilsService {
generateUrl(url: string | string[]): string {
const tenant = this.authService.selectedTenant() ?? 'default';
if (Array.isArray(url)) {
this.tenantHandlingService.getUrlEnrichedWithTenantCode(url.join(), tenant)
return this.tenantHandlingService.getUrlEnrichedWithTenantCode(url.join(''), tenant)
} else {
return this.tenantHandlingService.getUrlEnrichedWithTenantCode(url, tenant);
}

View File

@ -14,7 +14,7 @@
</div>
<div class="col-auto">
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplate)" [routerLink]="['/description-templates/new']">
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplate)" [routerLink]="[routerUtils.generateUrl('/description-templates/new')]">
<mat-icon>add</mat-icon>
{{'DESCRIPTION-TEMPLATE-LISTING.CREATE-DESCRIPTION-TEMPLATE' | translate}}
</button>
@ -36,16 +36,15 @@
<ng-template #listItemTemplate let-item="item" let-isColumnSelected="isColumnSelected">
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('label')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
<a class="buttonLinkClass" [routerLink]="[routerUtils.generateUrl(['./', item?.id])]" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
<br />
</ng-container>
<ng-container *ngIf="isColumnSelected('description')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.description | nullifyValue}}</a>
<a class="buttonLinkClass" [routerLink]="[routerUtils.generateUrl(['./', item?.id])]" class="col-12" (click)="$event.stopPropagation()">{{item?.description | nullifyValue}}</a>
<br />
</ng-container>
@ -93,16 +92,16 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button *ngIf="row.status !== descriptionTemplateStatuses.Finalized" mat-menu-item [routerLink]="['/description-templates/', row.id]">
<button *ngIf="row.status !== descriptionTemplateStatuses.Finalized" mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/', row.id])">
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="['/description-templates/new-version/', row.id]">
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item [routerLink]="routerUtils.generateUrl('/description-templates/new-version/', row.id)">
<mat-icon>queue</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.NEW-VERSION' | translate}}
</button>
<button mat-menu-item [routerLink]="['/description-templates/clone/', row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/clone/', row.id])">
<mat-icon>content_copy</mat-icon>{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.CLONE' | translate}}
</button>
<button mat-menu-item [routerLink]="['/description-templates/versions/', row.groupId]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-templates/versions/', row.groupId])">
<mat-icon>library_books</mat-icon>
{{'DESCRIPTION-TEMPLATE-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
</button>

View File

@ -30,6 +30,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { ImportDescriptionTemplateDialogComponent } from './import-description-template/import-description-template.dialog.component';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
@ -78,7 +79,8 @@ export class DescriptionTemplateListingComponent extends BaseListingComponent<De
private dialog: MatDialog,
private fileUtils: FileUtils,
private sumarizeTextPipe: SumarizeTextPipe,
private analyticsService: AnalyticsService
private analyticsService: AnalyticsService,
public routerUtils: RouterUtilsService,
) {
super(router, route, uiNotificationService, httpErrorHandlingService, queryParamsService);
// Lookup setup

View File

@ -8,7 +8,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)"
[routerLink]="['/description-template-type/new']">
[routerLink]="routerUtils.generateUrl(['/description-template-type/new'])">
<mat-icon>add</mat-icon>
{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.CREATE-TYPE' | translate}}
</button>
@ -42,7 +42,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>
@ -93,7 +93,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button *ngIf="!isFinalized(row)" mat-menu-item [routerLink]="['/description-template-type/' + row.id]">
<button *ngIf="!isFinalized(row)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/description-template-type/' + row.id])">
<mat-icon>edit</mat-icon>{{'DESCRIPTION-TEMPLATE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">

View File

@ -8,6 +8,7 @@ import { DescriptionTemplateTypeLookup } from '@app/core/query/description-templ
import { AuthService } from '@app/core/services/auth/auth.service';
import { DescriptionTemplateTypeService } from '@app/core/services/description-template-type/description-template-type.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
import { BaseListingComponent } from '@common/base/base-listing-component';
@ -52,6 +53,7 @@ export class DescriptionTemplateTypeListingComponent extends BaseListingComponen
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -14,7 +14,7 @@
</div>
<div class="col-auto">
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="['/dmp-blueprints/new']">
<button mat-raised-button class="create-btn" *ngIf="authService.hasPermission(authService.permissionEnum.EditDescriptionTemplateType)" [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new'])">
<mat-icon>add</mat-icon>
{{'DMP-BLUEPRINT-LISTING.CREATE-DMP-BLUEPRINT' | translate}}
</button>
@ -40,7 +40,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('label')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12" (click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
<br />
</ng-container>
@ -88,16 +88,16 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="['/dmp-blueprints/', row.id]">
<button *ngIf="(row.status != null && row.status === dmpBlueprintStatuses.Draft)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/', row.id])">
<mat-icon>edit</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === dmpBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="['/dmp-blueprints/new-version' , row.id]">
<button *ngIf="row.belongsToCurrentTenant != false && (row.status === dmpBlueprintStatuses.Finalized || row.status == null)" mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/new-version' , row.id])">
<mat-icon>queue</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.NEW-VERSION' | translate}}
</button>
<button mat-menu-item [routerLink]="['/dmp-blueprints/clone' , row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/clone/' , row.id])">
<mat-icon>content_copy</mat-icon>{{'DMP-BLUEPRINT-LISTING.ACTIONS.CLONE' | translate}}
</button>
<button mat-menu-item [routerLink]="['/dmp-blueprints/versions' , row.groupId]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/dmp-blueprints/versions/' , row.groupId])">
<mat-icon>library_books</mat-icon>
{{'DMP-BLUEPRINT-LISTING.ACTIONS.VIEW-VERSIONS' | translate}}
</button>

View File

@ -29,6 +29,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { ImportDmpBlueprintDialogComponent } from './import-dmp-blueprint/import-dmp-blueprint.dialog.component';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
@ -63,6 +64,7 @@ export class DmpBlueprintListingComponent extends BaseListingComponent<DmpBluepr
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -8,7 +8,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditLanguage)"
[routerLink]="['/languages/new']">
[routerLink]="routerUtils.generateUrl(['/languages/new'])">
<mat-icon>add</mat-icon>
{{'LANGUAGE-LISTING.CREATE' | translate}}
</button>
@ -39,7 +39,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('code')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.code | nullifyValue}}</a>
<br />
</ng-container>
@ -81,7 +81,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/language/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/languages/', row.id])">
<mat-icon>edit</mat-icon>{{'LANGUAGE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">

View File

@ -7,6 +7,7 @@ import { LanguageLookup } from '@app/core/query/language.lookup';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
import { BaseListingComponent } from '@common/base/base-listing-component';
@ -49,6 +50,7 @@ export class LanguageListingComponent extends BaseListingComponent<Language, Lan
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -9,7 +9,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditPrefillingSource)"
[routerLink]="['/prefilling-sources/new']">
[routerLink]="routerUtils.generateUrl(['/prefilling-sources/new'])">
<mat-icon>add</mat-icon>
{{'PREFILLING-SOURCE-LISTING.CREATE' | translate}}
</button>
@ -40,7 +40,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>
@ -83,7 +83,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/prefilling-sources/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/prefilling-sources/', row.id])">
<mat-icon>edit</mat-icon>{{'PREFILLING-SOURCE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">

View File

@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
templateUrl: './prefilling-source-listing.component.html',
@ -50,6 +51,7 @@ export class PrefillingSourceListingComponent extends BaseListingComponent<Prefi
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -9,7 +9,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditReferenceType)"
[routerLink]="['/reference-type/new']">
[routerLink]="routerUtils.generateUrl(['/reference-type/new'])">
<mat-icon>add</mat-icon>
{{'REFERENCE-TYPE-LISTING.CREATE-TYPE' | translate}}
</button>
@ -44,7 +44,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>
@ -96,7 +96,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/reference-type/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/reference-type/' + row.id])">
<mat-icon>edit</mat-icon>{{'REFERENCE-TYPE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">

View File

@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
templateUrl: './reference-type-listing.component.html',
@ -50,6 +51,7 @@ export class ReferenceTypeListingComponent extends BaseListingComponent<Referenc
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -9,7 +9,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditReference)"
[routerLink]="['/references/new']">
[routerLink]="routerUtils.generateUrl(['/references/new/'])">
<mat-icon>add</mat-icon>
{{'REFERENCE-LISTING.CREATE' | translate}}
</button>
@ -42,7 +42,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('label')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.label | nullifyValue}}</a>
<br />
</ng-container>
@ -105,7 +105,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/references/', row.id])">
<mat-icon>edit</mat-icon>{{'REFERENCE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button *ngIf="row.belongsToCurrentTenant != false" mat-menu-item (click)="deleteType(row.id)">

View File

@ -8,6 +8,7 @@ import { ReferenceLookup } from '@app/core/query/reference.lookup';
import { AuthService } from '@app/core/services/auth/auth.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { ReferenceService } from '@app/core/services/reference/reference.service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
import { BaseListingComponent } from '@common/base/base-listing-component';
@ -53,6 +54,7 @@ export class ReferenceListingComponent extends BaseListingComponent<Reference, R
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -4,14 +4,13 @@
<div class="row mb-4 mt-4">
<div class="col">
<h4>{{'TENANT-LISTING.TITLE' | translate}}</h4>
<app-navigation-breadcrumb />
</div>
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditTenant)"
[routerLink]="['/tenants/new']">
[routerLink]="routerUtils.generateUrl(['/tenants/new'])">
<mat-icon>add</mat-icon>
{{'TENANT-LISTING.CREATE' | translate}}
</button>
@ -42,7 +41,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>
@ -85,7 +84,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/tenant/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/tenants/' + row.id])">
<mat-icon>edit</mat-icon>{{'TENANT-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button mat-menu-item (click)="deleteType(row.id)">

View File

@ -22,6 +22,7 @@ import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { nameof } from 'ts-simple-nameof';
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
templateUrl: './tenant-listing.component.html',
@ -49,6 +50,7 @@ export class TenantListingComponent extends BaseListingComponent<Tenant, TenantL
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,

View File

@ -3,7 +3,6 @@
<div class="col-md-10 offset-md-1">
<div class="row mb-4 mt-4">
<div class="col">
<h4>{{'USER-LISTING.TITLE' | translate}}</h4>
<app-navigation-breadcrumb />
</div>
@ -30,7 +29,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12" (click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12" (click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>

View File

@ -94,11 +94,11 @@
</div>
<div class="col-auto col-xl-12">
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
<a [routerLink]="['/plans']" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
</div>
<div class="col-auto col-xl-12">
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
<a [routerLink]="['/descriptions']" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
<a [routerLink]="routerUtils.generateUrl(['/descriptions'])" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
</div>
<div class="col-auto col-xl-12">
<div class="counter-zero" style="width: fit-content;"><span>0</span></div>
@ -119,13 +119,13 @@
<div [ngClass]="{'counter': dashboardStatistics?.dmpCount != 0, 'counter-zero': dashboardStatistics?.dmpCount == 0}" style="width: fit-content;">
<span>{{dashboardStatistics?.dmpCount}}</span>
</div>
<a [routerLink]="['/plans']" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
<a [routerLink]="routerUtils.generateUrl(['/plans'])" class="link">{{'DASHBOARD.DMPS' | translate}}</a>
</div>
<div class="col-auto col-xl-12">
<div [ngClass]="{'counter': dashboardStatistics?.descriptionCount != 0, 'counter-zero': dashboardStatistics?.descriptionCount == 0}" style="width: fit-content;">
<span>{{dashboardStatistics?.descriptionCount}}</span>
</div>
<a [routerLink]="['/descriptions']" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
<a [routerLink]="routerUtils.generateUrl(['/descriptions'])" class="link">{{'DASHBOARD.DESCRIPTIONS' | translate}}</a>
</div>
<div class="col-auto col-xl-12">
<div [ngClass]="{'counter': grantCount != 0, 'counter-zero': grantCount == 0}" style="width: fit-content;">

View File

@ -18,6 +18,7 @@ import { takeUntil } from 'rxjs/operators';
import { StartNewDescriptionDialogComponent } from '../description/start-new-description-dialog/start-new-description-dialog.component';
import { StartNewDmpDialogComponent } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.component';
import { AnalyticsService } from '@app/core/services/matomo/analytics-service';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
@ -35,6 +36,7 @@ export class DashboardComponent extends BaseComponent implements OnInit {
isIntroCardVisible = true;
constructor(
public routerUtils: RouterUtilsService,
private router: Router,
private route: ActivatedRoute,
private dashboardService: DashboardService,

View File

@ -31,4 +31,4 @@ import { ServerErrorsInterceptor } from '@common/modules/errors/server-errors-in
},
]
})
export class ErrorsModule { }
export class ErrorsModule { } //not used

View File

@ -9,7 +9,7 @@
<div class="col-auto">
<button mat-raised-button class="create-btn"
*ngIf="authService.hasPermission(authService.permissionEnum.EditNotificationTemplate)"
[routerLink]="['/notification-templates/new']">
[routerLink]="routerUtils.generateUrl(['/notification-templates/new'])">
<mat-icon>add</mat-icon>
{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.CREATE' | translate}}
</button>
@ -40,7 +40,7 @@
<div class="d-flex align-items-center p-3 gap-1-rem">
<div class="row">
<ng-container *ngIf="isColumnSelected('name')">
<a class="buttonLinkClass" [routerLink]="'./' + item?.id" class="col-12"
<a class="buttonLinkClass" [routerLink]="routerUtils.generateUrl('./' + item?.id)" class="col-12"
(click)="$event.stopPropagation()">{{item?.name | nullifyValue}}</a>
<br />
</ng-container>
@ -98,7 +98,7 @@
<mat-icon>more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item [routerLink]="['/notification-templates/' + row.id]">
<button mat-menu-item [routerLink]="routerUtils.generateUrl(['/notification-templates/' + row.id])">
<mat-icon>edit</mat-icon>{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-LISTING.ACTIONS.EDIT' | translate}}
</button>
<button mat-menu-item (click)="deleteType(row.id)">

View File

@ -26,6 +26,7 @@ import { NotificationTemplateKindPipe } from '@common/formatting/pipes/notificat
import { Language } from '@app/core/model/language/language';
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
import { IsActive } from '@notification-service/core/enum/is-active.enum';
import { RouterUtilsService } from '@app/core/services/router/router-utils.service';
@Component({
templateUrl: './notification-template-listing.component.html',
@ -53,6 +54,7 @@ export class NotificationTemplateListingComponent extends BaseListingComponent<N
rowIdentity = x => x.id;
constructor(
public routerUtils: RouterUtilsService,
protected router: Router,
protected route: ActivatedRoute,
protected uiNotificationService: UiNotificationService,