Commit fa0729eb authored by Gordon Seto's avatar Gordon Seto Committed by Commit Bot

[CrOS Settings] Add 'Skip & Setup new profile' button to button bar

Add UI for button to skip the profile discovery page and go to the
activation code page.

Bug: 1093185
Change-Id: I558f2df186829ddb9147dff19a0e34289fa20a34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2528142
Commit-Queue: Gordon Seto <gordonseto@google.com>
Reviewed-by: default avatarAzeem Arshad <azeemarshad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825968}
parent 8e919b58
......@@ -264,6 +264,9 @@
<message name="IDS_CELLULAR_SETUP_NEXT_LABEL" desc="Label for button that advances to next step during cellular setup">
Next
</message>
<message name="IDS_CELLULAR_SETUP_SKIP_DISCOVERY_LABEL" desc="Label for button that skips the multiple profile selection step and sets up a new profile during eSIM cellular setup">
Skip &amp; Set up new profile
</message>
<message name="IDS_CELLULAR_SETUP_ESIM_PAGE_ACTIVATION_CODE" desc="Label for activation code input box">
Activation code
</message>
......
c3e2157a5e4c36dbb471ffacb5843357522d38f5
\ No newline at end of file
......@@ -29,6 +29,7 @@ constexpr webui::LocalizedString kLocalizedStringsWithoutPlaceholders[] = {
IDS_CELLULAR_SETUP_ESTABLISH_NETWORK_CONNECTION},
{"next", IDS_CELLULAR_SETUP_NEXT_LABEL},
{"tryAgain", IDS_CELLULAR_SETUP_TRY_AGAIN_LABEL},
{"skipDiscovery", IDS_CELLULAR_SETUP_SKIP_DISCOVERY_LABEL},
{"simDetectPageTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_TITLE},
{"simDetectPageErrorTitle", IDS_CELLULAR_SETUP_SIM_DETECT_PAGE_ERROR_TITLE},
{"simDetectPageErrorMessage",
......
......@@ -34,6 +34,7 @@ suite('CellularSetupButtonBarTest', function() {
next: state,
tryAgain: state,
done: state,
skipDiscovery: state,
};
Polymer.dom.flush();
}
......@@ -69,6 +70,7 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#tryAgain')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#next')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#done')));
assertTrue(isButtonShownAndEnabled(buttonBar.$$('#skipDiscovery')));
});
test('individual buttons appear but are diabled', function() {
......@@ -78,6 +80,7 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#tryAgain')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#next')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#done')));
assertTrue(isButtonShownAndDisabled(buttonBar.$$('#skipDiscovery')));
});
test('individual buttons are hidden', function() {
......@@ -87,5 +90,6 @@ suite('CellularSetupButtonBarTest', function() {
assertTrue(isButtonHidden(buttonBar.$$('#tryAgain')));
assertTrue(isButtonHidden(buttonBar.$$('#next')));
assertTrue(isButtonHidden(buttonBar.$$('#done')));
assertTrue(isButtonHidden(buttonBar.$$('#skipDiscovery')));
});
});
......@@ -30,6 +30,13 @@
[[i18n('back')]]
</cr-button>
<div id="flex"></div>
<cr-button id="cancel"
class="cancel-button"
on-click="onCancelButtonClicked_"
disabled="[[isButtonDisabled_(Button.CANCEL, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.CANCEL, buttonState.*)]]">
[[i18n('cancel')]]
</cr-button>
<cr-button id="tryAgain"
class="action-button"
on-click="onTryAgainButtonClicked_"
......@@ -44,12 +51,12 @@
hidden$="[[isButtonHidden_(Button.DONE, buttonState.*)]]">
[[i18n('done')]]
</cr-button>
<cr-button id="cancel"
class="cancel-button"
on-click="onCancelButtonClicked_"
disabled="[[isButtonDisabled_(Button.CANCEL, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.CANCEL, buttonState.*)]]">
[[i18n('cancel')]]
<cr-button id="skipDiscovery"
class="action-button"
on-click="onNextButtonClicked_"
disabled="[[isButtonDisabled_(Button.SKIP_DISCOVERY, buttonState.*)]]"
hidden$="[[isButtonHidden_(Button.SKIP_DISCOVERY, buttonState.*)]]">
[[i18n('skipDiscovery')]]
</cr-button>
<cr-button id="next"
class="action-button"
......
......@@ -89,6 +89,8 @@ Polymer({
return this.buttonState.next;
case cellularSetup.Button.TRY_AGAIN:
return this.buttonState.tryAgain;
case cellularSetup.Button.SKIP_DISCOVERY:
return this.buttonState.skipDiscovery;
default:
assertNotReached();
return cellularSetup.ButtonState.SHOWN_AND_ENABLED;
......
......@@ -27,6 +27,7 @@ cr.define('cellularSetup', function() {
DONE: 3,
NEXT: 4,
TRY_AGAIN: 5,
SKIP_DISCOVERY: 6,
};
/**
......@@ -36,6 +37,7 @@ cr.define('cellularSetup', function() {
* done: (!cellularSetup.ButtonState|undefined),
* next: (!cellularSetup.ButtonState|undefined),
* tryAgain: (!cellularSetup.ButtonState|undefined),
* skipDiscovery: (!cellularSetup.ButtonState|undefined),
* }}
*/
/* #export */ let ButtonBarState;
......
......@@ -54,7 +54,8 @@ cr.define('cellular_setup', function() {
cellularSetup.ButtonState.HIDDEN,
done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN
tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
};
},
......
......@@ -212,6 +212,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_BUT_DISABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
};
break;
case PSimUIState.ACTIVATION_SUCCESS:
......@@ -223,6 +224,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.HIDDEN,
next: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
};
break;
case PSimUIState.WAITING_FOR_ACTIVATION_TO_FINISH:
......@@ -233,6 +235,7 @@ cr.define('cellularSetup', function() {
done: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
next: cellularSetup.ButtonState.HIDDEN,
tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
};
break;
default:
......
......@@ -47,7 +47,8 @@ Polymer({
backward: cellularSetup.ButtonState.HIDDEN,
cancel: cellularSetup.ButtonState.SHOWN_AND_ENABLED,
done: cellularSetup.ButtonState.HIDDEN,
tryAgain: cellularSetup.ButtonState.HIDDEN
tryAgain: cellularSetup.ButtonState.HIDDEN,
skipDiscovery: cellularSetup.ButtonState.HIDDEN,
};
if (selectedPage === cellularSetup.CellularSetupPageName.PSIM_FLOW_UI ||
selectedPage === cellularSetup.CellularSetupPageName.ESIM_FLOW_UI) {
......
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