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

XWIKI-21971: No options when using LiveData with a LevelsClass column #2982

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

surli
Copy link
Member

@surli surli commented Mar 14, 2024

Jira URL

https://jira.xwiki.org/browse/XWIKI-21971

Changes

Description

  • Provide a list of maps of label / values in case of LevelsClass

Clarifications

  • Selectize is expecting a list of entries value/labels to create the options, and not a list of strings

Screenshots & Video

N/A

Executed Tests

Ran mvn clean install -Pquality on module livedata.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • 15.10.x

surli added 2 commits March 14, 2024 11:20
  * Provide a list of maps of label / values in case of LevelsClass
  * Provide equals/hashcode/tostring method in
    LiveDataPropertyDescriptor
  * Improve test to rely on LiveDataPropertyDescriptor objects instead
    of relying on JSON serialization
@surli surli marked this pull request as ready for review March 14, 2024 10:59
@surli surli added the backport stable-15.10.x Used for automatic backport to 15.10.x branch. label Mar 14, 2024
@surli surli requested review from manuelleduc and mflorea March 14, 2024 11:00
String expectedJSON =
"[" + getExpectedDocPropsJSON() + "," + expectedClassProps.toString().replace('\'', '"') + "]";
assertEquals(expectedJSON, this.objectMapper.writeValueAsString(properties));
assertEquals(List.of(descriptor0, descriptor1, descriptor2, descriptor3, descriptor4), properties);
Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed on the chat, I've refactored the test to use objects instead of JSON serialization to avoid issues with order of parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for refactoring this!

Copy link
Contributor

@manuelleduc manuelleduc left a comment

Choose a reason for hiding this comment

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

lgtm except for the few code style comments.

@surli surli merged commit 65d216e into master Mar 14, 2024
1 check passed
@surli surli deleted the XWIKI-21971 branch March 14, 2024 13:20
github-actions bot pushed a commit that referenced this pull request Mar 14, 2024
…#2982)

  * Provide a list of maps of label / values in case of LevelsClass
  * Provide equals/hashcode/tostring method in
    LiveDataPropertyDescriptor
  * Improve test to rely on LiveDataPropertyDescriptor objects instead
    of relying on JSON serialization
  * Minor fixes after review

(cherry picked from commit 65d216e)
surli added a commit that referenced this pull request Mar 14, 2024
…#2982)

  * Provide a list of maps of label / values in case of LevelsClass
  * Provide equals/hashcode/tostring method in
    LiveDataPropertyDescriptor
  * Improve test to rely on LiveDataPropertyDescriptor objects instead
    of relying on JSON serialization
  * Minor fixes after review

(cherry picked from commit 65d216e)
Sereza7 pushed a commit to Sereza7/xwiki-platform that referenced this pull request Mar 14, 2024
…xwiki#2982)

  * Provide a list of maps of label / values in case of LevelsClass
  * Provide equals/hashcode/tostring method in
    LiveDataPropertyDescriptor
  * Improve test to rely on LiveDataPropertyDescriptor objects instead
    of relying on JSON serialization
  * Minor fixes after review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable-15.10.x Used for automatic backport to 15.10.x branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants