浏览代码

Added spinner while candidate change selection level

pull/53/head
Safet Purkovic 3 年前
父节点
当前提交
d2c6983edc
共有 2 个文件被更改,包括 27 次插入3 次删除
  1. 9
    0
      src/components/Selection/Selection.js
  2. 18
    3
      src/store/actions/processes/processesActionConstants.js

+ 9
- 0
src/components/Selection/Selection.js 查看文件

@@ -6,6 +6,10 @@ import { setDoneProcessReq } from "../../store/actions/processes/processAction";
import { useDispatch, useSelector } from "react-redux";
import { formatDateSrb, formatTimeSrb } from "../../util/helpers/dateHelpers";
import { SELECTION_PROCESS_OF_APPLICANT_PAGE } from "../../constants/pages";
import { PUT_PROCESS_LOADING } from "../../store/actions/processes/processesActionConstants";
import { selectIsLoadingByActionType } from "../../store/selectors/loadingSelectors";
import Backdrop from "../../components/MUI/BackdropComponent";


const dragStart = (e, applicant) => {
e.dataTransfer.setData("text/plain", JSON.stringify(applicant));
@@ -38,6 +42,10 @@ const Selection = (props) => {
}
}

const isLoading = useSelector(
selectIsLoadingByActionType(PUT_PROCESS_LOADING)
);

const handleOpenDetails = (id) => {
props.history.push(SELECTION_PROCESS_OF_APPLICANT_PAGE.replace(":id", id))
}
@@ -68,6 +76,7 @@ const Selection = (props) => {
<div className="selection-card-title">
<h3>{props.selection.name}</h3>
</div>
<Backdrop position="absolute" isLoading={isLoading} />

{applicants.length > 0 && renderList}
{applicants.length === 0 && <div className="sel-item">

+ 18
- 3
src/store/actions/processes/processesActionConstants.js 查看文件

@@ -1,9 +1,24 @@
import {
createClearType,
createErrorType,
createFetchType,
createLoadingType,
createSuccessType,
} from '../actionHelpers';

export const FETCH_PROCESSES_REQ = 'FETCH_PROCESSES_REQ';
export const FETCH_PROCESSES_ERR = 'FETCH_PROCESSES_ERR';
export const FETCH_PROCESSES_SUCCESS = 'FETCH_PROCESSES_SUCCESS';
export const PUT_PROCESS_REQ = 'PUT_PROCESS_REQ';
export const PUT_PROCESS_ERR = 'PUT_PROCESS_ERR';
export const PUT_PROCESS_SUCCESS = 'PUT_PROCESS_SUCCESS';

const PUT_PROCESS_SCOPE = 'PUT_PROCESS';
export const PUT_PROCESS_REQ = createFetchType(PUT_PROCESS_SCOPE);
export const PUT_PROCESS_SUCCESS = createSuccessType(PUT_PROCESS_SCOPE);
export const PUT_PROCESS_ERR = createErrorType(PUT_PROCESS_SCOPE);
export const CLEAR_PUT_PROCESS_ERR = createClearType(
`${PUT_PROCESS_SCOPE}_ERR`,
);
export const PUT_PROCESS_LOADING = createLoadingType(PUT_PROCESS_SCOPE);

export const FETCH_APPLICANT_PROCESSES_REQ = 'FETCH_APPLICANT_PROCESSES_REQ';
export const FETCH_APPLICANT_PROCESSES_ERR = 'FETCH_APPLICANT_PROCESSES_ERR';
export const FETCH_APPLICANT_PROCESSES_SUCCESS = 'FETCH_APPLICANT_PROCESSES_SUCCESS';

正在加载...
取消
保存