@@ -32,8 +32,6 @@ import {
32
32
LogEvent ,
33
33
Mixin ,
34
34
newActionEvent ,
35
- OpenDocEvent ,
36
- SclhistoryEntry ,
37
35
} from './foundation.js' ;
38
36
import { getFilterIcon , iconColors } from './icons/icons.js' ;
39
37
import { Plugin } from './Plugging.js' ;
@@ -43,7 +41,6 @@ const icons = {
43
41
warning : 'warning' ,
44
42
error : 'report' ,
45
43
action : 'history' ,
46
- sclhistory : 'history_toggle_off' ,
47
44
} ;
48
45
49
46
function getPluginName ( src : string ) : string {
@@ -113,58 +110,6 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
113
110
return index ;
114
111
}
115
112
116
- private convertToDate ( when : string | null ) : Date | null {
117
- const convertedTime = new Date ( when ?? '' ) ;
118
- if ( ! isNaN ( convertedTime . getTime ( ) ) ) {
119
- return convertedTime ;
120
- }
121
- return null ;
122
- }
123
-
124
- private createMessage (
125
- who : string | null ,
126
- why : string | null
127
- ) : string | undefined {
128
- let message = who ;
129
- if ( message !== null && why !== null ) {
130
- message += ' : ' + why ;
131
- } else if ( why !== null ) {
132
- message = why ;
133
- }
134
- return message ?? undefined ;
135
- }
136
-
137
- private createSclHistoryEntry (
138
- who : string | null ,
139
- what : string | null ,
140
- why : string | null ,
141
- when : string | null
142
- ) : SclhistoryEntry {
143
- return {
144
- kind : 'sclhistory' ,
145
- title : what ?? 'UNDEFINED' ,
146
- message : this . createMessage ( who , why ) ,
147
- time : this . convertToDate ( when ) ,
148
- } ;
149
- }
150
-
151
- private async onLoadHistoryFromDoc ( event : OpenDocEvent ) {
152
- const doc = event . detail . doc ;
153
-
154
- Array . from (
155
- doc . querySelectorAll ( ':root > Header > History > Hitem' )
156
- ) . forEach ( historyItem => {
157
- this . history . push (
158
- this . createSclHistoryEntry (
159
- historyItem . getAttribute ( 'who' ) ,
160
- historyItem . getAttribute ( 'what' ) ,
161
- historyItem . getAttribute ( 'why' ) ,
162
- historyItem . getAttribute ( 'when' )
163
- )
164
- ) ;
165
- } ) ;
166
- }
167
-
168
113
private onIssue ( de : IssueEvent ) : void {
169
114
const issues = this . diagnoses . get ( de . detail . validatorId ) ;
170
115
@@ -249,7 +194,6 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
249
194
250
195
this . addEventListener ( 'log' , this . onLog ) ;
251
196
this . addEventListener ( 'issue' , this . onIssue ) ;
252
- this . addEventListener ( 'open-doc' , this . onLoadHistoryFromDoc ) ;
253
197
}
254
198
255
199
renderLogEntry (
@@ -330,9 +274,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
330
274
331
275
private renderFilterButtons ( ) {
332
276
return ( < LogEntryType [ ] > Object . keys ( icons ) ) . map (
333
- kind => html `< mwc-icon-button-toggle
334
- id ="${ kind } filter "
335
- ?on =${ kind !== 'sclhistory' }
277
+ kind => html `< mwc-icon-button-toggle id ="${ kind } filter " on
336
278
> ${ getFilterIcon ( kind , false ) }
337
279
${ getFilterIcon ( kind , true ) } </ mwc-icon-button-toggle
338
280
> `
@@ -362,8 +304,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
362
304
# content mwc-list-item .info ,
363
305
# content mwc-list-item .warning ,
364
306
# content mwc-list-item .error ,
365
- # content mwc-list-item .action ,
366
- # content mwc-list-item .sclhistory {
307
+ # content mwc-list-item .action {
367
308
display : none;
368
309
}
369
310
# infofilter [on ] ~ # content mwc-list-item .info {
@@ -378,9 +319,6 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
378
319
# actionfilter [on ] ~ # content mwc-list-item .action {
379
320
display : flex;
380
321
}
381
- # sclhistoryfilter [on ] ~ # content mwc-list-item .sclhistory {
382
- display : flex;
383
- }
384
322
385
323
# log {
386
324
--mdc-dialog-min-width : 92vw ;
0 commit comments