Auditing refinements.

This commit is contained in:
Patrick Fic
2024-05-09 16:11:45 -07:00
parent 9ab6e511b9
commit 2f77f0fb45
10 changed files with 161 additions and 75 deletions

View File

@@ -5,6 +5,7 @@ const INITIAL_STATE = {
scoreCard: null,
error: null,
loading: false,
auditLoading: false,
audit: {},
auditError: null
};
@@ -30,10 +31,12 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
return { ...state, data: action.payload };
case ReportingActionTypes.SET_SCORE_CARD:
return { ...state, loading: false, scoreCard: action.payload };
case ReportingActionTypes.CALCULATE_AUDIT:
return { ...state, auditLoading: true };
case ReportingActionTypes.SET_AUDIT_RESULTS:
return { ...state, loading: false, auditError: null, audit: action.payload };
return { ...state, loading: false, auditLoading: false, auditError: null, audit: action.payload };
case ReportingActionTypes.SET_AUDIT_ERROR:
return { ...state, auditError: action.payload };
return { ...state, auditLoading: false, auditError: action.payload };
case ReportingActionTypes.TOGGLE_GROUP_VERIFIED:
return {
...state,

View File

@@ -9,7 +9,7 @@ export const selectReportingError = createSelector([selectReporting], (reporting
export const selectReportData = createSelector([selectReporting], (reporting) => reporting.data);
export const selectAuditData = createSelector([selectReporting], (reporting) => reporting.audit);
export const selectAuditError = createSelector([selectReporting], (reporting) => reporting.auditError);
export const selectAuditLoading = createSelector([selectReporting], (reporting) => reporting.auditLoading);
// export const selectWatchedPaths = createSelector(
// [selectReporting],
// (application) => application.watchedPaths