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

Hide "Options" for last revision if it's the only non-deleted revision #8

Closed
the-turk opened this issue Apr 14, 2020 · 0 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@the-turk
Copy link
Owner

Bug Report

Current Behavior
If there is only one non-deleted revision in revision list and it's the last one, "Revert Changes" action fails because there is no any other content to be used for revert action.

Steps to Reproduce

  1. Edit a post
  2. Click on "original content" revision in the revision list
  3. Click on Options -> Delete button and delete the "original content"
  4. Click on "most recent" revision in the revision list
  5. Click on Options -> Revert Changes button
  6. See the "Reverting of changes failed." error

Expected Behavior
"Options" button should not be visible if last revision is the only non-deleted revision in the revision list.

Screenshots

Environment

  • Extension version: 1.0.4

Possible Solution
I think I should count deleted revisions and change some logic here:

{((this.post.canDeleteEditHistory() &&
this.revision.revision() != this.post.revisionCount()) ||
this.post.canRollbackEditHistory() ?

@the-turk the-turk added the bug Something isn't working label Apr 14, 2020
@the-turk the-turk self-assigned this Apr 14, 2020
@the-turk the-turk added this to the 1.0.5 milestone Apr 14, 2020
the-turk pushed a commit that referenced this issue Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant