-
Notifications
You must be signed in to change notification settings - Fork 2
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
JTE/PKFE-37 #62
JTE/PKFE-37 #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a couple of scenarios. Needs fixing
app/front-end/src/features/editor/components/editorView/editorView.tsx
Outdated
Show resolved
Hide resolved
@@ -174,7 +182,11 @@ export const FileTreeItem = React.forwardRef(function CustomTreeItem( | |||
onClick: (event) => { | |||
if (!blocked) { | |||
if (getContentProps().onClick) getContentProps().onClick(event); | |||
handleClick(item.id, item.label, item.fileType); | |||
if (unsaved) { | |||
if (item.fileType !== FileTypes.FOLDER) setIsConfirmDialogOpen(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if trying to open currently opened file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
onMouseDown={(event) => { | ||
event.stopPropagation(); | ||
// Remove the file from the workspace | ||
Workspace.filesHistoryStateUpdate(undefined, file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If closing the current file which has edited cells, it should also prompt the confirmation about losing changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved! Great catch
@@ -127,7 +127,6 @@ export const EditorView: React.FC = () => { | |||
|
|||
const onCellEditStart = () => { | |||
unsavedStateUpdate(true); | |||
console.log(unsaved); | |||
}; | |||
|
|||
const getWorkspaceFile = useCallback(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when moving to the next or previous page of the file, it should also prompt that changes may be lost.
The same principle should also be done with changing page size number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
if (item.fileType !== FileTypes.FOLDER) setIsConfirmDialogOpen(true); | ||
} else { | ||
handleClick(item.id, item.label, item.fileType); | ||
} | ||
} | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when using context menu actions such as rename
and export
, it should also prompt with unsaved data will be lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found new issue. Overall great job!
const handleCloseIconClick = (event: React.MouseEvent) => { | ||
event.stopPropagation(); | ||
if (!blocked) { | ||
if (unsaved) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New issue. When closing the file which is not the current I have unsaved changes, I get the prompt of unsaved changes. It should let me close not relevant files. Should also check if it's the current file, otherwise don't prompt the unsaved changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be also correlated to switching between file in file history. Maybe the parent button of selecting different file is also invoked when pressing close button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
Added unsaved changes in editor warning dialogs.