@@ -8,10 +8,12 @@ import {TextFieldBase} from "@material/mwc-textfield/mwc-textfield-base";
8
8
export type CompasSettingsRecord = {
9
9
sclDataServiceUrl : string ;
10
10
cimMappingServiceUrl : string ;
11
+ keycloakAuthUrl : string ;
11
12
} ;
12
13
export const defaults : CompasSettingsRecord = {
13
14
sclDataServiceUrl : 'http://localhost:9090/compas-scl-data-service' ,
14
- cimMappingServiceUrl : 'http://localhost:9091/compas-cim-mapping'
15
+ cimMappingServiceUrl : 'http://localhost:9091/compas-cim-mapping' ,
16
+ keycloakAuthUrl : 'http://localhost:8089/auth/'
15
17
} ;
16
18
17
19
export function CompasSettings ( ) {
@@ -21,6 +23,7 @@ export function CompasSettings() {
21
23
return {
22
24
sclDataServiceUrl : this . getCompasSetting ( 'sclDataServiceUrl' ) ,
23
25
cimMappingServiceUrl : this . getCompasSetting ( 'cimMappingServiceUrl' ) ,
26
+ keycloakAuthUrl : this . getCompasSetting ( 'keycloakAuthUrl' )
24
27
} ;
25
28
} ,
26
29
@@ -52,9 +55,14 @@ export class CompasSettingsElement extends LitElement {
52
55
return < TextFieldBase > this . shadowRoot ! . querySelector ( 'mwc-textfield[id="cimMappingServiceUrl"]' ) ;
53
56
}
54
57
58
+ getKeycloakAuthUrlField ( ) : TextFieldBase {
59
+ return < TextFieldBase > this . shadowRoot ! . querySelector ( 'mwc-textfield[id="keycloakAuthUrl"]' ) ;
60
+ }
61
+
55
62
valid ( ) : boolean {
56
63
return this . getSclDataServiceUrlField ( ) . checkValidity ( )
57
- && this . getCimMappingServiceUrlField ( ) . checkValidity ( ) ;
64
+ && this . getCimMappingServiceUrlField ( ) . checkValidity ( )
65
+ && this . getKeycloakAuthUrlField ( ) . checkValidity ( ) ;
58
66
}
59
67
60
68
save ( ) : boolean {
@@ -65,6 +73,7 @@ export class CompasSettingsElement extends LitElement {
65
73
// Update settings from TextField.
66
74
CompasSettings ( ) . setCompasSetting ( 'sclDataServiceUrl' , this . getSclDataServiceUrlField ( ) . value ) ;
67
75
CompasSettings ( ) . setCompasSetting ( 'cimMappingServiceUrl' , this . getCimMappingServiceUrlField ( ) . value ) ;
76
+ CompasSettings ( ) . setCompasSetting ( 'keycloakAuthUrl' , this . getKeycloakAuthUrlField ( ) . value ) ;
68
77
return true ;
69
78
}
70
79
@@ -91,6 +100,10 @@ export class CompasSettingsElement extends LitElement {
91
100
label ="${ translate ( 'compas.settings.cimMappingServiceUrl' ) } "
92
101
value ="${ this . compasSettings . cimMappingServiceUrl } " required >
93
102
</ mwc-textfield >
103
+ < mwc-textfield dialogInitialFocus id ="keycloakAuthUrl "
104
+ label ="${ translate ( 'compas.settings.keycloakAuthUrl' ) } "
105
+ value ="${ this . compasSettings . keycloakAuthUrl } " required >
106
+ </ mwc-textfield >
94
107
95
108
< mwc-button style ="--mdc-theme-primary: var(--mdc-theme-error) "
96
109
@click =${ ( ) => {
0 commit comments