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

IA-3725: Display deprecated possible fields in entity type dialog #1843

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

beygorghor
Copy link
Collaborator

@beygorghor beygorghor commented Dec 5, 2024

For now you can select all the fields from all the versions of a form without knowing if the field is still active on the latest version of the form. We need to display the difference while editing fields on entity types dialog

Related JIRA tickets : IA-3725

Self proofreading checklist

  • Did I use eslint and black formatters
  • Is my code clear enough and well documented
  • Are my typescript files well typed
  • New translations have been added or updated if new strings have been introduced in the frontend
  • My migrations file are included
  • Are there enough tests
  • Documentation has been included (for new feature)

Changes

  • create a get_possible_fields_with_latest_version field in the FormSerializer
  • use possible_fields_with_latest_version while fetching possible fields for entity type dialog
  • highlight deprecated fields on the dialog

How to test

  • Make sure you have a form with multiple versions, and removed/renamed fields on the latest.
  • edit/create a entity type with this form as reference form
  • play with last three select on the dialog, you should see the fields that has been deleted

Print screen / video

Screenshot 2024-12-05 at 11 28 27

Notes

Things that the reviewers should know:

  • known bugs that are out of the scope of the PR
  • other trade-offs that were made
  • does the PR depends on a PR in bluesquare-components?
  • should the PR be merged into another PR?

Follow the Conventional Commits specification

The merge message of a pull request must follow the Conventional Commits specification.

This convention helps to automatically generate release notes.

Use lowercase for consistency.

Example:

fix: empty instance pop up

Refs: IA-3665

Note that the Jira reference is preceded by a line break.

Both the line break and the Jira reference are entered in the Add an optional extended description… field.

Copy link
Member

@quang-le quang-le left a comment

Choose a reason for hiding this comment

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

Please just add/update test

Comment on lines +142 to +146
.sort((a, b) =>
formatLabel(a).localeCompare(formatLabel(b), undefined, {
sensitivity: 'accent',
}),
)
Copy link
Member

Choose a reason for hiding this comment

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

not really related but we should have that sort in a utils. I always have to ctrl+F it 😅

@beygorghor
Copy link
Collaborator Author

Forms unit test are a bit useless and need to be refactor, i have created another ticket for that => IA-3760

@beygorghor beygorghor merged commit 4fd746e into main Dec 6, 2024
3 checks passed
@beygorghor beygorghor deleted the IA-3725-possible_fields_with_latest_version branch December 6, 2024 14:57
@tdethier tdethier added user tested Has already been tested on staging ok for release Released and removed ok for release labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released user tested Has already been tested on staging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants