Skip to content

Commit 2ca4439

Browse files
authored
Fix back button will appear twice on certain conditions (aws#4363)
also, enable back button consistently
1 parent 12eda83 commit 2ca4439

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

plugins/core/webview/src/q-ui/components/awsProfileForm.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
<!-- SPDX-License-Identifier: Apache-2.0 -->
33

44
<template>
5-
<button class="back-button" @click="handleBackButtonClick">
6-
<svg width="13" height="11" viewBox="0 0 13 11" fill="none" xmlns="http://www.w3.org/2000/svg">
7-
<path
8-
d="M4.98667 0.0933332L5.73333 0.786666L1.57333 4.94667H12.0267V5.96H1.57333L5.73333 10.0667L4.98667 10.8133L0.0266666 5.8V5.10667L4.98667 0.0933332Z"
9-
fill="#21A2FF"
10-
/>
11-
</svg>
12-
</button>
135
<div class="title no-bold font-amazon">Profile Name</div>
146
<div class="hint font-amazon">The identifier for these credentials</div>
157
<input class="iamInput font-amazon" type="text" id="profileName" name="profileName" v-model="profileName"/>
@@ -49,9 +41,6 @@ export default defineComponent({
4941
async handleContinueClick() {
5042
this.$emit('login', new LongLivedIAM(this.profileName, this.accessKey, this.secretKey))
5143
},
52-
handleBackButtonClick() {
53-
this.$emit('backToMenu')
54-
},
5544
}
5645
})
5746
</script>

plugins/core/webview/src/q-ui/components/login.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:is-connected="stage === 'CONNECTED'"
1010
/>
1111

12-
<button v-if="cancellable" class="back-button" @click="handleBackButtonClick" tabindex="-1">
12+
<button v-if="stage !== 'START' || cancellable" class="back-button" @click="handleBackButtonClick" tabindex="-1">
1313
<svg width="24" height="24" viewBox="0 -3 13 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1414
<path
1515
d="M4.98667 0.0933332L5.73333 0.786666L1.57333 4.94667H12.0267V5.96H1.57333L5.73333 10.0667L4.98667 10.8133L0.0266666 5.8V5.10667L4.98667 0.0933332Z"
@@ -116,7 +116,7 @@ export default defineComponent({
116116
this.$store.commit('setStage', stage)
117117
},
118118
handleBackButtonClick() {
119-
if (this.cancellable && this.stage === 'START') {
119+
if (this.cancellable) {
120120
window.ideApi.postMessage({ command: 'toggleBrowser' })
121121
}
122122
this.mutateStage('START')

plugins/core/webview/src/q-ui/components/loginOptions.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export default defineComponent({
3434
toggleItemSelection(itemId: number) {
3535
this.selectedLoginOption = itemId
3636
},
37-
handleBackButtonClick() {
38-
this.$emit('backToMenu')
39-
},
4037
stageChanged(stage: Stage) {
4138
this.$emit('stageChanged', stage)
4239
},

plugins/core/webview/src/q-ui/components/ssoLoginForm.vue

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
<!-- SPDX-License-Identifier: Apache-2.0 -->
33

44
<template>
5-
<button class="back-button" @click="handleBackButtonClick" tabindex="-1">
6-
<svg width="24" height="24" viewBox="0 -3 13 16" fill="none" xmlns="http://www.w3.org/2000/svg">
7-
<path
8-
d="M4.98667 0.0933332L5.73333 0.786666L1.57333 4.94667H12.0267V5.96H1.57333L5.73333 10.0667L4.98667 10.8133L0.0266666 5.8V5.10667L4.98667 0.0933332Z"
9-
fill="#21A2FF"
10-
/>
11-
</svg>
12-
</button>
135
<div class="font-amazon" @keydown.enter="handleContinueClick">
146
<div class="bottom-small-gap">
157
<div class="title">Sign in with SSO:</div>
@@ -112,9 +104,6 @@ export default defineComponent({
112104
handleUrlInput() {
113105
this.isInputValid = this.startUrl != "" && this.selectedRegion != "";
114106
},
115-
handleBackButtonClick() {
116-
this.$emit('backToMenu')
117-
},
118107
async handleContinueClick() {
119108
if (!this.isInputValid) {
120109
return

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/webview/ToolkitLoginWebview.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,12 @@ class ToolkitWebviewBrowser(val project: Project) : LoginBrowser(project, Toolki
196196
val regionJson = objectMapper.writeValueAsString(regions)
197197

198198
// TODO: if codecatalyst connection expires, set stage to 'REAUTH'
199-
val stage = "START"
199+
// TODO: make these strings type safe
200+
val stage = if (state.feature == FeatureId.Codecatalyst) {
201+
"SSO_FORM"
202+
} else {
203+
"START"
204+
}
200205

201206
val jsonData = """
202207
{

0 commit comments

Comments
 (0)