Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hotwax/import into import/#217
Browse files Browse the repository at this point in the history
  • Loading branch information
sanskar345 committed Aug 24, 2023
2 parents 316ec4b + c466e37 commit a0a80dc
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 291 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ VUE_APP_ALIAS={}
VUE_APP_DEFAULT_LOG_LEVEL="error"
VUE_APP_MAPPING_TYPES={"PO": "PO_MAPPING_PREF","RSTINV": "INV_MAPPING_PREF"}
VUE_APP_MAPPING_PO={"orderId": { "label": "Order ID", "required": true }, "productSku": { "label": "Shopify product SKU", "required": true },"orderDate": { "label": "Arrival date", "required": true }, "quantity": { "label": "Ordered quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }}
VUE_APP_MAPPING_RSTINV={"productSku": { "label": "Product SKU", "required": true }, "quantity": { "label": "Quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }, "locationSeqId": { "label": "Facility Location", "required": true }}
VUE_APP_MAPPING_RSTINV={"productSku": { "label": "Product SKU", "required": true }, "quantity": { "label": "Quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }, "locationSeqId": { "label": "Facility Location", "required": true }}
VUE_APP_DEFAULT_LOG_LEVEL="error"
VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login"
30 changes: 7 additions & 23 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,10 @@ name: Deploy to Firebase Hosting on merge
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
- name: Install Firebase
run: npm install -g firebase-tools
- name: Set Firebase project
run: firebase use default --token "$HOTWAX_PUBLIC_SECRET"
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:dev
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-firebase-hosting-merge.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
36 changes: 10 additions & 26 deletions .github/workflows/firebase-hosting-release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on release
'on':
push:
tags:
- '*' # Push events to every tag not containing / Refer https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Checkout to latest release tag
run: |
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
- name: Install Firebase
run: npm install -g firebase-tools
- name: Set Firebase project
run: firebase use default --token "$HOTWAX_PUBLIC_SECRET"
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:uat
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-firebase-hosting-release.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
35 changes: 9 additions & 26 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,15 @@ name: Verify build

on:
push:
branches: [ main ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]

branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}


- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
jobs:
call-workflow-in-another-repo:
uses: hotwax/dxp-components/.github/workflows/common-pull-request.yml@main
with:
config-path: .github/labeler.yml
secrets:
envPAT: ${{ secrets.envPAT }}
83 changes: 39 additions & 44 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "import",
"version": "2.9.0",
"version": "2.10.0",
"private": true,
"description": "Import App",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"@capacitor/core": "^2.4.7",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.1.0",
"@hotwax/dxp-components": "^1.1.1",
"@hotwax/dxp-components": "^1.3.4",
"@hotwax/oms-api": "^1.6.0",
"@ionic/core": "6.7.5",
"@ionic/vue": "6.7.5",
Expand Down
7 changes: 4 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default defineComponent({
},
async unauthorized() {
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}`;
}
},
async mounted() {
Expand All @@ -103,7 +104,7 @@ export default defineComponent({
cacheMaxAge: this.maxAge,
events: {
unauthorised: this.unauthorized,
responseErrror: () => {
responseError: () => {
setTimeout(() => this.dismissLoader(), 100);
},
queueTask: (payload: any) => {
Expand Down Expand Up @@ -139,4 +140,4 @@ export default defineComponent({
}
},
});
</script>
</script>
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Are you sure you want to delete this CSV mapping? This action cannot be undone.": "Are you sure you want to delete this CSV mapping? This action cannot be undone.",
"Are you sure you want to update this CSV mapping? This action cannot be undone.": "Are you sure you want to update this CSV mapping? This action cannot be undone.",
"Arrival date": "Arrival date",
"Authenticating": "Authenticating",
"Backorder": "Backorder",
"Blank": "Blank",
"Buffer days": "Buffer days",
Expand Down Expand Up @@ -52,6 +53,7 @@
"Changes to the CSV mapping has been saved.": "Changes to the CSV mapping has been saved.",
"File upload": "File upload",
"File uploaded successfully": "File uploaded successfully",
"Go to Launchpad": "Go to Launchpad",
"Go to OMS": "Go to OMS",
"here": "here",
"items": "items",
Expand All @@ -68,6 +70,7 @@
"line items": "line items",
"Loading": "Loading",
"Login": "Login",
"Logging in": "Logging in",
"Logout": "Logout",
"Mapping": "Mapping",
"Mapping details": "Mapping details",
Expand Down
9 changes: 7 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import store from './store'
import { DateTime } from 'luxon';

import logger from './logger';
import { dxpComponents } from '@hotwax/dxp-components';
import { dxpComponents } from '@hotwax/dxp-components'
import { login, logout, loader } from './user-utils';

const app = createApp(App)
.use(IonicVue, {
Expand All @@ -43,7 +44,11 @@ const app = createApp(App)
.use(i18n)
.use(store)
.use(dxpComponents, {
defaultImgUrl: require("@/assets/images/defaultImage.png")
defaultImgUrl: require("@/assets/images/defaultImage.png"),
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
Expand Down
Loading

0 comments on commit a0a80dc

Please sign in to comment.