Commit 2cf71fd8 authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Fix OS settings "People" row when Account Manager is disabled

Make the first row of the People section not clickable when the account
manager is disabled (e.g. via flags or Finch).

Bug: 950007
Test: added to browser_tests
Change-Id: Ib9720f55fb60b526afe3ae40566678f603423320
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760463Reviewed-by: default avatarLutz Justen <ljusten@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688533}
parent a16e96e6
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</div> </div>
<div class="middle two-line no-min-width" <div class="middle two-line no-min-width"
on-click="onAccountManagerTap_" on-click="onAccountManagerTap_"
actionable> actionable$="[[isAccountManagerEnabled_]]">
<div class="flex text-elide settings-box-text"> <div class="flex text-elide settings-box-text">
<span id="profile-name">[[profileName_]]</span> <span id="profile-name">[[profileName_]]</span>
<div id="profile-label" class="secondary"> <div id="profile-label" class="secondary">
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
</div> </div>
</div> </div>
<cr-icon-button class="subpage-arrow" <cr-icon-button class="subpage-arrow"
hidden="[[!isAccountManagerEnabled_]]"
id="account-manager-subpage-trigger" id="account-manager-subpage-trigger"
aria-label="$i18n{accountManagerSubMenuLabel}" aria-label="$i18n{accountManagerSubMenuLabel}"
aria-describedby="profile-name"></cr-icon-button> aria-describedby="profile-name"></cr-icon-button>
......
...@@ -337,7 +337,9 @@ Polymer({ ...@@ -337,7 +337,9 @@ Polymer({
* @private * @private
*/ */
onAccountManagerTap_: function(e) { onAccountManagerTap_: function(e) {
settings.navigateTo(settings.routes.ACCOUNT_MANAGER); if (this.isAccountManagerEnabled_) {
settings.navigateTo(settings.routes.ACCOUNT_MANAGER);
}
}, },
/** /**
......
...@@ -130,6 +130,9 @@ cr.define('settings_people_page', function() { ...@@ -130,6 +130,9 @@ cr.define('settings_people_page', function() {
'pushedName', peoplePage.$$('#profile-name').textContent.trim()); 'pushedName', peoplePage.$$('#profile-name').textContent.trim());
const newBg = peoplePage.$$('#profile-icon').style.backgroundImage; const newBg = peoplePage.$$('#profile-icon').style.backgroundImage;
assertTrue(newBg.includes(iconDataUrl)); assertTrue(newBg.includes(iconDataUrl));
// Sub-page trigger is hidden.
assertTrue(peoplePage.$$('#account-manager-subpage-trigger').hidden);
}); });
test('GAIA name and picture, account manager enabled', async () => { test('GAIA name and picture, account manager enabled', async () => {
...@@ -156,6 +159,14 @@ cr.define('settings_people_page', function() { ...@@ -156,6 +159,14 @@ cr.define('settings_people_page', function() {
assertEquals( assertEquals(
'primary@gmail.com, +2 more accounts', 'primary@gmail.com, +2 more accounts',
peoplePage.$$('#profile-label').textContent.trim()); peoplePage.$$('#profile-label').textContent.trim());
// Sub-page trigger is shown.
const subpageTrigger = peoplePage.$$('#account-manager-subpage-trigger');
assertFalse(subpageTrigger.hidden);
// Sub-page trigger navigates to Google account manager.
subpageTrigger.click();
assertEquals(settings.getCurrentRoute(), settings.routes.ACCOUNT_MANAGER);
}); });
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment