Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18495 - Bug Fix - Show Resolution Section when not Correction Filing #552

Merged
merged 4 commits into from
Dec 14, 2023
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-edit-ui",
"version": "4.7.13",
"version": "4.7.14",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down
21 changes: 14 additions & 7 deletions src/components/SpecialResolution/Memorandum.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
class="pt-0 section-container"
>
<v-checkbox
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
id="chk-memorandum-in-resolution"
v-model="memorandumInResolution"
hide-details
Expand All @@ -119,14 +119,14 @@
</template>
</v-checkbox>
<span
v-if="!hasResolutionOnFile"
v-if="!hasResolutionSection"
class="black-bold-font"
>
Upload a new full set of the memorandum PDF document
</span>
<v-spacer class="spacer" />
<UploadRulesOrMemorandum
v-if="!hasResolutionOnFile"
v-if="!hasResolutionSection"
ref="uploadMemorandumRef"
/>
</div>
Expand Down Expand Up @@ -168,7 +168,6 @@
>
<div
v-if="getSpecialResolutionMemorandum && getSpecialResolutionMemorandum.key"
:key="getSpecialResolutionMemorandum.key"
>
<v-icon
color="primary"
Expand All @@ -179,7 +178,9 @@

<!-- New Memorandum -->
<a
:key="getSpecialResolutionMemorandum.key"
class="ml-1"
:class=" {'dropdown-active': (!getSpecialResolutionMemorandum.url)}"
download
@click="openPdf()"
>
Expand All @@ -203,11 +204,13 @@
{{ lastUploadedDetails }}
</span>
<v-icon
v-if="hasResolutionSection"
color="green darken-2"
>
mdi-check
</v-icon>
<span
v-if="hasResolutionSection"
id="memorandum-changes-included-resolution"
class="ml-1 d-inline-block info-text"
>
Expand Down Expand Up @@ -288,7 +291,7 @@ export default class Memorandum extends Vue {
@Getter(useStore) getEntitySnapshot!: EntitySnapshotIF
@Getter(useStore) getSpecialResolutionMemorandum!: RulesMemorandumIF
@Getter(useStore) hasSpecialResolutionMemorandumChanged!: boolean
@Getter(useStore) hasResolutionOnFile!: boolean
@Getter(useStore) hasResolutionSection!: boolean

@Action(useStore) setEditingMemorandum!: (x: boolean) => void
@Action(useStore) setSpecialResolutionMemorandumValid!: (x: boolean) => void
Expand Down Expand Up @@ -375,7 +378,7 @@ export default class Memorandum extends Vue {
this.hasChanged = true
this.isEditing = false
let memorandum = this.getSpecialResolutionMemorandum
if (!this.hasResolutionOnFile) {
if (!this.hasResolutionSection) {
memorandum = {
...memorandum,
...this.$refs.uploadMemorandumRef.getNewRulesNameAndKey(),
Expand All @@ -395,7 +398,7 @@ export default class Memorandum extends Vue {

validate (includeIsEditing: boolean): boolean {
// This validates the checkbox.
let memorandumValid = this.$refs.memorandumForm.validate() || !this.hasResolutionOnFile
let memorandumValid = this.$refs.memorandumForm.validate() || !this.hasResolutionSection
if (includeIsEditing) {
memorandumValid = memorandumValid && !this.isEditing
}
Expand Down Expand Up @@ -450,6 +453,10 @@ ul {
color: black;
}

.dropdown-active {
color: rgba(0,0,0,.87) !important; cursor: auto;
}

.last-modified-details {
display: inline-flex;
font-size: .75rem;
Expand Down
85 changes: 45 additions & 40 deletions src/components/SpecialResolution/Resolution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,64 @@
flat
>
<!-- Header -->
<article class="header-container section-container">
<div class="section-container header-container">
<v-icon color="appDkBlue">
mdi-handshake
</v-icon>
<label class="font-weight-bold pl-2">Special Resolution</label>
</article>
<v-card
</div>
<v-form
ref="resolutionTextForm"
flat
:class="{'invalid-section':
isCoopCorrectionFiling ?
(invalidResolutionSection && requireCorrectionCheck) :
invalidResolutionSection}"
>
<v-row
class="section-container pr-0"
<div
class="section-container"
>
<v-col
cols="auto"
<v-row
no-gutters
>
<v-checkbox
v-if="requireCorrectionCheck && isCoopCorrectionFiling"
id="resolution-text-not-require-chkbx"
class="inherit-checkbox"
label="Correction to the special resolution text is not required."
hide-details
@change="onResolutionCorrectionChk"
/>
<v-label
v-if="!requireCorrectionCheck && isCoopCorrectionFiling"
<v-col
cols="auto"
>
Correction to the special resolution text is not required.
</v-label>
</v-col>
<v-col
cols="auto"
class="ml-auto mt-n1"
>
<!-- Column for the button -->
<v-btn
v-if="!requireCorrectionCheck && isCoopCorrectionFiling"
id="btn-resolution-correction-undo"
text
color="primary"
class="undo-action"
@click="requireCorrectionCheck = !requireCorrectionCheck"
<v-checkbox
v-if="requireCorrectionCheck && isCoopCorrectionFiling"
id="resolution-text-not-require-chkbx"
class="inherit-checkbox"
label="Correction to the special resolution text is not required."
hide-details
@change="onResolutionCorrectionChk"
/>
<v-label
v-if="!requireCorrectionCheck && isCoopCorrectionFiling"
>
Correction to the special resolution text is not required.
</v-label>
</v-col>
<v-col
cols="1"
class="pt-0 mt-n2 align-right"
>
<v-icon small>
mdi-undo
</v-icon>
<span>Undo</span>
</v-btn>
</v-col>
</v-row>
<div class="actions mr-4">
<v-btn
v-if="!requireCorrectionCheck && isCoopCorrectionFiling"
id="btn-resolution-correction-undo"
text
color="primary"
@click="requireCorrectionCheck = !requireCorrectionCheck"
>
<v-icon small>
mdi-undo
</v-icon>
<span>Undo</span>
</v-btn>
</div>
</v-col>
</v-row>
</div>

<InstructionalText v-if="shouldDisplayResolution" />

Expand Down Expand Up @@ -209,7 +214,7 @@
</div>
</v-form>
</section>
</v-card>
</v-form>
</v-card>
</template>

Expand Down
29 changes: 17 additions & 12 deletions src/components/SpecialResolution/Rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@
</div>
<div v-else>
<div
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="pt-0 instructional-text section-container"
:class="{'error-text': rulesEditingInvalid}"
>
You can update the rules of association in one of the following ways:
</div>
<v-divider
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="mx-8"
/>
<section
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="py-4 section-container"
>
<v-btn
Expand Down Expand Up @@ -134,11 +134,12 @@
</v-checkbox>
</section>
<v-divider
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="mx-8"
/>
<section :class="{'section-container': hasResolutionOnFile}">
<section :class="{'section-container': hasResolutionSection}">
<v-btn
v-if="hasResolutionSection"
id="btn-upload-rules"
text
block
Expand All @@ -149,17 +150,20 @@
describeDropdown = false; uploadDropdown = !uploadDropdown"
>
<span
:class="{'black-bold-font' : uploadDropdown || !hasResolutionOnFile}"
:class="{'black-bold-font' : uploadDropdown}"
>
Upload a new full set of the rules PDF document
</span>
<v-spacer class="spacer" />
<v-icon v-if="hasResolutionOnFile">
<v-icon v-if="hasResolutionSection">
{{ uploadDropdown ? 'mdi-menu-up' : 'mdi-menu-down' }}
</v-icon>
</v-btn>
<span v-else>
Upload a new full set of the rules PDF document
</span>
<UploadRulesOrMemorandum
v-if="uploadDropdown || !hasResolutionOnFile"
v-if="uploadDropdown || !hasResolutionSection"
ref="uploadRulesRef"
:invalidSection="rulesEditingInvalid"
/>
Expand Down Expand Up @@ -198,7 +202,7 @@
</v-expand-transition>
</section>
<v-divider
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="mx-8"
/>

Expand Down Expand Up @@ -251,6 +255,7 @@
>
mdi-file-pdf-outline
</v-icon>
<!-- New Rule -->
<a
v-if="getSpecialResolutionRules && getSpecialResolutionRules.key"
:key="getSpecialResolutionRules.key"
Expand Down Expand Up @@ -370,7 +375,7 @@ export default class Rules extends Vue {
@Getter(useStore) getSpecialResolutionRulesValid!: boolean
@Getter(useStore) getNameRequestLegalName!: string
@Getter(useStore) hasSpecialResolutionRulesChanged!: boolean
@Getter(useStore) hasResolutionOnFile!: boolean
@Getter(useStore) hasResolutionSection!: boolean

@Action(useStore) setEditingRules!: (x: boolean) => void
@Action(useStore) setSpecialResolutionRules!: (x: RulesMemorandumIF) => void
Expand Down Expand Up @@ -461,7 +466,7 @@ export default class Rules extends Vue {
this.hasChanged = true
this.isEditing = false
let rules = this.getSpecialResolutionRules
if (this.uploadDropdown || !this.hasResolutionOnFile) {
if (this.uploadDropdown || !this.hasResolutionSection) {
rules = {
...rules,
...this.$refs.uploadRulesRef.getNewRulesNameAndKey(),
Expand All @@ -482,7 +487,7 @@ export default class Rules extends Vue {
validate (includeIsEditing: boolean): boolean {
// Show error in section, if no option is selected.
// No options when there is no resolution on file.
this.noOptionSelected = this.hasResolutionOnFile
this.noOptionSelected = this.hasResolutionSection
? (this.isEditing && !this.rulesInResolution && !this.rulesInUpload) : false
// Validate the form.
let rulesValid = this.$refs.rulesForm.validate() && !this.noOptionSelected
Expand Down
7 changes: 6 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,12 @@ export const useStore = defineStore('store', {

/** Check if the original filing includes resolutions. */
hasResolutionOnFile (): boolean {
return this.getEntitySnapshot?.resolutions.length > 0
return this.getEntitySnapshot?.resolutions?.length > 0
},

/** Display resolution text section when a correction filing has existing resolution or not correction filing. */
hasResolutionSection (): boolean {
return this.hasResolutionOnFile || !this.isCoopCorrectionFiling
},

/** True if (registered) mailing address has changed. */
Expand Down
4 changes: 2 additions & 2 deletions src/views/Correction/CoopCorrection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<Memorandum class="mt-10" />

<Resolution
v-if="hasResolutionOnFile"
v-if="hasResolutionSection"
class="mt-10"
/>

Expand Down Expand Up @@ -124,7 +124,7 @@ export default class CoopCorrection extends Mixins(CommonMixin, DateMixin, FeeMi
// Global getters
@Getter(useStore) isPartnership!: boolean
@Getter(useStore) isSoleProp!: boolean
@Getter(useStore) hasResolutionOnFile!: boolean
@Getter(useStore) hasResolutionSection!: boolean

// Global actions
@Action(useStore) setHaveUnsavedChanges!: (x: boolean) => void
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/Memorandum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { mount } from '@vue/test-utils'
import Memorandum from '@/components/SpecialResolution/Memorandum.vue'
import UploadRulesOrMemorandum from '@/components/SpecialResolution/UploadRulesOrMemorandum.vue'
import flushPromises from 'flush-promises'
import { CorpTypeCd, FilingTypes } from '@/enums'

const vuetify = new Vuetify({})

Expand Down Expand Up @@ -113,7 +114,9 @@ describe('Memorandum', () => {
})

it('saveMemorandum - valid - memorandum in upload', async () => {
store.stateModel.entitySnapshot.resolutions = []
store.stateModel.entitySnapshot.resolutions = null
store.stateModel.tombstone.entityType = CorpTypeCd.COOP
store.stateModel.tombstone.filingType = FilingTypes.CORRECTION
await wrapper.vm.$nextTick()
await wrapper.find('#btn-change-memorandum').trigger('click')
const uploadRules = wrapper.findComponent(UploadRulesOrMemorandum)
Expand Down
Loading