20
20
<hr />
21
21
22
22
<div class =" service-item-content-form-section" >
23
- <div class =" service-item -content-form-container" >
23
+ <div class =" codewhisperer -content-form-container" >
24
24
<BuilderIdForm
25
25
:state =" builderIdState"
26
26
@auth-connection-updated =" onAuthConnectionUpdated"
27
27
></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
+
28
48
<IdentityCenterForm
29
49
:state =" identityCenterState"
30
50
@auth-connection-updated =" onAuthConnectionUpdated"
51
+ v-show =" isIdentityCenterShown"
31
52
></IdentityCenterForm >
32
53
</div >
33
54
</div >
@@ -54,6 +75,7 @@ export default defineComponent({
54
75
builderIdCodeWhisperer: false ,
55
76
identityCenterCodeWhisperer: false ,
56
77
} as Record <AuthFormId , boolean >,
78
+ isIdentityCenterShown: false ,
57
79
}
58
80
},
59
81
computed: {
@@ -63,18 +85,30 @@ export default defineComponent({
63
85
identityCenterState(): CodeWhispererIdentityCenterState {
64
86
return authFormsState .identityCenterCodeWhisperer
65
87
},
88
+ /** The appropriate accordion symbol (collapsed/uncollapsed) */
89
+ collapsibleClass() {
90
+ return this .isIdentityCenterShown ? ' icon icon-vscode-chevron-down' : ' icon icon-vscode-chevron-right'
91
+ },
66
92
},
67
93
methods: {
68
94
updateIsAllAuthsLoaded() {
69
95
const hasUnloaded = Object .values (this .isLoaded ).filter (val => ! val ).length > 0
70
96
this .isAllAuthsLoaded = ! hasUnloaded
71
97
},
72
98
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
+
73
104
this .isLoaded [args .id ] = true
74
105
this .updateIsAllAuthsLoaded ()
75
106
76
107
this .emitAuthConnectionUpdated (' codewhisperer' , args )
77
108
},
109
+ toggleIdentityCenterShown() {
110
+ this .isIdentityCenterShown = ! this .isIdentityCenterShown
111
+ },
78
112
},
79
113
})
80
114
@@ -92,4 +126,12 @@ export class CodeWhispererContentState implements AuthStatus {
92
126
<style >
93
127
@import ' ./baseServiceItemContent.css' ;
94
128
@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
+ }
95
137
</style >
0 commit comments