Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm dialog before leaving the board without saving. #229

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

AliLee0923
Copy link
Collaborator

Implemented confirm dialog before leaving the board without saving.
When users try to leave the created board with out saving, they will see confirm dialog letting them know they don't save the board and asking if they want to save or back.
close #76

Copy link
Collaborator

@tomivm tomivm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please @AliLee0923 could you review if there is a way to show the Dialog or an alert when navigation events are dispatched? like the back and forward buttons
and the reload button. We should show the dialog to prevent the user from performing this without see the dialog. We should show this dialog or a native Alert before closing the tab/window.

src/components/DataItem/DataItem.tsx Outdated Show resolved Hide resolved
src/components/NewBoardLink/NewBoardLink.tsx Outdated Show resolved Hide resolved
@@ -30,17 +33,21 @@ export type BoardActions = {
board: BoardRecord | null,
) => void;
setBoardIsUpToDate: () => void;
setBoardLeaveStatus: (status: any) => void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using any. It may lead to unexpected behavior in the future

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already tried to use a specific type for this.
But I am not sure if it is possible or not, because the type of original variable is generic.

@AliLee0923
Copy link
Collaborator Author

Hi, @tomivm
I implemented confirmation for reloading and closing tab.
But am still strugling with navigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show confirmation dialog before Clean the board if it's not saved
3 participants