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

Implemented: support to add focus on first input element inside mapping modals(#132) #299

Merged
merged 1 commit into from
Aug 22, 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
2 changes: 1 addition & 1 deletion src/components/CustomMappingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ion-list>
<ion-list-header>{{ translate("Custom mapping") }}</ion-list-header>
<ion-item>
<ion-input :label="translate('Mapping ID')" v-model="mappingId" placeholder="Mapping ID" />
<ion-input id="inputElement" :label="translate('Mapping ID')" v-model="mappingId" placeholder="Mapping ID" />
</ion-item>
<ion-item>
<ion-input :label="translate('Mapping Name')" v-model="mappingName" placeholder="Mapping name" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/FacilityAddressModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ion-label>{{ translate("Address") }}</ion-label>
</ion-item-divider>
<ion-item>
<ion-input :label="translate('Shipping name')" label-placement="floating" v-model="address.toName" />
<ion-input id="inputElement" :label="translate('Shipping name')" label-placement="floating" v-model="address.toName" />
</ion-item>
<ion-item>
<ion-input label-placement="floating" v-model="address.address1">
Expand Down
2 changes: 1 addition & 1 deletion src/components/FacilityExternalIdModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ion-list>
<ion-list-header>{{ translate('Facility External ID') }}</ion-list-header>
<ion-item>
<ion-input :label="translate('Identification')" v-model="currentFacility.externalId" />
<ion-input id="inputElement" :label="translate('Identification')" v-model="currentFacility.externalId" />
</ion-item>
</ion-list>

Expand Down
2 changes: 1 addition & 1 deletion src/components/FacilityMappingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<ion-list>
<ion-list-header>{{ externalMappingTypes[mappingId] }}</ion-list-header>
<ion-item>
<ion-input :label="translate('Identification')" v-model="mappingValue" placeholder="Mapping Value" />
<ion-input id="inputElement" :label="translate('Identification')" v-model="mappingValue" placeholder="Mapping Value" />
</ion-item>
</ion-list>

Expand Down
16 changes: 12 additions & 4 deletions src/components/FacilityMappingPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default defineComponent({
})

await popoverController.dismiss()
customMappingModal.present()
customMappingModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async addMappingModal(type: any) {
const addMappingModal = await modalController.create({
Expand All @@ -64,23 +66,29 @@ export default defineComponent({
})

await popoverController.dismiss()
addMappingModal.present()
addMappingModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async createShopifyFacilityMappingModal() {
const facilityShopifyMappingModal = await modalController.create({
component: FacilityShopifyMappingModal
})

await popoverController.dismiss()
facilityShopifyMappingModal.present()
facilityShopifyMappingModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async createFacilityExternalId() {
const facilityExternalIdModal = await modalController.create({
component: FacilityExternalIdModal
})

await popoverController.dismiss()
facilityExternalIdModal.present()
facilityExternalIdModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
},
setup() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FacilityShopifyMappingModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</ion-select>
</ion-item>
<ion-item>
<ion-input :label="translate('Location ID')" :placeholder="translate('Add your location ID from Shopify')" v-model="shopifyLocationId" />
<ion-input id="inputElement" :label="translate('Location ID')" :placeholder="translate('Add your location ID from Shopify')" v-model="shopifyLocationId" />
</ion-item>
</ion-list>

Expand Down
16 changes: 12 additions & 4 deletions src/views/FacilityDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,9 @@ export default defineComponent({
}
})

addressModal.present()
addressModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async addCustomSchedule() {
const customScheduleModal = await modalController.create({
Expand Down Expand Up @@ -1160,22 +1162,28 @@ export default defineComponent({
componentProps: { mappingId: mapping.facilityIdenTypeId, mapping, type: 'update' }
})

customMappingModal.present()
customMappingModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async editFacilityExternalId() {
const facilityExternalIdModal = await modalController.create({
component: FacilityExternalIdModal
})

facilityExternalIdModal.present()
facilityExternalIdModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
async editShopifyFacilityMapping(shopifyFacilityMapping: any) {
const customMappingModal = await modalController.create({
component: FacilityShopifyMappingModal,
componentProps: { shopifyFacilityMapping, type: 'update' }
})

customMappingModal.present()
customMappingModal.present().then(() => {
(document.querySelector("#inputElement") as any).setFocus()
})
},
getOpenEndTime(startTime: any, capacity: any) {
const openTime = DateTime.fromFormat(startTime, 'HH:mm:ss').toFormat('HH:mm a');
Expand Down
Loading