-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1922 from tijlleenders/vin/-/scheduler-error
show error message in a modal when scheduler breaks
- Loading branch information
Showing
8 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react"; | ||
import "../index.scss"; | ||
import ZModal from "@src/common/ZModal"; | ||
import { useRecoilState } from "recoil"; | ||
import { schedulerErrorModalShown, schedulerErrorState } from "@src/store/SchedulerErrorState"; | ||
|
||
const SchedulerErrorModal = () => { | ||
const [schedulerErrorMessage, setSchedulerErrorMessage] = useRecoilState(schedulerErrorState); | ||
const [showErrorModal, setShowErrorModal] = useRecoilState(schedulerErrorModalShown); | ||
|
||
const handleModalClose = () => { | ||
setSchedulerErrorMessage(null); | ||
setShowErrorModal(true); | ||
}; | ||
|
||
if (showErrorModal) return null; | ||
|
||
return ( | ||
<ZModal open={!!schedulerErrorMessage} type="scheduleErrorModal" onCancel={handleModalClose}> | ||
<h1 className="popupModal-title">{schedulerErrorMessage}</h1> | ||
</ZModal> | ||
); | ||
}; | ||
|
||
export default SchedulerErrorModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { atom } from "recoil"; | ||
|
||
export const schedulerErrorState = atom({ | ||
key: "schedulerErrorState", | ||
default: null as string | null, | ||
}); | ||
|
||
export const schedulerErrorModalShown = atom({ | ||
key: "schedulerErrorModalShown", | ||
default: false, | ||
}); |