-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implemented: support to make the runs page dynamic(#17)
- Loading branch information
Showing
18 changed files
with
305 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import api from "@/api" | ||
|
||
const fetchRoutingGroups = async (payload: any): Promise<any> => { | ||
return api({ | ||
url: "groups", | ||
method: "GET", | ||
query: payload | ||
}); | ||
} | ||
|
||
const createRoutingGroup = async (payload: any): Promise<any> => { | ||
return api({ | ||
url: "groups", | ||
method: "POST", | ||
data: payload | ||
}) | ||
} | ||
|
||
export const OrderRoutingService = { | ||
createRoutingGroup, | ||
fetchRoutingGroups | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import UtilState from "./modules/util/UtilState"; | ||
|
||
export default interface RootState { | ||
user: any; | ||
util: UtilState; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default interface OrderRoutingState { | ||
groups: Array<any>; // runs | ||
routes: Array<any>; | ||
rule: Array<any>; | ||
currentGroupId: string; | ||
currentRouteId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { ActionTree } from "vuex" | ||
import RootState from "@/store/RootState" | ||
import OrderRoutingState from "./OrderRoutingState" | ||
import { OrderRoutingService } from "@/services/RoutingService" | ||
import { hasError, showToast, sortSequence } from "@/utils" | ||
import * as types from './mutation-types' | ||
|
||
const actions: ActionTree<OrderRoutingState, RootState> = { | ||
async fetchOrderRoutingGroups({ commit }) { | ||
let routingGroups = [] as any; | ||
// filter groups on the basis of productStoreId | ||
const payload = {} | ||
|
||
try { | ||
const resp = await OrderRoutingService.fetchRoutingGroups(payload); | ||
|
||
if(!hasError(resp) && resp.data.length) { | ||
routingGroups = resp.data | ||
} else { | ||
throw resp.data | ||
} | ||
} catch(err) { | ||
console.log(err); | ||
Check warning on line 23 in src/store/modules/orderRouting/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
Check warning on line 23 in src/store/modules/orderRouting/actions.ts GitHub Actions / call-workflow-in-another-repo / build_and_deploy
|
||
} | ||
|
||
if(routingGroups.length) { | ||
routingGroups = sortSequence(routingGroups) | ||
} | ||
|
||
commit(types.ORDER_ROUTING_GROUPS_UPDATED, routingGroups) | ||
}, | ||
|
||
async createRoutingGroup({ dispatch }, groupName) { | ||
const payload = { | ||
groupName, | ||
productStoreId: "STORE" | ||
} | ||
try { | ||
const resp = await OrderRoutingService.createRoutingGroup(payload) | ||
|
||
if(!hasError(resp)) { | ||
showToast('Brokering run created') | ||
dispatch("fetchOrderRoutingGroups") | ||
} | ||
} catch(err) { | ||
showToast("Failed to create brokering run") | ||
console.log('err', err) | ||
Check warning on line 47 in src/store/modules/orderRouting/actions.ts GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)
Check warning on line 47 in src/store/modules/orderRouting/actions.ts GitHub Actions / call-workflow-in-another-repo / build_and_deploy
|
||
} | ||
} | ||
} | ||
|
||
export default actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { GetterTree } from "vuex" | ||
import OrderRoutingState from "./OrderRoutingState" | ||
import RootState from "@/store/RootState" | ||
|
||
const getters: GetterTree<OrderRoutingState, RootState> = { | ||
getRoutingGroups(state) { | ||
return state.groups | ||
} | ||
} | ||
|
||
export default getters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import actions from "./actions" | ||
import getters from "./getters" | ||
import mutations from "./mutations" | ||
import { Module } from "vuex" | ||
import OrderRoutingState from "./OrderRoutingState" | ||
import RootState from "@/store/RootState" | ||
|
||
const orderRoutingModule: Module<OrderRoutingState, RootState> = { | ||
namespaced: true, | ||
state: { | ||
groups: [], | ||
routes: [], | ||
rule: [], | ||
currentGroupId: '', | ||
currentRouteId: '' | ||
}, | ||
getters, | ||
actions, | ||
mutations, | ||
} | ||
|
||
export default orderRoutingModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const SN_ORDER_ROUTING = "orderRouting" | ||
export const ORDER_ROUTING_GROUPS_UPDATED = SN_ORDER_ROUTING + "/GROUPS_UPDATED" | ||
export const ORDER_ROUTING_ROUTES_UPDATED = SN_ORDER_ROUTING + "/ROUTES_UPDATED" | ||
export const ORDER_ROUTING_RULE_UPDATED = SN_ORDER_ROUTING + "/RULE_UPDATED" | ||
export const ORDER_ROUTING_CURRENT_GROUP_UPDATED = SN_ORDER_ROUTING + "/CURRENT_GROUP_UPDATED" | ||
export const ORDER_ROUTING_CURRENT_ROUTE_UPDATED = SN_ORDER_ROUTING + "/CURRENT_ROUTE_UPDATED" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { MutationTree } from "vuex" | ||
import OrderRoutingState from "./OrderRoutingState" | ||
import * as types from "./mutation-types" | ||
|
||
const mutations: MutationTree<OrderRoutingState> = { | ||
[types.ORDER_ROUTING_GROUPS_UPDATED](state, payload) { | ||
state.groups = payload | ||
}, | ||
[types.ORDER_ROUTING_ROUTES_UPDATED](state, payload) { | ||
state.routes = payload | ||
}, | ||
[types.ORDER_ROUTING_RULE_UPDATED](state, payload) { | ||
state.rule = payload | ||
}, | ||
[types.ORDER_ROUTING_CURRENT_GROUP_UPDATED](state, groupId) { | ||
state.currentGroupId = groupId | ||
}, | ||
[types.ORDER_ROUTING_CURRENT_ROUTE_UPDATED](state, routeId) { | ||
state.currentRouteId = routeId | ||
} | ||
} | ||
export default mutations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Enumeration } from "@/types"; | ||
|
||
export default interface UtilState { | ||
enums: Array<Enumeration> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ActionTree } from "vuex" | ||
import RootState from "@/store/RootState" | ||
import UtilState from "./UtilState" | ||
|
||
const actions: ActionTree<UtilState, RootState> = {} | ||
|
||
export default actions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { GetterTree } from "vuex" | ||
import UtilState from "./UtilState" | ||
import RootState from "@/store/RootState" | ||
|
||
const getters: GetterTree<UtilState, RootState> = {} | ||
|
||
export default getters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import actions from "./actions" | ||
import getters from "./getters" | ||
import mutations from "./mutations" | ||
import { Module } from "vuex" | ||
import UtilState from "./UtilState" | ||
import RootState from "@/store/RootState" | ||
|
||
const utilModule: Module<UtilState, RootState> = { | ||
namespaced: true, | ||
state: { | ||
enums: [], | ||
}, | ||
getters, | ||
actions, | ||
mutations, | ||
} | ||
|
||
export default utilModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export const SN_UTIL = "util" | ||
export const UTIL_ENUMS_UPDATED = SN_UTIL + "/ENUMS_UPDATED" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { MutationTree } from "vuex" | ||
import UtilState from "./UtilState" | ||
import * as types from "./mutation-types" | ||
|
||
const mutations: MutationTree<UtilState> = { | ||
[types.UTIL_ENUMS_UPDATED](state, payload) { | ||
state.enums = payload | ||
} | ||
} | ||
export default mutations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
type Enumeration = { | ||
enumId: string, | ||
enumTypeId: string, | ||
enumCode: string, | ||
sequenceId: string, | ||
description: string, | ||
enumName: string, | ||
sequenceNum: number | ||
} | ||
|
||
type Group = { | ||
routingGroupId: string, | ||
productStoreId: string, | ||
groupName: string, | ||
sequenceNum: number, | ||
description: string, | ||
createdByUser: string, | ||
createdDate: string, | ||
lastUpdatedStamp: string, | ||
} | ||
|
||
type Route = { | ||
orderRoutingId: string, | ||
routingGroupId: string, | ||
statusId: string, | ||
routingName: string, | ||
sequenceNum: number, | ||
description: string, | ||
createdByUser: string, | ||
createdDate: string, | ||
lastUpdatedStamp: string | ||
} | ||
|
||
type Rule = { | ||
routingRuleId: string, | ||
orderRoutingId: string, | ||
ruleName: string, | ||
statusId: string, | ||
sequenceNum: number, | ||
assignmentEnumId: string, | ||
fulfillEntireShipGroup: string, | ||
createdDate: string, | ||
createdByUser: string, | ||
lastUpdatedStamp: string | ||
} | ||
|
||
export { | ||
Enumeration, | ||
Group, | ||
Route, | ||
Rule | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.