-
Notifications
You must be signed in to change notification settings - Fork 611
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
Feature/cms 1091 ability to move entries to a new section #14541
base: 5.2
Are you sure you want to change the base?
Feature/cms 1091 ability to move entries to a new section #14541
Conversation
…ements Update tooltip to work on disabled elements
…on' of https://github.com/craftcms/cms into feature/cms-1091-ability-to-move-entries-to-a-new-section
…-new-section # Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map
Rather than showing the “Couldn’t find any sections that all selected elements could be moved to.” message in the modal, ideally the “Move to” action is just grayed out ahead of time if there aren’t any other sections with the same entry type. This should be doable via the |
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.
Just finished a quick scan of the modal contents:
- The section buttons should have an
aria-pressed
value that toggles between true and false (see internal documentation re: exclusive button groups) - The Move button's
aria-disabled
state should be toggled when a section is selected - The focus indicator for the move icon is under 3:1 contrast ratio against the modal footer background. This is a larger global issue caused by the disabled element opacity.
- The focus indicator for the button is difficult to see since it doesn’t contrast against the dark background. This could benefit from a two-toned focus indicator, like the one used in the global skip link, with a white outline adjacent to the button background.
- Loading spinner that appears in modal content body should have an equivalent status message that is read for screen reader users.
Note that some of these (like the disabled button focus outline) may be larger/more global issues than the scope of this PR.
@gcamacho079, as per our chats, all items except the disabled button focus ring are actioned. To get the last item from the list to work, I added the live region container and |
…bility-to-move-entries-to-a-new-section
$components[] = Html::button(Craft::t('app', 'Apply draft'), [ | ||
'class' => ['btn', 'secondary', 'formsubmit'], | ||
/** @phpstan-ignore-next-line */ | ||
$disabled = $canonical->hasMethod('isEntryTypeCompatible') && !$element->isEntryTypeCompatible(); |
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.
ElementsController shouldn’t be giving any special treatment to entries, so we’ll need to rethink how we do this.
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.
ok; addressed here: f86e782
src/base/ElementInterface.php
Outdated
* @return bool | ||
* @since 5.0.0 | ||
*/ | ||
public function canMove(User $user): bool; |
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.
It seems a little weird to introduce the concept of “moving” to all element types, when entries are the only one that would actually know what to do with it.
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.
As per our chat, this might end up being a way to go.
But, for now, I have reverted those changes and used a different approach where I added the ability to further customise element chip & card attributes, and I’m adding data-movable
via those.
…-new-section # Conflicts: # .github/workflows/ci.yml # src/elements/Entry.php # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map # src/web/assets/cp/src/js/CraftElementLabel.js # src/web/assets/garnish/dist/garnish.js # src/web/assets/garnish/dist/garnish.js.map
…-new-section # Conflicts: # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map
Description
Adds element index action to move entries between sections.
Notes:
maxAuthors
limit, no data is changed/lost for the entries, but the next time they’re saved, a validation error will be showncraft-tooltip
to work with disabled elements!Related issues
cms-1091