Commit 7a1faa55 authored by Nnamdi Theodore Johnson-Kanu's avatar Nnamdi Theodore Johnson-Kanu Committed by Chromium LUCI CQ

[CrOS cellular] Add remove esim profile dialog to internet page

Screenshot: https://screenshot.googleplex.com/4KPcDWcvuJZUKvP.png

Bug: 1093185
Change-Id: Ieea3e4b58a8da6f98e94af7d2dec2f2b53816b72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2569784
Commit-Queue: Nnamdi Theodore Johnson-kanu <tjohnsonkanu@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833615}
parent 771ce89f
......@@ -170,6 +170,13 @@
iccid="[[esimProfileIccid_]]">
</esim-rename-dialog>
</template>
<template is="dom-if" if="[[showESimRemoveProfileDialog_]]" restamp>
<esim-remove-profile-dialog id="esimRemoveProfileDialog"
on-close="onCloseESimRemoveProfileDialog_"
iccid="[[esimProfileIccid_]]">
</esim-remove-profile-dialog>
</template>
</template>
<script src="internet_page.js"></script>
</dom-module>
......@@ -137,6 +137,12 @@ Polymer({
value: false,
},
/** @private {boolean} */
showESimRemoveProfileDialog_: {
type: Boolean,
value: false,
},
/**
* Iccid of an esim profile, used in internet detail menu.
* @private {string}
......@@ -183,6 +189,7 @@ Polymer({
'show-known-networks': 'onShowKnownNetworks_',
'show-networks': 'onShowNetworks_',
'show-esim-profile-rename-dialog': 'onShowESimProfileRenameDialog_',
'show-esim-remove-profile-dialog': 'onShowESimRemoveProfileDialog_'
},
/** @private {?settings.InternetPageBrowserProxy} */
......@@ -411,6 +418,20 @@ Polymer({
this.showESimProfileRenameDialog_ = false;
},
/**
* @param {!CustomEvent<!{iccid: string}>} event
* @private
*/
onShowESimRemoveProfileDialog_(event) {
this.esimProfileIccid_ = event.detail.iccid;
this.showESimRemoveProfileDialog_ = true;
},
/** @private */
onCloseESimRemoveProfileDialog_() {
this.showESimRemoveProfileDialog_ = false;
},
/**
* @param {!CustomEvent<chromeos.networkConfig.mojom.NetworkType>} event
* @private
......
......@@ -9,6 +9,7 @@ import './bluetooth_page/bluetooth_page.m.js';
import './bluetooth_page/bluetooth_subpage.m.js';
import './bluetooth_page/bluetooth_device_list_item.m.js';
import './internet_page/cellular_setup_dialog.m.js';
import './internet_page/esim_remove_profile_dialog.m.js';
import './internet_page/internet_config.m.js';
import './internet_page/internet_detail_page.m.js';
import './internet_page/internet_known_networks_page.m.js';
......@@ -34,7 +35,6 @@ import './os_about_page/channel_switcher_dialog.m.js';
import './os_about_page/detailed_build_info.m.js';
import './os_about_page/update_warning_dialog.m.js';
import './os_search_page/os_search_page.m.js';
import './internet_page/esim_remove_profile_dialog.m.js';
export {AboutPageBrowserProxyImpl, BrowserChannel, UpdateStatus} from '../about_page/about_page_browser_proxy.m.js';
export {LifetimeBrowserProxy, LifetimeBrowserProxyImpl} from '../lifetime_browser_proxy.m.js';
......
......@@ -278,7 +278,7 @@ suite('InternetPage', function() {
'Toggle mobile on/off should be focused for settingId=13.');
});
test('Show rename profile dialog', async function() {
test('Show rename esim profile dialog', async function() {
eSimManagerRemote.addEuiccForTest(1);
await flushAsync();
......@@ -293,6 +293,22 @@ suite('InternetPage', function() {
renameDialog = internetPage.$$('#esimRenameDialog');
assertTrue(!!renameDialog);
});
test('Show remove esim profile dialog', async function() {
eSimManagerRemote.addEuiccForTest(1);
await flushAsync();
let removeDialog = internetPage.$$('#esimRemoveProfileDialog');
assertFalse(!!removeDialog);
const event = new CustomEvent(
'show-esim-remove-profile-dialog', {detail: {iccid: '1'}});
internetPage.dispatchEvent(event);
await flushAsync();
removeDialog = internetPage.$$('#esimRemoveProfileDialog');
assertTrue(!!removeDialog);
});
});
// TODO(stevenjb): Figure out a way to reliably test navigation. Currently
......
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