Skip to content

Commit

Permalink
Implemented: addGeopoint modal, addAddress modal and addGeoPoint card(#3
Browse files Browse the repository at this point in the history
)
  • Loading branch information
amansinghbais committed Nov 15, 2023
1 parent c678594 commit 2ac5502
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 28 deletions.
96 changes: 96 additions & 0 deletions src/components/AddAddressModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal()">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ translate("Address") }}</ion-title>
</ion-toolbar>
</ion-header>

<ion-content>
<ion-item>
<ion-label>{{ translate("Address line 1") }}</ion-label>
<ion-input />
</ion-item>
<ion-item class="ion-margin-bottom">
<ion-label>{{ translate("Address line 2") }}</ion-label>
<ion-input />
</ion-item>
<ion-item>
<ion-label>{{ translate("City") }}</ion-label>
<ion-input />
</ion-item>
<ion-item>
<ion-label>{{ translate("Country") }}</ion-label>
<ion-input />
</ion-item>
<ion-item>
<ion-label>{{ translate("State") }}</ion-label>
<ion-input />
</ion-item>
<ion-item>
<ion-label>{{ translate("Zipcode") }}</ion-label>
<ion-input />
</ion-item>
</ion-content>

<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button>
<ion-icon :icon="saveOutline" />
</ion-fab-button>
</ion-fab>
</template>

<script lang="ts">
import {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonTitle,
IonToolbar,
modalController
} from "@ionic/vue";
import { defineComponent } from "vue";
import { closeOutline, saveOutline } from "ionicons/icons";
import { translate } from '@hotwax/dxp-components'
export default defineComponent({
name: "AddAddressModal",
components: {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonTitle,
IonToolbar,
},
methods: {
closeModal() {
modalController.dismiss()
}
},
setup() {
return {
closeOutline,
saveOutline,
translate
};
},
});
</script>
88 changes: 88 additions & 0 deletions src/components/AddGeoPointModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<template>
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button @click="closeModal()">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
</ion-buttons>
<ion-title>{{ translate("Latitude & Longitude") }}</ion-title>
</ion-toolbar>
</ion-header>

<ion-content>
<ion-item class="ion-margin-bottom">
<ion-label>{{ "<postal code value>" }}</ion-label>
<ion-button fill="outline">
{{ translate("Generate") }}
<ion-icon slot="end" :icon="colorWandOutline" />
</ion-button>
</ion-item>
<ion-item>
<ion-label>{{ translate("Latitude") }}</ion-label>
<ion-input />
</ion-item>
<ion-item>
<ion-label>{{ translate("Longitude") }}</ion-label>
<ion-input />
</ion-item>
</ion-content>

<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button>
<ion-icon :icon="saveOutline" />
</ion-fab-button>
</ion-fab>
</template>

<script lang="ts">
import {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonTitle,
IonToolbar,
modalController
} from "@ionic/vue";
import { defineComponent } from "vue";
import { closeOutline, colorWandOutline, saveOutline } from "ionicons/icons";
import { translate } from '@hotwax/dxp-components'
export default defineComponent({
name: "AddGeoPointModal",
components: {
IonButton,
IonButtons,
IonContent,
IonFab,
IonFabButton,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonTitle,
IonToolbar,
},
methods: {
closeModal() {
modalController.dismiss()
}
},
setup() {
return {
closeOutline,
colorWandOutline,
saveOutline,
translate
};
},
});
</script>
13 changes: 12 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
"Add": "Add",
"Add timings": "Add timings",
"Address": "Address",
"Address line 1": "Address line 1",
"Address line 2": "Address line 2",
"Allow pickup": "Allow pickup",
"Built: ": "Built: { builtDateTime }",
"Cancel": "Cancel",
"Change": "Change",
"Change time zone": "Change time zone",
"City": "City",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"Country": "Country",
"Days to ship": "Days to ship",
"Dismiss": "Dismiss",
"Edit": "Edit",
"Facility details": "Facility details",
"Fetching TimeZones": "Fetching TimeZones",
"Friday": "Friday",
"Fulfillment Settings": "Fulfillment Settings",
"Generate": "Generate",
"Generate shipping labels": "Generate shipping labels",
"Instance Url": "Instance Url",
"Latitude": "Latitude",
"Latitude & Longitude": "Latitude & Longitude",
"Login": "Login",
"Logout": "Logout",
"Longitude": "Longitude",
"Make primary": "Make primary",
"Monday": "Monday",
"No time zone found": "No time zone found",
Expand All @@ -37,10 +45,12 @@
"Settings": "Settings",
"Something went wrong": "Something went wrong",
"Sorry, your username or password is incorrect. Please try again.": "Sorry, your username or password is incorrect. Please try again.",
"State": "State",
"Store": "Store",
"store name": "store name",
"Sunday": "Sunday",
"Thursday": "Thursday",
"These values are used to help customers lookup how close they are to your stores when they are finding nearby stores.": "These values are used to help customers lookup how close they are to your stores when they are finding nearby stores.",
"Time zone updated successfully": "Time zone updated successfully",
"Tuesday": "Tuesday",
"Unlink":"Unlink",
Expand All @@ -50,5 +60,6 @@
"Version: ": "Version: { appVersion }",
"View order count history": "View order count history",
"Wednesday": "Wednesday",
"Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu."
"Would you like to update your time zone to . Your profile is currently set to . This setting can always be changed from the settings menu.": "Would you like to update your time zone to {localTimeZone}. Your profile is currently set to {profileTimeZone}. This setting can always be changed from the settings menu.",
"Zipcode": "Zipcode"
}
99 changes: 72 additions & 27 deletions src/views/FacilityDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,57 @@
<ion-item lines="none" class="ion-margin-top">
<ion-label>
<h1>{{ "Facility Name" }}</h1>
<p>Facility Id</p>
<p>{{ "Facility Id" }}</p>
</ion-label>
</ion-item>

<section>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ translate("Address") }}
</ion-card-title>
</ion-card-header>
<ion-item lines="full">
<ion-label>
<h3>{{ "Address line 1" }}</h3>
<h3>{{ "Address line 2" }}</h3>
<p class="ion-text-wrap">{{ "City," }} {{ "Zipcode" }}</p>
<p class="ion-text-wrap">{{ "State," }} {{ "Country" }}</p>
</ion-label>
</ion-item>
<ion-button fill="clear">{{ translate("Edit") }}</ion-button>
<ion-button expand="block" fill="outline">
{{ translate("Add") }}
<ion-icon slot="end" :icon="addCircleOutline" />
</ion-button>
</ion-card>
<div>
<ion-card>
<ion-card-header>
<ion-card-title>
{{ translate("Address") }}
</ion-card-title>
</ion-card-header>
<ion-item lines="full">
<ion-label>
<h3>{{ "Address line 1" }}</h3>
<h3>{{ "Address line 2" }}</h3>
<p class="ion-text-wrap">{{ "City," }} {{ "Zipcode" }}</p>
<p class="ion-text-wrap">{{ "State," }} {{ "Country" }}</p>
</ion-label>
</ion-item>
<ion-button fill="clear" @click="addAddress">{{ translate("Edit") }}</ion-button>
<ion-button expand="block" fill="outline" @click="addAddress">
{{ translate("Add") }}
<ion-icon slot="end" :icon="addCircleOutline" />
</ion-button>
</ion-card>

<ion-card>
<ion-card-header>
<ion-card-title>
{{ translate("Latitude & Longitude") }}
</ion-card-title>
</ion-card-header>
<ion-card-content>
{{ translate("These values are used to help customers lookup how close they are to your stores when they are finding nearby stores.") }}
</ion-card-content>
<ion-item lines="full">
<ion-label>{{ translate("Latitude") }}</ion-label>
<p>{{ "<latitude>" }}</p>
</ion-item>
<ion-item lines="full">
<ion-label>{{ translate("Longitude") }}</ion-label>
<p>{{ "<longitude>" }}</p>
</ion-item>
<ion-button fill="clear" @click="addGeoPoint">{{ translate("Edit") }}</ion-button>
<ion-button expand="block" fill="outline" @click="addGeoPoint">
{{ translate("Add") }}
<ion-icon slot="end" :icon="addCircleOutline" />
</ion-button>
</ion-card>
</div>

<ion-card>
<ion-card-header>
Expand Down Expand Up @@ -163,10 +189,8 @@
<ion-toggle :checked="true" slot="end" />
</ion-item>
<ion-item lines="full">
<ion-label>{{ translate("Days to ship") }} {{ 2 }}</ion-label>
<ion-button color="medium" fill="clear" slot="end">
<ion-icon slot="icon-only" :icon="closeOutline" />
</ion-button>
<ion-label>{{ translate("Days to ship") }}</ion-label>
<ion-input type="number" min="0" placeholder="0"/>
</ion-item>
<ion-button fill="outline" expand="block">
{{ translate("Update days to ship") }}
Expand Down Expand Up @@ -213,6 +237,7 @@ import {
IonContent,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonList,
Expand All @@ -222,11 +247,14 @@ import {
IonTitle,
IonToggle,
IonToolbar,
popoverController
popoverController,
modalController
} from '@ionic/vue'
import { addOutline, addCircleOutline, closeOutline, ellipsisVerticalOutline } from 'ionicons/icons'
import OpenStorePopover from '@/components/OpenStorePopover.vue';
import { translate } from '@hotwax/dxp-components';
import AddAddressModal from '@/components/AddAddressModal.vue'
import AddGeoPointModal from '@/components/AddGeoPointModal.vue';
export default defineComponent({
name: 'FacilityDetails',
Expand All @@ -243,6 +271,7 @@ export default defineComponent({
IonContent,
IonHeader,
IonIcon,
IonInput,
IonItem,
IonLabel,
IonList,
Expand All @@ -257,10 +286,26 @@ export default defineComponent({
async openStorePopover(ev: Event) {
const popover = await popoverController.create({
component: OpenStorePopover,
event: ev
event: ev,
showBackdrop: false
});
return popover.present()
},
async addAddress() {
const addAddressModal = await modalController.create({
component: AddAddressModal
})
addAddressModal.present()
},
async addGeoPoint() {
const addGeoPointModal = await modalController.create({
component: AddGeoPointModal
})
addGeoPointModal.present()
}
},
setup() {
return {
Expand Down

0 comments on commit 2ac5502

Please sign in to comment.