feat: label reports overview (#11194)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -17,6 +17,11 @@ const typeMap = {
|
||||
apiMethod: 'getTeamReports',
|
||||
mutationKey: 'setTeamSummaryReport',
|
||||
},
|
||||
label: {
|
||||
flagKey: 'isFetchingLabelSummaryReports',
|
||||
apiMethod: 'getLabelReports',
|
||||
mutationKey: 'setLabelSummaryReport',
|
||||
},
|
||||
};
|
||||
|
||||
async function fetchSummaryReports(type, params, { commit }) {
|
||||
@@ -38,10 +43,12 @@ export const initialState = {
|
||||
inboxSummaryReports: [],
|
||||
agentSummaryReports: [],
|
||||
teamSummaryReports: [],
|
||||
labelSummaryReports: [],
|
||||
uiFlags: {
|
||||
isFetchingInboxSummaryReports: false,
|
||||
isFetchingAgentSummaryReports: false,
|
||||
isFetchingTeamSummaryReports: false,
|
||||
isFetchingLabelSummaryReports: false,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -55,6 +62,9 @@ export const getters = {
|
||||
getTeamSummaryReports(state) {
|
||||
return state.teamSummaryReports;
|
||||
},
|
||||
getLabelSummaryReports(state) {
|
||||
return state.labelSummaryReports;
|
||||
},
|
||||
getUIFlags(state) {
|
||||
return state.uiFlags;
|
||||
},
|
||||
@@ -72,6 +82,10 @@ export const actions = {
|
||||
fetchTeamSummaryReports({ commit }, params) {
|
||||
return fetchSummaryReports('team', params, { commit });
|
||||
},
|
||||
|
||||
fetchLabelSummaryReports({ commit }, params) {
|
||||
return fetchSummaryReports('label', params, { commit });
|
||||
},
|
||||
};
|
||||
|
||||
export const mutations = {
|
||||
@@ -84,6 +98,9 @@ export const mutations = {
|
||||
setTeamSummaryReport(state, data) {
|
||||
state.teamSummaryReports = data;
|
||||
},
|
||||
setLabelSummaryReport(state, data) {
|
||||
state.labelSummaryReports = data;
|
||||
},
|
||||
setUIFlags(state, uiFlag) {
|
||||
state.uiFlags = { ...state.uiFlags, ...uiFlag };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user