-
Notifications
You must be signed in to change notification settings - Fork 65
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 for hard counts creation (#528)
- Loading branch information
Showing
21 changed files
with
500 additions
and
15 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
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
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
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,3 @@ | ||
export default interface UtilState { | ||
facilityGroups: any; | ||
} |
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,28 @@ | ||
import { ActionTree } from 'vuex' | ||
import RootState from '@/store/RootState' | ||
import * as types from './mutation-types' | ||
import { hasError } from '@/utils'; | ||
import logger from '@/logger' | ||
import { UtilService } from '@/services/UtilService' | ||
import UtilState from './UtilState'; | ||
|
||
const actions: ActionTree<UtilState, RootState> = { | ||
|
||
async fetchFacilityGroups ( { commit }) { | ||
let facilityGroups = []; | ||
|
||
try { | ||
const resp = await UtilService.fetchFacilityGroups({ pageSize: 200 }) | ||
if(!hasError(resp)) { | ||
facilityGroups = resp.data; | ||
} else { | ||
throw resp | ||
} | ||
} catch(err) { | ||
logger.error("Failed to fetch facility groups", err) | ||
} | ||
commit(types.UTIL_FACILITY_GROUPS_UPDATED, facilityGroups); | ||
} | ||
} | ||
|
||
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,10 @@ | ||
import { GetterTree } from "vuex"; | ||
import RootState from "../../RootState"; | ||
import UtilState from "./UtilState"; | ||
|
||
const getters: GetterTree<UtilState, RootState> = { | ||
getFacilityGroups(state) { | ||
return state.facilityGroups | ||
} | ||
}; | ||
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 RootState from '../../RootState' | ||
import UtilState from './UtilState' | ||
|
||
const utilModule: Module<UtilState, RootState> = { | ||
namespaced: true, | ||
state: { | ||
facilityGroups: [] | ||
}, | ||
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_FACILITY_GROUPS_UPDATED = SN_UTIL + '/FACILITY_GROUPS_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 * as types from './mutation-types' | ||
import UtilState from './UtilState'; | ||
|
||
const mutations: MutationTree <UtilState> = { | ||
[types.UTIL_FACILITY_GROUPS_UPDATED] (state, payload) { | ||
state.facilityGroups = 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
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
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
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.