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

Bugfix/view modes and card view #16088

Merged
merged 9 commits into from
Nov 12, 2024
Merged

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Nov 12, 2024

Description

Issue 1:
Sources only had the view modes if they were considered top-level sources. While that’s fine for the CMS itself, the Commerce Orders do use nested sources (e.g. All Orders > New). Not having the view modes available for non-top-level sources triggered JS errors and caused the non-top-level index page not to work as expected.

Solution:

  • Added additional safeguards to stop assuming that sourceViewModes will always be defined and contain anything.
  • The data-view-modes attribute is now populated for the non-top-level sources, too

Issue 2:
An error was thrown when a native field was dragged into the field layout designer and selected to be included in the card view straight away.

Solution:
Added craft\fieldlayoutelements\BaseField::previewPlaceholderHtml().

Issue 3:
When a field was dragged into the field layout designer, a corresponding checkbox was added under “Card Attributes” straight away. No checks were made to see if that field was previewable.

Solution:
Added extra checks to ensure the field is previewable before adding/removing a corresponding checkbox on the fly.

Issue 4:
When a field that was selected to show on the card was removed from the designer, the card preview was not updated accordingly.

Solution:
Uncheck the checkbox before removal.

Issue 5:
When a field that was selected to provide a thumbnail for the card was removed from the designer, the card preview was not updated accordingly.

Solution:
Set the card view designer to now show a thumbnail and update the preview.

Related issues

n/a

@brandonkelly brandonkelly merged commit 9e981fd into 5.5 Nov 12, 2024
6 checks passed
@brandonkelly brandonkelly deleted the bugfix/view-modes-and-card-view branch November 12, 2024 16:50
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.

2 participants