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

Fix history view dropdown for first entry, showing 'Revert to this version option' always #4471

Merged
merged 4 commits into from Mar 8, 2023

Conversation

sneridagh
Copy link
Member

@sneridagh sneridagh commented Mar 6, 2023

No description provided.

@netlify
Copy link

netlify bot commented Mar 6, 2023

Deploy Preview for volto canceled.

Name Link
🔨 Latest commit 474449a
🔍 Latest deploy log https://app.netlify.com/sites/volto/deploys/640849a8d16eeb0008c40689

@cypress
Copy link

cypress bot commented Mar 6, 2023

Passing run #4282 ↗︎

0 461 20 0 Flakiness 0

Details:

Simplify the solution, as suggested by David
Project: Volto Commit: 474449a7b5
Status: Passed Duration: 14:46 💡
Started: Mar 8, 2023 8:42 AM Ended: Mar 8, 2023 8:57 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@sneridagh sneridagh requested a review from davisagli March 7, 2023 15:15
render() {
processHistoryEntries = () => {
// Getting the history entries from the props
// No clue why the reverse(concat()) is necessary
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I guess someone just didn't want to figure out how to write a for loop to go through the entries in reverse order?


return item;
});
};
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

You could use lodash.find to add is_current: true to the first item that has type: 'versioning' instead of adding show_revert_true to all the others. And then check for is_current below.

But, this is good enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

@davisagli refactored using find, I thought it would return all the matching elements. Thanks for the suggestion!

@sneridagh sneridagh merged commit 12e05f1 into master Mar 8, 2023
@sneridagh sneridagh deleted the fixMissleadingDropdownOptionInHistoryView branch March 8, 2023 11:23
sneridagh added a commit that referenced this pull request Mar 8, 2023
sneridagh added a commit that referenced this pull request Mar 12, 2023
erral pushed a commit that referenced this pull request Mar 18, 2023
sneridagh added a commit that referenced this pull request May 10, 2023
* master: (23 commits)
  Fix training urls (Remove /5/) (#4502)
  Release 17.0.0-alpha.1
  Changelog
  Serve static assets with an efficient cache policy (#2216)
  Release 16.15.0. Update Changelog. (#4485)
  Improvements to dev proxy (#4434)
  fix: newsitem view blocks wrapper className (#4443)
  Fix history view dropdown for first entry, showing 'Revert to this version option' always (#4471)
  Teaser block docs (#4461)
  Fix order of row of long table  in edit and view mode. (#4472)
  Improve flaky test in autofocus Cypress tests (#4475)
  Use popperjs in BlockChooser, move the markup to the bottom of the bo… (#4141)
  Change from links to inline literals in `CHANGELOG.md` to fix linkche… (#4470)
  Release generate-volto 7.0.0-alpha.2
  Improve stylelint config in generator, include scss support (#4469)
  Fix weird GHA failure on config option not supported (#4466)
  Release generate-volto 7.0.0-alpha.1
  Fix ESlint failure for the generator (#4465)
  Change towncrier job name (#4462)
  Release 17.0.0-alpha.0
  ...
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.

None yet

2 participants