-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implemented: support to add,update and display an address and latitude, longitude for a facility (#20) #22
Conversation
…when no address found (hotwax#20)
</ion-item> | ||
</ion-content> | ||
|
||
<ion-fab @click="saveAddress" vertical="bottom" horizontal="end" slot="fixed"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move click event to ion-fab-button
} | ||
}, | ||
getGeoPoint(state) { | ||
return state.current?.geoPoint ? JSON.parse(JSON.stringify(state.current.geoPoint)) : {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we have used optional chaining here?
entityName: "FacilityContactDetailByPurpose", | ||
orderBy: 'fromDate DESC', | ||
filterByDate: 'Y', | ||
fieldList: ['address1', 'address2', 'city', 'contactMechId', 'countryGeoName', 'latitude', 'longitude', 'postalCode', 'stateGeoName'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass viewSize as 1, as we only need a single record from this entity.
throw resp.data | ||
} | ||
} catch(err) { | ||
logger.error(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.error(err) | |
logger.error('Failed to fetch the postal address for the facility', err) |
src/store/modules/util/index.ts
Outdated
locationTypes: {} | ||
locationTypes: {}, | ||
countries: [], | ||
states: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
states: [] | |
states: {} |
src/store/modules/util/UtilState.ts
Outdated
@@ -2,4 +2,6 @@ export default interface UtilState { | |||
productStores: any[]; | |||
facilityTypes: object; | |||
locationTypes: object; | |||
countries: any[]; | |||
states: any[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
states: any[]; | |
states: any; |
<ion-item @keyup.enter.stop> | ||
<ion-label>{{ translate("State") }}</ion-label> | ||
<ion-select interface="popover" :placeholder="translate('Select')" v-model="address.stateGeoId"> | ||
<ion-select-option v-for="(state, index) in states[address.countryGeoId]" :key="index" :value="state.geoId">{{ state.geoName }}</ion-select-option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ion-select-option v-for="(state, index) in states[address.countryGeoId]" :key="index" :value="state.geoId">{{ state.geoName }}</ion-select-option> | |
<ion-select-option v-for="state in states[address.countryGeoId]" :key="state.geoId" :value="state.geoId">{{ state.geoName }}</ion-select-option> |
Make same changes for country ion-select.
const payload = { | ||
address1: this.address.address1, | ||
address2: this.address.address2, | ||
city: this.address.city, | ||
countryGeoId: this.address.countryGeoId, | ||
facilityId: this.facilityId, | ||
postalCode: this.address.postalCode, | ||
stateProvinceGeoId: this.address.stateGeoId | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const payload = { | |
address1: this.address.address1, | |
address2: this.address.address2, | |
city: this.address.city, | |
countryGeoId: this.address.countryGeoId, | |
facilityId: this.facilityId, | |
postalCode: this.address.postalCode, | |
stateProvinceGeoId: this.address.stateGeoId | |
} | |
const payload = { | |
...this.address, | |
facilityId: this.facilityId | |
} |
<ion-content> | ||
<form @keyup.enter="saveGeoPoint"> | ||
<ion-item class="ion-margin-bottom"> | ||
<ion-input placeholder="Zipcode" v-model="geoPoint.postalCode" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add translation for placeholder
closeModal() { | ||
modalController.dismiss() | ||
}, | ||
async saveAddress() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only call saveAddress if there are changes in the address
Related Issues
Closes #20
Short Description and Why It's Useful
Implemented support to add, update and display an address and latitude, longitude for a facility.
Screenshots of Visual Changes before/after (If There Are Any)
Contribution and Currently Important Rules Acceptance