Skip to content

Commit 50c9d79

Browse files
committed
cleanup
1 parent a6debbf commit 50c9d79

File tree

5 files changed

+17
-39
lines changed

5 files changed

+17
-39
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/QLoginWebview.kt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,16 @@ class QWebviewBrowser(val project: Project, private val parentDisposable: Dispos
182182
ToolkitConnectionManager.getInstance(project)
183183
.activeConnectionForFeature(QConnection.getInstance()) as? AwsBearerTokenConnection
184184
)?.let { connection ->
185-
runInEdt {
186-
SsoLogoutAction(connection).actionPerformed(
187-
AnActionEvent.createFromDataContext(
188-
"qBrowser",
189-
null,
190-
DataContext.EMPTY_CONTEXT
191-
)
185+
runInEdt {
186+
SsoLogoutAction(connection).actionPerformed(
187+
AnActionEvent.createFromDataContext(
188+
"qBrowser",
189+
null,
190+
DataContext.EMPTY_CONTEXT
192191
)
193-
}
192+
)
194193
}
194+
}
195195
}
196196

197197
is BrowserMessage.Reauth -> {
@@ -302,9 +302,8 @@ class QWebviewBrowser(val project: Project, private val parentDisposable: Dispos
302302
profiles: ${writeValueAsString(profiles ?: "")},
303303
errorMessage: '$errorMessage'
304304
}
305-
""".trimIndent()
305+
""".trimIndent()
306306

307-
println(jsonData)
308307
executeJS("window.ideClient.prepareUi($jsonData)")
309308
}
310309
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/BrowserMessage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo
2929
JsonSubTypes.Type(value = BrowserMessage.SwitchProfile::class, name = "switchProfile"),
3030
JsonSubTypes.Type(value = BrowserMessage.PublishWebviewTelemetry::class, name = "webviewTelemetry")
3131
)
32-
// Webview to IDE
3332
sealed interface BrowserMessage {
33+
3434
// FIX_WHEN_MIN_IS_233: data objects are not stable until Kotlin 1.9
3535
// https://kotlinlang.org/docs/whatsnew19.html#stable-data-objects-for-symmetry-with-data-classes
3636
object PrepareUi : BrowserMessage

plugins/core/webview/src/ideClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export class IdeClient {
4949
result = new ListProfilePendingResult()
5050
break
5151
}
52-
console.log(result)
5352
this.store.commit('setProfilesResult', result)
5453
}
5554

@@ -88,6 +87,6 @@ export class IdeClient {
8887
cancelLogin(): void {
8988
// this.reset()
9089
this.store.commit('setStage', 'START')
91-
window.ideApi.postMessage({command: 'cancelLogin'})
90+
window.ideApi.postMessage({ command: 'cancelLogin' })
9291
}
9392
}

plugins/core/webview/src/model.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,17 @@ export interface ListProfileResult {
7171

7272
export class ListProfileSuccessResult implements ListProfileResult {
7373
status: 'succeeded' = 'succeeded'
74-
75-
constructor(readonly profiles: Profile[]) {
76-
}
74+
constructor(readonly profiles: Profile[]) {}
7775
}
7876

7977
export class ListProfileFailureResult implements ListProfileResult {
8078
status: 'failed' = 'failed'
81-
82-
constructor(readonly errorMessage: string) {
83-
}
79+
constructor(readonly errorMessage: string) {}
8480
}
8581

8682
export class ListProfilePendingResult implements ListProfileResult {
8783
status: 'pending' = 'pending'
88-
89-
constructor() {
90-
}
84+
constructor() {}
9185
}
9286

9387
export enum LoginIdentifier {
@@ -146,8 +140,7 @@ export class BuilderId implements LoginOption {
146140
export class ExistConnection implements LoginOption {
147141
id: LoginIdentifier = LoginIdentifier.EXISTING_LOGINS
148142

149-
constructor(readonly pluginConnectionId: string) {
150-
}
143+
constructor(readonly pluginConnectionId: string) {}
151144

152145
// this case only happens for bearer connection for now
153146
requiresBrowser(): boolean {

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div @keydown.enter="handleContinueClick">
55
<div class="font-amazon">
66
<template v-if="isWaitingResponse">
7-
<div class="header bottomMargin">Fetching Q Developer profiles...this may take a minute.</div>
7+
<div class="title bottom-small-gap">Fetching Q Developer profiles...this may take a minute.</div>
88
</template>
99

1010
<template v-else>
@@ -94,25 +94,12 @@ export default defineComponent({
9494
if (profileResult instanceof ListProfileSuccessResult) {
9595
this.availableProfiles = profileResult.profiles
9696
} else {
97-
this.errorMessage = (profileResult as ListProfileFailureResult).errorMessage
97+
this.errorMessage = GENERIC_PROFILE_LOAD_ERROR
9898
}
9999
100100
return false
101101
}
102102
},
103-
mounted() {
104-
// console.debug("Vuex raw profiles:", this.$store.state.profiles);
105-
// this.availableProfiles = this.$store.state.profiles;
106-
// this.errorMessage = this.$store.state.errorMessage ? GENERIC_PROFILE_LOAD_ERROR : undefined;
107-
// this.isRefreshing = false;
108-
// watch(() => this.$store.state.profiles, (newVal, oldVal) => {
109-
// this.availableProfiles = newVal
110-
// this.isRefreshing = false
111-
// });
112-
// watch(() => this.$store.state.errorMessage, (newVal) => {
113-
// this.errorMessage = newVal ? GENERIC_PROFILE_LOAD_ERROR : undefined;
114-
// })
115-
},
116103
methods: {
117104
toggleItemSelection(profile: Profile) {
118105
this.selectedProfile = profile;

0 commit comments

Comments
 (0)