Added formatting for jobs lists and jobs detail components
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -16,3 +16,7 @@ export const selectWatcherError = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.watcherError
|
||||
);
|
||||
export const selectSelectedJobId = createSelector(
|
||||
[selectApplication],
|
||||
(application) => application.selectedJobId
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user