Browse Source

set false loading spinner

pull/1/head
wahyun 11 months ago
parent
commit
1198746dd7
  1. 16
      src/views/SimproV2/CreatedProyek/ImportActivity/index.js

16
src/views/SimproV2/CreatedProyek/ImportActivity/index.js

@ -93,6 +93,7 @@ const ImportActivity = ({ params }) => {
//
const [isMovePage, setIsMovePage] = useState(false);
const [isPreview, setIsPreview] = useState(false);
const [loading, setLoading] = useState(true);
useEffect(() => {
getDataAssignHr();
@ -130,7 +131,9 @@ const ImportActivity = ({ params }) => {
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');
}
}
@ -144,6 +147,7 @@ const ImportActivity = ({ params }) => {
setIsMovePage(false);
}, 5000);
} else {
setLoading(false)
NotificationManager.error('file harus dalam format .xlsx', 'Failed');
}
// else{
@ -219,8 +223,9 @@ const ImportActivity = ({ params }) => {
}
dataMapped.push(extractedRow)
setLoading(false)
}
setLoading(false)
setDatatable(dataMapped)
}
});
@ -250,8 +255,11 @@ const ImportActivity = ({ params }) => {
const timestamp = Date.now();
const newTimestamp = timestamp + 60000;
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt'
}
setLoading(false)
}else{
setLoading(false)
}
setLoading(false)
setIsMovePage(true);
setIsPreview(true);
}
@ -369,7 +377,7 @@ const ImportActivity = ({ params }) => {
<h4 className="capitalize">Data Preview</h4>
</CardHeader>
<CardBody>
<Spin tip="Loading...">
<Spin tip="Loading..." spinning={loading}>
<Table
rowClassName={(record, index) => index % 2 == 0 ? 'table-row-light' : 'table-row-dark'}
dataSource={dataTable}

Loading…
Cancel
Save