Skip to content

Conversation

@myovchev
Copy link
Contributor

@myovchev myovchev commented Oct 2, 2024

Summary

  • Fix a reorder issue for arrays (UI array editor)
  • Fix inline array items label to be consistent with the standard array slat list

What are the specific steps to test this change?

  • Reorder an array item via drag-n-drop in the Array Editor for standard and inline arrays should work as expected
  • The inline array item label now uses title for titleField by default (consistent with the Slat list)

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@linear
Copy link

linear bot commented Oct 2, 2024

@myovchev myovchev requested a review from BoDonkey October 2, 2024 12:37
Copy link
Contributor

@BoDonkey BoDonkey left a comment

Choose a reason for hiding this comment

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

Tested and works correctly.

Comment on lines +135 to +136
// FIX: swapping the items does not trigger the watcher
this.next = this.next.slice();
Copy link
Member

Choose a reason for hiding this comment

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

is this more performant than setting the watcher to deep: true ? (probably)

Copy link
Contributor Author

@myovchev myovchev Oct 2, 2024

Choose a reason for hiding this comment

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

Hmm, I can't say that. I'm not sure if deep will solve it.
I would assume deep is more CPU intensive as it should compare every property in a deep object (and we already do that in the watcher). This should be a cheap check for Vue (because it fails ===).

@myovchev myovchev merged commit c25ad4a into main Oct 3, 2024
8 checks passed
@myovchev myovchev deleted the pro-6627-reorder-arrays-ui branch October 3, 2024 10:14
haroun added a commit to haroun/apostrophe that referenced this pull request Oct 8, 2024
* upstream/main:
  Release 4.8.0 (apostrophecms#4742)
  Enable by default, other tweaks (apostrophecms#4741)
  PRO-6627: Fix array reorder and labels (apostrophecms#4740)
  Pro 6518 mobile preview (apostrophecms#4720)
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.

4 participants