File tree Expand file tree Collapse file tree 6 files changed +49
-3
lines changed
test/integration/compas-editors Expand file tree Collapse file tree 6 files changed +49
-3
lines changed Original file line number Diff line number Diff line change 121
121
slot =" graphic"
122
122
style =" width : 90px "
123
123
>
124
+ <mwc-icon >
125
+ restore
126
+ </mwc-icon >
124
127
</span >
125
128
</mwc-list-item >
126
129
</mwc-list >
Original file line number Diff line number Diff line change
1
+ In the CoMPAS Editor the different versions of an SCL XML File are shown that are stored in CoMPAS.
2
+
3
+ - <svg xmlns =" http://www.w3.org/2000/svg " height =" 24px " viewBox =" 0 0 24 24 " width =" 24px " fill =" #000000 " ><path d =" M0 0h24v24H0V0z " fill =" none " /><path d =" M13 3c-4.97 0-9 4.03-9 9H1l4 3.99L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z " /></svg >:
4
+ Restore a specific version from CoMPAS. <br />
5
+ By pressing the icon and confirming the action that specific version will be loaded in OpenSCD.
6
+ That version isn't saved yet in CoMPAS as the latest version. By saving it using the menu 'Save CoMPAS'
7
+ the loaded version can be saved as the latest version.
8
+ - <svg xmlns =" http://www.w3.org/2000/svg " height =" 24px " viewBox =" 0 0 24 24 " width =" 24px " fill =" #000000 " ><path d =" M0 0h24v24H0V0z " fill =" none " /><path d =" M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z " /></svg >:
9
+ Remove a specific version from CoMPAS.<br />
10
+ By pressing the icon and confirming the action that specific version will be removed from CoMPAS.
11
+ - <svg xmlns =" http://www.w3.org/2000/svg " height =" 24px " viewBox =" 0 0 24 24 " width =" 24px " fill =" #000000 " ><path d =" M0 0h24v24H0V0z " fill =" none " /><path d =" M14.12 10.47L12 12.59l-2.13-2.12-1.41 1.41L10.59 14l-2.12 2.12 1.41 1.41L12 15.41l2.12 2.12 1.41-1.41L13.41 14l2.12-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4zM6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9z " /></svg >:
12
+ Remove the SCL XML File completely from CoMPAS, all versions.<br />
13
+ By pressing the icon and confirming the action all versions will be removed from CoMPAS.
Original file line number Diff line number Diff line change 1
1
This is an open repository of information on OpenSCD and IEC 61850-6. You are welcome to share your knowledge with the rest of the world at https://github.com/openscd/open-scd/wiki/Home/_edit 😄 . Welcome aboard!
2
2
3
- So far we have documented some essential [ general OpenSCD editor features] ( https://github.com/openscd/open-scd/wiki/OpenSCD-Editor-Features ) and features regarding the individual [ sections of an SCL file] ( https://github.com/openscd/open-scd/wiki/SCL-Sections ) .
3
+ So far we have documented some essential [ general OpenSCD editor features] ( https://github.com/openscd/open-scd/wiki/OpenSCD-Editor-Features ) and features regarding the individual [ sections of an SCL file] ( https://github.com/openscd/open-scd/wiki/SCL-Sections ) .
4
+ And for CoMPAS there is also some documentation about the [ CoMPAS Version Editor] ( https://github.com/openscd/open-scd/wiki/CoMPAS-Versions-Editor ) .
Original file line number Diff line number Diff line change 21
21
### DataTypeTemplates
22
22
23
23
- [ DataTypeTemplate editor] ( https://github.com/openscd/open-scd/wiki/DataTypeTemplate-editor )
24
+
25
+ ## CoMPASS
26
+
27
+ - [ CoMPAS Versions Editor] ( https://github.com/openscd/open-scd/wiki/CoMPAS-Versions-Editor )
Original file line number Diff line number Diff line change @@ -89,7 +89,11 @@ export default class CompasVersionsPlugin extends LitElement {
89
89
if ( items . length - 1 === index ) {
90
90
return html `< mwc-list-item tabindex ="0 " graphic ="control ">
91
91
${ name } (${ version } )
92
- < span slot ="graphic " style ="width: 90px "> </ span >
92
+ < span slot ="graphic " style ="width: 90px ">
93
+ < mwc-icon @click =${ ( ) => {
94
+ this . confirmRestoreCompas ( version ) ;
95
+ } } > restore</ mwc-icon >
96
+ </ span >
93
97
</ mwc-list-item > `
94
98
}
95
99
return html `< mwc-list-item tabindex ="0 "
Original file line number Diff line number Diff line change @@ -118,7 +118,28 @@ describe('compas-versions-plugin', () => {
118
118
119
119
it ( 'has 3 item entries' , ( ) => {
120
120
expect ( element . shadowRoot ! . querySelectorAll ( 'mwc-list > mwc-list-item' ) )
121
- . to . have . length ( 3 )
121
+ . to . have . length ( 3 ) ;
122
+ } ) ;
123
+
124
+ it ( 'first entry has correct buttons' , ( ) => {
125
+ expect ( element . shadowRoot ! . querySelectorAll ( 'mwc-list > mwc-list-item' ) . length )
126
+ . to . be . greaterThan ( 1 ) ;
127
+ // Retrieve the first item after checking that there are items.
128
+ const item = element . shadowRoot ! . querySelectorAll ( 'mwc-list > mwc-list-item' ) [ 0 ] ;
129
+ // There should be 2 buttons, first the restore, second the delete.
130
+ expect ( item . querySelectorAll ( 'span > mwc-icon' ) ) . to . have . length ( 2 ) ;
131
+ expect ( item . querySelectorAll ( 'span > mwc-icon' ) [ 0 ] . textContent ) . to . be . equal ( 'restore' ) ;
132
+ expect ( item . querySelectorAll ( 'span > mwc-icon' ) [ 1 ] . textContent ) . to . be . equal ( 'delete' ) ;
133
+ } ) ;
134
+
135
+ it ( 'last entry has one buttons' , ( ) => {
136
+ expect ( element . shadowRoot ! . querySelectorAll ( 'mwc-list > mwc-list-item' ) )
137
+ . to . have . length ( 3 ) ;
138
+ // Retrieve the last item after checking that there are 3 items.
139
+ const item = element . shadowRoot ! . querySelectorAll ( 'mwc-list > mwc-list-item' ) [ 2 ] ;
140
+ // There should be 1 buttons, the restore button.
141
+ expect ( item . querySelectorAll ( 'span > mwc-icon' ) ) . to . have . length ( 1 ) ;
142
+ expect ( item . querySelectorAll ( 'span > mwc-icon' ) [ 0 ] . textContent ) . to . be . equal ( 'restore' ) ;
122
143
} ) ;
123
144
124
145
it ( 'looks like the latest snapshot' , async ( ) => {
You can’t perform that action at this time.
0 commit comments