Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CrOS Settings] Add confirmation code dialog from network settings page.
Add dialog prompting the user for a confirmation code if required when attempting to install an eSIM profile from the network settings page. Screenshot: https://screenshot.googleplex.com/4AkPWFzZhEYYGYJ.png Bug: 1093185 Change-Id: If75f4751797d8b31eed6af5a5b0449e43f91a0bf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713887 Reviewed-by: Regan Hsu <hsuregan@chromium.org> Reviewed-by: Azeem Arshad <azeemarshad@chromium.org> Commit-Queue: Gordon Seto <gordonseto@google.com> Cr-Commit-Position: refs/heads/master@{#857760}
- Loading branch information
Gordon Seto
authored and
Chromium LUCI CQ
committed
Feb 25, 2021
1 parent
325f03f
commit a7ba703
Showing
16 changed files
with
346 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ettings_strings_grdp/IDS_CELLULAR_SETUP_ESIM_PAGE_CONFIRMATION_CODE_DIALOG_ERROR.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
08db40e7f3e6345e3c590672152e1e086228a680 |
1 change: 1 addition & 0 deletions
1
...ings_strings_grdp/IDS_SETTINGS_INTERNET_NETWORK_CONFIRMATION_CODE_DIALOG_MESSAGE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
790bed005fbbd794ae50b9341c97da187cda6b74 |
1 change: 1 addition & 0 deletions
1
...ttings_strings_grdp/IDS_SETTINGS_INTERNET_NETWORK_CONFIRMATION_CODE_DIALOG_TITLE.png.sha1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
790bed005fbbd794ae50b9341c97da187cda6b74 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
chrome/browser/resources/settings/chromeos/internet_page/esim_confirmation_code_dialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<link rel="import" href="chrome://resources/html/polymer.html"> | ||
|
||
<link rel="import" href="chrome://resources/cr_components/chromeos/cellular_setup/esim_manager_utils.html"> | ||
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> | ||
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> | ||
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> | ||
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> | ||
|
||
<dom-module id="esim-confirmation-code-dialog"> | ||
<template> | ||
<style include="iron-flex iron-positioning"> | ||
:host { | ||
--cr-dialog-width: 480px; | ||
} | ||
|
||
paper-spinner-lite { | ||
height: 20px; | ||
position: absolute; | ||
right: 16px; | ||
top: 6px; | ||
width: 20px; | ||
} | ||
|
||
#message { | ||
margin-bottom: 40px; | ||
} | ||
|
||
#cancel { | ||
margin-inline-end: 8px; | ||
} | ||
</style> | ||
<cr-dialog id="confirmationCodeDialog" show-on-attach> | ||
<div slot="title">$i18n{eSimConfirmationCodeDialogTitle}</div> | ||
<div slot="body"> | ||
<div id="message"> | ||
$i18n{eSimConfirmationCodeDialogMessage} | ||
</div> | ||
<div class="relative"> | ||
<cr-input id="confirmationCode" | ||
value="{{confirmationCode_}}" | ||
spellcheck="false" | ||
disabled="[[isInstallInProgress_]]" | ||
error-message="$i18n{eSimConfirmationCodeDialogError}" | ||
invalid="[[showError_]]"> | ||
</cr-input> | ||
<paper-spinner-lite active | ||
hidden$="[[!isInstallInProgress_]]"> | ||
</paper-spinner-lite> | ||
</div> | ||
</div> | ||
<div slot="button-container"> | ||
<cr-button id="cancel" | ||
on-click="onCancelClicked_" | ||
class="cancel-button"> | ||
$i18n{eSimRenameProfileDialogCancel} | ||
</cr-button> | ||
<cr-button id="done" | ||
on-click="onDoneClicked_" | ||
disabled="[[isDoneButtonDisabled_(confirmationCode_, isInstallInProgress_)]]" | ||
class="action-button"> | ||
$i18n{eSimRenameProfileDialogDone} | ||
</cr-button> | ||
</div> | ||
</cr-dialog> | ||
</template> | ||
<script src="esim_confirmation_code_dialog.js"></script> | ||
</dom-module> |
80 changes: 80 additions & 0 deletions
80
chrome/browser/resources/settings/chromeos/internet_page/esim_confirmation_code_dialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright 2021 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/** | ||
* @fileoverview Polymer element to enter a confirmation code if required when | ||
* installing an eSIM profile. | ||
*/ | ||
|
||
Polymer({ | ||
is: 'esim-confirmation-code-dialog', | ||
|
||
behaviors: [ | ||
I18nBehavior, | ||
], | ||
|
||
properties: { | ||
/** @type {?chromeos.cellularSetup.mojom.ESimProfileRemote} */ | ||
profile: { | ||
type: Object, | ||
value: null, | ||
}, | ||
|
||
/** @private {string} */ | ||
confirmationCode_: { | ||
type: String, | ||
value: '', | ||
observer: 'onConfirmationCodeChanged_', | ||
}, | ||
|
||
/** @private {boolean} */ | ||
isInstallInProgress_: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
|
||
/** @private {boolean} */ | ||
showError_: { | ||
type: Boolean, | ||
value: false, | ||
}, | ||
}, | ||
|
||
/** @private */ | ||
onConfirmationCodeChanged_() { | ||
this.showError_ = false; | ||
}, | ||
|
||
/** | ||
* @param {Event} event | ||
* @private | ||
*/ | ||
onDoneClicked_(event) { | ||
this.isInstallInProgress_ = true; | ||
this.showError_ = false; | ||
|
||
this.profile.installProfile(this.confirmationCode_).then((response) => { | ||
this.isInstallInProgress_ = false; | ||
if (response.result === | ||
chromeos.cellularSetup.mojom.ESimOperationResult.kSuccess) { | ||
this.$.confirmationCodeDialog.close(); | ||
return; | ||
} | ||
this.showError_ = true; | ||
}); | ||
}, | ||
|
||
/** | ||
* @param {Event} event | ||
* @private | ||
*/ | ||
onCancelClicked_(event) { | ||
this.$.confirmationCodeDialog.close(); | ||
}, | ||
|
||
/** @private */ | ||
isDoneButtonDisabled_() { | ||
return !this.confirmationCode_ || this.isInstallInProgress_; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.