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

Quick edit modal for content language #4355

Conversation

AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Dec 8, 2023

Summary

Description of the change(s) you made

Add a quick edit modal to edit content nodes languages. Also add an checkbox to update descendants languages, but this does not work for now until #4372 is merged.

Screenshots

Compartir.pantalla.-.2024-01-05.09_39_40.mp4

Reviewer guidance

How can a reviewer test these changes?

  1. Go to update a channel content
  2. Click on the "Edit Language" option on the content node menu.
  3. Or you can select multiple content nodes and select "Edit language" on the bulk toolbar.

References

Closes #3415

Comments

The "clear" button on the search textbox should be included on KDS first, and we should add just a prop in this code.


Contributor's Checklist

Studio-specifc:

  • All user-facing strings are translated properly
  • The notranslate class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)
  • All UI components are LTR and RTL compliant
  • Views are organized into pages, components, and layouts directories as described in the docs
  • Users' storage used is recalculated properly on any changes to main tree files
  • If there new ways this uses user data that needs to be factored into our Privacy Policy, it has been noted.

Testing:

  • Code is clean and well-commented
  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Any new interactions have been added to the QA Sheet
  • Critical and brittle code paths are covered by unit tests

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@AlexVelezLl AlexVelezLl changed the base branch from unstable to studio-usability-enhancements December 13, 2023 14:59
@AlexVelezLl AlexVelezLl force-pushed the quick-edit-modal-language branch from 7a110e4 to c2ea655 Compare January 2, 2024 20:01
@AlexVelezLl AlexVelezLl requested a review from akolson January 5, 2024 14:51
Copy link
Member

@akolson akolson Jan 8, 2024

Choose a reason for hiding this comment

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

Using setTimeout in tests is not recommended may make the tests unreliable. You could consider using requestAnimationFrame or throttling instead.

Copy link
Member

Choose a reason for hiding this comment

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

Here is an example that uses the requestAnimationFrame

Copy link
Member

Choose a reason for hiding this comment

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

}
const criteria = ['id', 'native_name', 'readable_name'];
return LanguagesList.filter(lang =>
criteria.some(key => lang[key]?.toLowerCase().includes(searchQuery))
Copy link
Member

Choose a reason for hiding this comment

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

It's worth-noting that the chaining operator(?.) is not supported in IE 11 that we are still supporting(The last time i checked) :(.

Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Implementation looks correct to me! I have left a few general comments for your consideration. Great work @AlexVelezLl

@AlexVelezLl
Copy link
Member Author

AlexVelezLl commented Jan 10, 2024

Thanks! @akolson I have replaced the setTimeout (didnt know about the requestAnimationFrame, thank you!!), and removed the chaning operator 🙌.

@AlexVelezLl AlexVelezLl merged commit 0744636 into learningequality:studio-usability-enhancements Jan 10, 2024
9 checks passed
@AlexVelezLl AlexVelezLl deleted the quick-edit-modal-language branch January 10, 2024 14:11
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