Merge pull request #1077 from Safelite/feature/digital/INSR-7930

INSR-7930 Implement Client Possessive logic
This commit is contained in:
Josh Dassinger 2026-02-13 12:25:43 -06:00 committed by GitHub
commit 0fa275f8b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 0 deletions

View file

@ -133,3 +133,20 @@ export function formatDate(date, formatter) {
}
return '';
}
/**
* @function toPossessive
* @param {string | null} input
* @returns {string}
*/
export function toPossessive(input) {
if (input == null || input.trim().length === 0) {
return input;
}
if (input.toLowerCase().endsWith("s")) {
return `${input}'`
}
return `${input}'s`
}

View file

@ -144,6 +144,7 @@ describe('entry-page.vue', () => {
TPAEnabled: true,
ClientFullName: 'Full Name',
ClientDisplayName: 'Display Name',
ClientPossessiveName: 'Display Name\'s',
ClaimRegistrationRequired: true,
EnableNoCompQuote: true
})
@ -153,6 +154,7 @@ describe('entry-page.vue', () => {
expect(issConfig.clientName).toBe('TestClient');
expect(issConfig.clientFullName).toBe('Full Name');
expect(issConfig.clientDisplayName).toBe('Display Name');
expect(issConfig.clientPossessiveName).toBe('Display Name\'s');
expect(issConfig.parentAccountNumber).toBe('12345');
expect(issConfig.styleSheet).toBe('test-style');
expect(issConfig.isCoverageEnabled).toBe(true);

View file

@ -14,6 +14,7 @@ import { getISSCookie, updateOrCreateISSCookie } from '@/helpers/cookie-helper.j
import { useMainStore } from '@/store';
import showIssLoadingModal from '@/helpers/loading-modal-helper';
import applicationConfig from '@/constants/application-config';
import { toPossessive } from '@/helpers/text-helper';
export default {
name: 'entry-page',
@ -144,6 +145,7 @@ export default {
this.mainStore.issConfig.clientName = data.accountName;
this.mainStore.issConfig.clientFullName = data.accountName; // Defaults to use the client name.
this.mainStore.issConfig.clientDisplayName = data.accountName; // Defaults to use the client name.
this.mainStore.issConfig.clientPossessiveName = toPossessive(data.accountName); // Defaults to use the client name.
this.mainStore.issConfig.parentAccountNumber = data.parentAccountNumber;
this.mainStore.issConfig.styleSheet = data.styleSheet;
this.mainStore.issConfig.isCoverageEnabled = data.coverageEnabled;
@ -163,6 +165,11 @@ export default {
if (clientFlags.ClientDisplayName != null) {
this.mainStore.issConfig.clientDisplayName = clientFlags.ClientDisplayName;
this.mainStore.issConfig.clientPossessiveName = toPossessive(clientFlags.ClientDisplayName);
}
if (clientFlags.ClientPossessiveName != null) {
this.mainStore.issConfig.clientPossessiveName = clientFlags.ClientPossessiveName;
}
if (clientFlags.ClaimRegistrationRequired) {

View file

@ -247,6 +247,7 @@ export const getDefaultState = () => ({
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
clientFullName: 'Generic Insurance', // this is the default and will be overriden by the client's name or client's full name.
clientDisplayName: 'Generic Insurance', // this is the default and will be overridden by the client's name or client display name.
clientPossessiveName: 'Generic Insurance\'s', // this is the default and will be overridden by the client's name or client display name converted to possessive or the clients possessive name.
clientHeader: {},
styleSheet: '', // Stylesheet used by the client.
parentAccountNumber: 0, // Parent account number used by the client.