@@ -11,6 +11,7 @@ import {getOpenScdElement} from "./foundation.js";
11
11
export type CompasSettingsRecord = {
12
12
sclDataServiceUrl : string ;
13
13
cimMappingServiceUrl : string ;
14
+ sclAutoAlignmentServiceUrl : string ;
14
15
} ;
15
16
16
17
export function CompasSettings ( ) {
@@ -20,13 +21,15 @@ export function CompasSettings() {
20
21
return {
21
22
sclDataServiceUrl : this . getCompasSetting ( 'sclDataServiceUrl' ) ,
22
23
cimMappingServiceUrl : this . getCompasSetting ( 'cimMappingServiceUrl' ) ,
24
+ sclAutoAlignmentServiceUrl : this . getCompasSetting ( 'sclAutoAlignmentServiceUrl' ) ,
23
25
} ;
24
26
} ,
25
27
26
28
get defaultSettings ( ) : CompasSettingsRecord {
27
29
return {
28
30
sclDataServiceUrl : '/compas-scl-data-service' ,
29
- cimMappingServiceUrl : '/compas-cim-mapping'
31
+ cimMappingServiceUrl : '/compas-cim-mapping' ,
32
+ sclAutoAlignmentServiceUrl : '/compas-scl-auto-alignment'
30
33
}
31
34
} ,
32
35
@@ -58,9 +61,14 @@ export class CompasSettingsElement extends LitElement {
58
61
return < TextFieldBase > this . shadowRoot ! . querySelector ( 'mwc-textfield[id="cimMappingServiceUrl"]' ) ;
59
62
}
60
63
64
+ getSclAutoAlignmentServiceUrlField ( ) : TextFieldBase {
65
+ return < TextFieldBase > this . shadowRoot ! . querySelector ( 'mwc-textfield[id="sclAutoAlignmentServiceUrl"]' ) ;
66
+ }
67
+
61
68
valid ( ) : boolean {
62
69
return this . getSclDataServiceUrlField ( ) . checkValidity ( )
63
- && this . getCimMappingServiceUrlField ( ) . checkValidity ( ) ;
70
+ && this . getCimMappingServiceUrlField ( ) . checkValidity ( )
71
+ && this . getSclAutoAlignmentServiceUrlField ( ) . checkValidity ( ) ;
64
72
}
65
73
66
74
save ( ) : boolean {
@@ -71,6 +79,7 @@ export class CompasSettingsElement extends LitElement {
71
79
// Update settings from TextField.
72
80
CompasSettings ( ) . setCompasSetting ( 'sclDataServiceUrl' , this . getSclDataServiceUrlField ( ) . value ) ;
73
81
CompasSettings ( ) . setCompasSetting ( 'cimMappingServiceUrl' , this . getCimMappingServiceUrlField ( ) . value ) ;
82
+ CompasSettings ( ) . setCompasSetting ( 'sclAutoAlignmentServiceUrl' , this . getSclAutoAlignmentServiceUrlField ( ) . value ) ;
74
83
return true ;
75
84
}
76
85
@@ -93,13 +102,16 @@ export class CompasSettingsElement extends LitElement {
93
102
label = "${ translate ( 'compas.settings.sclDataServiceUrl' ) } "
94
103
value = "${ this . compasSettings . sclDataServiceUrl } " required >
95
104
</ mwc- textfield>
96
- <mwc- textfield dialogInitialFocus id= "cimMappingServiceUrl"
105
+ <mwc- textfield id= "cimMappingServiceUrl"
97
106
label = "${ translate ( 'compas.settings.cimMappingServiceUrl' ) } "
98
107
value = "${ this . compasSettings . cimMappingServiceUrl } " required >
99
108
</ mwc- textfield>
109
+ <mwc- textfield id= "sclAutoAlignmentServiceUrl"
110
+ label = "${ translate ( 'compas.settings.sclAutoAlignmentServiceUrl' ) } "
111
+ value = "${ this . compasSettings . sclAutoAlignmentServiceUrl } " required >
112
+ </ mwc- textfield>
100
113
101
- <mwc- butto n style= "--mdc-theme-primary: var(--mdc-theme-error)"
102
- @click = ${ ( ) => {
114
+ <mwc- butto n @click = ${ ( ) => {
103
115
if ( this . reset ( ) ) {
104
116
this . close ( ) ;
105
117
}
@@ -117,6 +129,10 @@ export class CompasSettingsElement extends LitElement {
117
129
margin : 10px ;
118
130
width : 100% ;
119
131
}
132
+
133
+ mwc-button {
134
+ --mdc-theme-primary : var (--mdc-theme-error )
135
+ }
120
136
`
121
137
}
122
138
0 commit comments