@@ -240,38 +240,43 @@ export default {
240
240
me . $store . commit ( 'app/importStatus' , feedback ) ;
241
241
me . $store . commit ( 'app/importTransition' , 'info' ) ;
242
242
} , function ( errorMsg ) {
243
- CSVImport . analyzeFile ( file , function ( data ) {
244
- me . $store . commit ( 'app/importFileType' , 'csv' ) ;
245
- me . importFrameworkName = file . name . replace ( ".csv" , "" ) ;
246
- for ( let i = 0 ; i < data . length ; i ++ ) {
247
- if ( data [ i ] [ 0 ] === "" ) {
248
- data . splice ( i , 1 ) ;
249
- }
250
- }
251
- for ( var i = 0 ; i < data [ 0 ] . length ; i ++ ) {
252
- let column = { } ;
253
- column . name = data [ 0 ] [ i ] ;
254
- column . index = i ;
255
- me . csvColumns . push ( column ) ;
256
- if ( column . name . toLowerCase ( ) . indexOf ( "name" ) !== - 1 ) {
257
- me . importCsvColumnName = column ;
258
- }
259
- if ( column . name . toLowerCase ( ) . indexOf ( "description" ) !== - 1 ) {
260
- me . importCsvColumnDescription = column ;
261
- }
262
- if ( column . name . toLowerCase ( ) . indexOf ( "scope" ) !== - 1 ) {
263
- me . importCsvColumnScope = column ;
243
+ if ( errorMsg . indexOf ( 'CTDLASN Parse Error' ) !== - 1 ) {
244
+ me . $store . commit ( 'app/addImportError' , errorMsg ) ;
245
+ me . $store . commit ( 'app/importTransition' , 'process' ) ;
246
+ } else {
247
+ CSVImport . analyzeFile ( file , function ( data ) {
248
+ me . $store . commit ( 'app/importFileType' , 'csv' ) ;
249
+ me . importFrameworkName = file . name . replace ( ".csv" , "" ) ;
250
+ for ( let i = 0 ; i < data . length ; i ++ ) {
251
+ if ( data [ i ] [ 0 ] === "" ) {
252
+ data . splice ( i , 1 ) ;
253
+ }
264
254
}
265
- if ( column . name . toLowerCase ( ) . indexOf ( "id" ) !== - 1 ) {
266
- me . importCsvColumnId = column ;
255
+ for ( var i = 0 ; i < data [ 0 ] . length ; i ++ ) {
256
+ let column = { } ;
257
+ column . name = data [ 0 ] [ i ] ;
258
+ column . index = i ;
259
+ me . csvColumns . push ( column ) ;
260
+ if ( column . name . toLowerCase ( ) . indexOf ( "name" ) !== - 1 ) {
261
+ me . importCsvColumnName = column ;
262
+ }
263
+ if ( column . name . toLowerCase ( ) . indexOf ( "description" ) !== - 1 ) {
264
+ me . importCsvColumnDescription = column ;
265
+ }
266
+ if ( column . name . toLowerCase ( ) . indexOf ( "scope" ) !== - 1 ) {
267
+ me . importCsvColumnScope = column ;
268
+ }
269
+ if ( column . name . toLowerCase ( ) . indexOf ( "id" ) !== - 1 ) {
270
+ me . importCsvColumnId = column ;
271
+ }
267
272
}
268
- }
269
- me . $store . commit ( 'app/importStatus ' , ( me . competencyCount = ( data . length - 1 ) ) + " Competencies Detected." ) ;
270
- me . $store . commit ( 'app/importTransition' , 'info' ) ;
271
- } , function ( error ) {
272
- me . $store . commit ( 'app/addImportError ' , error ) ;
273
- me . $store . commit ( 'app/importTransition' , 'process' ) ;
274
- } ) ;
273
+ me . $store . commit ( 'app/importStatus' , ( me . competencyCount = ( data . length - 1 ) ) + " Competencies Detected." ) ;
274
+ me . $store . commit ( 'app/importTransition ' , 'info' ) ;
275
+ } , function ( error ) {
276
+ me . $store . commit ( 'app/addImportError' , error ) ;
277
+ me . $store . commit ( 'app/importTransition ' , 'process' ) ;
278
+ } ) ;
279
+ }
275
280
} ) ;
276
281
}
277
282
} else if ( file . name . endsWith ( ".json" ) || file . name . endsWith ( ".jsonld" ) ) {
0 commit comments