From f835fea81392468f5dfea2173ae3ae7836f0c256 Mon Sep 17 00:00:00 2001 From: John Sandoval Date: Tue, 14 Apr 2026 12:40:01 -0600 Subject: [PATCH 1/5] WIP: Cosmo encumber updates --- .../components/LicenseCard/LicenseCard.less | 2 +- .../src/components/LicenseCard/LicenseCard.ts | 81 ++++++++++++++++--- .../components/LicenseCard/LicenseCard.vue | 9 ++- .../PrivilegeCard/PrivilegeCard.less | 2 +- .../components/PrivilegeCard/PrivilegeCard.ts | 73 ++++++++++++++--- .../PrivilegeCard/PrivilegeCard.vue | 9 ++- webroot/src/locales/en.json | 9 +++ webroot/src/locales/es.json | 5 ++ webroot/src/network/mocks/mock.data.api.ts | 1 + 9 files changed, 161 insertions(+), 30 deletions(-) diff --git a/webroot/src/components/LicenseCard/LicenseCard.less b/webroot/src/components/LicenseCard/LicenseCard.less index 3e19bdecf..dc84a28fa 100644 --- a/webroot/src/components/LicenseCard/LicenseCard.less +++ b/webroot/src/components/LicenseCard/LicenseCard.less @@ -377,7 +377,7 @@ flex-direction: column; width: 100%; - &:not(:last-child) { + &:first-child { margin-bottom: 1.2rem; } diff --git a/webroot/src/components/LicenseCard/LicenseCard.ts b/webroot/src/components/LicenseCard/LicenseCard.ts index 07807a013..8839d0423 100644 --- a/webroot/src/components/LicenseCard/LicenseCard.ts +++ b/webroot/src/components/LicenseCard/LicenseCard.ts @@ -103,6 +103,14 @@ class LicenseCard extends mixins(MixinForm) { return this.$store.state.user; } + get isAppModeJcc(): boolean { + return this.$store.getters.isAppModeJcc; + } + + get isAppModeCosmetology(): boolean { + return this.$store.getters.isAppModeCosmetology; + } + get currentUser(): StaffUser { return this.userStore.model; } @@ -243,11 +251,17 @@ class LicenseCard extends mixins(MixinForm) { } get encumberDisciplineOptions(): Array<{ value: string, name: string | ComputedRef }> { - const options = this.$tm('licensing.disciplineTypes').map((disciplineType) => ({ + let options = this.$tm('licensing.disciplineTypes').map((disciplineType) => ({ value: disciplineType.key, name: disciplineType.name, })); + if (this.isAppModeCosmetology) { + const includeList = ['suspension', 'revocation', 'surrender of license']; + + options = options.filter((option) => includeList.includes(option.value)); + } + options.unshift({ value: '', name: computed(() => this.$t('common.selectOption')), @@ -257,10 +271,38 @@ class LicenseCard extends mixins(MixinForm) { } get npdbCategoryOptions(): Array<{ value: string, name: string | ComputedRef }> { - return this.$tm('licensing.npdbTypes').map((npdbType) => ({ + const { isAppModeJcc, isAppModeCosmetology } = this; + let options = this.$tm('licensing.npdbTypes').map((npdbType) => ({ value: npdbType.key, name: npdbType.name, })); + + if (isAppModeJcc) { + const excludeList = ['Fraud', 'Consumer Harm']; + + options = options.filter((option) => !excludeList.includes(option.value)); + } else if (isAppModeCosmetology) { + const includeList = ['Fraud', 'Consumer Harm', 'Other']; + + options = options + .filter((option) => includeList.includes(option.value)) + .map((option) => { + option.value = option.value?.toLowerCase(); + + return option; + }); + + options.unshift({ + value: '', + name: computed(() => this.$t('common.selectOption')), + }); + } + + return options; + } + + get shouldAllowNpdbMultiSelect(): boolean { + return this.isAppModeJcc; } get endInvestigationModalTitle(): string { @@ -314,10 +356,16 @@ class LicenseCard extends mixins(MixinForm) { encumberModalNpdbCategories: new FormInput({ id: 'npdb-categories', name: 'npdb-categories', - label: computed(() => this.$t('licensing.npdbCategoryLabel')), - validation: Joi.array().min(1).messages(this.joiMessages.array), + label: (this.shouldAllowNpdbMultiSelect) + ? computed(() => this.$t('licensing.npdbCategoryLabel')) + : computed(() => this.$t('licensing.encumberBasisLabel')), + validation: (this.shouldAllowNpdbMultiSelect) + ? Joi.array().min(1).messages(this.joiMessages.array) + : Joi.string().required().messages(this.joiMessages.string), valueOptions: this.npdbCategoryOptions, - value: [], + value: (this.shouldAllowNpdbMultiSelect) + ? [] + : '', }), encumberModalStartDate: new FormInput({ id: 'encumber-start', @@ -482,7 +530,8 @@ class LicenseCard extends mixins(MixinForm) { currentCompactType: compactType, licenseeId, stateAbbrev, - licenseTypeAbbrev + licenseTypeAbbrev, + formData } = this; if (this.selectedInvestigation) { @@ -496,9 +545,11 @@ class LicenseCard extends mixins(MixinForm) { licenseType: licenseTypeAbbrev.toLowerCase(), investigationId, encumbrance: { - encumbranceType: this.formData.encumberModalDisciplineAction.value, - npdbCategories: this.formData.encumberModalNpdbCategories.value, - startDate: this.formData.encumberModalStartDate.value, + encumbranceType: formData.encumberModalDisciplineAction.value, + npdbCategories: (Array.isArray(formData.encumberModalNpdbCategories.value)) + ? formData.encumberModalNpdbCategories.value + : [formData.encumberModalNpdbCategories.value], + startDate: formData.encumberModalNpdbCategories.value, }, }).catch((err) => { this.modalErrorMessage = err?.message || this.$t('common.error'); @@ -511,9 +562,11 @@ class LicenseCard extends mixins(MixinForm) { licenseeId, licenseState: stateAbbrev, licenseType: licenseTypeAbbrev.toLowerCase(), - encumbranceType: this.formData.encumberModalDisciplineAction.value, - npdbCategories: this.formData.encumberModalNpdbCategories.value, - startDate: this.formData.encumberModalStartDate.value, + encumbranceType: formData.encumberModalDisciplineAction.value, + npdbCategories: (Array.isArray(formData.encumberModalNpdbCategories.value)) + ? formData.encumberModalNpdbCategories.value + : [formData.encumberModalNpdbCategories.value], + startDate: formData.encumberModalStartDate.value, }).catch((err) => { this.modalErrorMessage = err?.message || this.$t('common.error'); this.isFormError = true; @@ -952,7 +1005,9 @@ class LicenseCard extends mixins(MixinForm) { this.validateAll({ asTouched: true }); } else if (this.isEncumberLicenseModalDisplayed) { this.formData.encumberModalDisciplineAction.value = this.encumberDisciplineOptions[1]?.value; - this.formData.encumberModalNpdbCategories.value = [this.npdbCategoryOptions[1]?.value]; + this.formData.encumberModalNpdbCategories.value = (this.shouldAllowNpdbMultiSelect) + ? [this.npdbCategoryOptions[1]?.value] + : this.npdbCategoryOptions[1]?.value; this.formData.encumberModalStartDate.value = moment().format('YYYY-MM-DD'); await nextTick(); this.validateAll({ asTouched: true }); diff --git a/webroot/src/components/LicenseCard/LicenseCard.vue b/webroot/src/components/LicenseCard/LicenseCard.vue index 1f415d33f..501f9c5a7 100644 --- a/webroot/src/components/LicenseCard/LicenseCard.vue +++ b/webroot/src/components/LicenseCard/LicenseCard.vue @@ -155,7 +155,14 @@
- + +
}> { - const options = this.$tm('licensing.disciplineTypes').map((disciplineType) => ({ + let options = this.$tm('licensing.disciplineTypes').map((disciplineType) => ({ value: disciplineType.key, name: disciplineType.name, })); + if (this.isAppModeCosmetology) { + const includeList = ['suspension', 'revocation', 'surrender of license']; + + options = options.filter((option) => includeList.includes(option.value)); + } + options.unshift({ value: '', name: computed(() => this.$t('common.selectOption')), @@ -237,10 +243,38 @@ class PrivilegeCard extends mixins(MixinForm) { } get npdbCategoryOptions(): Array<{ value: string, name: string | ComputedRef }> { - return this.$tm('licensing.npdbTypes').map((npdbType) => ({ + const { isAppModeJcc, isAppModeCosmetology } = this; + let options = this.$tm('licensing.npdbTypes').map((npdbType) => ({ value: npdbType.key, name: npdbType.name, })); + + if (isAppModeJcc) { + const excludeList = ['Fraud', 'Consumer Harm']; + + options = options.filter((option) => !excludeList.includes(option.value)); + } else if (isAppModeCosmetology) { + const includeList = ['Fraud', 'Consumer Harm', 'Other']; + + options = options + .filter((option) => includeList.includes(option.value)) + .map((option) => { + option.value = option.value?.toLowerCase(); + + return option; + }); + + options.unshift({ + value: '', + name: computed(() => this.$t('common.selectOption')), + }); + } + + return options; + } + + get shouldAllowNpdbMultiSelect(): boolean { + return this.isAppModeJcc; } get endInvestigationModalTitle(): string { @@ -314,10 +348,16 @@ class PrivilegeCard extends mixins(MixinForm) { encumberModalNpdbCategories: new FormInput({ id: 'npdb-categories', name: 'npdb-categories', - label: computed(() => this.$t('licensing.npdbCategoryLabel')), - validation: Joi.array().min(1).messages(this.joiMessages.array), + label: (this.shouldAllowNpdbMultiSelect) + ? computed(() => this.$t('licensing.npdbCategoryLabel')) + : computed(() => this.$t('licensing.encumberBasisLabel')), + validation: (this.shouldAllowNpdbMultiSelect) + ? Joi.array().min(1).messages(this.joiMessages.array) + : Joi.string().required().messages(this.joiMessages.string), valueOptions: this.npdbCategoryOptions, - value: [], + value: (this.shouldAllowNpdbMultiSelect) + ? [] + : '', }), encumberModalStartDate: new FormInput({ id: 'encumber-start', @@ -546,7 +586,8 @@ class PrivilegeCard extends mixins(MixinForm) { currentCompactType: compactType, licenseeId, stateAbbrev, - privilegeTypeAbbrev + privilegeTypeAbbrev, + formData } = this; if (this.selectedInvestigation) { @@ -560,9 +601,11 @@ class PrivilegeCard extends mixins(MixinForm) { licenseType: privilegeTypeAbbrev.toLowerCase(), investigationId, encumbrance: { - encumbranceType: this.formData.encumberModalDisciplineAction.value, - npdbCategories: this.formData.encumberModalNpdbCategories.value, - startDate: this.formData.encumberModalStartDate.value, + encumbranceType: formData.encumberModalDisciplineAction.value, + npdbCategories: (Array.isArray(formData.encumberModalNpdbCategories.value)) + ? formData.encumberModalNpdbCategories.value + : [formData.encumberModalNpdbCategories.value], + startDate: formData.encumberModalStartDate.value, }, }).catch((err) => { this.modalErrorMessage = err?.message || this.$t('common.error'); @@ -575,9 +618,11 @@ class PrivilegeCard extends mixins(MixinForm) { licenseeId, privilegeState: stateAbbrev, licenseType: privilegeTypeAbbrev.toLowerCase(), - encumbranceType: this.formData.encumberModalDisciplineAction.value, - npdbCategories: this.formData.encumberModalNpdbCategories.value, - startDate: this.formData.encumberModalStartDate.value, + encumbranceType: formData.encumberModalDisciplineAction.value, + npdbCategories: (Array.isArray(formData.encumberModalNpdbCategories.value)) + ? formData.encumberModalNpdbCategories.value + : [formData.encumberModalNpdbCategories.value], + startDate: formData.encumberModalStartDate.value, }).catch((err) => { this.modalErrorMessage = err?.message || this.$t('common.error'); this.isFormError = true; @@ -1015,7 +1060,9 @@ class PrivilegeCard extends mixins(MixinForm) { this.validateAll({ asTouched: true }); } else if (this.isEncumberPrivilegeModalDisplayed) { this.formData.encumberModalDisciplineAction.value = this.encumberDisciplineOptions[1]?.value; - this.formData.encumberModalNpdbCategories.value = [this.npdbCategoryOptions[1]?.value]; + this.formData.encumberModalNpdbCategories.value = (this.shouldAllowNpdbMultiSelect) + ? [this.npdbCategoryOptions[1]?.value] + : this.npdbCategoryOptions[1]?.value; this.formData.encumberModalStartDate.value = moment().format('YYYY-MM-DD'); await nextTick(); this.validateAll({ asTouched: true }); diff --git a/webroot/src/components/PrivilegeCard/PrivilegeCard.vue b/webroot/src/components/PrivilegeCard/PrivilegeCard.vue index 529035a05..95da31cee 100644 --- a/webroot/src/components/PrivilegeCard/PrivilegeCard.vue +++ b/webroot/src/components/PrivilegeCard/PrivilegeCard.vue @@ -216,7 +216,14 @@
- + +
Date: Tue, 14 Apr 2026 12:46:27 -0600 Subject: [PATCH 2/5] Update follow-redirects dep --- webroot/yarn.lock | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/webroot/yarn.lock b/webroot/yarn.lock index 261e4ec28..d169d67ba 100644 --- a/webroot/yarn.lock +++ b/webroot/yarn.lock @@ -6688,15 +6688,10 @@ flush-promises@^1.0.2: resolved "https://registry.yarnpkg.com/flush-promises/-/flush-promises-1.0.2.tgz#4948fd58f15281fed79cbafc86293d5bb09b2ced" integrity sha512-G0sYfLQERwKz4+4iOZYQEZVpOt9zQrlItIxQAAYAWpfby3gbHrx0osCHz5RLl/XoXevXk0xoN4hDFky/VV9TrA== -follow-redirects@^1.0.0: - version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== - -follow-redirects@^1.15.11: - version "1.15.11" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" - integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== +follow-redirects@^1.0.0, follow-redirects@^1.15.11: + version "1.16.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.16.0.tgz#28474a159d3b9d11ef62050a14ed60e4df6d61bc" + integrity sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw== for-each@^0.3.3: version "0.3.3" From f0afb3f867972fd9a245cf55304d7704b5ef17be Mon Sep 17 00:00:00 2001 From: John Sandoval Date: Tue, 14 Apr 2026 12:56:18 -0600 Subject: [PATCH 3/5] WIP: Cosmo encumber updates --- webroot/src/locales/es.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webroot/src/locales/es.json b/webroot/src/locales/es.json index b0e281e95..06509806e 100644 --- a/webroot/src/locales/es.json +++ b/webroot/src/locales/es.json @@ -908,6 +908,10 @@ "name": "Fraude, engaño o tergiversación", "key": "Fraud, Deception, or Misrepresentation" }, + { + "name": "Fraude", + "key": "Fraud" + }, { "name": "Prácticas inseguras o atención deficiente", "key": "Unsafe Practice or Substandard Care" From b58821baf3a6f3f6b63baf31d5ba113efada5211 Mon Sep 17 00:00:00 2001 From: John Sandoval Date: Tue, 14 Apr 2026 13:18:14 -0600 Subject: [PATCH 4/5] WIP: Cosmo encumber updates --- webroot/src/components/LicenseCard/LicenseCard.ts | 2 +- webroot/src/components/PrivilegeCard/PrivilegeCard.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webroot/src/components/LicenseCard/LicenseCard.ts b/webroot/src/components/LicenseCard/LicenseCard.ts index 8839d0423..ce723696d 100644 --- a/webroot/src/components/LicenseCard/LicenseCard.ts +++ b/webroot/src/components/LicenseCard/LicenseCard.ts @@ -549,7 +549,7 @@ class LicenseCard extends mixins(MixinForm) { npdbCategories: (Array.isArray(formData.encumberModalNpdbCategories.value)) ? formData.encumberModalNpdbCategories.value : [formData.encumberModalNpdbCategories.value], - startDate: formData.encumberModalNpdbCategories.value, + startDate: formData.encumberModalStartDate.value, }, }).catch((err) => { this.modalErrorMessage = err?.message || this.$t('common.error'); diff --git a/webroot/src/components/PrivilegeCard/PrivilegeCard.vue b/webroot/src/components/PrivilegeCard/PrivilegeCard.vue index 95da31cee..1d8805eaf 100644 --- a/webroot/src/components/PrivilegeCard/PrivilegeCard.vue +++ b/webroot/src/components/PrivilegeCard/PrivilegeCard.vue @@ -101,7 +101,7 @@
{{$t('licensing.privilegeNumSymbol')}}
{{privilegeId}}
-
+
{{ $t('licensing.disciplineStatus') }}
{{disciplineContent}}
From f913d7c67051c5eabcf4ebc737c6e79bd814c290 Mon Sep 17 00:00:00 2001 From: John Sandoval Date: Thu, 16 Apr 2026 10:54:24 -0600 Subject: [PATCH 5/5] WIP: Cosmo encumber updates --- webroot/src/components/LicenseCard/LicenseCard.ts | 12 +++--------- .../src/components/PrivilegeCard/PrivilegeCard.ts | 12 +++--------- webroot/src/locales/en.json | 4 ---- webroot/src/locales/es.json | 4 ---- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/webroot/src/components/LicenseCard/LicenseCard.ts b/webroot/src/components/LicenseCard/LicenseCard.ts index ce723696d..a01799d22 100644 --- a/webroot/src/components/LicenseCard/LicenseCard.ts +++ b/webroot/src/components/LicenseCard/LicenseCard.ts @@ -278,19 +278,13 @@ class LicenseCard extends mixins(MixinForm) { })); if (isAppModeJcc) { - const excludeList = ['Fraud', 'Consumer Harm']; + const excludeList = ['Consumer Harm']; options = options.filter((option) => !excludeList.includes(option.value)); } else if (isAppModeCosmetology) { - const includeList = ['Fraud', 'Consumer Harm', 'Other']; + const includeList = ['Fraud, Deception, or Misrepresentation', 'Consumer Harm', 'Other']; - options = options - .filter((option) => includeList.includes(option.value)) - .map((option) => { - option.value = option.value?.toLowerCase(); - - return option; - }); + options = options.filter((option) => includeList.includes(option.value)); options.unshift({ value: '', diff --git a/webroot/src/components/PrivilegeCard/PrivilegeCard.ts b/webroot/src/components/PrivilegeCard/PrivilegeCard.ts index d583591a8..6d3319d59 100644 --- a/webroot/src/components/PrivilegeCard/PrivilegeCard.ts +++ b/webroot/src/components/PrivilegeCard/PrivilegeCard.ts @@ -250,19 +250,13 @@ class PrivilegeCard extends mixins(MixinForm) { })); if (isAppModeJcc) { - const excludeList = ['Fraud', 'Consumer Harm']; + const excludeList = ['Consumer Harm']; options = options.filter((option) => !excludeList.includes(option.value)); } else if (isAppModeCosmetology) { - const includeList = ['Fraud', 'Consumer Harm', 'Other']; + const includeList = ['Fraud, Deception, or Misrepresentation', 'Consumer Harm', 'Other']; - options = options - .filter((option) => includeList.includes(option.value)) - .map((option) => { - option.value = option.value?.toLowerCase(); - - return option; - }); + options = options.filter((option) => includeList.includes(option.value)); options.unshift({ value: '', diff --git a/webroot/src/locales/en.json b/webroot/src/locales/en.json index 291e63102..319f97699 100644 --- a/webroot/src/locales/en.json +++ b/webroot/src/locales/en.json @@ -924,10 +924,6 @@ "name": "Fraud, Deception, or Misrepresentation", "key": "Fraud, Deception, or Misrepresentation" }, - { - "name": "Fraud", - "key": "Fraud" - }, { "name": "Unsafe Practice or Substandard Care", "key": "Unsafe Practice or Substandard Care" diff --git a/webroot/src/locales/es.json b/webroot/src/locales/es.json index 06509806e..b0e281e95 100644 --- a/webroot/src/locales/es.json +++ b/webroot/src/locales/es.json @@ -908,10 +908,6 @@ "name": "Fraude, engaño o tergiversación", "key": "Fraud, Deception, or Misrepresentation" }, - { - "name": "Fraude", - "key": "Fraud" - }, { "name": "Prácticas inseguras o atención deficiente", "key": "Unsafe Practice or Substandard Care"