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

Mark selected language as active in dropdown #35588

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

esoergel
Copy link
Contributor

@esoergel esoergel commented Jan 7, 2025

Product Description

Show currently selected language as "active" in the web apps language selection dropdown

image

This also makes the selected language no longer clickable.

Technical Summary

https://dimagi.atlassian.net/browse/USH-5114

Shout out to @avazirna for #35444

Feature Flag

Safety Assurance

Safety story

This is pretty straightforward a change - I'm happy with local testing

Automated test coverage

QA Plan

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@dimagimon dimagimon added the Risk: Medium Change affects files that have been flagged as medium risk. label Jan 7, 2025
@esoergel esoergel marked this pull request as ready for review January 7, 2025 21:20
@esoergel esoergel requested a review from minhaminha January 7, 2025 21:21
@@ -1371,8 +1371,10 @@ hqDefine("cloudcare/js/formplayer/menus/views", [
this.languageOptionsEnabled = options.languageOptionsEnabled;
},
templateContext: function () {
const currentLang = UsersModels.getCurrentUser().displayOptions.language;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be better to put this in MenuDropdownView.childViewOptions so UsersModels.getCurrentUser() only need the be called once. And maybe only if languageOptionsEnabled is true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getCurrentUser is cached actually, so it shouldn't be a problem to call it more than once:

var userInstance;
self.getCurrentUser = function () {
if (!userInstance) {
userInstance = new self.CurrentUser();
}
return userInstance;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Risk: Medium Change affects files that have been flagged as medium risk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants