Skip to content

Commit

Permalink
Rename display_Name property
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-scott committed Dec 20, 2024
1 parent de7a839 commit f0087aa
Show file tree
Hide file tree
Showing 31 changed files with 126 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export abstract class AddParticipantBaseDirective extends BookingBaseComponent i
lastName: this.participantDetails.lastName?.trim(),
email: this.participantDetails.email?.trim() || '',
phone: this.participantDetails.phone?.trim() || '',
displayName: this.participantDetails.display_Name?.trim() || '',
displayName: this.participantDetails.displayName?.trim() || '',
companyName: this.participantDetails.company?.trim() || '',
companyNameIndividual: this.participantDetails.company?.trim() || '',
representing: this.participantDetails.representee?.trim() || '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const participants: VHParticipant[] = [];
const p1 = new VHParticipant();
p1.firstName = 'John';
p1.lastName = 'Doe';
p1.display_Name = 'John Doe';
p1.displayName = 'John Doe';
p1.title = 'Mr.';
p1.email = '[email protected]';
p1.phone = '32332';
Expand All @@ -107,7 +107,7 @@ p1.username = '[email protected]';
const p2 = new VHParticipant();
p2.firstName = 'Jane';
p2.lastName = 'Doe';
p2.display_Name = 'Jane Doe';
p2.displayName = 'Jane Doe';
p2.title = 'Mr.';
p2.email = '[email protected]';
p2.phone = '32332';
Expand All @@ -120,7 +120,7 @@ p1.username = '[email protected]';
const p3 = new VHParticipant();
p3.firstName = 'Chris';
p3.lastName = 'Green';
p3.display_Name = 'Chris Green';
p3.displayName = 'Chris Green';
p3.title = 'Mr.';
p3.email = '[email protected]';
p3.phone = '32332';
Expand All @@ -134,7 +134,7 @@ p3.userRoleName = 'Representative';
const p4 = new VHParticipant();
p4.firstName = 'Test';
p4.lastName = 'Participant';
p4.display_Name = 'Test Participant';
p4.displayName = 'Test Participant';
p4.title = 'Mr.';
p4.email = '[email protected]';
p4.phone = '32332';
Expand All @@ -146,7 +146,7 @@ p4.userRoleName = 'Individual';
const p5 = new VHParticipant();
p5.firstName = 'Test7';
p5.lastName = 'Participant7';
p5.display_Name = 'Test Participant7';
p5.displayName = 'Test Participant7';
p5.title = 'Mr.';
p5.email = '[email protected]';
p5.phone = '32332';
Expand All @@ -159,7 +159,7 @@ p5.interpreterFor = '[email protected]';
const p6 = new VHParticipant();
p6.firstName = 'Test8';
p6.lastName = 'Participant8';
p6.display_Name = 'Test Participant8';
p6.displayName = 'Test Participant8';
p6.title = 'Mr.';
p6.email = '[email protected]';
p6.phone = '32332';
Expand Down Expand Up @@ -202,7 +202,7 @@ function initParticipant() {
participant.firstName = 'Sam';
participant.lastName = 'Green';
participant.phone = '12345';
participant.display_Name = 'Sam Green';
participant.displayName = 'Sam Green';
participant.title = 'Mr';
participant.hearingRoleName = 'Representative';
participant.company = 'CN';
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('AddParticipantComponent', () => {
expect(email.value).toBe(participant.email);
expect(phone.value).toBe(participant.phone);
expect(title.value).toBe(participant.title);
expect(displayName.value).toBe(participant.display_Name);
expect(displayName.value).toBe(participant.displayName);
expect(companyName.value).toBe(participant.company);
expect(component.displayNextButton).toBeFalsy();
expect(component.displayClearButton).toBeTruthy();
Expand All @@ -411,7 +411,7 @@ describe('AddParticipantComponent', () => {
it('should populate the form fields when values are null', () => {
participant.email = null;
participant.phone = null;
participant.display_Name = null;
participant.displayName = null;
participant.company = null;
participant.representee = null;
component.getParticipant(participant);
Expand Down Expand Up @@ -642,14 +642,14 @@ describe('AddParticipantComponent', () => {
const pa1 = new VHParticipant();
pa1.firstName = 'firstname';
pa1.lastName = 'lastname-interpretee';
pa1.display_Name = 'firstname lastname-interpretee';
pa1.displayName = 'firstname lastname-interpretee';
pa1.email = '[email protected]';
pa1.hearingRoleName = 'Litigant in Person';

const pa2 = new VHParticipant();
pa2.firstName = 'firstname';
pa2.lastName = 'lastname-interpreter';
pa1.display_Name = 'firstname lastname-interpreter';
pa1.displayName = 'firstname lastname-interpreter';
pa2.email = '[email protected]';
pa2.hearingRoleName = 'Interpreter';
pa2.interpreterFor = '[email protected]';
Expand All @@ -674,14 +674,14 @@ describe('AddParticipantComponent', () => {
const part1 = new VHParticipant();
part1.firstName = 'firstname';
part1.lastName = 'lastname-interpretee';
part1.display_Name = 'firstname lastname-interpretee';
part1.displayName = 'firstname lastname-interpretee';
part1.email = '[email protected]';
part1.hearingRoleName = 'Litigant in Person';

const part2 = new VHParticipant();
part2.firstName = 'firstname';
part2.lastName = 'lastname-interpreter';
part2.display_Name = 'firstname lastname-interpreter';
part2.displayName = 'firstname lastname-interpreter';
part2.email = '[email protected]';
part2.hearingRoleName = 'Interpreter';
part2.interpreterFor = '[email protected]';
Expand Down Expand Up @@ -909,7 +909,7 @@ describe('AddParticipantComponent edit mode', () => {
role: 'Panel Member',
email: participant.email,
phone: participant.phone,
displayName: participant.display_Name,
displayName: participant.displayName,
companyName: participant.company,
companyNameIndividual: participant.company,
representing: participant.representee,
Expand Down Expand Up @@ -1042,7 +1042,7 @@ describe('AddParticipantComponent edit mode', () => {
interpretee.setValue('[email protected]');
component.updateParticipant();
const updatedParticipant = component.hearing.participants.find(x => x.email === '[email protected]');
expect(updatedParticipant.display_Name).toBe('Sam Green');
expect(updatedParticipant.displayName).toBe('Sam Green');
});
it('should before save booking check if all fields available', () => {
component.actionsBeforeSave();
Expand All @@ -1069,7 +1069,7 @@ describe('AddParticipantComponent edit mode', () => {
lastName: participant.lastName,
email: participant.email,
phone: participant.phone,
displayName: participant.display_Name,
displayName: participant.displayName,
companyName: participant.company,
companyNameIndividual: participant.company,
representing: participant.representee,
Expand All @@ -1094,7 +1094,7 @@ describe('AddParticipantComponent edit mode', () => {
lastName: participant.lastName,
email: participant.email,
phone: participant.phone,
displayName: participant.display_Name,
displayName: participant.displayName,
companyName: participant.company,
companyNameIndividual: participant.company,
representing: participant.representee,
Expand Down Expand Up @@ -1173,15 +1173,15 @@ describe('AddParticipantComponent edit mode', () => {
const part1 = new VHParticipant();
part1.firstName = 'firstname';
part1.lastName = 'lastname-interpretee';
part1.display_Name = 'firstname lastname-interpretee';
part1.displayName = 'firstname lastname-interpretee';
part1.email = '[email protected]';
part1.hearingRoleName = 'Litigant in Person';
part1.id = '100';

const part2 = new VHParticipant();
part2.firstName = 'firstname';
part2.lastName = 'lastname-interpreter';
part2.display_Name = 'firstname lastname-interpreter';
part2.displayName = 'firstname lastname-interpreter';
part2.email = '[email protected]';
part2.hearingRoleName = 'Interpreter';
part2.interpreterFor = '[email protected]';
Expand Down Expand Up @@ -1221,7 +1221,7 @@ describe('AddParticipantComponent edit mode', () => {
interpretee.setValue('[email protected]');
component.updateParticipant();
const updatedParticipant = component.hearing.participants.find(x => x.email === '[email protected]');
expect(updatedParticipant.display_Name).toBe('Test Participant8');
expect(updatedParticipant.displayName).toBe('Test Participant8');
});
});
describe('AddParticipantComponent edit mode no participants added', () => {
Expand Down Expand Up @@ -1348,7 +1348,7 @@ describe('AddParticipantComponent edit mode no participants added', () => {
lastName: participant.lastName,
email: participant.email,
phone: participant.phone,
displayName: participant.display_Name,
displayName: participant.displayName,
companyName: participant.company,
companyNameIndividual: participant.company,
representing: participant.representee,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ export class AddParticipantComponent extends AddParticipantBaseDirective impleme
newParticipant.hearingRoleCode = this.hearingRoles.find(h => h.name === this.role.value)?.code;

newParticipant.email = this.searchEmail ? this.searchEmail.email : '';
newParticipant.display_Name = this.displayName.value;
newParticipant.displayName = this.displayName.value;
if (this.isRoleRepresentative(this.role.value)) {
newParticipant.company = this.companyName.value;
} else {
Expand Down Expand Up @@ -766,7 +766,7 @@ export class AddParticipantComponent extends AddParticipantBaseDirective impleme
private addLinkedParticipant(newParticipant: VHParticipant): void {
if (newParticipant.interpreterFor) {
const interpretee = this.getInterpretee(newParticipant.interpreterFor);
newParticipant.interpreteeName = interpretee.display_Name;
newParticipant.interpreteeName = interpretee.displayName;
const linkedParticipant: LinkedParticipantModel = {
participantEmail: newParticipant.email,
linkedParticipantEmail: interpretee.email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { HearingRoles } from 'src/app/common/model/hearing-roles.model';
function initHearingRequest(): VHBooking {
const participants: VHParticipant[] = [];
const p1 = new VHParticipant();
p1.display_Name = 'display name1';
p1.displayName = 'display name1';
p1.email = '[email protected]';
p1.contactEmail = '[email protected]';
p1.firstName = 'first';
Expand All @@ -39,7 +39,7 @@ function initHearingRequest(): VHBooking {
p1.hearingRoleName = 'Judge';

const p2 = new VHParticipant();
p2.display_Name = 'display name2';
p2.displayName = 'display name2';
p2.email = '[email protected]';
p2.contactEmail = '[email protected]';
p2.firstName = 'first2';
Expand Down Expand Up @@ -297,8 +297,8 @@ describe('AssignJudgeComponent', () => {
component.judgeDisplayNameFld.setValue('<script>' + displayNameSanitized + '</script>');
component.changeDisplayName();
expect(component.judgeDisplayNameFld.value).toBe(displayNameSanitized);
expect(component.judge.display_Name).toBe(displayNameSanitized);
expect(component.hearing.participants.find(x => x.isJudge).display_Name).toBe(displayNameSanitized);
expect(component.judge.displayName).toBe(displayNameSanitized);
expect(component.hearing.participants.find(x => x.isJudge).displayName).toBe(displayNameSanitized);
});

it('should unsubscribe all subcriptions on destroy component', () => {
Expand Down Expand Up @@ -351,14 +351,14 @@ describe('AssignJudgeComponent', () => {
const judge = new VHParticipant();
judge.username = 'JudgeUserName';
judge.email = 'JudgeEmail';
judge.display_Name = 'JudgeDisplayName';
judge.displayName = 'JudgeDisplayName';
judge.phone = 'JudgePhone';
judge.isCourtroomAccount = true;

const alternateJudge = new VHParticipant();
alternateJudge.username = 'AlternateJudgeUserName';
alternateJudge.email = 'AlternateJudgeEmail';
alternateJudge.display_Name = 'AlternateJudgeDisplayName';
alternateJudge.displayName = 'AlternateJudgeDisplayName';
alternateJudge.phone = 'AlternateJudgePhone';
alternateJudge.hearingRoleName = Constants.HearingRoles.Judge;

Expand Down Expand Up @@ -401,7 +401,7 @@ describe('AssignJudgeComponent', () => {
});

it('should set correct validation errors if display name is null', () => {
component.judge.display_Name = null;
component.judge.displayName = null;

component.saveJudge();
expect(component.isJudgeParticipantError).toBe(false);
Expand All @@ -410,7 +410,7 @@ describe('AssignJudgeComponent', () => {
});

it('should set correct validation errors if display name is null', () => {
component.judge.display_Name = null;
component.judge.displayName = null;

component.saveJudge();
expect(component.isJudgeParticipantError).toBe(false);
Expand Down Expand Up @@ -551,7 +551,7 @@ describe('AssignJudgeComponent', () => {
beforeEach(() => {
const updatedJudgeDisplayName = 'UpdatedJudgeDisplayName';
videoHearingsServiceSpy.canAddJudge.and.returnValue(true);
component.judge.display_Name = updatedJudgeDisplayName;
component.judge.displayName = updatedJudgeDisplayName;
});

it('should add judge account when none present', () => {
Expand All @@ -569,7 +569,7 @@ describe('AssignJudgeComponent', () => {

expect(updatedJudges.length).toBe(1);
expect(component.courtAccountJudgeEmail).toEqual(judge.username);
expect(component.judgeDisplayNameFld.value).toEqual(judge.display_Name);
expect(component.judgeDisplayNameFld.value).toEqual(judge.displayName);
expect(updatedJudges[0]).toBe(judge);
expect(updatedJudges[0].hearingRoleCode).toBe(Constants.HearingRoleCodes.Judge);

Expand All @@ -578,7 +578,7 @@ describe('AssignJudgeComponent', () => {
});
});
afterEach(() => {
expect(component.judgeDisplayNameFld.value).toEqual(judge.display_Name);
expect(component.judgeDisplayNameFld.value).toEqual(judge.displayName);
expect(component.judgeEmailFld.value).toEqual(otherInformationDetailsJudgeEmail);
expect(component.judgePhoneFld.value).toEqual(otherInformationDetailsJudgePhone);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class AssignJudgeComponent extends BookingBaseComponent implements OnInit
const staffMemberExists = this.hearing?.participants.find(x => x.hearingRoleName === Constants.HearingRoles.StaffMember);

this.showAddStaffMemberFld = new FormControl(!!staffMemberExists);
this.judgeDisplayNameFld = new FormControl(this.judge?.display_Name, {
this.judgeDisplayNameFld = new FormControl(this.judge?.displayName, {
validators: [Validators.required, Validators.pattern(Constants.TextInputPatternDisplayName), Validators.maxLength(255)],
updateOn: 'blur'
});
Expand Down Expand Up @@ -161,7 +161,7 @@ export class AssignJudgeComponent extends BookingBaseComponent implements OnInit
}),
this.judgeDisplayNameFld.valueChanges.subscribe(name => {
if (this.judge) {
this.judge.display_Name = name;
this.judge.displayName = name;
}
}),
this.judgeEmailFld.valueChanges.subscribe(email => {
Expand Down Expand Up @@ -213,10 +213,10 @@ export class AssignJudgeComponent extends BookingBaseComponent implements OnInit
const text = SanitizeInputText(this.judgeDisplayNameFld.value);
this.judgeDisplayNameFld.setValue(text);

if (this.judge?.display_Name) {
if (this.judge?.displayName) {
const judge = this.hearing.participants.find(x => x.isJudge);
if (judge) {
this.hearing.participants.find(x => x.isJudge).display_Name = this.judge.display_Name;
this.hearing.participants.find(x => x.isJudge).displayName = this.judge.displayName;
}
}
}
Expand Down Expand Up @@ -245,13 +245,13 @@ export class AssignJudgeComponent extends BookingBaseComponent implements OnInit
this.logger.debug(`${this.loggerPrefix} Attempting to save judge.`);

if (this.judge?.email) {
if (!this.judge.display_Name) {
if (!this.judge.displayName) {
this.logger.warn(`${this.loggerPrefix} No judge selected. Display name not set.`);
this.failedSubmission = true;
return;
}

if (!this.hearingService.canAddJudge(this.judge.display_Name)) {
if (!this.hearingService.canAddJudge(this.judge.displayName)) {
this.logger.warn(`${this.loggerPrefix} Judge could not be a panel member or winger in the same hearing.`);
this.isJudgeParticipantError = true;
this.failedSubmission = true;
Expand Down Expand Up @@ -364,7 +364,7 @@ export class AssignJudgeComponent extends BookingBaseComponent implements OnInit

private setTextFieldValues() {
if (this.isJudgeSelected) {
this.judgeDisplayNameFld.setValue(this.judge.display_Name);
this.judgeDisplayNameFld.setValue(this.judge.displayName);
let judgeEmail = '';
if (this.displayEmailField) {
judgeEmail = this.otherInformationDetails.JudgeEmail;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function initHearingRequest(): VHBooking {
firstName: 'John',
lastName: 'Doe',
email: '[email protected]',
display_Name: 'John Doe',
displayName: 'John Doe',
userRoleName: 'Representative',
interpretation_language: undefined
}),
Expand All @@ -34,7 +34,7 @@ function initHearingRequest(): VHBooking {
firstName: 'Chris',
lastName: 'Green',
email: 'chris@green,com',
display_Name: 'Chris Green',
displayName: 'Chris Green',
userRoleName: 'Representative',
interpretation_language: undefined
}),
Expand All @@ -43,7 +43,7 @@ function initHearingRequest(): VHBooking {
firstName: 'Jane',
lastName: 'Smith',
email: '[email protected]',
display_Name: 'Jane Smith',
displayName: 'Jane Smith',
userRoleName: 'Individual',
interpretation_language: undefined
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class EndpointsComponent extends BookingBaseComponent implements OnInit,
displayName: e.displayName,
defenceAdvocate: defenceAdvocate
? {
displayName: defenceAdvocate?.display_Name,
displayName: defenceAdvocate?.displayName,
email: defenceAdvocate?.email
}
: null,
Expand Down
Loading

0 comments on commit f0087aa

Please sign in to comment.