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

feat(ddi to lunatic): dynamic units #1175

Merged
merged 17 commits into from
Dec 18, 2024
Merged

feat(ddi to lunatic): dynamic units #1175

merged 17 commits into from
Dec 18, 2024

Conversation

nsenave
Copy link
Contributor

@nsenave nsenave commented Dec 11, 2024

@nsenave nsenave self-assigned this Dec 11, 2024
@nsenave nsenave marked this pull request as ready for review December 12, 2024 17:26
@nsenave nsenave added the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 12, 2024
Copy link

👋 Version 3.31.0-SNAPSHOT deployed on docker hub

@github-actions github-actions bot removed the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 12, 2024
@nsenave
Copy link
Contributor Author

nsenave commented Dec 13, 2024

@QRuhier @laurentC35 J'ai passé les type des labels d'unité en VTL 9621748

@nsenave nsenave added the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 13, 2024
Copy link

👋 Version 3.31.0-SNAPSHOT.2 deployed on docker hub

@github-actions github-actions bot removed the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 13, 2024
Copy link
Contributor Author

@nsenave nsenave left a comment

Choose a reason for hiding this comment

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

to do

return null;
DynamicLabel label = new DynamicLabel();
label.setValue(value);
// (type is left at its default value)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm j'aurais pu skip tout le code que j'ai ajouté dans LunaticEditLabelTypes en faisant simplement un set ici j'ai l'impression, à refacto

}

public static DynamicLabel createUnit(String value) {
if (value == null)
Copy link

@corbininsee corbininsee Dec 13, 2024

Choose a reason for hiding this comment

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

if (value == null || value.trim().isEmpty()) { throw new InvalidValueException("The value for DynamicLabel cannot be null or empty."); }

Ne serait-ce pas mieux de lever une exception ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oui je comprends ta remarque c'est le signe d'une faiblesse dans la modélisation de cet objet, mais il a le droit de façon légitime de ne pas avoir de unit, dans ces cas là la prop reste à null donc pas besoin de créer un objet "label" sur la cible.

Ceci dit, au départ la méthode était en privée ici donc c'était pas trop gênant, mais entre deux je l'ai passée en public pour m'en resservir ailleurs, et dans le "cas général" c'est piégeux que la méthode puisse renvoyer du null en effet

Je vais essayer de refacto pour faire plus propre

@nsenave nsenave added the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 16, 2024
Copy link

👋 Version 3.31.0-SNAPSHOT.3 deployed on docker hub

@github-actions github-actions bot removed the deploy-snapshot To be used in PR to trigger snapshot deploy pipeline label Dec 16, 2024
@nsenave nsenave merged commit 8ad732a into v3-main Dec 18, 2024
@nsenave nsenave deleted the feat/v3-dynamic-unit branch December 18, 2024 09:06
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