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: Added the support for using facility selector from dxp-component(#dxp/228) #753

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
454 changes: 95 additions & 359 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.6",
"@hotwax/dxp-components": "^1.15.2",
"@hotwax/oms-api": "^1.14.0",
"@hotwax/dxp-components": "file:../dxp-components",
"@hotwax/oms-api": "file:../oms-api",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
"@ionic/vue-router": "^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, 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, 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 @@ -10,6 +10,7 @@ export {
getNotificationUserPrefTypeIds,
getProductIdentificationPref,
getUserFacilities,
getUserPreference,
hasError,
initialise,
logout,
Expand All @@ -23,5 +24,6 @@ export {
updateInstanceUrl,
updateToken,
setUserTimeZone,
setUserPreference,
getAvailableTimeZones
}
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, mailUnreadOutline, mailOpenOutline, checkmarkDoneOutl
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 @@ -179,6 +180,7 @@ export default defineComponent({
return {
appPages,
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 @@ -204,6 +204,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 @@ -289,6 +290,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 @@ -466,6 +468,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 @@ -201,6 +201,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 order information...": "Obteniendo información del pedido...",
"Fetching pickers": "Fetching pickers",
Expand Down Expand Up @@ -288,6 +289,7 @@
"No channels found": "No se encontraron canales",
"No data available": "¡No hay datos disponibles!",
"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": "Aún no se han enviado envíos",
"No shipping label error received from carrier": "No se encontraron datos.",
Expand Down Expand Up @@ -463,6 +465,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 @@ -204,6 +204,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 @@ -288,6 +289,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 @@ -463,6 +465,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
9 changes: 6 additions & 3 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, getProductIdentificationPref, initialise, setProductIdentificationPref, setUserLocale, setUserTimeZone,
getAvailableTimeZones } from './adapter';
import { getConfig, 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 @@ -67,7 +67,10 @@ const app = createApp(App)
setUserLocale,
setUserTimeZone,
storeClientRegistrationToken,
getAvailableTimeZones
getAvailableTimeZones,
getUserFacilities,
setUserPreference,
getUserPreference
});

router.isReady().then(() => {
Expand Down
5 changes: 4 additions & 1 deletion src/services/UtilService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { api, client, hasError } from '@/adapter';
import logger from '@/logger';
import store from '@/store';
import { isPdf } from '@/utils';
import { useUserStore } from '@hotwax/dxp-components'

const fetchShipmentMethods = async (query: any): Promise <any> => {
return api({
Expand Down Expand Up @@ -29,6 +30,8 @@ const fetchPicklistInformation = async (query: any): Promise <any> => {

const findShipmentIdsForOrders = async(picklistBinIds: Array<string>, orderIds: Array<string>, statusId = ["SHIPMENT_APPROVED", "SHIPMENT_INPUT"]): Promise<any> => {
let shipmentIdsForOrders = {};
const currentFacility: any = useUserStore().getCurrentFacility
const facilityId = currentFacility?.facilityId

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


Expand Down Expand Up @@ -358,14 +358,16 @@ const actions: ActionTree<CarrierState, RootState> = {
async fetchFacilityCarriers({ state, commit }, payload) {
let facilityCarriers = [] as any;
let viewIndex = 0, resp, docCount = 0;

const currentFacility: any = useUserStore().getCurrentFacility
const facilityId = currentFacility?.facilityId

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