diff --git a/.env.example b/.env.example index b518990c..6002fc9c 100644 --- a/.env.example +++ b/.env.example @@ -12,4 +12,6 @@ VUE_APP_ORDER_IN_BRKRNG_FILTERS=["orderTypeId: SALES_ORDER", "facilityId: _NA_", VUE_APP_PERMISSION_ID= VUE_APP_ALIAS= VUE_APP_CTGRY_AND_BRKRNG_JOB=["JOB_REL_PREODR_CAT", "JOB_BKR_ORD", "JOB_RLS_ORD_DTE"] -VUE_APP_DEFAULT_ALIAS= \ No newline at end of file +VUE_APP_DEFAULT_ALIAS= +VUE_APP_DEFAULT_LOG_LEVEL="error" +VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 79910ca6..e7a25e19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,8 @@ "@capacitor/core": "^2.4.7", "@capacitor/ios": "^2.5.0", "@hotwax/app-version-info": "^1.0.0", - "@hotwax/apps-theme": "^1.2.1", + "@hotwax/apps-theme": "^1.2.3", + "@hotwax/dxp-components": "^1.3.4", "@hotwax/oms-api": "^1.6.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", @@ -512,9 +513,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz", - "integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==", + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==", "bin": { "parser": "bin/babel-parser.js" }, @@ -2178,14 +2179,26 @@ "integrity": "sha512-PnJTqTbFvvl9N23yi1DjL4aNmTkpYFrayyoJyfH1qDJXADFbQ9kB7gJmKcfiPpyYMGR86Yf3Is5ct0+wReUJGQ==" }, "node_modules/@hotwax/apps-theme": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.1.tgz", - "integrity": "sha512-BbHN6ZXHWUxO7EPyQ8xXcIKt25ptNfBha+2rvtZJ19U4e3T5joLjxOIsPdJCUFcCEisFRlx1453GoNnlRenBjw==" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.3.tgz", + "integrity": "sha512-s/NbdmIbzRTWcOhCBJz6TN7vlNfO8wcjJYiQx7aNAzWB2O+eLlIhTIJMI/rMgGeXV5q3d2HMBVlkly3MlQBcww==" + }, + "node_modules/@hotwax/dxp-components": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.3.4.tgz", + "integrity": "sha512-uw0dmxm19lzsgcLWZ2fQBAZem0d7TkxGR0iSq1c7Bj1mkAJZXH5JbP12w0lYhtes7Q1MjhHPlWljCh6624E9XA==", + "dependencies": { + "@hotwax/oms-api": "^1.8.1", + "luxon": "^3.3.0", + "pinia": "2.0.36", + "pinia-plugin-persistedstate": "^3.1.0", + "vue": "^3.3.4" + } }, "node_modules/@hotwax/oms-api": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.6.0.tgz", - "integrity": "sha512-sPT3FkHKg/bOPzyDgx1p8+iWROZWPhpUedgXHCdbx73A7eUatoFUVDt3tI/LNs2Y5pAS69PivRTHgTLS4X4YCw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.8.1.tgz", + "integrity": "sha512-pVceiuaOSkRZM3i87+TCEu6uBMDG01JGTG92mCpDUXWmA6nd0BL7QiK1Qr8a9lDTib0M24RVBDCGc/cX6nlxgg==", "dependencies": { "@types/node-json-transform": "^1.0.0", "axios": "^0.21.1", @@ -6326,13 +6339,6 @@ "wrap-ansi": "^5.1.0" } }, - "node_modules/@vue/cli-plugin-unit-jest/node_modules/csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==", - "dev": true, - "peer": true - }, "node_modules/@vue/cli-plugin-unit-jest/node_modules/detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -8013,40 +8019,40 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.47.tgz", - "integrity": "sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", + "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/shared": "3.2.47", + "@babel/parser": "^7.21.3", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "source-map": "^0.6.1" + "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.47.tgz", - "integrity": "sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", + "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", "dependencies": { - "@vue/compiler-core": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-core": "3.3.4", + "@vue/shared": "3.3.4" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.47.tgz", - "integrity": "sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==", - "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.47", - "@vue/compiler-dom": "3.2.47", - "@vue/compiler-ssr": "3.2.47", - "@vue/reactivity-transform": "3.2.47", - "@vue/shared": "3.2.47", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", + "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", + "dependencies": { + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.4", + "@vue/compiler-dom": "3.3.4", + "@vue/compiler-ssr": "3.3.4", + "@vue/reactivity-transform": "3.3.4", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "magic-string": "^0.25.7", + "magic-string": "^0.30.0", "postcss": "^8.1.10", - "source-map": "^0.6.1" + "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-sfc/node_modules/picocolors": { @@ -8078,12 +8084,12 @@ } }, "node_modules/@vue/compiler-ssr": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.47.tgz", - "integrity": "sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", + "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", "dependencies": { - "@vue/compiler-dom": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-dom": "3.3.4", + "@vue/shared": "3.3.4" } }, "node_modules/@vue/component-compiler-utils": { @@ -8164,60 +8170,60 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.47.tgz", - "integrity": "sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", + "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", "dependencies": { - "@vue/shared": "3.2.47" + "@vue/shared": "3.3.4" } }, "node_modules/@vue/reactivity-transform": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz", - "integrity": "sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", + "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", "dependencies": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.47", - "@vue/shared": "3.2.47", + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.4", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "magic-string": "^0.25.7" + "magic-string": "^0.30.0" } }, "node_modules/@vue/runtime-core": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.47.tgz", - "integrity": "sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", + "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", "dependencies": { - "@vue/reactivity": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/reactivity": "3.3.4", + "@vue/shared": "3.3.4" } }, "node_modules/@vue/runtime-dom": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.47.tgz", - "integrity": "sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", + "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", "dependencies": { - "@vue/runtime-core": "3.2.47", - "@vue/shared": "3.2.47", - "csstype": "^2.6.8" + "@vue/runtime-core": "3.3.4", + "@vue/shared": "3.3.4", + "csstype": "^3.1.1" } }, "node_modules/@vue/server-renderer": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.47.tgz", - "integrity": "sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", + "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", "dependencies": { - "@vue/compiler-ssr": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-ssr": "3.3.4", + "@vue/shared": "3.3.4" }, "peerDependencies": { - "vue": "3.2.47" + "vue": "3.3.4" } }, "node_modules/@vue/shared": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.47.tgz", - "integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==" + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", + "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, "node_modules/@vue/test-utils": { "version": "2.2.10", @@ -11760,9 +11766,9 @@ "dev": true }, "node_modules/csstype": { - "version": "2.6.21", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", - "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "node_modules/cyclist": { "version": "1.0.1", @@ -23717,21 +23723,29 @@ } }, "node_modules/luxon": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", - "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", + "integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==", "engines": { "node": ">=12" } }, "node_modules/magic-string": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "version": "0.30.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz", + "integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==", "dependencies": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" } }, + "node_modules/magic-string/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -25391,6 +25405,64 @@ "node": ">=0.10.0" } }, + "node_modules/pinia": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.36.tgz", + "integrity": "sha512-4UKApwjlmJH+VuHKgA+zQMddcCb3ezYnyewQ9NVrsDqZ/j9dMv5+rh+1r48whKNdpFkZAWVxhBp5ewYaYX9JcQ==", + "dependencies": { + "@vue/devtools-api": "^6.5.0", + "vue-demi": "*" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "@vue/composition-api": "^1.4.0", + "typescript": ">=4.4.4", + "vue": "^2.6.14 || ^3.2.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia-plugin-persistedstate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.0.tgz", + "integrity": "sha512-tZbNGf2vjAQcIm7alK40sE51Qu/m9oWr+rEgNm/2AWr1huFxj72CjvpQcIQzMknDBJEkQznCLAGtJTIcLKrKdw==", + "peerDependencies": { + "pinia": "^2.0.0" + } + }, + "node_modules/pinia/node_modules/vue-demi": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", + "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", @@ -28197,12 +28269,6 @@ "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, - "node_modules/sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", - "deprecated": "Please use @jridgewell/sourcemap-codec instead" - }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -29846,7 +29912,7 @@ "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -30337,15 +30403,15 @@ "dev": true }, "node_modules/vue": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.47.tgz", - "integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", + "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", "dependencies": { - "@vue/compiler-dom": "3.2.47", - "@vue/compiler-sfc": "3.2.47", - "@vue/runtime-dom": "3.2.47", - "@vue/server-renderer": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-dom": "3.3.4", + "@vue/compiler-sfc": "3.3.4", + "@vue/runtime-dom": "3.3.4", + "@vue/server-renderer": "3.3.4", + "@vue/shared": "3.3.4" } }, "node_modules/vue-cli-plugin-i18n": { @@ -30375,12 +30441,6 @@ "source-map": "^0.6.1" } }, - "node_modules/vue-cli-plugin-i18n/node_modules/csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==", - "dev": true - }, "node_modules/vue-cli-plugin-i18n/node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -33562,9 +33622,9 @@ } }, "@babel/parser": { - "version": "7.20.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz", - "integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==" + "version": "7.22.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz", + "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==" }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { "version": "7.18.6", @@ -34730,14 +34790,26 @@ "integrity": "sha512-PnJTqTbFvvl9N23yi1DjL4aNmTkpYFrayyoJyfH1qDJXADFbQ9kB7gJmKcfiPpyYMGR86Yf3Is5ct0+wReUJGQ==" }, "@hotwax/apps-theme": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.1.tgz", - "integrity": "sha512-BbHN6ZXHWUxO7EPyQ8xXcIKt25ptNfBha+2rvtZJ19U4e3T5joLjxOIsPdJCUFcCEisFRlx1453GoNnlRenBjw==" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@hotwax/apps-theme/-/apps-theme-1.2.3.tgz", + "integrity": "sha512-s/NbdmIbzRTWcOhCBJz6TN7vlNfO8wcjJYiQx7aNAzWB2O+eLlIhTIJMI/rMgGeXV5q3d2HMBVlkly3MlQBcww==" + }, + "@hotwax/dxp-components": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@hotwax/dxp-components/-/dxp-components-1.3.4.tgz", + "integrity": "sha512-uw0dmxm19lzsgcLWZ2fQBAZem0d7TkxGR0iSq1c7Bj1mkAJZXH5JbP12w0lYhtes7Q1MjhHPlWljCh6624E9XA==", + "requires": { + "@hotwax/oms-api": "^1.8.1", + "luxon": "^3.3.0", + "pinia": "2.0.36", + "pinia-plugin-persistedstate": "^3.1.0", + "vue": "^3.3.4" + } }, "@hotwax/oms-api": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.6.0.tgz", - "integrity": "sha512-sPT3FkHKg/bOPzyDgx1p8+iWROZWPhpUedgXHCdbx73A7eUatoFUVDt3tI/LNs2Y5pAS69PivRTHgTLS4X4YCw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@hotwax/oms-api/-/oms-api-1.8.1.tgz", + "integrity": "sha512-pVceiuaOSkRZM3i87+TCEu6uBMDG01JGTG92mCpDUXWmA6nd0BL7QiK1Qr8a9lDTib0M24RVBDCGc/cX6nlxgg==", "requires": { "@types/node-json-transform": "^1.0.0", "axios": "^0.21.1", @@ -38055,13 +38127,6 @@ "wrap-ansi": "^5.1.0" } }, - "csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==", - "dev": true, - "peer": true - }, "detect-newline": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", @@ -39385,40 +39450,40 @@ } }, "@vue/compiler-core": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.47.tgz", - "integrity": "sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", + "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", "requires": { - "@babel/parser": "^7.16.4", - "@vue/shared": "3.2.47", + "@babel/parser": "^7.21.3", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "source-map": "^0.6.1" + "source-map-js": "^1.0.2" } }, "@vue/compiler-dom": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.47.tgz", - "integrity": "sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", + "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", "requires": { - "@vue/compiler-core": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-core": "3.3.4", + "@vue/shared": "3.3.4" } }, "@vue/compiler-sfc": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.2.47.tgz", - "integrity": "sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==", - "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.47", - "@vue/compiler-dom": "3.2.47", - "@vue/compiler-ssr": "3.2.47", - "@vue/reactivity-transform": "3.2.47", - "@vue/shared": "3.2.47", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", + "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", + "requires": { + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.4", + "@vue/compiler-dom": "3.3.4", + "@vue/compiler-ssr": "3.3.4", + "@vue/reactivity-transform": "3.3.4", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "magic-string": "^0.25.7", + "magic-string": "^0.30.0", "postcss": "^8.1.10", - "source-map": "^0.6.1" + "source-map-js": "^1.0.2" }, "dependencies": { "picocolors": { @@ -39439,12 +39504,12 @@ } }, "@vue/compiler-ssr": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.2.47.tgz", - "integrity": "sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", + "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", "requires": { - "@vue/compiler-dom": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-dom": "3.3.4", + "@vue/shared": "3.3.4" } }, "@vue/component-compiler-utils": { @@ -39510,57 +39575,57 @@ "requires": {} }, "@vue/reactivity": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.47.tgz", - "integrity": "sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", + "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", "requires": { - "@vue/shared": "3.2.47" + "@vue/shared": "3.3.4" } }, "@vue/reactivity-transform": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz", - "integrity": "sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", + "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", "requires": { - "@babel/parser": "^7.16.4", - "@vue/compiler-core": "3.2.47", - "@vue/shared": "3.2.47", + "@babel/parser": "^7.20.15", + "@vue/compiler-core": "3.3.4", + "@vue/shared": "3.3.4", "estree-walker": "^2.0.2", - "magic-string": "^0.25.7" + "magic-string": "^0.30.0" } }, "@vue/runtime-core": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.47.tgz", - "integrity": "sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", + "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", "requires": { - "@vue/reactivity": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/reactivity": "3.3.4", + "@vue/shared": "3.3.4" } }, "@vue/runtime-dom": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.47.tgz", - "integrity": "sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", + "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", "requires": { - "@vue/runtime-core": "3.2.47", - "@vue/shared": "3.2.47", - "csstype": "^2.6.8" + "@vue/runtime-core": "3.3.4", + "@vue/shared": "3.3.4", + "csstype": "^3.1.1" } }, "@vue/server-renderer": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.2.47.tgz", - "integrity": "sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", + "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", "requires": { - "@vue/compiler-ssr": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-ssr": "3.3.4", + "@vue/shared": "3.3.4" } }, "@vue/shared": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.47.tgz", - "integrity": "sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==" + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", + "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" }, "@vue/test-utils": { "version": "2.2.10", @@ -42435,9 +42500,9 @@ } }, "csstype": { - "version": "2.6.21", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", - "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", + "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" }, "cyclist": { "version": "1.0.1", @@ -51728,16 +51793,23 @@ } }, "luxon": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.2.1.tgz", - "integrity": "sha512-QrwPArQCNLAKGO/C+ZIilgIuDnEnKx5QYODdDtbFaxzsbZcc/a7WFq7MhsVYgRlwawLtvOUESTlfJ+hc/USqPg==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", + "integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==" }, "magic-string": { - "version": "0.25.9", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", - "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "version": "0.30.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz", + "integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==", "requires": { - "sourcemap-codec": "^1.4.8" + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "dependencies": { + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + } } }, "make-dir": { @@ -53076,6 +53148,29 @@ "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "dev": true }, + "pinia": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.0.36.tgz", + "integrity": "sha512-4UKApwjlmJH+VuHKgA+zQMddcCb3ezYnyewQ9NVrsDqZ/j9dMv5+rh+1r48whKNdpFkZAWVxhBp5ewYaYX9JcQ==", + "requires": { + "@vue/devtools-api": "^6.5.0", + "vue-demi": "*" + }, + "dependencies": { + "vue-demi": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.5.tgz", + "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==", + "requires": {} + } + } + }, + "pinia-plugin-persistedstate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.0.tgz", + "integrity": "sha512-tZbNGf2vjAQcIm7alK40sE51Qu/m9oWr+rEgNm/2AWr1huFxj72CjvpQcIQzMknDBJEkQznCLAGtJTIcLKrKdw==", + "requires": {} + }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", @@ -55376,11 +55471,6 @@ "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", "dev": true }, - "sourcemap-codec": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" - }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -56678,7 +56768,7 @@ "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true + "devOptional": true }, "uglify-js": { "version": "3.4.10", @@ -57072,15 +57162,15 @@ "dev": true }, "vue": { - "version": "3.2.47", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.47.tgz", - "integrity": "sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", + "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", "requires": { - "@vue/compiler-dom": "3.2.47", - "@vue/compiler-sfc": "3.2.47", - "@vue/runtime-dom": "3.2.47", - "@vue/server-renderer": "3.2.47", - "@vue/shared": "3.2.47" + "@vue/compiler-dom": "3.3.4", + "@vue/compiler-sfc": "3.3.4", + "@vue/runtime-dom": "3.3.4", + "@vue/server-renderer": "3.3.4", + "@vue/shared": "3.3.4" } }, "vue-cli-plugin-i18n": { @@ -57110,12 +57200,6 @@ "source-map": "^0.6.1" } }, - "csstype": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz", - "integrity": "sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==", - "dev": true - }, "picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", diff --git a/package.json b/package.json index 01bde8c1..37eabcd2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@capacitor/ios": "^2.5.0", "@hotwax/app-version-info": "^1.0.0", "@hotwax/apps-theme": "^1.2.3", + "@hotwax/dxp-components": "^1.3.4", "@hotwax/oms-api": "^1.6.0", "@ionic/core": "6.7.5", "@ionic/vue": "6.7.5", diff --git a/src/App.vue b/src/App.vue index a8a2d3e8..284138d0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -66,7 +66,8 @@ export default defineComponent({ }, async unauthorised() { this.store.dispatch("user/logout"); - this.router.push("/login") + const redirectUrl = window.location.origin + '/login'; + window.location.href = `${process.env.VUE_APP_LOGIN_URL}?redirectUrl=${redirectUrl}`; } }, created() { diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 188dba66..664a4f17 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -12,6 +12,7 @@ "ATP": "ATP", "Auto": "Auto", "Auto releasing": "Auto releasing", + "Authenticating": "Authenticating", "Available": "Available", "Available purchase order": "Available purchase order", "Available to promise": "Available to promise", @@ -56,6 +57,7 @@ "from date": "from date", "Failed to update configuration": "Failed to update configuration", "Failed to get pre-order/backorder categories": "Failed to get pre-order/backorder categories", + "Go to Launchpad": "Go to Launchpad", "Go to OMS": "Go to OMS", "History": "History", "Hold pre-order physical inventory": "Hold pre-order physical inventory", @@ -83,6 +85,7 @@ "Listed on store(s)": "Listed on {count} store(s)", "Loading": "Loading", "Login": "Login", + "Logging in": "Logging in", "Logout": "Logout", "Loyalty status": "Loyalty status", "Never in any category": "Never in any category", diff --git a/src/main.ts b/src/main.ts index fb766205..3a7dd452 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,6 +28,8 @@ import '@ionic/vue/css/display.css'; /* Theme variables */ import './theme/variables.css'; +import { dxpComponents } from '@hotwax/dxp-components' +import { login, logout, loader } from './user-utils'; const app = createApp(App) .use(IonicVue, { @@ -35,7 +37,13 @@ const app = createApp(App) }) .use(router) .use(i18n) - .use(store); + .use(store) + .use(dxpComponents, { + login, + logout, + loader, + appLoginUrl: process.env.VUE_APP_LOGIN_URL as string + }); // Filters are removed in Vue 3 and global filter introduced https://v3.vuejs.org/guide/migration/filters.html#global-filters app.config.globalProperties.$filters = { diff --git a/src/router/index.ts b/src/router/index.ts index 1da7e907..c146ad4b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,32 +1,35 @@ import { createRouter, createWebHistory } from '@ionic/vue-router'; import { RouteRecordRaw } from 'vue-router'; -import Login from '../views/login.vue' import Products from '../views/products.vue' import ProductDetails from '../views/product-details.vue' import CatalogProductDetails from '../views/catalog-product-details.vue' import Orders from '../views/orders.vue' import Catalog from '../views/catalog.vue' import Settings from '../views/settings.vue' -import store from '@/store' +import store from '@/store'; +import { Login, useAuthStore } from '@hotwax/dxp-components'; +import { loader } from '@/user-utils'; - -const authGuard = (to: any, from: any, next: any) => { - if (store.getters['user/isAuthenticated']) { - next() - } else { - next("/login") +const authGuard = async (to: any, from: any, next: any) => { + const authStore = useAuthStore() + if (!authStore.isAuthenticated || !store.getters['user/isAuthenticated']) { + await loader.present('Authenticating') + // TODO use authenticate() when support is there + const redirectUrl = window.location.origin + '/login' + window.location.href = `${process.env.VUE_APP_LOGIN_URL}?redirectUrl=${redirectUrl}` + loader.dismiss() } + next() }; const loginGuard = (to: any, from: any, next: any) => { - if (!store.getters['user/isAuthenticated']) { - next() - } else { - next("/") + const authStore = useAuthStore() + if (authStore.isAuthenticated && !to.query?.token && !to.query?.oms) { + next('/') } + next(); }; - const routes: Array = [ { path: '/', diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index 489fa102..ae42d3c0 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -7,17 +7,20 @@ import { hasError, showToast } from '@/utils' import { translate } from '@/i18n' import { Settings } from 'luxon' import { updateInstanceUrl, updateToken, resetConfig } from '@/adapter' +import { useAuthStore } from '@hotwax/dxp-components'; const actions: ActionTree = { /** * Login user and return token */ - async login ({ commit, dispatch }, { username, password }) { + async login ({ commit, dispatch }, payload) { + + const { token, oms } = payload; + dispatch("setUserInstanceUrl", oms); + try { - const resp = await UserService.login(username, password) - if (resp.status === 200 && resp.data) { - if (resp.data.token) { + if (token) { const permissionId = process.env.VUE_APP_PERMISSION_ID; if (permissionId) { const checkPermissionResponse = await UserService.checkPermission({ @@ -25,20 +28,15 @@ const actions: ActionTree = { permissionId }, headers: { - Authorization: 'Bearer ' + resp.data.token, + Authorization: 'Bearer ' + token, 'Content-Type': 'application/json' } }); if (checkPermissionResponse.status === 200 && !hasError(checkPermissionResponse) && checkPermissionResponse.data && checkPermissionResponse.data.hasPermission) { - commit(types.USER_TOKEN_CHANGED, { newToken: resp.data.token }) - updateToken(resp.data.token) + commit(types.USER_TOKEN_CHANGED, { newToken: token }) + updateToken(token) await dispatch('getProfile') - if (resp.data._EVENT_MESSAGE_ && resp.data._EVENT_MESSAGE_.startsWith("Alert:")) { - // TODO Internationalise text - showToast(translate(resp.data._EVENT_MESSAGE_)); - } - return resp.data; } else { const permissionError = 'You do not have permission to access the app.'; showToast(translate(permissionError)); @@ -46,33 +44,24 @@ const actions: ActionTree = { return Promise.reject(new Error(permissionError)); } } else { - commit(types.USER_TOKEN_CHANGED, { newToken: resp.data.token }) - updateToken(resp.data.token) + commit(types.USER_TOKEN_CHANGED, { newToken: token }) + updateToken(token) await dispatch('getProfile') - return resp.data; } - } else if (hasError(resp)) { - showToast(translate('Sorry, your username or password is incorrect. Please try again.')); - console.error("error", resp.data._ERROR_MESSAGE_); - return Promise.reject(new Error(resp.data._ERROR_MESSAGE_)); } - } else { - showToast(translate('Something went wrong')); - console.error("error", resp.data._ERROR_MESSAGE_); - return Promise.reject(new Error(resp.data._ERROR_MESSAGE_)); - } } catch (err: any) { showToast(translate('Something went wrong')); console.error("error", err); return Promise.reject(new Error(err)) } - // return resp }, /** * Logout user */ async logout ({ commit }) { + const authStore = useAuthStore() + // TODO add any other tasks if need commit(types.USER_END_SESSION) resetConfig(); @@ -81,6 +70,9 @@ const actions: ActionTree = { this.dispatch("order/resetOrderQuery") this.dispatch("job/clearCtgryAndBrkrngJobs") this.dispatch("util/clearInvConfigs") + + // reset plugin state on logout + authStore.$reset() }, /** diff --git a/src/user-utils/index.ts b/src/user-utils/index.ts new file mode 100644 index 00000000..faf98e48 --- /dev/null +++ b/src/user-utils/index.ts @@ -0,0 +1,34 @@ +import { translate } from '@/i18n' +import store from '@/store' +import { loadingController } from '@ionic/vue' + +const login = async (payload: any) => store.dispatch('user/login', payload); + +const logout = async () => store.dispatch('user/logout'); + +const loader = { + value: null as any, + present: async (message: string) => { + if (!loader.value) { + loader.value = await loadingController + .create({ + message: translate(message), + translucent: false, + backdropDismiss: false + }); + } + loader.value.present(); + }, + dismiss: () => { + if (loader.value) { + loader.value.dismiss(); + loader.value = null as any; + } + } +} + +export { + login, + loader, + logout +} \ No newline at end of file diff --git a/src/views/login.vue b/src/views/login.vue deleted file mode 100644 index 57483eb7..00000000 --- a/src/views/login.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - diff --git a/src/views/settings.vue b/src/views/settings.vue index cd23cbc7..2f782d40 100644 --- a/src/views/settings.vue +++ b/src/views/settings.vue @@ -16,12 +16,19 @@ - + + {{ userProfile?.userLoginId }} {{ userProfile.partyName }} - {{ $t("Logout") }} + {{ $t("Logout") }} + + {{ $t("Go to Launchpad") }} + + @@ -181,9 +188,13 @@ export default defineComponent({ methods: { logout: function() { this.store.dispatch("user/logout").then(() => { - this.$router.push('/login') + const redirectUrl = window.location.origin + '/login' + window.location.href = `${process.env.VUE_APP_LOGIN_URL}?isLoggedOut=true&redirectUrl=${redirectUrl}` }) }, + goToLaunchpad() { + window.location.href = `${process.env.VUE_APP_LOGIN_URL}` + }, async changeTimeZone() { const timeZoneModal = await modalController.create({ component: TimeZoneModal, diff --git a/vue.config.js b/vue.config.js index 241ddba4..79984780 100644 --- a/vue.config.js +++ b/vue.config.js @@ -7,5 +7,6 @@ module.exports = { localeDir: 'locales', enableInSFC: true } - } + }, + runtimeCompiler: true } \ No newline at end of file