Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions webroot/src/components/Licensee/LicenseeList/LicenseeList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,22 @@ class LicenseeList extends Vue {
}

get headerRecord() {
const cosmetologySpecificColumns = {
licenseNumber: this.$t('licensing.stateLicenseNumber'),
...(this.isPublicSearch)
? {
isPublicSearch: true,
eligibilityDisplay: () => this.$t('licensing.compactRestriction'),
isRestricted: () => false,
}
: {}
};
const record = {
firstName: this.$t('common.firstName'),
lastName: this.$t('common.lastName'),
homeJurisdictionDisplay: () => this.$t('licensing.homeState'),
...(this.isAppModeCosmetology
Comment thread
jlkravitz marked this conversation as resolved.
? {
licenseNumber: this.$t('licensing.stateLicenseNumber'),
}
? { ...cosmetologySpecificColumns }
: {
privilegeStatesDisplay: () => this.$t('licensing.privileges'),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,29 @@ class LicenseeList extends Vue {
return options;
}

get listDescriptionText(): string {
return (this.isAppModeCosmetology)
? this.$t('licensing.licensingListDescriptionCosm')
: this.$t('licensing.licensingListDescription');
}

get headerRecord() {
const cosmetologySpecificColumns = {
licenseNumber: this.$t('licensing.stateLicenseNumber'),
...(this.isPublicSearch)
? {
isPublicSearch: true,
eligibilityDisplay: () => this.$t('licensing.compactRestriction'),
isRestricted: () => false,
}
: {}
};
const record = {
firstName: this.$t('common.firstName'),
lastName: this.$t('common.lastName'),
homeJurisdictionDisplay: () => this.$t('licensing.homeState'),
...(this.isAppModeCosmetology
? {
licenseNumber: this.$t('licensing.stateLicenseNumber'),
}
? { ...cosmetologySpecificColumns }
: {
privilegeStatesDisplay: () => this.$t('licensing.privileges'),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</button>
</div>
</div>
<div class="list-description">{{ $t('licensing.licensingListDescription')}}</div>
<div class="list-description">{{ listDescriptionText }}</div>
<ListContainer
:listId="listId"
:listData="this.licenseStore.model"
Expand Down
17 changes: 17 additions & 0 deletions webroot/src/components/Licensee/LicenseeRow/LicenseeRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@
'desc': isSortOptionDescending('licenseNumber'),
}"></span>
</div>
<div
v-if="isAppModeCosmetology && (isPublicSearch || item.isPublicSearch)"
class="cell license-eligibility"
:class="{ 'is-sort-enabled': isSortOptionEnabled('licenseEligibility') }"
@click="isSortOptionEnabled('licenseEligibility') && handleSortSelect('licenseEligibility')"
@keyup.enter="isSortOptionEnabled('licenseEligibility') && handleSortSelect('licenseEligibility')"
:tabindex="(isHeaderRow && isSortOptionEnabled('licenseEligibility')) ? 0 : -1"
:role="(isHeaderRow) ? 'columnheader' : 'cell'"
>
<span v-if="$matches.phone.only" class="cell-title">{{ $t('licensing.compactRestriction') }}:</span>
<span :class="{ alert: item.isRestricted() }">{{ item.eligibilityDisplay() }}</span>
<span v-if="isSortOptionEnabled('licenseEligibility')" class="sort-icon" :class="{
'is-selected': isSortOptionSelected('licenseEligibility'),
'asc': isSortOptionAscending('licenseEligibility'),
'desc': isSortOptionDescending('licenseEligibility'),
}"></span>
</div>
</div>
</template>

Expand Down
5 changes: 5 additions & 0 deletions webroot/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@
"inactive": "Inactive",
"initializing": "Initializing"
},
"restrictionOptions": {
"eligible": "No restrictions",
"ineligible": "Alert: Restricted"
},
"licenseActions": "License actions",
"privilegeActions": "Privilege actions",
"privilegeActionsNone": "No available actions",
Expand Down Expand Up @@ -950,6 +954,7 @@
"personalInfoTitle": "Personal information",
"eventNodeLabel": "Event: {eventNameDisplay} on {eventDate}",
"statusBlockLabel": "{status} status block",
"compactRestriction": "Restriction",
"compactEligible": "Compact Eligible",
"notCompactEligible": "Not Compact Eligible",
"privilegeVerification": "Privilege Verification",
Expand Down
5 changes: 5 additions & 0 deletions webroot/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,10 @@
"inactive": "Inactivo",
"initializing": "Inicializando"
},
"restrictionOptions": {
"eligible": "Sin restricciones",
"ineligible": "Alerta: Restringido"
},
"licenseActions": "Acciones de licencia",
"privilegeActions": "Acciones de privilegio",
"privilegeActionsNone": "No hay acciones disponibles",
Expand Down Expand Up @@ -934,6 +938,7 @@
"personalInfoTitle": "Información personal",
"eventNodeLabel": "Evento: {eventNameDisplay} en {eventDate}",
"statusBlockLabel": "{status} bloque de estado",
"compactRestriction": "Restricción",
"compactEligible": "Elegible Compacto",
"notCompactEligible": "No Compacto Elegible",
"privilegeVerification": "Verificación de privilegios",
Expand Down
15 changes: 14 additions & 1 deletion webroot/src/models/Licensee/Licensee.model.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import chai, { expect } from 'chai';
import chaiMatchPattern from 'chai-match-pattern';
import { serverDateFormat, serverDatetimeFormat, displayDateFormat } from '@/app.config';
import { CompactType } from '@models/Compact/Compact.model';
import { Licensee, LicenseeStatus, LicenseeSerializer } from '@models/Licensee/Licensee.model';
import {
Licensee,
LicenseeStatus,
LicenseeEligibility,
LicenseeSerializer
} from '@models/Licensee/Licensee.model';
import { Address } from '@models/Address/Address.model';
import {
License,
Expand Down Expand Up @@ -80,6 +85,8 @@ describe('Licensee model', () => {
expect(licensee.privilegeStatesDisplay()).to.equal('');
expect(licensee.licenseTypeName()).to.equal('');
expect(licensee.statusDisplay()).to.equal('Inactive');
expect(licensee.eligibilityDisplay()).to.equal('');
expect(licensee.isRestricted()).to.equal(false);
expect(licensee.phoneNumberDisplay()).to.equal('');
expect(licensee.isMilitaryStatusActive()).to.equal(false);
expect(licensee.activeMilitaryAffiliation()).to.equal(null);
Expand Down Expand Up @@ -156,6 +163,7 @@ describe('Licensee model', () => {
adverseActions: [new AdverseAction()],
lastUpdated: '2020-01-01',
status: LicenseeStatus.ACTIVE,
eligibility: LicenseeEligibility.INELIGIBLE,
};
const licensee = new Licensee(data);

Expand Down Expand Up @@ -202,6 +210,8 @@ describe('Licensee model', () => {
expect(licensee.privilegeStatesDisplay()).to.equal('Unknown');
expect(licensee.licenseTypeName()).to.equal('Audiologist');
expect(licensee.statusDisplay()).to.equal('Active');
expect(licensee.eligibilityDisplay()).to.equal('Alert: Restricted');
expect(licensee.isRestricted()).to.equal(true);
expect(licensee.phoneNumberDisplay()).to.equal('+1 323-455-8990');
expect(licensee.isMilitaryStatusActive()).to.equal(false);
expect(licensee.activeMilitaryAffiliation()).to.equal(null);
Expand Down Expand Up @@ -429,6 +439,7 @@ describe('Licensee model', () => {
],
dateOfUpdate: moment().format(serverDateFormat),
licenseStatus: LicenseeStatus.ACTIVE,
licenseEligibility: LicenseeEligibility.ELIGIBLE,
adverseActions: [
{
adverseActionId: 'test-adverseAction-id',
Expand Down Expand Up @@ -495,6 +506,8 @@ describe('Licensee model', () => {
expect(licensee.privilegeStatesDisplay()).to.equal('Colorado');
expect(licensee.licenseTypeName()).to.equal('Audiologist');
expect(licensee.statusDisplay()).to.equal('Active');
expect(licensee.eligibilityDisplay()).to.equal('No restrictions');
expect(licensee.isRestricted()).to.equal(false);
expect(licensee.phoneNumberDisplay()).to.equal('+1 323-455-8990');
expect(licensee.isMilitaryStatusActive()).to.equal(true);
expect(licensee.activeMilitaryAffiliation()).to.matchPattern({
Expand Down
16 changes: 16 additions & 0 deletions webroot/src/models/Licensee/Licensee.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export enum LicenseeStatus {
INACTIVE = 'inactive',
}

export enum LicenseeEligibility {
ELIGIBLE = 'eligible',
INELIGIBLE = 'ineligible',
}

export interface InterfaceLicensee {
id?: string | null;
npi?: string | null;
Expand All @@ -61,6 +66,7 @@ export interface InterfaceLicensee {
adverseActions?: Array<AdverseAction>;
lastUpdated?: string | null;
status?: LicenseeStatus;
eligibility?: LicenseeEligibility | null;
}

// ========================================================
Expand Down Expand Up @@ -93,6 +99,7 @@ export class Licensee implements InterfaceLicensee {
public adverseActions? = [];
public lastUpdated? = null;
public status? = LicenseeStatus.INACTIVE;
public eligibility? = null;

constructor(data?: InterfaceLicensee) {
const cleanDataObject = deleteUndefinedProperties(data);
Expand Down Expand Up @@ -201,6 +208,14 @@ export class Licensee implements InterfaceLicensee {
return this.$t(`licensing.statusOptions.${this.status}`);
}

public eligibilityDisplay(): string {
return (this.eligibility) ? this.$t(`licensing.restrictionOptions.${this.eligibility}`) : '';
}

public isRestricted(): boolean {
return Boolean(this.eligibility && this.eligibility === LicenseeEligibility.INELIGIBLE);
}

public phoneNumberDisplay(): string {
return this.phoneNumber ? formatPhoneNumber(stripPhoneNumber(this.phoneNumber)) : '';
}
Expand Down Expand Up @@ -444,6 +459,7 @@ export class LicenseeSerializer {
militaryStatus: json.militaryStatus,
militaryStatusNote: json.militaryStatusNote,
status: json.licenseStatus,
eligibility: json.licenseEligibility,
lastUpdated: json.dateOfUpdate,
};

Expand Down
2 changes: 2 additions & 0 deletions webroot/src/network/mocks/mock.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ export const licensees = {
militaryStatus: 'approved',
militaryStatusNote: 'All the docs look good!',
licenseStatus: 'active',
licenseEligibility: 'eligible', // COSM list fetch
licenseJurisdiction: 'co',
currentHomeJurisdiction: 'co',
npi: '1234567890',
Expand Down Expand Up @@ -682,6 +683,7 @@ export const licensees = {
militaryStatus: 'declined',
militaryStatusNote: 'Could not view the required docs. Please upload new copies.',
licenseStatus: 'active',
licenseEligibility: 'ineligible', // COSM list fetch
licenseJurisdiction: 'co',
currentHomeJurisdiction: 'co',
npi: '6441445289',
Expand Down
13 changes: 13 additions & 0 deletions webroot/src/store/license/license.mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ export default {
.findIndex((p: any) => p.id === licensee.id);

if (licenseeToUpdateIndex !== -1) {
const currentLicenseeRecord = state.model[licenseeToUpdateIndex];
const listFetchOnlyProps = ['licenseNumber', 'eligibility'];

// Some props are only returned on the list fetch, and we want to preserve those where possible.
listFetchOnlyProps.forEach((listFetchOnlyProp) => {
const isCurrentRecordIncludingProp = Object.hasOwn(currentLicenseeRecord, listFetchOnlyProp);
const isNewRecordMissingProp = Object.hasOwn(licensee, listFetchOnlyProp);

if (isCurrentRecordIncludingProp && isNewRecordMissingProp) {
licensee[listFetchOnlyProp] = currentLicenseeRecord[listFetchOnlyProp];
}
});

state.model.splice(licenseeToUpdateIndex, 1, licensee);
} else {
state.model.push(licensee);
Expand Down
5 changes: 5 additions & 0 deletions webroot/src/styles.common/_lists.less
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@
margin-right: 0.4rem;
font-weight: @fontWeightBold;
}

.alert {
color: @midRed;
font-weight: @fontWeightBold;
}
}

.sort-icon {
Expand Down
Loading