Skip to content

Commit 11df56e

Browse files
Merge pull request #238 from com-pas/Fetch_BTComponents
feat: Import IEDs from Sitipe Backend service
2 parents 39868b0 + 03279a6 commit 11df56e

File tree

10 files changed

+920
-220
lines changed

10 files changed

+920
-220
lines changed

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
<base href="/">
1515

1616
<!-- Original URL from Google: https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&family=Roboto:wght@300;400;500&display=swap -->
17-
<link href="public/google/fonts/roboto-v27.css" rel="stylesheet">
18-
<link href="public/google/fonts/roboto-mono-v13.css" rel="stylesheet">
17+
<link href="/public/google/fonts/roboto-v27.css" rel="stylesheet">
18+
<link href="/public/google/fonts/roboto-mono-v13.css" rel="stylesheet">
1919
<!-- Original URL from Google: https://fonts.googleapis.com/css?family=Material+Icons+Outlined&display=block -->
20-
<link href="public/google/icons/material-icons-outlined.css" rel="stylesheet">
21-
<link href="public/css/normalize.css" rel="stylesheet">
20+
<link href="/public/google/icons/material-icons-outlined.css" rel="stylesheet">
21+
<link href="/public/css/normalize.css" rel="stylesheet">
2222
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
2323
<link rel="icon" type="image/png" sizes="16x16" href="public/favicon-16x16.png">
2424
<link rel="icon" type="image/png" sizes="32x32" href="public/favicon-32x32.png">

public/js/plugins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export const officialPlugins = [
323323
{
324324
name: 'Sitipe',
325325
src: '/src/editors/Sitipe.js',
326-
icon: 'conveyor_belt',
326+
icon: 'precision_manufacturing',
327327
default: true,
328328
kind: 'editor',
329329
},

src/compas/CompasSettings.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type CompasSettingsRecord = {
2020
sclValidatorServiceUrl: string;
2121
cimMappingServiceUrl: string;
2222
sclAutoAlignmentServiceUrl: string;
23+
sitipeServiceUrl: string;
2324
useWebsockets: 'on' | 'off';
2425
};
2526

@@ -34,6 +35,7 @@ export function CompasSettings() {
3435
sclAutoAlignmentServiceUrl: this.getCompasSetting(
3536
'sclAutoAlignmentServiceUrl'
3637
),
38+
sitipeServiceUrl: this.getCompasSetting('sitipeServiceUrl'),
3739
useWebsockets: this.getCompasSetting('useWebsockets'),
3840
};
3941
},
@@ -44,6 +46,7 @@ export function CompasSettings() {
4446
sclValidatorServiceUrl: '/compas-scl-validator',
4547
cimMappingServiceUrl: '/compas-cim-mapping',
4648
sclAutoAlignmentServiceUrl: '/compas-scl-auto-alignment',
49+
sitipeServiceUrl: '/compas-sitipe-service',
4750
useWebsockets: 'on',
4851
};
4952
},
@@ -106,6 +109,12 @@ export class CompasSettingsElement extends LitElement {
106109
);
107110
}
108111

112+
getSitipeServiceUrlField(): TextFieldBase {
113+
return <TextFieldBase>(
114+
this.shadowRoot!.querySelector('mwc-textfield[id="sitipeServiceUrl"]')
115+
);
116+
}
117+
109118
getUseWebsockets(): Switch {
110119
return <Switch>(
111120
this.shadowRoot!.querySelector('mwc-switch[id="useWebsockets"]')
@@ -117,7 +126,8 @@ export class CompasSettingsElement extends LitElement {
117126
this.getSclDataServiceUrlField().checkValidity() &&
118127
this.getSclValidatorServiceUrlField().checkValidity() &&
119128
this.getCimMappingServiceUrlField().checkValidity() &&
120-
this.getSclAutoAlignmentServiceUrlField().checkValidity()
129+
this.getSclAutoAlignmentServiceUrlField().checkValidity() &&
130+
this.getSitipeServiceUrlField().checkValidity()
121131
);
122132
}
123133

@@ -143,6 +153,10 @@ export class CompasSettingsElement extends LitElement {
143153
'sclAutoAlignmentServiceUrl',
144154
this.getSclAutoAlignmentServiceUrlField().value
145155
);
156+
CompasSettings().setCompasSetting(
157+
'sitipeServiceUrl',
158+
this.getSitipeServiceUrlField().value
159+
);
146160
CompasSettings().setCompasSetting(
147161
'useWebsockets',
148162
this.getUseWebsockets().checked ? 'on' : 'off'
@@ -193,6 +207,13 @@ export class CompasSettingsElement extends LitElement {
193207
required
194208
>
195209
</mwc-textfield>
210+
<mwc-textfield
211+
id="sitipeServiceUrl"
212+
label="${translate('compas.settings.sitipeServiceUrl')}"
213+
value="${this.compasSettings.sitipeServiceUrl}"
214+
required
215+
>
216+
</mwc-textfield>
196217
<mwc-formfield label="${translate('compas.settings.useWebsockets')}">
197218
<mwc-switch
198219
id="useWebsockets"

0 commit comments

Comments
 (0)