Skip to content

Commit

Permalink
Implemented: app version component from dxp-components (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Mar 7, 2024
1 parent 3c9a4ee commit b7fa8d2
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 70 deletions.
86 changes: 51 additions & 35 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.1.0",
"@hotwax/dxp-components": "^1.11.0",
"@hotwax/dxp-components": "^1.12.1",
"@hotwax/oms-api": "^1.10.0",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
Expand Down
6 changes: 3 additions & 3 deletions src/components/ClosePurchaseOrderModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ion-list>
<ion-item :button="isPOItemStatusPending(item)" v-for="(item, index) in getPOItems()" :key="index" @click="item.isChecked = !item.isChecked">
<ion-thumbnail slot="start">
<ShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label>
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
Expand Down Expand Up @@ -66,7 +66,7 @@ import { defineComponent } from 'vue';
import { mapGetters, useStore } from 'vuex'
import { OrderService } from "@/services/OrderService";
import { productHelpers } from '@/utils';
import { ShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { useRouter } from 'vue-router';
export default defineComponent({
Expand All @@ -87,7 +87,7 @@ export default defineComponent({
IonTitle,
IonThumbnail,
IonToolbar,
ShopifyImg
DxpShopifyImg
},
computed: {
...mapGetters({
Expand Down
6 changes: 3 additions & 3 deletions src/components/ImageModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ion-header>

<ion-content class="ion-text-center">
<ShopifyImg :src="imageUrl" />
<DxpShopifyImg :src="imageUrl" />

</ion-content>
</template>
Expand All @@ -29,7 +29,7 @@ import {
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { closeOutline } from 'ionicons/icons';
import { ShopifyImg } from '@hotwax/dxp-components';
import { DxpShopifyImg } from '@hotwax/dxp-components';
export default defineComponent({
name: 'ImageModal',
Expand All @@ -41,7 +41,7 @@ export default defineComponent({
IonIcon,
IonTitle,
IonToolbar,
ShopifyImg
DxpShopifyImg
},
props: ["imageUrl", "productName"],
methods: {
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Authenticating": "Authenticating",
"Are you sure you have received the purchase order for the selected items? Once closed, the shipments for the selected items wont be available for receiving later.": "Are you sure you have received the purchase order for the selected items? { space } Once closed, the shipments for the selected items won't be available for receiving later.",
"Arrival date": "Arrival date",
"Built: ": "Built: {builtDateTime}",
"Cancel": "Cancel",
"Change": "Change",
"Choosing a product identifier allows you to view products with your preferred identifiers.": "Choosing a product identifier allows you to view products with your preferred identifiers.",
Expand Down Expand Up @@ -123,6 +124,7 @@
"To close the purchase order, select all.": "To close the purchase order, select all.",
"Unable to update product identifier preference": "Unable to update product identifier preference",
"Username": "Username",
"Version: ": "Version: {appVersion}",
"You do not have permission to access this page": "You do not have permission to access this page",
"ZeroQuantity": "ZeroQuantity"
}
1 change: 1 addition & 0 deletions src/store/modules/user/UserState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default interface UserState {
facilityLocationsByFacilityId: any;
productIdentificationPref: any;
permissions: any;
pwaState: any;
}
4 changes: 4 additions & 0 deletions src/store/modules/user/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ const actions: ActionTree<UserState, RootState> = {
} catch(err) {
console.error(err)
}
},

updatePwaState({ commit }, payload) {
commit(types.USER_PWA_STATE_UPDATED, payload);
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const getters: GetterTree <UserState, RootState> = {
},
getProductIdentificationPref: (state) => {
return state.productIdentificationPref;
},
getPwaState(state) {
return state.pwaState;
}
}
export default getters;
4 changes: 4 additions & 0 deletions src/store/modules/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const userModule: Module<UserState, RootState> = {
productIdentificationPref: {
primaryId: 'productId',
secondaryId: ''
},
pwaState: {
updateExists: false,
registration: null,
}
},
getters,
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/user/mutation-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export const USER_INSTANCE_URL_UPDATED = SN_USER + '/INSTANCE_URL_UPDATED'
export const USER_CURRENT_ECOM_STORE_UPDATED = SN_USER + '/CURRENT_ECOM_STORE_UPDATED'
export const USER_FACILITY_LOCATIONS_BY_FACILITY_ID = SN_USER + '/FACILITY_LOCATIONS_BY_FACILITY_ID'
export const USER_PREF_PRODUCT_IDENT_CHANGED = SN_USER + '/PREF_PRODUCT_IDENT_CHANGED'
export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED'
export const USER_PERMISSIONS_UPDATED = SN_USER + '/PERMISSIONS_UPDATED'
export const USER_PWA_STATE_UPDATED = SN_USER + '/PWA_STATE_UPDATED'
4 changes: 4 additions & 0 deletions src/store/modules/user/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ const mutations: MutationTree <UserState> = {
},
[types.USER_PERMISSIONS_UPDATED] (state, payload) {
state.permissions = payload
},
[types.USER_PWA_STATE_UPDATED](state, payload) {
state.pwaState.registration = payload.registration;
state.pwaState.updateExists = payload.updateExists;
}
}
export default mutations;
6 changes: 3 additions & 3 deletions src/views/AddProductModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
<DxpShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
Expand Down Expand Up @@ -61,7 +61,7 @@ import { defineComponent } from 'vue';
import { closeOutline, checkmarkCircle } from 'ionicons/icons';
import { mapGetters } from 'vuex'
import { useStore } from "@/store";
import { ShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { showToast } from '@/utils'
export default defineComponent({
Expand All @@ -81,7 +81,7 @@ export default defineComponent({
IonThumbnail,
IonTitle,
IonToolbar,
ShopifyImg
DxpShopifyImg
},
data() {
return {
Expand Down
6 changes: 3 additions & 3 deletions src/views/AddProductToPOModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
<DxpShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
Expand Down Expand Up @@ -60,7 +60,7 @@ import { defineComponent } from 'vue';
import { closeOutline, checkmarkCircle } from 'ionicons/icons';
import { mapGetters } from 'vuex'
import { useStore } from "@/store";
import { ShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { showToast } from '@/utils'
export default defineComponent({
Expand All @@ -80,7 +80,7 @@ export default defineComponent({
IonThumbnail,
IonTitle,
IonToolbar,
ShopifyImg
DxpShopifyImg
},
data() {
return {
Expand Down
8 changes: 4 additions & 4 deletions src/views/PurchaseOrderDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="product-info">
<ion-item lines="none">
<ion-thumbnail slot="start" @click="openImage(getProduct(item.productId).mainImageUrl, getProduct(item.productId).productName)">
<ShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
Expand Down Expand Up @@ -119,7 +119,7 @@
<div class="product-info">
<ion-item lines="none">
<ion-thumbnail slot="start" @click="openImage(getProduct(item.productId).mainImageUrl, getProduct(item.productId).productName)">
<ShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
<DxpShopifyImg size="small" :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label class="ion-text-wrap">
<h2>{{ productHelpers.getProductIdentificationValue(productIdentificationPref.primaryId, getProduct(item.productId)) }}</h2>
Expand Down Expand Up @@ -184,7 +184,7 @@ import {
import { defineComponent } from 'vue';
import { addOutline, cameraOutline, checkmarkDone, copyOutline, eyeOffOutline, eyeOutline, locationOutline, saveOutline, timeOutline } from 'ionicons/icons';
import ReceivingHistoryModal from '@/views/ReceivingHistoryModal.vue'
import { ShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { useStore, mapGetters } from 'vuex';
import { useRouter } from 'vue-router';
import Scanner from "@/components/Scanner.vue"
Expand All @@ -198,7 +198,7 @@ import { Actions, hasPermission } from '@/authorization'
export default defineComponent({
name: "PurchaseOrderDetails",
components: {
ShopifyImg,
DxpShopifyImg,
IonBackButton,
IonBadge,
IonButton,
Expand Down
6 changes: 3 additions & 3 deletions src/views/ReceivingHistoryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ion-list v-for="(item, index) in items" :key="index">
<ion-item>
<ion-thumbnail slot="start">
<ShopifyImg :src="getProduct(item.productId).mainImageUrl" />
<DxpShopifyImg :src="getProduct(item.productId).mainImageUrl" />
</ion-thumbnail>
<ion-label>
{{ item.receiversFullName }}
Expand Down Expand Up @@ -52,14 +52,14 @@ import {
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { closeOutline } from 'ionicons/icons';
import { ShopifyImg, translate } from '@hotwax/dxp-components';
import { DxpShopifyImg, translate } from '@hotwax/dxp-components';
import { mapGetters, useStore } from "vuex";
import { DateTime } from 'luxon';
export default defineComponent({
name: "ReceivingHistoryModal",
components: {
ShopifyImg,
DxpShopifyImg,
IonButton,
IonButtons,
IonContent,
Expand Down
Loading

0 comments on commit b7fa8d2

Please sign in to comment.