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

ENH Versioned badge to elements #1138

Merged

Conversation

sabina-talipova
Copy link
Contributor

Description

New badge element was added in the title to show current state of changes of Element block. There are three different bages:

  • Draft for unpublished changes in new blocks;
  • Modified for modified published blocks;

Manual testing steps

  • I create new Content Block in Elemental Area.
  • I should see Draft badge.
  • I populate Title field with "My title".
  • I should see Draft badge.
  • I save block.
  • I should see Draft badge.
  • I publish block.
  • I should not see a badge.
  • I update Title field.
  • I should see Modified badge.
  • I save block.
  • I should see Modified badge.

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

Comment on lines 21 to 37
And I click on the "#Form_ElementForm_1 [aria-label^='Insert link'] button" element
Then I should see "Page on this site" in the ".mce-menu.mce-in" element
And I should see "Link to a file" in the ".mce-menu.mce-in" element
And I should see "Link to external URL" in the ".mce-menu.mce-in" element
And I should see "Anchor on a page" in the ".mce-menu.mce-in" element
And I should see "Link to email address" in the ".mce-menu.mce-in" element
And I click on the "#Form_ElementForm_1 button[aria-label^='Insert link']" element
Then I should see "Page on this site" in the ".tox-menu" element
And I should see "Link to a file" in the ".tox-menu" element
And I should see "Link to external URL" in the ".tox-menu" element
And I should see "Anchor on a page" in the ".tox-menu" element
And I should see "Link to email address" in the ".tox-menu" element
# Check the link menu in the WYSIWYG "insert link" button is correct for block 2
When I click on block 2
# In CI, the mouse position just happens to produce a tooltip that stops us clicking on the insert link button
# so we have to move the mouse somewhere else to avoid that
And I click on the "input[type='text']" element
And I click on the "#Form_ElementForm_2 [aria-label^='Insert link'] button" element
Then I should see "Page on this site" in the ".mce-menu.mce-in" element
And I should see "Link to a file" in the ".mce-menu.mce-in" element
And I should see "Link to external URL" in the ".mce-menu.mce-in" element
And I should see "Anchor on a page" in the ".mce-menu.mce-in" element
And I should see "Link to email address" in the ".mce-menu.mce-in" element
And I click on the "#Form_ElementForm_2 button[aria-label^='Insert link']" element
Then I should see "Page on this site" in the ".tox-menu" element
And I should see "Link to a file" in the ".tox-menu" element
And I should see "Link to external URL" in the ".tox-menu" element
And I should see "Anchor on a page" in the ".tox-menu" element
And I should see "Link to email address" in the ".tox-menu" element
Copy link
Member

Choose a reason for hiding this comment

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

These changes probably need to be on 5.1 - I suspect that branch's CI will be failing without it.

Copy link
Contributor Author

@sabina-talipova sabina-talipova Jan 30, 2024

Choose a reason for hiding this comment

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

Without these changes I get Element #Form_ElementForm_1 [aria-label^='Insert link'] button not found in local env when I run tests even for branch 5.
But there is another issue with limited list of available link types in WIZIWIG.
multiple-wysiwyg-configs feature_35

Copy link
Member

Choose a reason for hiding this comment

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

Without these changes I get Element #Form_ElementForm_1 [aria-label^='Insert link'] button not found in local env when I run tests even for branch 5.

That would be resolved after merging these changes first into 5.1 (to resolve the failure there) and then merging up to 5. It's not actually related to the versioned badges work at all.

But there is another issue with limited list of available link types in WIZIWIG.

That's also separate to this issue and should be raised and resolved separately (but is probably just that asset-admin and cms haven't merged up yet, if I had to guess)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@sabina-talipova sabina-talipova changed the title Pulls/5/title versioned badge ENH Versioned badge to elements Jan 29, 2024
@sabina-talipova sabina-talipova force-pushed the pulls/5/title-versioned-badge branch from d835dab to a952aec Compare January 30, 2024 01:52
@sabina-talipova
Copy link
Contributor Author

That would be resolved after merging these changes first into 5.1 (to resolve the failure there) and then merging up to 5. It's not actually related to the versioned badges work at all.

For failed behat tests I pushed another PR

That's also separate to this issue and should be raised and resolved separately (but is probably just that asset-admin and cms haven't merged up yet, if I had to guess)

Yes, you're right this happens since new changes for elemental were already merged up, but not for admin, asset-admin and cms. So it should be fixed automatically.

@sabina-talipova
Copy link
Contributor Author

Failed tests require another PR

@emteknetnz
Copy link
Member

@sabina-talipova I've merged up the other PR from 5.1 to 5, though you may need to rebase this PR on 5 in order for behat to pass

@sabina-talipova sabina-talipova force-pushed the pulls/5/title-versioned-badge branch from a952aec to b23847a Compare January 31, 2024 00:36
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Behat failure is unrelated

@emteknetnz emteknetnz merged commit 5279f12 into silverstripe:5 Jan 31, 2024
10 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/5/title-versioned-badge branch January 31, 2024 05:16
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.

3 participants