Skip to content

Commit ac50961

Browse files
authWebview: toggle for CW Identity Center form (#3591)
cwProfessional: Have CW identity center form hidden We want to guide users to use BuilderID unless they know they have Identity Center setup. This commit adds a toggleable menu that will show the Identity Center form if the user clicks on it Signed-off-by: Nikolas Komonen <[email protected]>
1 parent d28f983 commit ac50961

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

src/auth/ui/vue/authForms/manageIdentityCenter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class CodeWhispererIdentityCenterState extends BaseIdentityCenterState {
237237
@import '../shared.css';
238238
239239
#identity-center-form {
240-
width: 250px;
240+
width: 280px;
241241
height: fit-content;
242242
}
243243
</style>

src/auth/ui/vue/serviceItemContent/baseServiceItemContent.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
.service-item-content-form-section {
2929
display: flex;
3030
flex-direction: column;
31+
align-items: center;
3132
gap: 20px;
3233
}
3334

src/auth/ui/vue/serviceItemContent/codeWhispererContent.vue

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,35 @@
2020
<hr />
2121

2222
<div class="service-item-content-form-section">
23-
<div class="service-item-content-form-container">
23+
<div class="codewhisperer-content-form-container">
2424
<BuilderIdForm
2525
:state="builderIdState"
2626
@auth-connection-updated="onAuthConnectionUpdated"
2727
></BuilderIdForm>
28+
29+
<div>
30+
<div
31+
v-on:click="toggleIdentityCenterShown"
32+
style="cursor: pointer; display: flex; flex-direction: row"
33+
>
34+
<div style="font-weight: bold; font-size: medium" :class="collapsibleClass"></div>
35+
<div>
36+
<div style="font-weight: bold; font-size: 14px">
37+
Have a
38+
<a href="https://aws.amazon.com/codewhisperer/pricing/">Professional Tier</a>
39+
subscription? Sign in with IAM Identity Center.
40+
</div>
41+
<div>
42+
Professional Tier offers administrative capabilities for organizations of developers.
43+
</div>
44+
</div>
45+
</div>
46+
</div>
47+
2848
<IdentityCenterForm
2949
:state="identityCenterState"
3050
@auth-connection-updated="onAuthConnectionUpdated"
51+
v-show="isIdentityCenterShown"
3152
></IdentityCenterForm>
3253
</div>
3354
</div>
@@ -54,6 +75,7 @@ export default defineComponent({
5475
builderIdCodeWhisperer: false,
5576
identityCenterCodeWhisperer: false,
5677
} as Record<AuthFormId, boolean>,
78+
isIdentityCenterShown: false,
5779
}
5880
},
5981
computed: {
@@ -63,18 +85,30 @@ export default defineComponent({
6385
identityCenterState(): CodeWhispererIdentityCenterState {
6486
return authFormsState.identityCenterCodeWhisperer
6587
},
88+
/** The appropriate accordion symbol (collapsed/uncollapsed) */
89+
collapsibleClass() {
90+
return this.isIdentityCenterShown ? 'icon icon-vscode-chevron-down' : 'icon icon-vscode-chevron-right'
91+
},
6692
},
6793
methods: {
6894
updateIsAllAuthsLoaded() {
6995
const hasUnloaded = Object.values(this.isLoaded).filter(val => !val).length > 0
7096
this.isAllAuthsLoaded = !hasUnloaded
7197
},
7298
async onAuthConnectionUpdated(args: ConnectionUpdateArgs) {
99+
if (args.id === 'identityCenterCodeWhisperer') {
100+
// Want to show the identity center form if already connected
101+
this.isIdentityCenterShown = await this.identityCenterState.isAuthConnected()
102+
}
103+
73104
this.isLoaded[args.id] = true
74105
this.updateIsAllAuthsLoaded()
75106
76107
this.emitAuthConnectionUpdated('codewhisperer', args)
77108
},
109+
toggleIdentityCenterShown() {
110+
this.isIdentityCenterShown = !this.isIdentityCenterShown
111+
},
78112
},
79113
})
80114
@@ -92,4 +126,12 @@ export class CodeWhispererContentState implements AuthStatus {
92126
<style>
93127
@import './baseServiceItemContent.css';
94128
@import '../shared.css';
129+
130+
.codewhisperer-content-form-container {
131+
display: flex;
132+
flex-direction: column;
133+
gap: 20px;
134+
justify-content: center;
135+
align-items: center;
136+
}
95137
</style>

0 commit comments

Comments
 (0)