Skip to content

Commit

Permalink
Merge pull request #753 from R-Sourabh/#dxp/228-facility-selector
Browse files Browse the repository at this point in the history
Implemented: Added the support for using facility selector from dxp-component(#dxp/228)
  • Loading branch information
ravilodhi authored Nov 19, 2024
2 parents cd733f3 + 40c4515 commit 92e8238
Show file tree
Hide file tree
Showing 36 changed files with 168 additions and 157 deletions.
8 changes: 4 additions & 4 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.2.6",
"@hotwax/dxp-components": "^1.15.5",
"@hotwax/dxp-components": "^1.16.0",
"@hotwax/oms-api": "^1.16.0",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
Expand Down
6 changes: 4 additions & 2 deletions src/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, fetchGoodIdentificationTypes, getUserFacilities, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken,
subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones } from '@hotwax/oms-api'
import { api, client, getConfig, getNotificationEnumIds, getNotificationUserPrefTypeIds, getProductIdentificationPref, fetchGoodIdentificationTypes, getUserFacilities, getUserPreference, hasError, initialise, logout, removeClientRegistrationToken, resetConfig, setProductIdentificationPref, setUserLocale, storeClientRegistrationToken,
subscribeTopic, unsubscribeTopic, updateInstanceUrl, updateToken, setUserTimeZone, setUserPreference, getAvailableTimeZones } from '@hotwax/oms-api'

export {
api,
Expand All @@ -11,6 +11,7 @@ export {
getProductIdentificationPref,
fetchGoodIdentificationTypes,
getUserFacilities,
getUserPreference,
hasError,
initialise,
logout,
Expand All @@ -24,5 +25,6 @@ export {
updateInstanceUrl,
updateToken,
setUserTimeZone,
setUserPreference,
getAvailableTimeZones
}
8 changes: 5 additions & 3 deletions src/components/DownloadRejectedOrdersModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
} from '@ionic/vue';
import { computed, defineComponent } from 'vue';
import { closeOutline, cloudDownloadOutline} from 'ionicons/icons';
import { getProductIdentificationValue, translate, useProductIdentificationStore } from '@hotwax/dxp-components';
import { getProductIdentificationValue, translate, useProductIdentificationStore, useUserStore } from '@hotwax/dxp-components';
import { mapGetters, useStore } from 'vuex';
import { escapeSolrSpecialChars, prepareSolrQuery } from '@/utils/solrHelper'
import { RejectionService } from '@/services/RejectionService'
Expand Down Expand Up @@ -136,8 +136,7 @@
computed: {
...mapGetters({
getProduct: 'product/getProduct',
rejectedOrders: 'rejection/getRejectedOrders',
currentFacility: 'user/getCurrentFacility',
rejectedOrders: 'rejection/getRejectedOrders'
})
},
methods: {
Expand Down Expand Up @@ -297,8 +296,10 @@
},
setup() {
const store = useStore()
const userStore = useUserStore()
const productIdentificationStore = useProductIdentificationStore();
let productIdentificationPref = computed(() => productIdentificationStore.getProductIdentificationPref)
let currentFacility: any = computed(() => userStore.getCurrentFacility)
return {
Expand All @@ -308,6 +309,7 @@
productIdentificationPref,
store,
translate,
currentFacility
}
}
});
Expand Down
6 changes: 4 additions & 2 deletions src/components/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { arrowBackOutline, backspaceOutline, mailUnreadOutline, mailOpenOutline,
import { useStore } from "@/store";
import { useRouter } from "vue-router";
import { hasPermission } from "@/authorization";
import { translate } from '@hotwax/dxp-components';
import { translate, useUserStore } from '@hotwax/dxp-components';
export default defineComponent({
name: "Menu",
Expand All @@ -70,7 +70,6 @@ export default defineComponent({
computed: {
...mapGetters({
isUserAuthenticated: 'user/isUserAuthenticated',
currentFacility: 'user/getCurrentFacility',
})
},
methods: {
Expand All @@ -81,6 +80,8 @@ export default defineComponent({
setup() {
const store = useStore();
const router = useRouter();
const userStore = useUserStore()
let currentFacility: any = computed(() => userStore.getCurrentFacility)
const appPages = [
{
Expand Down Expand Up @@ -189,6 +190,7 @@ export default defineComponent({
appPages,
backspaceOutline,
checkmarkDoneOutline,
currentFacility,
hasPermission,
arrowBackOutline,
mailUnreadOutline,
Expand Down
10 changes: 6 additions & 4 deletions src/components/NotificationPreferenceModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ import {
modalController,
alertController,
} from "@ionic/vue";
import { defineComponent } from "vue";
import { defineComponent, computed } from "vue";
import { closeOutline, save } from "ionicons/icons";
import { mapGetters, useStore } from "vuex";
import { translate } from '@hotwax/dxp-components'
import { translate, useUserStore } from '@hotwax/dxp-components'
import { showToast } from "@/utils";
import emitter from "@/event-bus"
import { generateTopicName } from "@/utils/firebase";
Expand Down Expand Up @@ -82,7 +82,6 @@ export default defineComponent({
},
computed: {
...mapGetters({
currentFacility: 'user/getCurrentFacility',
instanceUrl: 'user/getInstanceUrl',
notificationPrefs: 'user/getNotificationPrefs'
}),
Expand Down Expand Up @@ -138,7 +137,7 @@ export default defineComponent({
}
},
async handleTopicSubscription() {
const facilityId = (this.currentFacility as any).facilityId
const facilityId = this.currentFacility?.facilityId
const subscribeRequests = [] as any
this.notificationPrefToUpdate.subscribe.map(async (enumId: string) => {
const topicName = generateTopicName(facilityId, enumId)
Expand Down Expand Up @@ -182,9 +181,12 @@ export default defineComponent({
},
setup() {
const store = useStore();
const userStore = useUserStore()
let currentFacility: any = computed(() => userStore.getCurrentFacility)
return {
closeOutline,
currentFacility,
translate,
save,
store
Expand Down
12 changes: 7 additions & 5 deletions src/components/TransferOrderFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ import {
IonTitle,
IonToolbar
} from "@ionic/vue";
import { defineComponent } from "vue";
import { defineComponent, computed } from "vue";
import { albumsOutline, banOutline, barChartOutline, calendarNumberOutline, checkmarkDoneOutline, closeOutline, filterOutline, iceCreamOutline, libraryOutline, pulseOutline, settings, shirtOutline, ticketOutline } from "ionicons/icons";
import { mapGetters, useStore } from 'vuex'
import { escapeSolrSpecialChars, prepareOrderQuery } from '@/utils/solrHelper';
import { UtilService } from '@/services/UtilService';
import { hasError } from '@/adapter';
import logger from '@/logger';
import { translate } from '@hotwax/dxp-components';
import { translate, useUserStore } from '@hotwax/dxp-components';
export default defineComponent({
name: "TransferOrderFilters",
Expand All @@ -77,7 +77,6 @@ export default defineComponent({
},
computed: {
...mapGetters({
currentFacility: 'user/getCurrentFacility',
transferOrders: 'transferorder/getTransferOrders',
getStatusDesc: 'util/getStatusDesc',
getShipmentMethodDesc: 'util/getShipmentMethodDesc',
Expand Down Expand Up @@ -126,7 +125,7 @@ export default defineComponent({
filters: {
'-orderStatusId': { value: 'ORDER_CREATED' },
orderTypeId: { value: 'TRANSFER_ORDER' },
facilityId: { value: escapeSolrSpecialChars(this.currentFacility.facilityId) },
facilityId: { value: escapeSolrSpecialChars(this.currentFacility?.facilityId) },
productStoreId: { value: this.currentEComStore.productStoreId }
},
facet: {
Expand Down Expand Up @@ -172,14 +171,17 @@ export default defineComponent({
},
setup() {
const store = useStore();
const userStore = useUserStore()
let currentFacility: any = computed(() => userStore.getCurrentFacility)
return {
albumsOutline,
banOutline,
barChartOutline,
calendarNumberOutline,
checkmarkDoneOutline,
closeOutline,
currentFacility,
filterOutline,
iceCreamOutline,
libraryOutline,
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"Failed to update shipment method detail.": "Failed to update shipment method detail.",
"Failed to update tracking code settings.": "Failed to update tracking code settings.",
"Failed to update variance type.": "Failed to update variance type.",
"Fetching facilities": "Fetching facilities",
"Fetching gift card info.": "Fetching gift card info.",
"Fetching time zones": "Fetching time zones",
"Fetching order information...": "Fetching order information...",
Expand Down Expand Up @@ -305,6 +306,7 @@
"No carrier found.": "No carrier found.",
"No data available": "No data available",
"No data found": "No data found",
"No facilities found": "No facilities found",
"No rejection reasons found.": "No rejection reasons found.",
"No shipments have been shipped yet": "No shipments have been shipped yet",
"No shipping label error received from carrier.": "No shipping label error received from carrier",
Expand Down Expand Up @@ -501,6 +503,8 @@
"Select an issue": "Select an issue",
"Select CSV": "Select CSV",
"Select facility": "Select facility",
"Select Facility": "Select Facility",
"Search facilities": "Search facilities",
"Select store": "Select store",
"Select the column for the following information in the uploaded CSV.": "Select the column for the following information in the uploaded CSV.",
"Select the fields you want to include in your export": "Select the fields you want to include in your export",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"Failed to update shipment method detail.": "Error al actualziar detalles metodo de envio.",
"Failed to update tracking code settings.": "Error al actualizar la configuracion del codigo de seguimiento.",
"Failed to update variance type.": "Error al actualizar el tipo de variante.",
"Fetching facilities": "Fetching facilities",
"Fetching gift card info.": "Obteniendo información de gift card.",
"Fetching order information...": "Obteniendo información del pedido...",
"Fetching pickers": "Obteniendo recolectores",
Expand Down Expand Up @@ -304,6 +305,7 @@
"No channels found": "No se encontraron canales",
"No data available": "¡No hay datos disponibles!",
"No data found": "No se encontro dato",
"No facilities found": "No facilities found",
"No rejection reasons found.": "No se encontro razon de rechazo.",
"No shipments have been shipped yet": "Aún no se han enviado envíos",
"No shipping label error received from carrier": "No se encontraron datos.",
Expand Down Expand Up @@ -498,6 +500,8 @@
"Select an issue": "Selecciona un problema",
"Select CSV": "Seleccionar CSV",
"Select facility": "Seleccionar instalación",
"Select Facility": "Select Facility",
"Search facilities": "Search facilities",
"Select store": "Seleccionar tienda",
"Select the column for the following information in the uploaded CSV.": "Selecciona la columna para la siguiente información en el CSV cargado.",
"Select the fields you want to include in your export": "Selecciona los campos que deseas incluir en tu exportación",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
"Failed to update shipment method detail.": "Failed to update shipment method detail.",
"Failed to update tracking code settings.": "追跡コード設定の更新に失敗しました。",
"Failed to update variance type.": "変動タイプの更新に失敗しました。",
"Fetching facilities": "Fetching facilities",
"Fetching gift card info.": "Fetching gift card info.",
"Fetching time zones": "タイムゾーンの取得中",
"Fetching order information...": "注文情報の取得中...",
Expand Down Expand Up @@ -304,6 +305,7 @@
"No carrier found.": "キャリアが見つかりません。",
"No data available": "データがありません",
"No data found": "何もデータが見つかりませんでした",
"No facilities found": "No facilities found",
"No rejection reasons found.": "拒否理由が見つかりません。",
"No shipments have been shipped yet": "まだ出荷された出荷はありません",
"No shipping label error received from carrier.": "キャリアから配送ラベルエラーは受信されていません",
Expand Down Expand Up @@ -498,6 +500,8 @@
"Select an issue": "問題を選択",
"Select CSV": "CSVを選択",
"Select facility": "施設を選択",
"Select Facility": "Select Facility",
"Search facilities": "Search facilities",
"Select store": "ストアを選択",
"Select the column for the following information in the uploaded CSV.": "アップロードされたCSV内の次の情報に対する列を選択。",
"Select the fields you want to include in your export": "エクスポートに含めるフィールドを選択",
Expand Down
7 changes: 5 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import permissionRules from '@/authorization/Rules';
import permissionActions from '@/authorization/Actions';
import { dxpComponents } from '@hotwax/dxp-components';
import { login, logout, loader } from '@/utils/user';
import { getConfig, fetchGoodIdentificationTypes, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, setUserTimeZone,
getAvailableTimeZones } from './adapter';
import { getConfig, fetchGoodIdentificationTypes, getProductIdentificationPref, getUserFacilities, getUserPreference, initialise, setProductIdentificationPref, setUserLocale, getAvailableTimeZones, setUserTimeZone,
setUserPreference } from './adapter';
import localeMessages from '@/locales';
import { addNotification, storeClientRegistrationToken } from '@/utils/firebase';

Expand Down Expand Up @@ -70,6 +70,9 @@ const app = createApp(App)
setUserTimeZone,
storeClientRegistrationToken,
getAvailableTimeZones,
getUserFacilities,
setUserPreference,
getUserPreference,
hasPermission
});

Expand Down
4 changes: 2 additions & 2 deletions src/services/UtilService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { api, hasError } from '@/adapter';
import logger from '@/logger';
import store from '@/store';
import { isPdf } from '@/utils';
import { isPdf, getCurrentFacilityId } from '@/utils';

const fetchShipmentMethods = async (query: any): Promise <any> => {
return api({
Expand Down Expand Up @@ -37,7 +37,7 @@ const findShipmentIdsForOrders = async(picklistBinIds: Array<string>, orderIds:
"primaryOrderId_op": "in",
"picklistBinId": picklistBinIds,
"picklistBinId_op": "in",
"originFacilityId": store.state.user.currentFacility.facilityId,
"originFacilityId": getCurrentFacilityId(),
"statusId": statusId,
"statusId_op": "in"
},
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/carrier/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as types from './mutation-types'
import logger from '@/logger'
import store from '@/store';
import { translate } from '@hotwax/dxp-components';
import { showToast, isValidCarrierCode, isValidDeliveryDays } from '@/utils';
import { showToast, isValidCarrierCode, isValidDeliveryDays, getCurrentFacilityId } from '@/utils';


const actions: ActionTree<CarrierState, RootState> = {
Expand Down Expand Up @@ -358,14 +358,14 @@ const actions: ActionTree<CarrierState, RootState> = {
async fetchFacilityCarriers({ state, commit }, payload) {

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'state' is defined but never used

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

'payload' is defined but never used

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'state' is defined but never used

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / build_and_deploy

'payload' is defined but never used

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'state' is defined but never used

Check warning on line 358 in src/store/modules/carrier/actions.ts

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

'payload' is defined but never used
let facilityCarriers = [] as any;
let viewIndex = 0, resp, docCount = 0;

try {
do {
const params = {
"entityName": "FacilityAndParty",
"inputFields": {
"roleTypeId": "CARRIER",
"facilityId": this.state.user.currentFacility.facilityId
"facilityId": getCurrentFacilityId()
},
"fieldList": ["facilityId", "partyId", "firstName", "lastName", "groupName", "roleTypeId", "fromDate"],
"noConditionFind": "Y",
Expand Down
Loading

0 comments on commit 92e8238

Please sign in to comment.