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: improve translations editing #324

Merged
merged 16 commits into from
Jan 18, 2024
Merged

Conversation

perierc
Copy link
Contributor

@perierc perierc commented Dec 25, 2023

What

This PR changes a few things about the edit entry page:

  • The children and parents are now listed horizontally instead of vertically, to make the information more compact
  • If there are no parents or no children, we display "No parents" instead of "Parents" "None"
  • The translations edition section has been revamped, using Tagify. Translations can be added freely via a blank entry, and tags can be deleted or reordered with drag&drop.
  • The backend has been updated to make the ID of the node change when the first translation of the main language changes. If the new ID already exists, it sends back an error to the frontend and the changes are not saved in the database.
  • When the first translation of a language changes, an alert informs the user on the frontend that the display name of this language (and ID of the node if it is the main language) will change if changes are saved.
  • Fixed an issue in the backend where the tags were normalised whereas they shouldn't.
  • The modified files that were still in Javascript (jsx) have been transformed to Typescript (tsx) and typed.

This PR also includes a lot of refactoring to simplify the code and avoid unnecessary rerenders.

Video demo

new-node-edition.mp4

ID change (first translation of the main language changes) :

id-change.mp4

Part of

#323

Copy link
Contributor

@eric-nguyen-cs eric-nguyen-cs left a comment

Choose a reason for hiding this comment

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

Good PR, does what it is supposed to do!
However, I left quite a bit of comments concerning the previous code's quality
Not sure if it should be handled in this PR or not... (But my stance on that is to refactor at the same time of adding new features, or better yet to do a refactor PR before the feat changes)

backend/editor/entries.py Outdated Show resolved Hide resolved
backend/editor/entries.py Outdated Show resolved Hide resolved
backend/editor/entries.py Show resolved Hide resolved
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

I see @eric-nguyen-cs did a good review, I didn't take the time to understand tsx files much, sorry.

backend/editor/entries.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the api label Jan 13, 2024
@perierc perierc force-pushed the improve-translations-editing branch from ef4d88e to 6e3df23 Compare January 17, 2024 13:39
@perierc perierc force-pushed the improve-translations-editing branch from 6e3df23 to 02b450b Compare January 17, 2024 13:40
@perierc perierc linked an issue Jan 18, 2024 that may be closed by this pull request
@alexgarel
Copy link
Member

@eric-nguyen-cs I let you validate it if @perierc thinks it's ready.

Copy link
Contributor

@eric-nguyen-cs eric-nguyen-cs left a comment

Choose a reason for hiding this comment

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

You can merge after solving the important comments

taxonomy-editor-frontend/package.json Show resolved Hide resolved
backend/editor/entries.py Show resolved Hide resolved
backend/editor/api.py Outdated Show resolved Hide resolved
backend/editor/entries.py Outdated Show resolved Hide resolved
taxonomy-editor-frontend/src/App.tsx Outdated Show resolved Hide resolved
@perierc perierc merged commit 453ff89 into main Jan 18, 2024
7 checks passed
@perierc perierc deleted the improve-translations-editing branch January 18, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve node editing on frontend
3 participants