diff --git a/src/app/dars/audit/audit.component.html b/src/app/dars/audit/audit.component.html index 1e0e694678fcf838fabaa50edf652be1ecee7dda..bcb0277062d45c1dc6c3be446674a4e4a8699bda 100644 --- a/src/app/dars/audit/audit.component.html +++ b/src/app/dars/audit/audit.component.html @@ -3,7 +3,7 @@ <div class="audit-metadata"> <div> <p>{{audit.header.preparedLabel}}: {{audit.header.preparedDate}}</p> - <p>{{audit.header.studentName}}</p> + <p>{{audit.header.studentName | auditFormatName}}</p> <p>{{audit.header.darsDegreeProgramCodeLabel}}: {{audit.header.darsDegreeProgramCode}}</p> </div> @@ -38,7 +38,7 @@ <h4>{{audit.topSection.advisorSection.advisorLabel}}:</h4> <ng-container *ngFor="let name of audit.topSection.advisorSection.advisorNames"> - <p class="audit-advisor-name">{{name}}</p> + <p class="audit-advisor-name">{{name | auditFormatName}}</p> </ng-container> </div> diff --git a/src/app/dars/dars.module.ts b/src/app/dars/dars.module.ts index fcccd4b88606f11d5cbabc3e1900268d288163c4..210611fcf956038023947e207c35e119ea0eb2e3 100644 --- a/src/app/dars/dars.module.ts +++ b/src/app/dars/dars.module.ts @@ -13,6 +13,7 @@ import { StoreModule } from '@ngrx/store'; import { darsReducer } from './store/reducer'; import { AuditLinePipe } from './pipes/audit-line.pipe'; import { SchoolOrCollegePipe } from './pipes/school-college.pipe'; +import { AuditNamePipe } from './pipes/name-format.pipe'; import { NewDegreeAuditDialogComponent } from './new-degree-audit-dialog/new-degree-audit-dialog.component'; import { NewWhatIfAuditDialogComponent } from './new-what-if-audit-dialog/new-what-if-audit-dialog.component'; import { AuditViewComponent } from './dars-audit-view/dars-audit-view.component'; @@ -30,6 +31,7 @@ import { RouterModule } from '@angular/router'; declarations: [ AuditLinePipe, SchoolOrCollegePipe, + AuditNamePipe, NewDegreeAuditDialogComponent, NewWhatIfAuditDialogComponent, DARSViewComponent, diff --git a/src/app/dars/pipes/name-format.pipe.ts b/src/app/dars/pipes/name-format.pipe.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f4578e2186e31e736130e8a7bc16dcc6cf619fd --- /dev/null +++ b/src/app/dars/pipes/name-format.pipe.ts @@ -0,0 +1,12 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ name: 'auditFormatName' }) +export class AuditNamePipe implements PipeTransform { + transform(name: string): string { + // Regex to match commas with no spaces after + const regex = /(,(?=\S)|:)/; + name = name.replace(regex, ', '); + + return name; + } +}