File tree Expand file tree Collapse file tree 9 files changed +73
-40
lines changed Expand file tree Collapse file tree 9 files changed +73
-40
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-FileCopyrightText: 2021 Alliander N.V.
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ version : 2
6
+
7
+ updates :
8
+ # Maintain dependencies for GitHub Actions
9
+ - package-ecosystem : " github-actions"
10
+ directory : " /"
11
+ schedule :
12
+ interval : " daily"
13
+ open-pull-requests-limit : 5
Original file line number Diff line number Diff line change 1
1
name : Build Project
2
2
3
- on : push
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' **'
7
+ - ' !main'
8
+ pull_request :
9
+ branches :
10
+ - ' main'
4
11
5
12
jobs :
6
13
build :
9
16
timeout-minutes : 15
10
17
11
18
steps :
12
- - uses : actions/checkout@v2
19
+ - name : Checkout
20
+ uses : actions/checkout@v2
21
+
22
+ - name : Set up Docker Buildx
23
+ id : buildx
24
+ if : ${{ github.event_name == 'pull_request' }}
25
+ uses : docker/setup-buildx-action@v1
26
+ - name : Cache Docker Register
27
+ if : ${{ github.event_name == 'pull_request' }}
28
+ uses : actions/cache@v2
29
+ with :
30
+ path : /tmp/.buildx-cache
31
+ key : ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
32
+
13
33
- name : Use Node.js 14.x
14
34
uses : actions/setup-node@v1
15
35
with :
16
36
node-version : ' 14.x'
37
+
38
+ - name : Test application with npm
39
+ if : ${{ github.event_name == 'push' }}
40
+ run : |
41
+ npm ci
42
+ npm run-script test
43
+
17
44
- name : Build application with npm
45
+ if : ${{ github.event_name == 'pull_request' }}
18
46
run : |
19
47
npm ci
20
48
npm run-script build
21
49
- name : Build docker image
50
+ if : ${{ github.event_name == 'pull_request' }}
22
51
uses : docker/build-push-action@v2
23
52
with :
24
53
# Set the context to use the current directory and not execute it's own git checkout.
Original file line number Diff line number Diff line change 13
13
name : Build and publish
14
14
runs-on : ubuntu-latest
15
15
steps :
16
- - name : Check out the repo
16
+ - name : Checkout
17
17
uses : actions/checkout@v2
18
+
19
+ - name : Set up Docker Buildx
20
+ id : buildx
21
+ uses : docker/setup-buildx-action@v1
22
+ - name : Login to Docker Hub
23
+ uses : docker/login-action@v1
24
+ with :
25
+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
26
+ password : ${{ secrets.DOCKER_HUB_TOKEN }}
27
+ - name : Cache Docker Register
28
+ uses : actions/cache@v2
29
+ with :
30
+ path : /tmp/.buildx-cache
31
+ key : ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
32
+
18
33
- name : Extract tag name
19
34
id : extract_tagname
20
35
shell : bash
@@ -24,15 +39,11 @@ jobs:
24
39
uses : actions/setup-node@v1
25
40
with :
26
41
node-version : ' 14.x'
42
+
27
43
- name : Build application with npm
28
44
run : |
29
45
npm ci
30
46
npm run-script build
31
- - name : Login to Docker Hub
32
- uses : docker/login-action@v1
33
- with :
34
- username : ${{ secrets.DOCKER_HUB_USERNAME }}
35
- password : ${{ secrets.DOCKER_HUB_TOKEN }}
36
47
- name : Build and push docker image to Docker Hub
37
48
uses : docker/build-push-action@v2
38
49
with :
Original file line number Diff line number Diff line change 41
41
tabindex =" 0"
42
42
>
43
43
<span >
44
- <description >
45
- System Exchange Description
46
- </description >
47
- (
48
- <code >
49
- SED
50
- </code >
51
- )
44
+ System Exchange Description (SED)
52
45
</span >
53
46
</mwc-list-item >
54
47
<mwc-list-item
57
50
tabindex =" -1"
58
51
>
59
52
<span >
60
- <description >
61
- Substation Specification Description
62
- </description >
63
- (
64
- <code >
65
- SSD
66
- </code >
67
- )
53
+ Substation Specification Description (SSD)
68
54
</span >
69
55
</mwc-list-item >
70
56
</mwc-list >
Original file line number Diff line number Diff line change 44
44
value =" SED"
45
45
>
46
46
<span >
47
- <description >
48
- System Exchange Description
49
- </description >
50
- (SED)
47
+ System Exchange Description (SED)
51
48
</span >
52
49
</mwc-radio-list-item >
53
50
<mwc-radio-list-item
59
56
value =" SSD"
60
57
>
61
58
<span >
62
- <description >
63
- Substation Specification Description
64
- </description >
65
- (SSD)
59
+ Substation Specification Description (SSD)
66
60
</span >
67
61
</mwc-radio-list-item >
68
62
</mwc-list >
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ export default class CompasVersionsPlugin extends LitElement {
132
132
`
133
133
}
134
134
135
- if ( this . scls ? .length <= 0 ) {
135
+ if ( this . scls . length <= 0 ) {
136
136
return html `
137
137
< mwc-list >
138
138
< mwc-list-item >
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ export function parseXml(textContent: string): Promise<Document> {
60
60
61
61
export function extractSclFromResponse ( response : Document ) : Promise < Document > {
62
62
// Extract the SCL Result from the Response and create a new Document from it.
63
- const sclData = response . querySelectorAll ( "SclData" ) . item ( 0 ) . textContent ;
64
- const sclDocument = new DOMParser ( ) . parseFromString ( sclData ?? '' , 'application/xml' ) ;
63
+ const sclData = response . querySelectorAll ( "SclData" ) . item ( 0 ) . textContent ?? '' ;
64
+ const sclDocument = new DOMParser ( ) . parseFromString ( sclData , 'application/xml' ) ;
65
65
return Promise . resolve ( sclDocument ) ;
66
66
}
67
67
Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ export class CompasSclTypeList extends LitElement {
49
49
return html `
50
50
< mwc-list >
51
51
${ this . sclTypes . map ( type => {
52
- const code = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Code" ) . item ( 0 ) ;
53
- const description = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Description" ) . item ( 0 ) ;
52
+ const code = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Code" ) . item ( 0 ) ! . textContent ?? '' ;
53
+ const description = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Description" ) . item ( 0 ) ! . textContent ?? '' ;
54
54
return html `< mwc-list-item tabindex ="0 "
55
- @click =${ ( ) => this . dispatchEvent ( newTypeSelectedEvent ( code ! . textContent ?? '' ) ) } >
55
+ @click =${ ( ) => this . dispatchEvent ( newTypeSelectedEvent ( code ) ) } >
56
56
< span > ${ description } (${ code } )</ span >
57
57
</ mwc-list-item > ` ;
58
58
} ) }
Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ export class CompasSclTypeRadiogroup extends LitElement {
54
54
< mwc-list activatable >
55
55
${ this . sclTypes . map ( type => {
56
56
const code = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Code" ) . item ( 0 ) ! . textContent ?? '' ;
57
- const description = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Description" ) . item ( 0 ) ;
58
- return html `< mwc-radio-list-item value ="${ code ?? '' } " ?selected ="${ ( code === this . value ) } " left >
57
+ const description = type . getElementsByTagNameNS ( SDS_NAMESPACE , "Description" ) . item ( 0 ) ! . textContent ?? '' ;
58
+ return html `< mwc-radio-list-item value ="${ code } " ?selected ="${ ( code === this . value ) } " left >
59
59
< span > ${ description } (${ code } )</ span >
60
60
</ mwc-radio-list-item > ` ;
61
61
} ) }
You can’t perform that action at this time.
0 commit comments