Added formatting for jobs lists and jobs detail components

This commit is contained in:
Patrick Fic
2020-10-14 22:37:49 -07:00
parent 76f8a17b92
commit 0456543574
24 changed files with 616 additions and 30 deletions

View File

@@ -19,7 +19,13 @@ export const setWatcherStatus = (status) => ({
type: ApplicationActionTypes.SET_WATCHER_STATUS,
payload: status,
});
export const setWatcherError = (error) => ({
type: ApplicationActionTypes.SET_WATCHER_ERROR,
payload: error,
});
export const setSelectedJobId = (jobId) => ({
type: ApplicationActionTypes.SET_SELECTED_JOB_ID,
payload: jobId,
});

View File

@@ -3,6 +3,7 @@ const INITIAL_STATE = {
watcherStatus: "Not Started",
watchedPaths: [],
watcherError: null,
selectedJobId: null,
};
const applicationReducer = (state = INITIAL_STATE, action) => {
@@ -32,6 +33,8 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
...state,
watcherError: action.payload,
};
case ApplicationActionTypes.SET_SELECTED_JOB_ID:
return { ...state, selectedJobId: action.payload };
default:
return state;
}

View File

@@ -16,3 +16,7 @@ export const selectWatcherError = createSelector(
[selectApplication],
(application) => application.watcherError
);
export const selectSelectedJobId = createSelector(
[selectApplication],
(application) => application.selectedJobId
);

View File

@@ -4,5 +4,6 @@ const ApplicationActionTypes = {
REMOVE_WATCHED_PATH: "REMOVE_WATCHED_PATH",
SET_WATCHER_STATUS: "SET_WATCHER_STATUS",
SET_WATCHER_ERROR: "SET_WATCHER_ERROR",
SET_SELECTED_JOB_ID: "SET_SELECTED_JOB_ID",
};
export default ApplicationActionTypes;