File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 146146 if ( r [ "family-names" ] != $ ( "#user-" + user + "-family" ) . val ( ) ) {
147147 $ ( "#user-" + user + "-family-orcid" ) . addClass ( "text-danger" ) ;
148148 }
149+ if ( ! r [ "institution-name" ] . include ( $ ( "#user-" + user + "-affiliation" ) . val ( ) ) ) {
150+ $ ( "#user-" + user + "-affiliation-orcid" ) . addClass ( "text-danger" ) ;
151+ }
149152 }
150153 submit . removeClass ( "disabled" ) ;
151154 }
199202 success : function ( data ) {
200203 if ( data [ "id" ] ) {
201204 var r = data ;
202- var tag = " <span class=text-muted>(from ROR)</span>"
205+ var names = r [ "names" ] . map ( ( x ) => x [ "value" ] ) ;
206+ var tag = " <span class=text-muted>(from ROR)</span>" ;
203207
204208 // Report results
205- $ ( "#user-" + user + "-affiliation-ror" ) . html ( r [ "name" ] + tag ) ;
209+ $ ( "#user-" + user + "-affiliation-ror" ) . html ( names . join ( ", " ) + tag ) ;
206210
207211 // Highlight inconsistencies
208- if ( r [ "name" ] != $ ( "#user-" + user + "-affiliation" ) . val ( ) ) {
212+ if ( ! names . include ( $ ( "#user-" + user + "-affiliation" ) . val ( ) ) ) {
209213 $ ( "#user-" + user + "-affiliation-ror" ) . addClass ( "text-danger" ) ;
210214 }
211- if ( r [ "id" ] != "https://ror.org/" + $ ( "#user-" + user + "-affiliation_ror" ) . val ( ) ) {
215+ var ror_url = "https://ror.org/" +
216+ $ ( "#user-" + user + "-affiliation_ror" ) . val ( ) ;
217+ if ( r [ "id" ] != ror_url ) {
212218 $ ( "#user-" + user + "-affiliation_ror-ror" ) . html ( r [ "id" ] + tag ) ;
213219 $ ( "#user-" + user + "-affiliation_ror-ror" ) . addClass ( "text-danger" ) ;
214220 }
You can’t perform that action at this time.
0 commit comments