Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hotwax/preorder into #237
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridwan6947 committed Jul 22, 2024
2 parents 81cae65 + b7fb46e commit 803126b
Show file tree
Hide file tree
Showing 37 changed files with 11,636 additions and 56,177 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ module.exports = {
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
jest: true
}
]
}
]
}
7 changes: 2 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Related Issues
<!-- Put related issue number which this PR is closing. For example #123 -->

Closes #
#

### Short Description and Why It's Useful
<!-- Describe in a few words what is this Pull Request changing and why it's useful -->
Expand All @@ -11,10 +11,7 @@ Closes #
<!-- If you made any changes in the UI layer, please provide before/after screenshots -->


**IMPORTANT NOTICE** - Remember to update `CHANGELOG.md` with description of your change


### Contribution and Currently Important Rules Acceptance
<!-- Please get familiar with following info -->

- [ ] I read and followed [contribution rules](https://github.com/DivanteLtd/vsf-capybara/blob/master/CONTRIBUTING.md)
- [ ] I read and followed [contribution rules](https://github.com/hotwax/preorder#contribution-guideline)
67,040 changes: 11,370 additions & 55,670 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "preorder-app",
"version": "1.16.0",
"version": "1.17.0",
"private": true,
"description": "HotWax Commece Pre-order App",
"scripts": {
Expand All @@ -18,12 +18,12 @@
"@capacitor/ios": "^2.5.0",
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.3",
"@hotwax/dxp-components": "1.8.0",
"@hotwax/oms-api": "^1.10.0",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
"@ionic/vue-router": "6.7.5",
"@hotwax/apps-theme": "^1.2.6",
"@hotwax/dxp-components": "1.13.0",
"@hotwax/oms-api": "1.14.0",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
"@ionic/vue-router": "^7.6.0",
"boon-js": "^2.0.3",
"core-js": "^3.6.5",
"luxon": "^3.2.0",
Expand All @@ -38,27 +38,22 @@
"devDependencies": {
"@capacitor/cli": "2.4.6",
"@intlify/vue-i18n-loader": "^2.0.0-rc.3",
"@types/jest": "^27.5.0",
"@types/luxon": "^3.2.0",
"@typescript-eslint/eslint-plugin": "~5.26.0",
"@typescript-eslint/parser": "~5.26.0",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-e2e-cypress": "~4.5.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-e2e-cypress": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-pwa": "^4.5.11",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/cli-plugin-pwa": "^5.0.8",
"@vue/cli-plugin-router": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
"@vue/cli-service": "~5.0.8",
"@vue/compiler-sfc": "^3.0.0-0",
"@vue/eslint-config-typescript": "^9.1.0",
"@vue/test-utils": "^2.0.0-0",
"@vue/vue3-jest": "^28.0.0",
"cypress": "^8.3.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"jest": "^28.1.0",
"ts-jest": "^28.0.8",
"typescript": "~4.7.4",
"vue-cli-plugin-i18n": "^1.0.1"
}
Expand Down
7 changes: 5 additions & 2 deletions src/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { api, client, getConfig, getProductIdentificationPref, initialise, logout, resetConfig, setProductIdentificationPref, updateInstanceUrl, updateToken } from '@hotwax/oms-api'
import { api, client, getConfig, getProductIdentificationPref, initialise, logout, resetConfig, setProductIdentificationPref, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones, setUserLocale } from '@hotwax/oms-api'

export {
api,
Expand All @@ -10,5 +10,8 @@ export {
resetConfig,
setProductIdentificationPref,
updateInstanceUrl,
updateToken
updateToken,
setUserLocale,
setUserTimeZone,
getAvailableTimeZones
}
9 changes: 8 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"back-order": "back-order",
"Back-order": "Back-order",
"Broker orders": "Broker orders",
"Browser TimeZone": "Browser TimeZone",
"Browser time zone": "Browser time zone",
"Built: ": "Built: {builtDateTime}",
"eCom Store": "eCom Store",
"Cancel": "Cancel",
"Cancel item": "Cancel item",
Expand Down Expand Up @@ -66,6 +69,7 @@
"Excluded ATP": "Excluded ATP",
"from date": "from date",
"Failed to update configuration": "Failed to update configuration",
"Fetching time zones": "Fetching time zones",
"Go to Launchpad": "Go to Launchpad",
"Go to OMS": "Go to OMS",
"History": "History",
Expand Down Expand Up @@ -190,7 +194,9 @@
"Selected variant not available": "Selected variant not available",
"Selected variant not available. Reseting to first variant.": "Selected variant not available. Reseting to first variant.",
"Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.": "Select a new promise date for these orders. This new date will be used for allocating inventory and fulfilling these orders.",
"Selected TimeZone": "Selected TimeZone",
"Select time zone": "Select time zone",
"Select a different time zone": "Select a different time zone",
"Service has been scheduled": "Service has been scheduled",
"Settings": "Settings",
"Ships from date": "Ships from date",
Expand All @@ -212,7 +218,7 @@
"Store": "Store",
"The order count in product cards will be updated based on the filters you select.": "The order count in product cards will be updated based on the filters you select.",
"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.",
"There are no jobs running the in the background right now.": "There are no jobs running the in the background right now.",
"There are no jobs running in the background right now.": "There are no jobs running in the background right now.",
"There are no preorders for the filters you have applied and variants you have selected.": "There are no preorders for the filters you have applied and variants you have selected.",
"There are jobs already pending.": "There are { count } jobs already pending.",
"There is a job already pending.": "There is a job already pending.",
Expand All @@ -236,6 +242,7 @@
"Username": "Username",
"variant": "variant",
"variants": "variants",
"Version: ": "Version: {appVersion}",
"When this product entered there was no sellable inventory and was available in": "When this product entered {categoryName} there was no sellable inventory and {poItemATP} was available in {poId}",
"With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues": "With Hold Pre-order Queue Physical Inventory disabled, the excess inventory is now available for sale online after deducting the queues",
"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.",
Expand Down
5 changes: 5 additions & 0 deletions src/i18n/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import en from "./en.json"

export default {
"en-US": en
};
14 changes: 10 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router';
import './registerServiceWorker'

import { IonicVue } from '@ionic/vue';
import i18n from './i18n'
Expand Down Expand Up @@ -33,11 +32,14 @@ import { login, logout, loader } from './user-utils';
import permissionPlugin from '@/authorization';
import permissionRules from '@/authorization/Rules';
import permissionActions from '@/authorization/Actions';
import { setUserTimeZone, getAvailableTimeZones, setUserLocale} from '@/adapter'
import localeMessages from './i18n/locales';
import { getConfig, getProductIdentificationPref, initialise, setProductIdentificationPref } from '@/adapter'

const app = createApp(App)
.use(IonicVue, {
mode: 'md'
mode: 'md',
innerHTMLTemplatesEnabled: true
})
.use(router)
.use(i18n)
Expand All @@ -52,9 +54,13 @@ const app = createApp(App)
logout,
loader,
appLoginUrl: process.env.VUE_APP_LOGIN_URL as string,
getConfig,
getConfig: getConfig,
initialise: initialise,
localeMessages,
setUserLocale,
setUserTimeZone,
getAvailableTimeZones,
getProductIdentificationPref,
initialise,
setProductIdentificationPref
});

Expand Down
30 changes: 0 additions & 30 deletions src/registerServiceWorker.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Orders from '../views/orders.vue'
import Catalog from '../views/catalog.vue'
import Settings from '../views/settings.vue'
import store from '@/store';
import { Login, useAuthStore } from '@hotwax/dxp-components';
import { DxpLogin, useAuthStore } from '@hotwax/dxp-components';
import { loader } from '@/user-utils';
import { hasPermission } from '@/authorization';
import { showToast } from '@/utils';
Expand Down Expand Up @@ -47,8 +47,8 @@ const routes: Array<RouteRecordRaw> = [
},
{
path: '/login',
name: 'login',
component: Login,
name: 'dxp-login',
component: DxpLogin,
beforeEnter: loginGuard
},
{
Expand Down
16 changes: 0 additions & 16 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ const login = async (username: string, password: string): Promise <any> => {
}
});
}
const getAvailableTimeZones = async (): Promise <any> => {
return api({
url: "getAvailableTimeZones",
method: "get",
cache: true
});
}
const setUserTimeZone = async (payload: any): Promise <any> => {
return api({
url: "setUserTimeZone",
method: "post",
data: payload
});
}

const setUserPreference = async (payload: any): Promise<any> => {
return api({
Expand Down Expand Up @@ -204,12 +190,10 @@ const getUserProfile = async (token: any): Promise<any> => {
}

export const UserService = {
getAvailableTimeZones,
getEComStores,
getPreferredStore,
getUserProfile,
getUserPermissions,
login,
setUserPreference,
setUserTimeZone,
}
7 changes: 7 additions & 0 deletions src/store/modules/order/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ const actions: ActionTree<OrderState, RootState> = {
commit(types.ORDER_SELECTED_ITEMS_UPDATED, { selectedItems: state.selectedItems } );
},

/**
* Clear selected items list
*/
clearSelectedItems ( { commit }) {
commit(types.ORDER_SELECTED_ITEMS_UPDATED, { selectedItems: [] } );
},

/**
* Remove items from selected items
*/
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/stock/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const actions: ActionTree<StockState, RootState> = {
"filters": {
"productId": productIds,
"productId_op": "in",
"productStoreId": this.state.user.currentEComStore.productStoreId
},
"fieldsToSelect": ["productId","atp"],
});
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/user/UserState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export default interface UserState {
token: string;
current: object | null;
permissions: any;
pwaState: any;
instanceUrl: string;
currentEComStore: object;
}
Loading

0 comments on commit 803126b

Please sign in to comment.