- Change to use more verbose names and fixed lint error in typo
This commit is contained in:
1 parent
8db6e09a60
commit
ee5fe21688
2 files changed
+13
-13
No files matched your search
@@ -62,7 +62,7 @@ const Dialog = ({ modelTitle, modelDescription,
|
|||||||
</Modal>
|
</Modal>
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog.PropTypes = {
|
Dialog.propTypes = {
|
||||||
modelTitle: PropTypes.string.isRequired,
|
modelTitle: PropTypes.string.isRequired,
|
||||||
modelDescription: PropTypes.string.isRequired,
|
modelDescription: PropTypes.string.isRequired,
|
||||||
open: PropTypes.bool.isRequired,
|
open: PropTypes.bool.isRequired,
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ const Settings = ({ isAdmin }) => {
|
|||||||
ttl: checkTTL ? (checkTTL / SECONDS_PER_DAY).toString() : 0,
|
ttl: checkTTL ? (checkTTL / SECONDS_PER_DAY).toString() : 0,
|
||||||
});
|
});
|
||||||
const [errors, setErrors] = useState({});
|
const [errors, setErrors] = useState({});
|
||||||
const delStatMntrInitState = { delMntrs: false, delSts: false };
|
const deleteStatsMonitorsInitState = { deleteMonitors: false, deleteStats: false };
|
||||||
const [isOpen, setIsOpen] = useState(delStatMntrInitState);
|
const [isOpen, setIsOpen] = useState(deleteStatsMonitorsInitState);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ const Settings = ({ isAdmin }) => {
|
|||||||
logger.error(error);
|
logger.error(error);
|
||||||
createToast({ body: "Failed to clear stats" });
|
createToast({ body: "Failed to clear stats" });
|
||||||
} finally {
|
} finally {
|
||||||
setIsOpen(delStatMntrInitState)
|
setIsOpen(deleteStatsMonitorsInitState)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ const Settings = ({ isAdmin }) => {
|
|||||||
logger.error(error);
|
logger.error(error);
|
||||||
createToast({ Body: "Failed to delete all monitors" });
|
createToast({ Body: "Failed to delete all monitors" });
|
||||||
} finally {
|
} finally {
|
||||||
setIsOpen(delStatMntrInitState)
|
setIsOpen(deleteStatsMonitorsInitState)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ const Settings = ({ isAdmin }) => {
|
|||||||
<Button
|
<Button
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="error"
|
color="error"
|
||||||
onClick={()=>setIsOpen({delSts: true, delMntrs: false})}
|
onClick={()=>setIsOpen({...deleteStatsMonitorsInitState, deleteStats: true})}
|
||||||
sx={{ mt: theme.spacing(4) }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
>
|
>
|
||||||
Clear all stats
|
Clear all stats
|
||||||
@@ -243,13 +243,13 @@ const Settings = ({ isAdmin }) => {
|
|||||||
<Dialog
|
<Dialog
|
||||||
modelTitle="model-clear-stats"
|
modelTitle="model-clear-stats"
|
||||||
modelDescription="clear-stats-confirmation"
|
modelDescription="clear-stats-confirmation"
|
||||||
open={isOpen.delSts}
|
open={isOpen.deleteStats}
|
||||||
onClose={() => setIsOpen(delStatMntrInitState)}
|
onClose={() => setIsOpen(deleteStatsMonitorsInitState)}
|
||||||
title="Do you want to clear all stats?"
|
title="Do you want to clear all stats?"
|
||||||
confirmationBtnLbl="Yes, clear all stats"
|
confirmationBtnLbl="Yes, clear all stats"
|
||||||
confirmationBtnOnClick={handleClearStats}
|
confirmationBtnOnClick={handleClearStats}
|
||||||
cancelBtnLbl="Cancel"
|
cancelBtnLbl="Cancel"
|
||||||
cancelBtnOnClick={() => setIsOpen(delStatMntrInitState)}
|
cancelBtnOnClick={() => setIsOpen(deleteStatsMonitorsInitState)}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
isLoading={isLoading || authIsLoading || checksIsLoading}
|
isLoading={isLoading || authIsLoading || checksIsLoading}
|
||||||
>
|
>
|
||||||
@@ -283,7 +283,7 @@ const Settings = ({ isAdmin }) => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
color="error"
|
color="error"
|
||||||
loading={isLoading || authIsLoading || checksIsLoading}
|
loading={isLoading || authIsLoading || checksIsLoading}
|
||||||
onClick={()=>setIsOpen({delMntrs: true, delSts: false})}
|
onClick={()=>setIsOpen({...deleteStatsMonitorsInitState, deleteMonitors: true})}
|
||||||
sx={{ mt: theme.spacing(4) }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
>
|
>
|
||||||
Remove all monitors
|
Remove all monitors
|
||||||
@@ -293,13 +293,13 @@ const Settings = ({ isAdmin }) => {
|
|||||||
<Dialog
|
<Dialog
|
||||||
modelTitle="model-delete-all-monitors"
|
modelTitle="model-delete-all-monitors"
|
||||||
modelDescription="delete-all-monitors-confirmation"
|
modelDescription="delete-all-monitors-confirmation"
|
||||||
open={isOpen.delMntrs}
|
open={isOpen.deleteMonitors}
|
||||||
onClose={() => setIsOpen(delStatMntrInitState)}
|
onClose={() => setIsOpen(deleteStatsMonitorsInitState)}
|
||||||
title="Do you want to remove all monitors?"
|
title="Do you want to remove all monitors?"
|
||||||
confirmationBtnLbl="Yes, clear all monitors"
|
confirmationBtnLbl="Yes, clear all monitors"
|
||||||
confirmationBtnOnClick={handleDeleteAllMonitors}
|
confirmationBtnOnClick={handleDeleteAllMonitors}
|
||||||
cancelBtnLbl="Cancel"
|
cancelBtnLbl="Cancel"
|
||||||
cancelBtnOnClick={() => setIsOpen(delStatMntrInitState)}
|
cancelBtnOnClick={() => setIsOpen(deleteStatsMonitorsInitState)}
|
||||||
theme={theme}
|
theme={theme}
|
||||||
isLoading={isLoading || authIsLoading || checksIsLoading}
|
isLoading={isLoading || authIsLoading || checksIsLoading}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in new issue
Block a user