Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

fix: fix sortByCollator collection macro return keys #556

Merged
merged 1 commit into from
May 30, 2023
Merged

fix: fix sortByCollator collection macro return keys #556

merged 1 commit into from
May 30, 2023

Conversation

mishagp
Copy link
Contributor

@mishagp mishagp commented May 28, 2023

Prevents results from being conformed to an object via Inertia rendering where an array is expected.

I observed a bug where entities from different account personalization sections weren't rendering because the frontend Vue code was expecting an array of entity DTO objects but got a nested object of entity DTO objects which broke frontend logic depending on the presence of an array.

Believe this issue may have been introduced with the addition of the localization collection sorting macro and traced it to the construction of the new collection. Looks like all that needed to be done was clean the keys after sorting to prevent Inertia from rendering as a JS object rather than an array.

Prevents results from being conformed to an object via Inertia rendering
@mishagp
Copy link
Contributor Author

mishagp commented May 28, 2023

Side-note, is there desire for an E2E testing suite using something like Laravel Dusk? I have some experience setting up CI for that and could contribute in that way!

@djaiss djaiss changed the title Fix to sortByCollator collection macro return keys fix: fix sortByCollator collection macro return keys May 28, 2023
@asbiin asbiin merged commit b96c6c8 into monicahq:main May 30, 2023
@asbiin
Copy link
Member

asbiin commented May 30, 2023

Side-note, is there desire for an E2E testing suite using something like Laravel Dusk? I have some experience setting up CI for that and could contribute in that way!

We don't have such E2E testing for the moment. That would be lovely if want to contribute for that. We also used to start using cypress in the Monica project, but I'm open to any good suggestion!

asbiin pushed a commit to monicahq/monica that referenced this pull request Jun 3, 2023
…dler#556)

Fix to `sortByCollator` collection macro

Prevents results from being conformed to an object via Inertia rendering
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants