Commit 2b5ee63b authored by Anastasiia Nikolaienko's avatar Anastasiia Nikolaienko Committed by Commit Bot

Change text on Settings Page for unmigrated accounts

Bug: 962284
Change-Id: I3d5ca93e11aa0a8a16a2c4bfb95273852392c2ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611891
Commit-Queue: Anastasiia Nikolaienko <anastasiian@google.com>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarKush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660785}
parent c1c5f5fc
......@@ -3626,6 +3626,12 @@
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_SIGNED_OUT_ACCOUNT_PLACEHOLDER" desc="Placeholder text for the full name of a signed out account in Account Manager.">
Sign in again
</message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_UNMIGRATED_ACCOUNT_PLACEHOLDER" desc="Placeholder text for the unmigrated account in Account Manager.">
Not updated yet
</message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_MIGRATION_LABEL" desc="Label of the migration button on Account Manager Settings page.">
Update account
</message>
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_REAUTHENTICATION_LABEL" desc="Label of the re-authentication button on Account Manager Settings page.">
Sign in
</message>
......
92ba90eaa3d94731b388337b83084f101c67477f
\ No newline at end of file
......@@ -99,7 +99,7 @@
<!-- Else, display a re-authentication message -->
<template is="dom-if" if="[[!item.isSignedIn]]">
<span style="color:red">
$i18n{accountManagerSignedOutAccountName}
[[getAccountManagerSignedOutName_(item.unmigrated)]]
</span>
</template>
......@@ -111,7 +111,7 @@
if="[[shouldShowReauthenticationButton_(item)]]">
<paper-button class="reauth-button"
on-click="onReauthenticationTap_">
$i18n{accountManagerReauthenticationLabel}
[[getAccountManagerSignedOutLabel_(item.unmigrated)]]
</paper-button>
</template>
......@@ -124,7 +124,7 @@
<!-- Else, display a hamburger menu for removing the account -->
<template is="dom-if" if="[[!item.isDeviceAccount]]">
<cr-icon-button class="icon-more-vert" title="$i18n{moreActions}"
on-click="onAccountActionsMenuButtonTap_"></cr-icon-button>
on-click="onAccountActionsMenuButtonTap_"></cr-icon-button>
</template>
</div>
</template>
......@@ -132,8 +132,7 @@
<div class="clear settings-box"></div>
<cr-action-menu>
<button class="dropdown-item"
on-click="onRemoveAccountTap_">
<button class="dropdown-item" on-click="onRemoveAccountTap_">
$i18n{removeAccountLabel}
</button>
</cr-action-menu>
......
......@@ -115,6 +115,24 @@ Polymer({
return this.i18n('accountManagerUnmanagedLabel');
},
/**
* @param {boolean} unmigrated
* @private
*/
getAccountManagerSignedOutName_: function(unmigrated) {
return this.i18n(unmigrated ? 'accountManagerUnmigratedAccountName'
: 'accountManagerSignedOutAccountName');
},
/**
* @param {boolean} unmigrated
* @private
*/
getAccountManagerSignedOutLabel_: function(unmigrated) {
return this.i18n(unmigrated ? 'accountManagerMigrationLabel'
: 'accountManagerReauthenticationLabel');
},
/**
* @param {!CustomEvent<!{model: !{item: !settings.Account}}>} event
* @private
......
......@@ -16,6 +16,7 @@ cr.exportPath('settings');
* accountType: number,
* isDeviceAccount: boolean,
* isSignedIn: boolean,
* unmigrated: boolean,
* fullName: string,
* email: string,
* pic: string,
......
......@@ -176,6 +176,8 @@ void AccountManagerUIHandler::OnGetAccounts(
webui::GetBitmapDataUrl(
default_icon.GetRepresentation(1.0f).GetBitmap()));
}
account.SetBoolean("unmigrated",
account_manager_->HasDummyGaiaToken(account_key));
if (IsSameAccount(account_key, device_account_id)) {
device_account = std::move(account);
......
......@@ -1648,6 +1648,10 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"removeAccountLabel", IDS_SETTINGS_ACCOUNT_MANAGER_REMOVE_ACCOUNT_LABEL},
{"accountManagerSignedOutAccountName",
IDS_SETTINGS_ACCOUNT_MANAGER_SIGNED_OUT_ACCOUNT_PLACEHOLDER},
{"accountManagerUnmigratedAccountName",
IDS_SETTINGS_ACCOUNT_MANAGER_UNMIGRATED_ACCOUNT_PLACEHOLDER},
{"accountManagerMigrationLabel",
IDS_SETTINGS_ACCOUNT_MANAGER_MIGRATION_LABEL},
{"accountManagerReauthenticationLabel",
IDS_SETTINGS_ACCOUNT_MANAGER_REAUTHENTICATION_LABEL},
{"accountManagerManagedLabel",
......
......@@ -25,6 +25,7 @@ cr.define('settings_people_page_account_manager', function() {
accountType: 1,
isDeviceAccount: true,
isSignedIn: true,
unmigrated: false,
fullName: 'Device Account',
email: 'admin@domain.com',
pic: 'data:image/png;base64,abc123',
......@@ -35,6 +36,7 @@ cr.define('settings_people_page_account_manager', function() {
accountType: 1,
isDeviceAccount: false,
isSignedIn: true,
unmigrated: false,
fullName: 'Secondary Account 1',
email: 'user1@example.com',
pic: '',
......@@ -44,9 +46,20 @@ cr.define('settings_people_page_account_manager', function() {
accountType: 1,
isDeviceAccount: false,
isSignedIn: false,
unmigrated: false,
fullName: 'Secondary Account 2',
email: 'user2@example.com',
pic: '',
},
{
id: '1010',
accountType: 1,
isDeviceAccount: false,
isSignedIn: false,
unmigrated: true,
fullName: 'Secondary Account 3',
email: 'user3@example.com',
pic: '',
}
]);
}
......@@ -96,6 +109,7 @@ cr.define('settings_people_page_account_manager', function() {
accountType: 1,
isDeviceAccount: true,
isSignedIn: true,
unmigrated: false,
fullName: 'Device Account',
email: 'admin@domain.com',
pic: 'data:image/png;base64,abc123',
......@@ -132,8 +146,8 @@ cr.define('settings_people_page_account_manager', function() {
test('AccountListIsPopulatedAtStartup', function() {
return browserProxy.whenCalled('getAccounts').then(() => {
Polymer.dom.flush();
// 3 accounts were added in |getAccounts()| mock above.
assertEquals(3, accountList.items.length);
// 4 accounts were added in |getAccounts()| mock above.
assertEquals(4, accountList.items.length);
});
});
......@@ -156,6 +170,26 @@ cr.define('settings_people_page_account_manager', function() {
});
});
test('UnauthenticatedAccountLabel', function() {
return browserProxy.whenCalled('getAccounts').then(() => {
Polymer.dom.flush();
assertEquals(
loadTimeData.getString('accountManagerReauthenticationLabel'),
accountManager.root.querySelectorAll('.reauth-button')[0]
.textContent.trim());
});
});
test('UnmigratedAccountLabel', function() {
return browserProxy.whenCalled('getAccounts').then(() => {
Polymer.dom.flush();
assertEquals(
loadTimeData.getString('accountManagerMigrationLabel'),
accountManager.root.querySelectorAll('.reauth-button')[1]
.textContent.trim());
});
});
test('RemoveAccount', function() {
return browserProxy.whenCalled('getAccounts').then(() => {
Polymer.dom.flush();
......
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