Skip to content

Commit

Permalink
Merge pull request #5 from ymaheshwari1/#2
Browse files Browse the repository at this point in the history
Implemented: landing page for the app(#2)
  • Loading branch information
ymaheshwari1 authored Nov 16, 2023
2 parents d4636ad + 942228f commit e9c6644
Show file tree
Hide file tree
Showing 26 changed files with 1,070 additions and 55 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/firebase-hosting-merge.yml

This file was deleted.

11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@capacitor/core": "^2.4.7",
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.4",
"@hotwax/dxp-components": "^1.11.0",
"@hotwax/oms-api": "^1.11.0",
"@ionic/core": "^6.7.5",
Expand Down
118 changes: 118 additions & 0 deletions src/components/OrderLimitPopover.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<template>
<ion-content>
<ion-list>
<ion-list-header>
{{ translate("Fulfillment Capacity") }}
</ion-list-header>
<ion-item button @click="updateOrderLimitType('unlimited')">
<ion-icon slot="end" :icon="lockOpenOutline" />
{{ translate("Unlimited Capacity") }}
</ion-item>
<ion-item button @click="updateOrderLimitType('no-capacity')">
{{ translate("No Capacity") }}
<ion-icon slot="end" :icon="lockClosedOutline" />
</ion-item>
<ion-item button lines="none" @click="updateOrderLimitType('custom')">
{{ translate("Custom") }}
</ion-item>
</ion-list>
</ion-content>
</template>

<script lang="ts">
import {
IonContent,
IonIcon,
IonItem,
IonList,
IonListHeader,
alertController,
popoverController
} from "@ionic/vue";
import { defineComponent } from "vue";
import { lockClosedOutline, lockOpenOutline } from 'ionicons/icons'
import { translate } from '@hotwax/dxp-components'
import { showToast } from '@/utils';
export default defineComponent({
name: "OrderLimitPopover",
components: {
IonContent,
IonIcon,
IonItem,
IonList,
IonListHeader
},
props: ['fulfillmentOrderLimit'],
data() {
return {
setLimit: this.fulfillmentOrderLimit as any
}
},
methods: {
async updateOrderLimitType(orderLimitType: string) {
let header = "Unlimited fulfillment capacity"
let message = "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option."
let showInput = false
if (orderLimitType === 'custom') {
header = "Custom fulfillment capacity"
message = ""
showInput = true
} else if (orderLimitType === 'no-capacity') {
this.setLimit = 0
header = "No fulfillment capacity"
message = "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option."
} else if (orderLimitType === 'unlimited') {
this.setLimit = ""
}
this.showOrderLimitAlert(header, message, showInput)
},
async showOrderLimitAlert(header: string, message: string, showInput: boolean) {
const alert = await alertController.create({
header: translate(header),
message: translate(message, {space: '</br></br>'}),
inputs: showInput ? [{
name: "setLimit",
placeholder: translate("Order fulfillment capacity"),
type: "number",
min: 0
}] : [],
buttons: [{
text: translate('Cancel'),
role: "cancel"
},
{
text: translate('Apply'),
handler: (data) => {
let setLimit = this.setLimit as any;
if(data) {
if(data.setLimit === '') {
showToast(translate('Please provide a value'))
return false;
} else if(data.setLimit <= 0) {
showToast(translate('Provide a value greater than 0'))
return false;
} else {
setLimit = data.setLimit
}
}
popoverController.dismiss(setLimit)
}
}]
})
await alert.present()
}
},
setup() {
return {
lockClosedOutline,
lockOpenOutline,
translate
}
},
});
</script>
58 changes: 53 additions & 5 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,112 @@
{
"A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.": "A store represents a company or a unique catalog of products. If your OMS is connected to multiple eCommerce stores selling different collections of products, you may have multiple Product Stores set up in HotWax Commerce.",
"Add": "Add",
"Add timings": "Add timings",
"Address": "Address",
"Address line 1": "Address line 1",
"Address line 2": "Address line 2",
"All": "All",
"Allow pickup": "Allow pickup",
"App": "App",
"Apply": "Apply",
"Back to Launchpad": "Back to Launchpad",
"Built: ": "Built: { builtDateTime }",
"Cancel": "Cancel",
"Change": "Change",
"Change time zone": "Change time zone",
"Choose language": "Choose language",
"City": "City",
"Click the backdrop to dismiss.": "Click the backdrop to dismiss.",
"Closing Time": "Closing Time",
"Configure the order fulfillment capacity of your facility.": "Configure the order fulfillment capacity of your facility.",
"Country": "Country",
"Custom": "Custom",
"Custom fulfillment capacity": "Custom fulfillment capacity",
"Days to ship": "Days to ship",
"Dismiss": "Dismiss",
"Edit": "Edit",
"Facility details": "Facility details",
"Facilities": "Facilities",
"Facility": "Facility",
"Facility Management": "Facility Management",
"Fetching TimeZones": "Fetching TimeZones",
"Facility details": "Facility details",
"Find Facilities": "Find Facilities",
"Friday": "Friday",
"Fulfillment Capacity": "Fulfillment Capacity",
"Fulfillment capacity updated successfully for ": "Fulfillment capacity updated successfully for {facilityName}",
"Fulfillment Settings": "Fulfillment Settings",
"Generate": "Generate",
"Generate shipping labels": "Generate shipping labels",
"Go to Launchpad": "Go to Launchpad",
"Go to OMS": "Go to OMS",
"Groups": "Groups",
"Instance Url": "Instance Url",
"Language": "Language",
"Latitude": "Latitude",
"Latitude & Longitude": "Latitude & Longitude",
"Loading": "Loading",
"Logging out": "Logging out",
"Login": "Login",
"Login failed": "Login failed",
"Logout": "Logout",
"Longitude": "Longitude",
"Make primary": "Make primary",
"Monday": "Monday",
"No Capacity": "No Capacity",
"No capacity": "No capacity",
"No facilities found": "No facilities found",
"No fulfillment capacity": "No fulfillment capacity",
"No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.": "No capacity sets the fulfillment capacity to 0, preventing any new orders from being allocated to this facility. Use the \"Reject all orders\" option in the fulfillment pages to clear your facilities fulfillment queue. To add a fulfillment capacity to this facility, use the custom option.",
"No time zone found": "No time zone found",
"OMS": "OMS",
"OMS instance": "OMS instance",
"Online Order Fulfillment": "Online Order Fulfillment",
"Opening Time": "Opening Time",
"Operating hours": "Operating hours",
"Password": "Password",
"Order fulfillment capacity": "Order fulfillment capacity",
"Parking": "Parking",
"Password": "Password",
"Please contact the administrator.": "Please contact the administrator.",
"primary store": "primary store",
"Product Store": "Product Store",
"Product Stores": "Product Stores",
"Reason:": "Reason:",
"Reset": "Reset",
"Saturday": "Saturday",
"Save": "Save",
"Search facilities": "Search facilities",
"Select store": "Select store",
"Select time": "Select time",
"Select time zone": "Select time zone",
"Search time zones": "Search time zones",
"Select facility": "Select facility",
"Select time zone": "Select time zone",
"Select product stores": "Select product stores",
"Select your preferred language.": "Select your preferred language.",
"Sell Online": "Sell Online",
"Settings": "Settings",
"Sell Inventory Online": "Sell Inventory Online",
"Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.": "Setting fulfillment capacity to 0 disables new order from being allocated to this facility. Leave this empty if this facility's fulfillment capacity is unrestricted.",
"Settings": "Settings",
"Something went wrong": "Something went wrong",
"Something went wrong while login. Please contact administrator.": "Something went wrong while login. Please contact administrator.",
"Sorry, your username or password is incorrect. Please try again.": "Sorry, your username or password is incorrect. Please try again.",
"Specify which facility you want to operate from. Order, inventory and other configuration data will be specific to the facility you select.": "Specify which facility you want to operate from. Order, inventory and other configuration data will be specific to the facility you select.",
"State": "State",
"Store": "Store",
"store name": "store name",
"Sunday": "Sunday",
"Thursday": "Thursday",
"The timezone you select is used to ensure automations you schedule are always accurate to the time you select.": "The timezone you select is used to ensure automations you schedule are always accurate to the time you select.",
"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.",
"This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.": "This is the name of the OMS you are connected to right now. Make sure that you are connected to the right instance before proceeding.",
"Thursday": "Thursday",
"Time zone updated successfully": "Time zone updated successfully",
"Timezone": "Timezone",
"Tuesday": "Tuesday",
"Type": "Type",
"threshold consumed": "threshold consumed",
"Unlimited Capacity": "Unlimited Capacity",
"Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.": "Unlimited capacity removes the fulfillment capacity limit entirely. To add a fulfillment capacity to this facility, use the custom option.",
"Unlimited fulfillment capacity": "Unlimited fulfillment capacity",
"Unlimited orders": "Unlimited orders",
"Unlink":"Unlink",
"Update days to ship": "Update days to ship",
"Username": "Username",
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import '@ionic/vue/css/display.css';

/* Theme variables */
import './theme/variables.css';
import '@hotwax/apps-theme';

import store from './store'
import permissionPlugin from '@/authorization';
Expand Down
24 changes: 19 additions & 5 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import Settings from "@/views/Settings.vue"
import FacilityDetails from '@/views/FacilityDetails.vue';
import store from '@/store'
import { hasPermission } from '@/authorization';
import { showToast } from '@/utils'
import 'vue-router'
import { useAuthStore, DxpLogin, translate } from '@hotwax/dxp-components'
import { loader } from '@/utils/user';
import FacilityManagement from '@/views/FacilityManagement.vue'
import Settings from '@/views/Settings.vue';
import FindFacilities from '@/views/FindFacilities.vue';

// Defining types for the meta values
declare module 'vue-router' {
Expand Down Expand Up @@ -39,24 +41,36 @@ const loginGuard = (to: any, from: any, next: any) => {
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/settings'
redirect: '/facility-management'
},
{
path: '/login',
name: 'Login',
component: DxpLogin,
beforeEnter: loginGuard
},
{
path: '/facility-management',
name: 'FacilityManagement',
component: FacilityManagement,
beforeEnter: authGuard
},
{
path: '/find-facilities',
name: 'FindFacilities',
component: FindFacilities,
beforeEnter: authGuard
},
{
path: "/facility-details/:facilityId",
props: true,
name: "Facility Details",
component: FacilityDetails,
props: true,
beforeEnter: authGuard
},
{
path: "/settings",
name: "Settings",
path: '/settings',
name: 'Settings',
component: Settings,
beforeEnter: authGuard
}
Expand Down
Loading

0 comments on commit e9c6644

Please sign in to comment.