-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:bcgov/ECC-ECER
- Loading branch information
Showing
17 changed files
with
186 additions
and
173 deletions.
There are no files selected for viewing
64 changes: 62 additions & 2 deletions
64
....Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/PreviewCard.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 |
---|---|---|
@@ -1,13 +1,73 @@ | ||
<template> | ||
<v-card variant="outlined" color="grey-lightest" rounded="lg"> | ||
<slot></slot> | ||
<v-card variant="outlined" :color="cardColor" rounded="lg"> | ||
<div class="float-right"> | ||
<v-tooltip v-model="show" location="top"> | ||
<template #activator="{ props }"> | ||
<v-btn icon="mdi-pencil" v-bind="props" :color="isValid ? 'primary' : 'error'" variant="plain" @click="setWizard(portalStage)" /> | ||
</template> | ||
<span>Edit {{ title }}</span> | ||
</v-tooltip> | ||
</div> | ||
<v-container> | ||
<v-row align="center"> | ||
<v-col> | ||
<h3 :class="isValid ? 'text-black' : 'text-error'">{{ title }}</h3> | ||
<p v-if="!isValid" class="small text-error"> | ||
<v-icon icon="mdi-alert-circle" color="error" class="mr-2"></v-icon> | ||
You must enter all required information in a valid format before submitting your application | ||
</p> | ||
</v-col> | ||
</v-row> | ||
<slot name="content"></slot> | ||
</v-container> | ||
</v-card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import type { PropType } from "vue"; | ||
import { defineComponent } from "vue"; | ||
import { useApplicationStore } from "@/store/application"; | ||
import { useWizardStore } from "@/store/wizard"; | ||
import type { Components } from "@/types/openapi"; | ||
export default defineComponent({ | ||
name: "PreviewCard", | ||
props: { | ||
isValid: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
title: { | ||
type: String, | ||
required: true, | ||
}, | ||
portalStage: { | ||
type: String as PropType<Components.Schemas.PortalStage>, | ||
required: true, | ||
}, | ||
}, | ||
setup: () => { | ||
const wizardStore = useWizardStore(); | ||
const applicationStore = useApplicationStore(); | ||
return { | ||
wizardStore, | ||
applicationStore, | ||
}; | ||
}, | ||
data: () => ({ | ||
show: false, | ||
}), | ||
computed: { | ||
cardColor() { | ||
return this.isValid ? "grey-lightest" : "error"; | ||
}, | ||
}, | ||
methods: { | ||
setWizard(stage: Components.Schemas.PortalStage) { | ||
this.wizardStore.setCurrentStep(stage); | ||
this.applicationStore.draftApplication.stage = this.wizardStore.currentStepStage; | ||
}, | ||
}, | ||
}); | ||
</script> |
50 changes: 32 additions & 18 deletions
50
src/ECER.Clients.RegistryPortal/ecer.clients.registryportal.client/src/components/Wizard.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
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 |
---|---|---|
|
@@ -16,8 +16,8 @@ | |
<v-col cols="12" md="8" lg="6" xl="4"> | ||
<v-text-field | ||
v-model="firstName" | ||
:rules="[Rules.required()]" | ||
label="First Name" | ||
:rules="[Rules.required('Enter your reference\'s first name')]" | ||
label="Reference First Name" | ||
variant="outlined" | ||
color="primary" | ||
maxlength="100" | ||
|
@@ -29,8 +29,8 @@ | |
<v-col cols="12" md="8" lg="6" xl="4"> | ||
<v-text-field | ||
v-model="lastName" | ||
:rules="[Rules.required()]" | ||
label="Last Name" | ||
:rules="[Rules.required('Enter your reference\'s last name')]" | ||
label="Reference Last Name" | ||
variant="outlined" | ||
color="primary" | ||
maxlength="100" | ||
|
@@ -42,8 +42,8 @@ | |
<v-col cols="12" md="8" lg="6" xl="4"> | ||
<v-text-field | ||
v-model="phoneNumber" | ||
:rules="[Rules.phoneNumber()]" | ||
label="Phone Number (Optional)" | ||
:rules="[Rules.phoneNumber('Enter your reference\'s 10-digit phone number')]" | ||
label="Reference Phone Number (Optional)" | ||
variant="outlined" | ||
color="primary" | ||
type="number" | ||
|
@@ -56,8 +56,8 @@ | |
<v-col cols="12" md="8" lg="6" xl="4"> | ||
<v-text-field | ||
v-model="emailAddress" | ||
:rules="[Rules.required(), Rules.email()]" | ||
label="Email" | ||
:rules="[Rules.required('Enter your reference\'s email in the format \'[email protected]\''), Rules.email('Enter your reference\'s email in the format \'[email protected]\'')]" | ||
label="Reference Email" | ||
variant="outlined" | ||
color="primary" | ||
maxlength="100" | ||
|
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.