-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
base: master
Are you sure you want to change the base?
Conversation
@@ -1371,8 +1371,10 @@ hqDefine("cloudcare/js/formplayer/menus/views", [ | |||
this.languageOptionsEnabled = options.languageOptionsEnabled; | |||
}, | |||
templateContext: function () { | |||
const currentLang = UsersModels.getCurrentUser().displayOptions.language; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
commcare-hq/corehq/apps/cloudcare/static/cloudcare/js/formplayer/users/models.js
Lines 72 to 78 in 0b23168
var userInstance; | |
self.getCurrentUser = function () { | |
if (!userInstance) { | |
userInstance = new self.CurrentUser(); | |
} | |
return userInstance; | |
}; |
Product Description
Show currently selected language as "active" in the web apps language selection dropdown
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
Labels & Review