Skip to content

Conversation

epipav
Copy link
Collaborator

@epipav epipav commented Jun 23, 2023

Changes proposed ✍️

  • Now custom opensource mappings both accept to and from translations. This is helpful when we need to query an exact field of an object array, but we want to get the full object back from opensearch

What

🤖 Generated by Copilot at c0647c5

This pull request improves the translation between Crowd and Opensearch by introducing a new customTranslation property for fields that need special handling. It also refactors the MemberTranslator class to avoid field collisions and improve code quality. The changes affect the opensearch.ts, members.ts, memberTranslator.ts, and fieldTranslator.ts files.

🤖 Generated by Copilot at c0647c5

Sing, O Muse, of the skillful coder who modified the code
To make the fields of Crowd and Opensearch more harmonious
He added customTranslation to the OpensearchField interface
And gave the power to the models to define their own mappings

Why

How

🤖 Generated by Copilot at c0647c5

  • Add customTranslation property to OpensearchField interface to allow for custom field mappings between Crowd and Opensearch (link)
  • Refactor MemberTranslator class to inherit from FieldTranslator class and move static field translations to parent class (link)
  • Fix id and uuid_id field collision in MemberTranslator class by setting reverse translation for uuid_id to id (link)
  • Update MembersOpensearch model to use customTranslation property for id, reach, identities, and tags fields (link, link, link, link)
  • Modify setTranslationMaps method in FieldTranslator class to check for custom translations in model and use them instead of default translations (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@epipav epipav marked this pull request as ready for review June 23, 2023 11:38
@epipav epipav self-assigned this Jun 23, 2023
@epipav epipav added the Bug Created by Linear-GitHub Sync label Jun 23, 2023
@epipav epipav merged commit 8134729 into main Jun 23, 2023
@epipav epipav deleted the bugfix/custom-opensearch-destinations branch June 23, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants