Commit fff5d925 authored by Gordon Seto's avatar Gordon Seto Committed by Chromium LUCI CQ

[CrOS Settings] Profile discovery install and update eSIM strings.

Update profile discovery page to only select one profile at a
time. Add installing eSIM profiles from the profile discovery
page.
Update activation code page description when no eSIM profiles were
found, add message and error message to eSIM final page.

Screenshots:
https://screenshot.googleplex.com/BrmvC8t88ei2fZZ.png
https://screenshot.googleplex.com/gcHndSi2XtU4WUg.png
https://screenshot.googleplex.com/7Xz4oKQMeYdZ283.png
https://screenshot.googleplex.com/8NMh78dNWUNq5Gd.png

Bug: 1093185
Change-Id: I61628f012fb19d383260b3cf26a30a1c7cff6d07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561040Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Commit-Queue: Gordon Seto <gordonseto@google.com>
Cr-Commit-Position: refs/heads/master@{#832628}
parent d3688f7c
...@@ -303,6 +303,12 @@ ...@@ -303,6 +303,12 @@
<message name="IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_MESSAGE" desc="Message displayed under title in final screen of cellular setup when ChromeOS encountered an error completing activation."> <message name="IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_MESSAGE" desc="Message displayed under title in final screen of cellular setup when ChromeOS encountered an error completing activation.">
An error occured during activation. An error occured during activation.
</message> </message>
<message name="IDS_CELLULAR_SETUP_ESIM_FINAL_PAGE_MESSAGE" desc="Message displayed under title in final success screen of eSIM cellular setup that tells user that their profile has been activated.">
Profile has been added successfully.
</message>
<message name="IDS_CELLULAR_SETUP_ESIM_FINAL_PAGE_ERROR_MESSAGE" desc="Message displayed under title in final screen of eSIM cellular setup when ChromeOS encountered an error installing eSIM profiles.">
Unable to connect to a mobile network. For technical support, please contact your carrier.
</message>
<message name="IDS_CELLULAR_SETUP_CELLULAR_SETUP_PAGE_PSIM_LABEL" desc="Label for physical SIM (pSIM) setup flow card radio select button during cellular setup"> <message name="IDS_CELLULAR_SETUP_CELLULAR_SETUP_PAGE_PSIM_LABEL" desc="Label for physical SIM (pSIM) setup flow card radio select button during cellular setup">
Physical SIM Physical SIM
</message> </message>
...@@ -324,6 +330,9 @@ ...@@ -324,6 +330,9 @@
<message name="IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE" desc="Label for informing the user on ways to retrieve an eSim profile"> <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE" desc="Label for informing the user on ways to retrieve an eSim profile">
Scan QR code using device camera or enter activation code provided by your carrier. Scan QR code using device camera or enter activation code provided by your carrier.
</message> </message>
<message name="IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_NO_PROFILES" desc="Label for informing the user on ways to retrieve an eSim profile after no eSIM profiles have been found.">
No profiles were discovered. To setup a new network, scan QR code using device camera or enter activation code provided by your carrier.
</message>
<message name="IDS_CELLULAR_SETUP_ESIM_PAGE_USE_CAMERA" desc="Label for button that uses the camera to scan for QR codes when clicked."> <message name="IDS_CELLULAR_SETUP_ESIM_PAGE_USE_CAMERA" desc="Label for button that uses the camera to scan for QR codes when clicked.">
Use camera to scan QR code Use camera to scan QR code
</message> </message>
......
57b82e94e5ee46431fd4796fe0a7fb9aa101625a
\ No newline at end of file
ee5a3f9282e24d012df8db178b9a93d764d48e07
\ No newline at end of file
1d5d372f5f8b4c6b4204871a459416e782363e09
\ No newline at end of file
...@@ -49,9 +49,14 @@ constexpr webui::LocalizedString kLocalizedStringsWithoutPlaceholders[] = { ...@@ -49,9 +49,14 @@ constexpr webui::LocalizedString kLocalizedStringsWithoutPlaceholders[] = {
{"finalPageMessage", IDS_CELLULAR_SETUP_FINAL_PAGE_MESSAGE}, {"finalPageMessage", IDS_CELLULAR_SETUP_FINAL_PAGE_MESSAGE},
{"finalPageErrorTitle", IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_TITLE}, {"finalPageErrorTitle", IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_TITLE},
{"finalPageErrorMessage", IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_MESSAGE}, {"finalPageErrorMessage", IDS_CELLULAR_SETUP_FINAL_PAGE_ERROR_MESSAGE},
{"eSimFinalPageMessage", IDS_CELLULAR_SETUP_ESIM_FINAL_PAGE_MESSAGE},
{"eSimFinalPageErrorMessage",
IDS_CELLULAR_SETUP_ESIM_FINAL_PAGE_ERROR_MESSAGE},
{"eSimProfileDetectMessage", {"eSimProfileDetectMessage",
IDS_CELLULAR_SETUP_ESIM_PROFILE_DETECT_MESSAGE}, IDS_CELLULAR_SETUP_ESIM_PROFILE_DETECT_MESSAGE},
{"scanQRCode", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE}, {"scanQRCode", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE},
{"scanQRCodeNoProfiles",
IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_NO_PROFILES},
{"switchCamera", IDS_CELLULAR_SETUP_ESIM_PAGE_SWITCH_CAMERA}, {"switchCamera", IDS_CELLULAR_SETUP_ESIM_PAGE_SWITCH_CAMERA},
{"useCamera", IDS_CELLULAR_SETUP_ESIM_PAGE_USE_CAMERA}, {"useCamera", IDS_CELLULAR_SETUP_ESIM_PAGE_USE_CAMERA},
{"scanQRCodeSuccess", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_SUCCESS}, {"scanQRCodeSuccess", IDS_CELLULAR_SETUP_ESIM_PAGE_SCAN_QR_CODE_SUCCESS},
......
...@@ -267,12 +267,22 @@ suite('CrComponentsEsimFlowUiTest', function() { ...@@ -267,12 +267,22 @@ suite('CrComponentsEsimFlowUiTest', function() {
profileList.selectItem(profileList.items[0]); profileList.selectItem(profileList.items[0]);
Polymer.dom.flush(); Polymer.dom.flush();
// The 'Done' button should now be enabled. // The 'Next' button should now be enabled.
assertTrue( assertTrue(
eSimPage.buttonState.done === eSimPage.buttonState.next ===
cellularSetup.ButtonState.SHOWN_AND_ENABLED); cellularSetup.ButtonState.SHOWN_AND_ENABLED);
assertTrue( assertTrue(
eSimPage.buttonState.skipDiscovery === eSimPage.buttonState.skipDiscovery ===
cellularSetup.ButtonState.HIDDEN); cellularSetup.ButtonState.HIDDEN);
// Simulate pressing 'Next'.
eSimPage.navigateForward();
await flushAsync();
// Should now be at the final page.
assertTrue(
eSimPage.selectedESimPageName_ === cellular_setup.ESimPageName.FINAL &&
eSimPage.selectedESimPageName_ === finalPage.id);
assertFalse(!!finalPage.$$('.error'));
}); });
}); });
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<base-page> <base-page>
<div slot="page-body"> <div slot="page-body">
<span id="scanQrCodeDescription"> <span id="scanQrCodeDescription">
[[i18n('scanQRCode')]] [[getDescription_(showNoProfilesMessage)]]
</span> </span>
<div id="esimQrCodeDetection"> <div id="esimQrCodeDetection">
<cr-button id="switchCameraButton" <cr-button id="switchCameraButton"
......
...@@ -79,6 +79,11 @@ Polymer({ ...@@ -79,6 +79,11 @@ Polymer({
type: Object, type: Object,
value: UiElement, value: UiElement,
}, },
/** @private */
showNoProfilesMessage: {
type: Boolean,
}
}, },
/** /**
...@@ -325,4 +330,10 @@ Polymer({ ...@@ -325,4 +330,10 @@ Polymer({
return false; return false;
} }
}, },
/** @private */
getDescription_() {
return this.showNoProfilesMessage ? this.i18n('scanQRCodeNoProfiles') :
this.i18n('scanQRCode');
},
}); });
...@@ -29,16 +29,19 @@ ...@@ -29,16 +29,19 @@
</setup-loading-page> </setup-loading-page>
<profile-discovery-list-page id="profileDiscoveryPage" <profile-discovery-list-page id="profileDiscoveryPage"
pending-profiles="[[pendingProfiles_]]" pending-profiles="[[pendingProfiles_]]"
selected-profiles="{{selectedProfiles_}}"> selected-profile="{{selectedProfile_}}">
</profile-discovery-list-page> </profile-discovery-list-page>
<activation-code-page id="activationCodePage" <activation-code-page id="activationCodePage"
activation-code="{{activationCode_}}" activation-code="{{activationCode_}}"
show-no-profiles-message="[[getShowNoProfilesMessage_(pendingProfiles_)]]"
show-error="{{showError_}}"> show-error="{{showError_}}">
</activation-code-page> </activation-code-page>
<final-page <final-page
id="finalPage" id="finalPage"
delegate="[[delegate]]" delegate="[[delegate]]"
show-error="[[showError_]]"> show-error="[[showError_]]"
message="[[i18n('eSimFinalPageMessage')]]"
error-message="[[i18n('eSimFinalPageErrorMessage')]]">
</final-page> </final-page>
</iron-pages> </iron-pages>
</template> </template>
......
...@@ -15,7 +15,7 @@ cr.define('cellular_setup', function() { ...@@ -15,7 +15,7 @@ cr.define('cellular_setup', function() {
/* #export */ const ESimUiState = { /* #export */ const ESimUiState = {
PROFILE_SEARCH: 'profile-search', PROFILE_SEARCH: 'profile-search',
ACTIVATION_CODE_ENTRY: 'activation-code-entry', ACTIVATION_CODE_ENTRY: 'activation-code-entry',
MULTI_PROFILE_SELECTION: 'multi-profile-selection', PROFILE_SELECTION: 'profile-selection',
SETUP_FINISH: 'setup-finish', SETUP_FINISH: 'setup-finish',
}; };
...@@ -73,12 +73,12 @@ cr.define('cellular_setup', function() { ...@@ -73,12 +73,12 @@ cr.define('cellular_setup', function() {
}, },
/** /**
* Profiles selected in profileDiscoveryPage to be installed. * Profile selected in profileDiscoveryPage to be installed.
* @type {!Array<!chromeos.cellularSetup.mojom.ESimProfileRemote>} * @type {?chromeos.cellularSetup.mojom.ESimProfileRemote}
* @private * @private
*/ */
selectedProfiles_: { selectedProfile_: {
type: Array, type: Object,
}, },
/** @private */ /** @private */
...@@ -103,7 +103,7 @@ cr.define('cellular_setup', function() { ...@@ -103,7 +103,7 @@ cr.define('cellular_setup', function() {
observers: [ observers: [
'updateSelectedPage_(state_)', 'updateButtonBarState_(state_)', 'updateSelectedPage_(state_)', 'updateButtonBarState_(state_)',
'onSelectedProfilesChanged_(selectedProfiles_.splices)' 'onSelectedProfileChanged_(selectedProfile_)'
], ],
/** @override */ /** @override */
...@@ -148,7 +148,7 @@ cr.define('cellular_setup', function() { ...@@ -148,7 +148,7 @@ cr.define('cellular_setup', function() {
this.handleProfileInstallResponse_.bind(this)); this.handleProfileInstallResponse_.bind(this));
break; break;
default: default:
this.state_ = ESimUiState.MULTI_PROFILE_SELECTION; this.state_ = ESimUiState.PROFILE_SELECTION;
break; break;
} }
}); });
...@@ -203,7 +203,7 @@ cr.define('cellular_setup', function() { ...@@ -203,7 +203,7 @@ cr.define('cellular_setup', function() {
case ESimUiState.ACTIVATION_CODE_ENTRY: case ESimUiState.ACTIVATION_CODE_ENTRY:
this.selectedESimPageName_ = ESimPageName.ACTIVATION_CODE; this.selectedESimPageName_ = ESimPageName.ACTIVATION_CODE;
break; break;
case ESimUiState.MULTI_PROFILE_SELECTION: case ESimUiState.PROFILE_SELECTION:
this.selectedESimPageName_ = ESimPageName.PROFILE_DISCOVERY; this.selectedESimPageName_ = ESimPageName.PROFILE_DISCOVERY;
break; break;
case ESimUiState.SETUP_FINISH: case ESimUiState.SETUP_FINISH:
...@@ -232,7 +232,7 @@ cr.define('cellular_setup', function() { ...@@ -232,7 +232,7 @@ cr.define('cellular_setup', function() {
skipDiscovery: cellularSetup.ButtonState.HIDDEN, skipDiscovery: cellularSetup.ButtonState.HIDDEN,
}; };
break; break;
case ESimUiState.MULTI_PROFILE_SELECTION: case ESimUiState.PROFILE_SELECTION:
buttonState = { buttonState = {
backward: cellularSetup.ButtonState.HIDDEN, backward: cellularSetup.ButtonState.HIDDEN,
cancel: this.delegate.shouldShowCancelButton() ? cancel: this.delegate.shouldShowCancelButton() ?
...@@ -273,17 +273,16 @@ cr.define('cellular_setup', function() { ...@@ -273,17 +273,16 @@ cr.define('cellular_setup', function() {
}, },
/** @private */ /** @private */
onSelectedProfilesChanged_() { onSelectedProfileChanged_() {
if (this.selectedProfiles_.length > 0) { if (this.selectedProfile_) {
this.set('buttonState.skipDiscovery', cellularSetup.ButtonState.HIDDEN); this.set('buttonState.skipDiscovery', cellularSetup.ButtonState.HIDDEN);
// TODO(crbug.com/1093185): Install the profiles when 'Done' is pressed.
this.set( this.set(
'buttonState.done', cellularSetup.ButtonState.SHOWN_AND_ENABLED); 'buttonState.next', cellularSetup.ButtonState.SHOWN_AND_ENABLED);
} else { } else {
this.set( this.set(
'buttonState.skipDiscovery', 'buttonState.skipDiscovery',
cellularSetup.ButtonState.SHOWN_AND_ENABLED); cellularSetup.ButtonState.SHOWN_AND_ENABLED);
this.set('buttonState.done', cellularSetup.ButtonState.HIDDEN); this.set('buttonState.next', cellularSetup.ButtonState.HIDDEN);
} }
}, },
...@@ -297,8 +296,13 @@ cr.define('cellular_setup', function() { ...@@ -297,8 +296,13 @@ cr.define('cellular_setup', function() {
this.activationCode_, /*confirmationCode=*/ '') this.activationCode_, /*confirmationCode=*/ '')
.then(this.handleProfileInstallResponse_.bind(this)); .then(this.handleProfileInstallResponse_.bind(this));
break; break;
case ESimUiState.MULTI_PROFILE_SELECTION: case ESimUiState.PROFILE_SELECTION:
this.state_ = ESimUiState.ACTIVATION_CODE_ENTRY; if (this.selectedProfile_) {
this.selectedProfile_.installProfile('').then(
this.handleProfileInstallResponse_.bind(this));
} else {
this.state_ = ESimUiState.ACTIVATION_CODE_ENTRY;
}
break; break;
default: default:
assertNotReached(); assertNotReached();
...@@ -313,6 +317,11 @@ cr.define('cellular_setup', function() { ...@@ -313,6 +317,11 @@ cr.define('cellular_setup', function() {
// TODO(crbug.com/1093185): Handle state when camera is used // TODO(crbug.com/1093185): Handle state when camera is used
return false; return false;
}, },
/** @private */
getShowNoProfilesMessage_() {
return !(this.pendingProfiles_ && this.pendingProfiles_.length > 0);
},
}); });
// #cr_define_end // #cr_define_end
......
...@@ -21,6 +21,12 @@ Polymer({ ...@@ -21,6 +21,12 @@ Polymer({
* @type {boolean} * @type {boolean}
*/ */
showError: Boolean, showError: Boolean,
/** @type {string} */
message: String,
/** @type {string} */
errorMessage: String,
}, },
/** /**
...@@ -42,8 +48,7 @@ Polymer({ ...@@ -42,8 +48,7 @@ Polymer({
* @private * @private
*/ */
getMessage_(showError) { getMessage_(showError) {
return showError ? this.i18n('finalPageErrorMessage') : return showError ? this.errorMessage : this.message;
this.i18n('finalPageMessage');
}, },
/** /**
......
...@@ -35,16 +35,15 @@ ...@@ -35,16 +35,15 @@
<div id="container" class="layout vertical flex" scrollable> <div id="container" class="layout vertical flex" scrollable>
<iron-list id="profileList" items="[[pendingProfiles]]" <iron-list id="profileList" items="[[pendingProfiles]]"
scroll-target="container" selection-enabled scroll-target="container" selection-enabled
preserve-focus multi-selection preserve-focus
selected-items="{{selectedProfiles}}" selected-item="{{selectedProfile}}"
role="listbox" role="listbox">
aria-multiselectable="true">
<template> <template>
<profile-discovery-list-item profile="[[item]]" <profile-discovery-list-item profile="[[item]]"
selected="[[isProfileSelected_(item, selectedProfiles.length)]]" selected="[[isProfileSelected_(item, selectedProfile)]]"
tabindex="0" tabindex="0"
role="option" role="option"
aria-selected="[[isProfileSelected_(item, selectedProfiles.length)]]"> aria-selected="[[isProfileSelected_(item, selectedProfile)]]">
</profile-discovery-list-item> </profile-discovery-list-item>
</template> </template>
</iron-list> </iron-list>
......
...@@ -22,11 +22,11 @@ Polymer({ ...@@ -22,11 +22,11 @@ Polymer({
}, },
/** /**
* @type {Array<!chromeos.cellularSetup.mojom.ESimProfileRemote>} * @type {?chromeos.cellularSetup.mojom.ESimProfileRemote}
* @private * @private
*/ */
selectedProfiles: { selectedProfile: {
type: Array, type: Object,
notify: true, notify: true,
}, },
}, },
...@@ -36,6 +36,6 @@ Polymer({ ...@@ -36,6 +36,6 @@ Polymer({
* @private * @private
*/ */
isProfileSelected_(profile) { isProfileSelected_(profile) {
return this.selectedProfiles.some(p => p === profile); return this.selectedProfile === profile;
} }
}); });
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
</provisioning-page> </provisioning-page>
<final-page id="finalPage" <final-page id="finalPage"
delegate="[[delegate]]" delegate="[[delegate]]"
show-error="[[showError_]]"> show-error="[[showError_]]"
message="[[i18n('finalPageMessage')]]"
error-message="[[i18n('finalPageErrorMessage')]]">
</final-page> </final-page>
</iron-pages> </iron-pages>
</template> </template>
......
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