Skip to content

Commit

Permalink
Merge pull request #860 from fecgov/patch/contacts-last-first
Browse files Browse the repository at this point in the history
patch/contacts-last-first
  • Loading branch information
mjtravers authored Feb 9, 2023
2 parents 0fdecc7 + 3c9de9a commit b18153c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('ContactListComponent', () => {

it('#displayName returns the contact name', () => {
let name = component.displayName(contact);
expect(name).toBe('Jane Smith');
expect(name).toBe('Smith, Jane');

contact.type = ContactTypes.ORGANIZATION;
name = component.displayName(contact);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class ContactListComponent extends TableListBaseComponent<Contact> {
*/
public displayName(item: Contact): string {
if ([ContactTypes.INDIVIDUAL, ContactTypes.CANDIDATE].includes(item.type)) {
return `${item.first_name} ${item.last_name}`;
return `${item.last_name}, ${item.first_name}`;
} else {
return item.name || '';
}
Expand Down

0 comments on commit b18153c

Please sign in to comment.