-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Previous Home Owners to Re-Registration flow (#1934)
* Create a new common CollapsibleCard component * Add PreviousHomeOwners to ReRegistrations flow * Add unit tests for PreviousHomeOwners in Re-Registration flow * Fix to show Group Headers for Previous Owners in Re-Registration flow
- Loading branch information
Showing
19 changed files
with
325 additions
and
37 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template> | ||
<v-card | ||
flat | ||
class="collapsible-card" | ||
> | ||
<header class="review-header"> | ||
<label | ||
class="font-weight-bold d-flex" | ||
data-test-id="card-header-label" | ||
> | ||
<img | ||
class="mr-1" | ||
width="25" | ||
src="@/assets/svgs/homeownersicon_reviewscreen.svg" | ||
> | ||
{{ headerLabel }} | ||
</label> | ||
|
||
<v-btn | ||
variant="plain" | ||
color="primary" | ||
class="hide-help-btn px-0" | ||
data-test-id="card-toggle-label" | ||
:ripple="false" | ||
@click="toggleCardOpen" | ||
> | ||
<v-icon | ||
:icon="state.isCardOpen ? 'mdi-eye-off' : 'mdi-eye'" | ||
class="mr-1" | ||
size="20" | ||
/> | ||
{{ state.isCardOpen ? 'Hide' : 'Show' }} {{ toggleLabel }} | ||
</v-btn> | ||
</header> | ||
<v-expand-transition> | ||
<div | ||
v-if="state.isCardOpen" | ||
data-test-id="card-slots" | ||
> | ||
<!-- Information/Description text slot --> | ||
<slot name="infoSlot" /> | ||
|
||
<slot name="mainSlot" /> | ||
</div> | ||
</v-expand-transition> | ||
</v-card> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { reactive } from 'vue'; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const props = defineProps<{ | ||
headerLabel: string, | ||
toggleLabel: string | ||
}>() | ||
const state = reactive({ | ||
isCardOpen: true | ||
}) | ||
const toggleCardOpen = () => { | ||
state.isCardOpen = !state.isCardOpen; | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.collapsible-card { | ||
.review-header { | ||
background-color: white; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
ppr-ui/src/components/mhrRegistration/HomeOwners/PreviousHomeOwners.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div | ||
class="mt-5" | ||
data-test-id="previous-home-owners" | ||
> | ||
<v-divider class="my-15" /> | ||
|
||
<CollapsibleCard | ||
headerLabel="Previous Home Owners" | ||
toggleLabel="Previous Owners" | ||
> | ||
<template #infoSlot> | ||
<p class="px-6 mb-6"> | ||
These were the homeowners at the time of the exemption or cancellation and will not | ||
appear on the re-registration of this manufactured home. | ||
</p> | ||
<v-divider class="mx-6" /> | ||
</template> | ||
<template #mainSlot> | ||
<div class="mx-6 my-7"> | ||
<span class="generic-label mr-5"> | ||
Home Tenancy Type | ||
</span> | ||
<span data-test-id="home-owner-tenancy-type"> | ||
{{ getMhrReRegistrationPreviousTenancyType }} | ||
</span> | ||
</div> | ||
<v-divider class="mx-6" /> | ||
|
||
<HomeOwnersTable | ||
:homeOwnerGroups="getMhrReRegistrationPreviousOwnerGroups" | ||
isReadonlyTable | ||
hideTableErrors | ||
:forceShowGroups="getMhrReRegistrationPreviousTenancyType === HomeTenancyTypes.COMMON" | ||
class="mx-6 mb-1" | ||
/> | ||
</template> | ||
</CollapsibleCard> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { CollapsibleCard } from '@/components/common' | ||
import { HomeOwnersTable } from '@/components/mhrRegistration/HomeOwners' | ||
import { useStore } from '@/store/store' | ||
import { storeToRefs } from 'pinia' | ||
import { HomeTenancyTypes } from '@/enums' | ||
const { | ||
getMhrReRegistrationPreviousOwnerGroups, | ||
getMhrReRegistrationPreviousTenancyType | ||
} = storeToRefs(useStore()) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/assets/styles/theme.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.