Skip to content
Snippets Groups Projects
Commit 371eaa6e authored by Scott Berg's avatar Scott Berg
Browse files

Add name formatting pipe.

parent 1c70b412
Branches ROENROLL-1883
No related tags found
No related merge requests found
Pipeline #41867 passed
......@@ -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>
......
......@@ -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,
......
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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment