Browse Source

update loader

pull/1/head
wahyuun 1 year ago
parent
commit
acc832a019
  1. 9
      src/views/SimproV2/CreatedProyek/AsignHrProject.js

9
src/views/SimproV2/CreatedProyek/AsignHrProject.js

@ -1,7 +1,7 @@
import React, { useEffect, useState, useMemo } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button, Form } from 'reactstrap';
import { Table, Tooltip } from 'antd';
import { Table, Tooltip, Spin } from 'antd';
import 'antd/dist/antd.css';
import moment from 'moment';
import { API_ADW, TOKEN_ADW, ASSIGN_HR_PROJECT_SEARCH, ASSIGN_HR_PROJECT_DELETE, USER_LIST, PROJECT_ROLE_SEARCH, ASSIGN_HR_PROJECT_ADD, ASSIGN_HR_PROJECT_EDIT } from '../../../const/ApiConst';
@ -26,9 +26,11 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
const [dataEdit, setDataEdit] = useState(null)
const [listUser, setListUser] = useState([])
const [listRole, setListRole] = useState([])
const [loading, setLoading] = useState(true);
useEffect(() => {
if (idTask > 0) {
setLoading(true);
getDataAssignHr();
}
}, [openDialog]);
@ -70,9 +72,10 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
if (result && result.data && result.data.code == 200) {
let dataRes = result.data.data || []
setdataUserToProject(dataRes);
setLoading(false);
} else {
setLoading(false);
NotificationManager.error('Gagal Mengambil Data!!', 'Failed');
}
}
@ -281,7 +284,9 @@ const AssignHrProject = ({ openDialog, closeDialog, toggleDialog, idTask, toolsR
<div>Assign Human Resource - {proyekName}</div> <Button onClick={handleOpenDialogFormTools} size='sm' color="primary"><i className='fa fa-plus'></i></Button>
</ModalHeader>
<ModalBody>
<Spin tip="Loading..." spinning={loading}>
{renderForm()}
</Spin>
</ModalBody>
{/* <ModalFooter>
<Button className="capitalize" color="secondary" onClick={() => handleCancel()}>Close</Button>

Loading…
Cancel
Save