File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -132,12 +132,20 @@ class App extends Component {
132
132
return null ;
133
133
}
134
134
135
- const providers = [ "Google" , "GitHub" , "GitLab" , "BitBucket" ] . filter (
136
- p => store . settings . external [ p . toLowerCase ( ) ]
137
- ) ;
135
+ const providers = [
136
+ "Google" ,
137
+ "GitHub" ,
138
+ "GitLab" ,
139
+ "BitBucket" ,
140
+ "SAML"
141
+ ] . filter ( p => store . settings . external [ p . toLowerCase ( ) ] ) ;
138
142
139
143
return providers . length ? (
140
- < Providers providers = { providers } onLogin = { this . handleExternalLogin } />
144
+ < Providers
145
+ providers = { providers }
146
+ labels = { store . settings . external_labels || { } }
147
+ onLogin = { this . handleExternalLogin }
148
+ />
141
149
) : null ;
142
150
}
143
151
Original file line number Diff line number Diff line change @@ -7,28 +7,41 @@ class Provider extends Component {
7
7
} ;
8
8
9
9
render ( ) {
10
- const { provider } = this . props ;
10
+ const { provider, label } = this . props ;
11
11
12
12
return (
13
13
< button
14
14
onClick = { this . handleLogin }
15
15
className = { `provider${ provider } btn btnProvider` }
16
16
>
17
- Continue with { provider }
17
+ Continue with { label }
18
18
</ button >
19
19
) ;
20
20
}
21
21
}
22
22
23
23
export default class Providers extends Component {
24
+ getLabel ( p ) {
25
+ const pId = p . toLowerCase ( ) ;
26
+ if ( pId in this . props . labels ) {
27
+ return this . props . labels [ pId ] ;
28
+ }
29
+ return p ;
30
+ }
31
+
24
32
render ( ) {
25
33
const { providers, onLogin } = this . props ;
26
34
27
35
return (
28
36
< div className = "providersGroup" >
29
37
< hr className = "hr" />
30
38
{ providers . map ( p => (
31
- < Provider key = { p } provider = { p } onLogin = { onLogin } />
39
+ < Provider
40
+ key = { p }
41
+ provider = { p }
42
+ label = { this . getLabel ( p ) }
43
+ onLogin = { onLogin }
44
+ />
32
45
) ) }
33
46
</ div >
34
47
) ;
You can’t perform that action at this time.
0 commit comments