Parcourir la source

fix grid loading

CR003
Alex Cheung il y a 11 mois
Parent
révision
874aeeb2cc
4 fichiers modifiés avec 30 ajouts et 16 suppressions
  1. +10
    -4
      src/components/FiDataGrid.js
  2. +2
    -2
      src/pages/authentication/ForgotPassword/AuthCallback/index.js
  3. +1
    -1
      src/pages/authentication/ForgotUsername/AuthCallback/index.js
  4. +17
    -9
      src/pages/authentication/Verify.js

+ 10
- 4
src/components/FiDataGrid.js Voir le fichier

@@ -51,9 +51,11 @@ export function FiDataGrid({ rows, columns, sx, autoHeight,
const [rowCount, setRowCount] = useState(0);

useEffect(() => {
setPage(0);
set_doLoad(doLoad);
setLoading(true)
if (doLoad !== undefined && Object.keys(doLoad).length>0 ){
setPage(0);
set_doLoad(doLoad);
setLoading(true)
}
}, [doLoad]);

useEffect(() => {
@@ -93,6 +95,7 @@ export function FiDataGrid({ rows, columns, sx, autoHeight,
if (customPageSize) {
setPageSize(customPageSize);
}
console.log(_doLoad)
if (_doLoad !== undefined && Object.keys(_doLoad).length==0 ){
setLoading(false)
if (applyGridOnReady !== undefined){
@@ -125,7 +128,10 @@ export function FiDataGrid({ rows, columns, sx, autoHeight,
// console.log(Object.keys(_doLoad.params).length > 0)
// console.log(Object.keys(_doLoad.params).length > 0)

if (_doLoad?.url == null) return;
if (_doLoad?.url == null){
setLoading(false)
return;
}
if (_doLoad.params == undefined) return;
if (_doLoad.params.searchCriteria !== undefined) return;
if (_doLoad.params == null) _doLoad.params = {};


+ 2
- 2
src/pages/authentication/ForgotPassword/AuthCallback/index.js Voir le fichier

@@ -388,8 +388,8 @@ const Index = () => {
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}>
<CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} />
</Grid>
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5,}}>
<Typography display="inline" variant="h4">
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5, ml:2}}>
<Typography display="inline" variant="h4" sx={{textAlign: 'justify'}}>
<FormattedMessage id="verifyFail"/>
</Typography>
</Grid>


+ 1
- 1
src/pages/authentication/ForgotUsername/AuthCallback/index.js Voir le fichier

@@ -441,7 +441,7 @@ const Index = () => {
{/* <Button disabled={true} hidden={true} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button> */}
<CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} />
</Grid>
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5, display: { xs: 'none', sm: 'none', md: 'block' } }}>
<Grid item xs={12} md={12} lg={12} sx={{ mb: 1, mt:5, ml:2, display: { xs: 'none', sm: 'none', md: 'block' } }}>
<Typography display="inline" variant="h4">
<FormattedMessage id="verifyFail"/>
</Typography>


+ 17
- 9
src/pages/authentication/Verify.js Voir le fichier

@@ -26,19 +26,27 @@ export default function Verify() {

const params = useParams()
const handleVerify = async () => {
console.log("handleVerify()");
const response = await axios.get(GET_VERIFY_USER_ACCOUNT, {
// console.log("handleVerify()");
await axios.get(GET_VERIFY_USER_ACCOUNT, {
params: {
email: decodeURIComponent(params.email),
emailVerifyHash: decodeURIComponent(params.verifyCode)
}
})
if (response.status === 200 && response.data) {
setVerifyState(true)
} else {
}).then(
(response)=>{
if (response.status === 200 && response.data) {
setVerifyState(true)
} else {
setVerifyState(false)
}
setIsLoading(false)
}
).catch(error => {
console.log(error)
setVerifyState(false)
}
setIsLoading(false)
setIsLoading(false)
});
}

useEffect(() => {
@@ -80,7 +88,7 @@ export default function Verify() {
<Stack mt={1} direction="column" justifyContent="flex-start" alignItems="center" spacing={2}>
{/* <Button disabled={true} hidden={true} variant="contained" type="submit" sx={{ fontSize: 12,height:'25px'}}>Submit</Button> */}
<CancelOutlinedIcon color="error" sx={{ width: "200px", height: "200px" }} />
<Typography display="inline" variant="h4">
<Typography display="inline" variant="h4" sx={{textAlign: 'justify'}}>
<FormattedMessage id="verifyFail"/>
</Typography>
<Button color="error" variant="outlined" component={Link} to="/login">


Chargement…
Annuler
Enregistrer