This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
stateManagement/data/handlers Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,8 @@ export const StyleVariables = Object.freeze({
255255 INPUT_SHADOW : 'var(--input-shadow)' ,
256256} ) ;
257257
258+
259+
258260export const SourceDataTypes = Object . freeze ( {
259261 CURRENT_FOLDER : 'current_folder' ,
260262 CURRENT_FOLDER_WITHOUT_SUBFOLDERS : 'current_folder_without_subfolders' ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function sanitizeDataCSV(rows: Row<RowDataType>[]): object[] {
1616 switch ( cellKey ) {
1717 case MetadataColumns . FILE :
1818 rowObject = updateFromPartial ( rowObject , {
19- [ cellKey ] : ( cellValue as Link ) . fileName ( )
19+ [ cellKey ] : ( cellValue as Link ) . path
2020 } ) ;
2121 break ;
2222 default :
Original file line number Diff line number Diff line change @@ -45,7 +45,11 @@ export default class SaveDataFromFileHandlerAction extends AbstractTableAction<D
4545 const rows : RowDataType [ ] = [ ] ;
4646 const lines = csv . toString ( ) . split ( "\n" ) ;
4747 const headers = this . normalizeArray ( lines [ 0 ] . split ( "," ) ) ;
48- const isCurrentFolder = config . source_data in [ SourceDataTypes . CURRENT_FOLDER , SourceDataTypes . CURRENT_FOLDER_WITHOUT_SUBFOLDERS ] ;
48+ const localSources = [
49+ SourceDataTypes . CURRENT_FOLDER ,
50+ SourceDataTypes . CURRENT_FOLDER_WITHOUT_SUBFOLDERS
51+ ] as string [ ] ;
52+ const isCurrentFolder = localSources . contains ( config . source_data ) ;
4953 const destination_folder = isCurrentFolder ? view . file . parent . path : config . source_destination_path ;
5054 // Obtain File from headers array
5155 const fileIndex = headers . indexOf (
@@ -54,7 +58,6 @@ export default class SaveDataFromFileHandlerAction extends AbstractTableAction<D
5458 if ( fileIndex === - 1 ) {
5559 throw new Error ( `${ view . plugin . settings . global_settings . csv_file_header_key } column not found in CSV file` ) ;
5660 }
57-
5861 for ( let i = 1 ; i < lines . length ; i ++ ) {
5962
6063 const currentline = this . normalizeArray ( lines [ i ] . split ( "," ) ) ;
You can’t perform that action at this time.
0 commit comments