@@ -41,6 +41,12 @@ q-list
4141 q-icon( v-else-if ='editorStore.validationChecks[chk.key] === 2' name ='mdi-information' size ='xs' color ='light-blue-5' )
4242 q-icon( v-else-if ='editorStore.validationChecks[chk.key] === -1' name ='mdi-close-circle' size ='xs' color ='red-5' )
4343 q-icon( v-else-if ='editorStore.validationChecks[chk.key] === -2' name ='mdi-alert-circle' size ='xs' color ='orange-5' )
44+ q-menu( touch-position context-menu auto-close )
45+ q-list.bg-dark-1 ( separator )
46+ q-item( clickable , @click ='resetIgnores(chk.key)' )
47+ q-item-section( side )
48+ q-icon( name ='mdi-cancel' size ='xs' color ='amber' )
49+ q-item-section Reset all ignores for this check
4450 q-expansion-item.bg-dark-5 (
4551 v-if ='editorStore.validationChecksDetails[chk.key].count > 0'
4652 group ='checks'
6369 no-caps
6470 outline
6571 color ='purple-3'
66- disabled
72+ @click = 'resetIgnores(chk.key)'
6773 )
6874 q-space
6975 q-btn.q-mr-sm (
@@ -95,8 +101,15 @@ q-list
95101 q-item-section( v-if ='dtl.group' , side )
96102 q-badge( color ='purple' text-color ='white' : label= 'dtl.group' )
97103 q-item-section.text-caption {{ dtl.message }}
98- q-item-section( v-if ='dtl.range' , side )
99- q-badge( color ='dark-3' text-color ='white' : label= 'dtl.range.startLineNumber + ":" + dtl.range.startColumn' )
104+ q-item-section( side )
105+ q-badge( v-if ='dtl.range' ,color ='dark-3' text-color ='white' ) {{ dtl.range.startLineNumber + ":" + dtl.range.startColumn }} #[ q-icon.q-ml-xs ( name ='mdi-dots-horizontal' ) ]
106+ q-btn( v-else color ='dark-3' text-color ='white' icon ='mdi-dots-horizontal' padding ='none xs' size ='xs' unelevated )
107+ q-menu( self ='top left' , anchor ='top right' auto-close )
108+ q-list.bg-dark-1 ( separator )
109+ q-item( clickable , @click ='ignoreCheck(chk.key, dtl.value)' )
110+ q-item-section( side )
111+ q-icon( name ='mdi-playlist-remove' size ='xs' color ='purple-2' )
112+ q-item-section Ignore "{{ dtl.value }}" for this document
100113</template >
101114
102115<script setup>
@@ -164,10 +177,56 @@ const valChecks = [
164177 }
165178]
166179
167- // METHODS
180+ // IGNORES METHODS
181+
182+ function resetIgnores (key ) {
183+ if (docsStore .activeDocument .extra ? .checks ? .[key]? .ignores ) {
184+ docsStore .activeDocument .extra .checks [key].ignores = []
185+ }
186+ $q .notify ({
187+ message: ' Ignores cleared!' ,
188+ caption: ' All ignores for this check have been reset.' ,
189+ color: ' positive' ,
190+ icon: ' mdi-playlist-remove'
191+ })
192+ }
193+
194+ function ignoreCheck (key , value ) {
195+ if (! docsStore .activeDocument .extra .checks ) {
196+ docsStore .activeDocument .extra .checks = {}
197+ }
198+ if (! docsStore .activeDocument .extra .checks [key]) {
199+ docsStore .activeDocument .extra .checks [key] = {}
200+ }
201+ if (! docsStore .activeDocument .extra .checks [key].ignores ) {
202+ docsStore .activeDocument .extra .checks [key].ignores = [value]
203+ } else if (docsStore .activeDocument .extra .checks [key].ignores .includes (value)) {
204+ $q .notify ({
205+ message: ' Ignore already added.' ,
206+ caption: ' Run the validation check again to use it.' ,
207+ color: ' orange-8' ,
208+ icon: ' mdi-alert'
209+ })
210+ return
211+ } else {
212+ docsStore .activeDocument .extra .checks [key].ignores .push (value)
213+ }
214+ $q .notify ({
215+ message: ' Ignore added!' ,
216+ caption: ' Run the validation check again to use it.' ,
217+ color: ' positive' ,
218+ icon: ' mdi-playlist-plus'
219+ })
220+ }
221+
222+ function getIgnores (key ) {
223+ return docsStore .activeDocument .extra ? .checks ? .[key]? .ignores ?? []
224+ }
225+
226+ // VALIDATION METHODS
168227
169228function articlesCheck (silent ) {
170- const results = checkArticles (modelStore[docsStore .activeDocument .id ].getValue ())
229+ const results = checkArticles (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' articles ' ) )
171230 if (results .count < 1 ) {
172231 editorStore .setValidationCheckState (' articles' , 1 )
173232 editorStore .setValidationCheckDetails (' articles' , [])
@@ -186,7 +245,7 @@ function articlesCheck (silent) {
186245}
187246
188247function hyphenationCheck (silent = false ) {
189- const results = checkHyphenation (modelStore[docsStore .activeDocument .id ].getValue ())
248+ const results = checkHyphenation (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' hyphenation ' ) )
190249 if (results .count < 1 ) {
191250 editorStore .setValidationCheckState (' hyphenation' , 1 )
192251 editorStore .setValidationCheckDetails (' hyphenation' , [])
@@ -205,7 +264,7 @@ function hyphenationCheck (silent = false) {
205264}
206265
207266function inclusiveLangCheck (silent = false ) {
208- const results = checkInclusiveLanguage (modelStore[docsStore .activeDocument .id ].getValue ())
267+ const results = checkInclusiveLanguage (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' inclusiveLanguage ' ) )
209268 if (results .count < 1 ) {
210269 editorStore .setValidationCheckState (' inclusiveLanguage' , 1 )
211270 editorStore .setValidationCheckDetails (' inclusiveLanguage' , [])
@@ -224,7 +283,7 @@ function inclusiveLangCheck (silent = false) {
224283}
225284
226285function nonAsciiCheck (silent = false ) {
227- const infos = checkNonAscii (modelStore[docsStore .activeDocument .id ].getValue ())
286+ const infos = checkNonAscii (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' nonAscii ' ) )
228287 if (infos < 1 ) {
229288 editorStore .setValidationCheckState (' nonAscii' , 1 )
230289 if (! silent) {
@@ -241,7 +300,7 @@ function nonAsciiCheck (silent = false) {
241300}
242301
243302function placeholdersCheck (silent = false ) {
244- const results = checkCommonPlaceholders (modelStore[docsStore .activeDocument .id ].getValue ())
303+ const results = checkCommonPlaceholders (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' placeholders ' ) )
245304 if (results .count < 1 ) {
246305 editorStore .setValidationCheckState (' placeholders' , 1 )
247306 editorStore .setValidationCheckDetails (' placeholders' , [])
@@ -260,7 +319,7 @@ function placeholdersCheck (silent = false) {
260319}
261320
262321function repeatedWordsCheck (silent ) {
263- const results = checkRepeatedWords (modelStore[docsStore .activeDocument .id ].getValue ())
322+ const results = checkRepeatedWords (modelStore[docsStore .activeDocument .id ].getValue (), getIgnores ( ' repeatedWords ' ) )
264323 if (results .count < 1 ) {
265324 editorStore .setValidationCheckState (' repeatedWords' , 1 )
266325 editorStore .setValidationCheckDetails (' repeatedWords' , [])
0 commit comments