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

Add 'Revert changes' button to note card #350

Merged
merged 4 commits into from
May 25, 2024
Merged

Conversation

colebemis
Copy link
Member

@colebemis colebemis commented May 22, 2024

Closes #349

Adds a "Revert changes" option to the note card dropdown menu for reverting edits made to a note in the editor.

  • Implements the revertChanges function to reset the editor content to the last saved state of the note and clear the "draft" from localStorage.
  • Adds a conditional rendering for the "Revert changes" dropdown item, which only appears when the editor state is dirty.
  • Utilizes the existing isDirty state to determine if the editor content has been modified from the last saved state, enabling the "Revert changes" option accordingly.

For more details, open the Copilot Workspace session.

Copy link

netlify bot commented May 22, 2024

Deploy Preview for lumen-notes ready!

Name Link
🔨 Latest commit 79c8401
🔍 Latest deploy log https://app.netlify.com/sites/lumen-notes/deploys/66513694b047960008767ee1
😎 Deploy Preview https://deploy-preview-350--lumen-notes.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 60
Accessibility: 81
Best Practices: 100
SEO: 75
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 22, 2024

Deploy Preview for lumen-storybook ready!

Name Link
🔨 Latest commit 79c8401
🔍 Latest deploy log https://app.netlify.com/sites/lumen-storybook/deploys/66513694444b030009fdf19d
😎 Deploy Preview https://deploy-preview-350--lumen-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Renames the "Revert changes" option to "Discard changes" in the note card dropdown menu and updates related callback function to reflect this change.

- Renames the dropdown menu option from "Revert changes" to "Discard changes" to align with the task requirement.
- Updates the `revertChanges` callback function to `discardChanges` and adjusts its comment to mention "discard unsaved changes" instead of "revert the editor content", making the function's purpose clearer and more accurately described.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/lumen-notes/lumen/pull/350?shareId=c7174592-efe0-434f-a696-72242149dab9).
@colebemis
Copy link
Member Author

Renames the "Revert changes" option to "Discard changes" in the note card dropdown menu and updates related callback function to reflect this change.

  • Renames the dropdown menu option from "Revert changes" to "Discard changes" to align with the task requirement.
  • Updates the revertChanges callback function to discardChanges and adjusts its comment to mention "discard unsaved changes" instead of "revert the editor content", making the function's purpose clearer and more accurately described.

For more details, open the Copilot Workspace session.

@colebemis colebemis marked this pull request as ready for review May 25, 2024 00:53
@colebemis colebemis merged commit da328fb into main May 25, 2024
10 of 11 checks passed
@colebemis colebemis deleted the colebemis/revert-changes branch May 25, 2024 00:55
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.

Revert changes
1 participant