@@ -96,53 +96,6 @@ export function validationSuspiciousName() {
9696 }
9797 }
9898
99- function makeIncorrectNameIssue ( entityId , nameKey , incorrectName , langCode ) {
100- return new validationIssue ( {
101- type : type ,
102- subtype : 'not_name' ,
103- severity : 'warning' ,
104- message : function ( context ) {
105- const entity = context . hasEntity ( this . entityIds [ 0 ] ) ;
106- if ( ! entity ) return '' ;
107- const preset = presetManager . match ( entity , context . graph ( ) ) ;
108- const langName = langCode && localizer . languageName ( langCode ) ;
109- return t . append ( 'issues.incorrect_name.message' + ( langName ? '_language' : '' ) ,
110- { feature : preset . name ( ) , name : incorrectName , language : langName }
111- ) ;
112- } ,
113- reference : showReference ,
114- entityIds : [ entityId ] ,
115- hash : `${ nameKey } =${ incorrectName } ` ,
116- dynamicFixes : function ( ) {
117- return [
118- new validationIssueFix ( {
119- icon : 'iD-operation-delete' ,
120- title : t . append ( 'issues.fix.remove_the_name.title' ) ,
121- onClick : function ( context ) {
122- const entityId = this . issue . entityIds [ 0 ] ;
123- const entity = context . entity ( entityId ) ;
124- let tags = Object . assign ( { } , entity . tags ) ; // shallow copy
125- delete tags [ nameKey ] ;
126- context . perform (
127- actionChangeTags ( entityId , tags ) , t ( 'issues.fix.remove_mistaken_name.annotation' )
128- ) ;
129- }
130- } )
131- ] ;
132- }
133- } ) ;
134-
135- function showReference ( selection ) {
136- selection . selectAll ( '.issue-reference' )
137- . data ( [ 0 ] )
138- . enter ( )
139- . append ( 'div' )
140- . attr ( 'class' , 'issue-reference' )
141- . call ( t . append ( 'issues.generic_name.reference' ) ) ;
142- }
143- }
144-
145-
14699 let validation = function checkGenericName ( entity ) {
147100 const tags = entity . tags ;
148101
@@ -151,23 +104,23 @@ export function validationSuspiciousName() {
151104 if ( hasWikidata ) return [ ] ;
152105
153106 let issues = [ ] ;
154- const notNames = ( tags [ 'not:name' ] || '' ) . split ( ';' ) ;
107+ // const notNames = (tags['not:name'] || '').split(';');
155108
156109 for ( let key in tags ) {
157110 const m = key . match ( / ^ n a m e (?: (?: : ) ( [ a - z A - Z _ - ] + ) ) ? $ / ) ;
158111 if ( ! m ) continue ;
159112
160113 const langCode = m . length >= 2 ? m [ 1 ] : null ;
161114 const value = tags [ key ] ;
162- if ( notNames . length ) {
163- for ( let i in notNames ) {
164- const notName = notNames [ i ] ;
165- if ( notName && value === notName ) {
166- issues . push ( makeIncorrectNameIssue ( entity . id , key , value , langCode ) ) ;
167- continue ;
168- }
169- }
170- }
115+ // if (notNames.length) {
116+ // for (let i in notNames) {
117+ // const notName = notNames[i];
118+ // if (notName && value === notName) {
119+ // issues.push(makeIncorrectNameIssue(entity.id, key, value, langCode));
120+ // continue;
121+ // }
122+ // }
123+ // }
171124 if ( isGenericName ( value , tags ) ) {
172125 issues . provisional = _waitingForNsi ; // retry later if we are waiting on NSI to finish loading
173126 issues . push ( makeGenericNameIssue ( entity . id , key , value , langCode ) ) ;
0 commit comments