Skip to content

Conversation

@jdsmithsos
Copy link
Contributor

@jdsmithsos jdsmithsos commented Aug 25, 2025

Jira tickets:

https://ikmdev.atlassian.net/browse/IIA-2440
https://ikmdev.atlassian.net/browse/IIA-2441

Summary of changes: modified ObservableViewNoOverride.baseCoordinateChangedListenersRemoved() to set the value of existing LanguageCoordinates, rather than create new LanguageCoordinates objects

Before change: Changing the Parent language causes child view coordinates to go into Overridden mode

Select Journal view coordinate language to Spanish then back to English.
Child goes into Overridden mode.

image

After change: Child view coordinates no longer go into Overridden mode

image

for (ObservableLanguageCoordinateBase observableLanguageCoordinateBase : this.languageCoordinates) {
var existingUuid = observableLanguageCoordinateBase.getLanguageCoordinateUuid();

if (newUuid.equals(existingUuid)) {
Copy link
Contributor

@swaroopsalvi swaroopsalvi Aug 26, 2025

Choose a reason for hiding this comment

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

@jdsmithsos ,
I will recommend to you to use Public id instead of UUID, since this is an array of ids, you might get a false negative.
Here is what I will recommend:

` for (LanguageCoordinate newLangCoord : newValue.languageCoordinates()) {
PublicId newPublicId = EntityService.get().getEntityFast(newLangCoord.getLanguageCoordinateUuid()).publicId();

        for (ObservableLanguageCoordinateBase observableLanguageCoordinateBase : this.languageCoordinates) {
            PublicId existingPublicId = EntityService.get().getEntityFast(observableLanguageCoordinateBase.getLanguageCoordinateUuid()).publicId();
            if (PublicId.equals(existingPublicId, newPublicId)) {
            ...
            ..
            }
        }
  }

`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PublicId existingPublicId = EntityService.get().getEntityFast(observableLanguageCoordinateBase.getLanguageCoordinateUuid()).publicId();
if (PublicId.equals(existingPublicId, newPublicId)) {

I'll try this, thanks

Copy link
Contributor Author

@jdsmithsos jdsmithsos Aug 26, 2025

Choose a reason for hiding this comment

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

I couldn't get the pubicID check to work, so I changed the way that the value is set, using the same way that the ObservableViewWithOverride does, which just indexes through the list and sets based on the index

@jdsmithsos
Copy link
Contributor Author

@swaroopsalvi There is not a parentID method available in LanguageCoordinate, which is why I am using the UUID

… set, changed to the same was as the ObservableViewWithOverride sets the values
Copy link
Contributor

@swaroopsalvi swaroopsalvi left a comment

Choose a reason for hiding this comment

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

Looks good.
Approved.

Copy link
Contributor

@dholubek dholubek left a comment

Choose a reason for hiding this comment

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

looks good

@jdsmithsos jdsmithsos merged commit 36dd303 into ikmdev:main Aug 26, 2025
7 checks passed
@jdsmithsos jdsmithsos deleted the feature/finished/IIA-2440-language-selection-in-parent-causes-child-override branch August 28, 2025 20:54
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.

3 participants