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

Improved: made zipCode mandatory, hide contact number prefix when no countryCode is selected (#154) #232

Merged
merged 4 commits into from
Mar 29, 2024
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
6 changes: 3 additions & 3 deletions src/components/FacilityAddressModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ion-select>
</ion-item>
<ion-item>
<ion-label position="floating">{{ translate("Zipcode") }}</ion-label>
<ion-label position="floating">{{ translate("Zipcode") }} <ion-text color="danger">*</ion-text></ion-label>
<ion-input v-model="address.postalCode" />
</ion-item>
<ion-item-divider color="light">
Expand All @@ -55,7 +55,7 @@
<ion-item>
<ion-label :position="telecomNumberValue?.countryCode ? 'stacked' : 'floating'">{{ translate("Contact number") }}</ion-label>
<ion-input v-model="telecomNumberValue.contactNumber">
<ion-text>{{ `${telecomNumberValue?.countryCode}-` }}</ion-text>
<ion-text v-if="telecomNumberValue?.countryCode">{{ `${telecomNumberValue.countryCode}-` }}</ion-text>
</ion-input>
</ion-item>
</form>
Expand Down Expand Up @@ -154,7 +154,7 @@ export default defineComponent({
async saveContact() {
let resp, postalAddress = '';

if(!this.address?.address1 || !this.address?.city) {
if(!this.address?.address1 || !this.address?.city || !this.address?.postalCode) {
showToast("Please fill all the required fields.")
return
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddFacilityAddress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</ion-item>
<ion-item>
<ion-label position="floating">
{{ translate('Zipcode') }}
{{ translate('Zipcode') }} <ion-text color="danger">*</ion-text>
</ion-label>
<ion-input v-model="formData.postalCode" />
</ion-item>
Expand All @@ -66,7 +66,7 @@
<ion-item lines="none">
<ion-label :position="countryCode ? 'stacked' : 'floating'">{{ translate("Contact number") }}</ion-label>
<ion-input v-model="contactNumber">
<ion-text>{{ `${countryCode}-` }}</ion-text>
<ion-text v-if=countryCode>{{ `${countryCode}-` }}</ion-text>
</ion-input>
</ion-item>
</ion-list>
Expand Down Expand Up @@ -198,7 +198,7 @@ export default defineComponent({
methods: {
async addAddress() {
let resp;
if (!this.formData.address1 || !this.formData.city) {
if (!this.formData.address1 || !this.formData.city || !this.formData.postalCode) {
showToast("Please fill all the required fields.")
return
}
Expand Down
Loading