Skip to content

Comments

Mapping attributes teis v40#1038

Open
anagperal wants to merge 5 commits intodevelopmentfrom
fix/mapping-attributes-teis
Open

Mapping attributes teis v40#1038
anagperal wants to merge 5 commits intodevelopmentfrom
fix/mapping-attributes-teis

Conversation

@anagperal
Copy link
Contributor

@anagperal anagperal commented Oct 23, 2025

📌 References

📝 Implementation

  • Also map the attributes if they exist like in v40
  • Fix test

📹 Screenshots/Screen capture

Error before:
image

Now success

🔥 Is there anything the reviewer should know to test it?

  • test it with instance v40 and applying mapping feature. I have tested using the scheduler

📑 Others

  • Any change in the GUI library? If so, what branch/PR?

  • Any change in the D2 Api? If so, what branch/PR?

@bundlemon
Copy link

bundlemon bot commented Oct 23, 2025

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
2.78MB (+17B 0%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link
Contributor

@MatiasArriola MatiasArriola left a comment

Choose a reason for hiding this comment

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

Thanks @anagperal !

Looks good to me, just a comment

Comment on lines 50 to 64
attributes: enrollment.attributes.map(att => {
const mappedAttributeId =
trackedEntityAttributesToTEI[att.attribute]?.mappedId ?? att.attribute;

const mappedValue = mapOptionValue(att.value, [
trackedEntityAttributesToTEI[att.attribute]?.mapping ?? {},
this.mapping,
]);

return {
...att,
attribute: mappedAttributeId,
value: mappedValue,
};
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be extracted to a function to avoid code duplication (same is done for attributes and enrollment.attributes).
Even if it is a helper inside the method like const mapAttribute = (att: TrakedEntityAttribute) => { [...] I think it would be a good option

Copy link
Contributor

@MatiasArriola MatiasArriola left a comment

Choose a reason for hiding this comment

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

Nice @anagperal! Thanks!

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