This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-27
lines changed
Expand file tree Collapse file tree 2 files changed +15
-27
lines changed Original file line number Diff line number Diff line change @@ -97,11 +97,19 @@ export async function obtainColumnsFromFile(
9797 file : TFile
9898) : Promise < Record < string , DatabaseColumn > > {
9999 const columns : Record < string , DatabaseColumn > = { } ;
100- const propertiesOfFile = DataviewService . getDataviewAPI ( ) . page ( file . path ) ;
100+ const rawProperties = DataviewService . getDataviewAPI ( ) . page ( file . path ) ;
101101 // Check if propertiesOfFile is empty
102- if ( propertiesOfFile . length === 0 ) {
103- return columns ;
102+ if ( rawProperties . length === 0 ) {
103+ return { } ;
104104 }
105+ const propertiesOfFile : Record < string , Literal > = { } ;
106+ // Reduce propertiesOfFile to unique keys
107+ Object . entries ( rawProperties ) . forEach ( ( [ key , value ] ) => {
108+ const lowercaseKey = key . toLowerCase ( ) ;
109+ if ( ! propertiesOfFile [ lowercaseKey ] ) {
110+ propertiesOfFile [ lowercaseKey ] = value ;
111+ }
112+ } ) ;
105113
106114 Object . entries ( propertiesOfFile ) . forEach ( ( [ key , value ] , index ) => {
107115 const input = getInputInFuctionOfLiteral ( value ) ;
@@ -203,6 +211,7 @@ function validateColumnKey(columnKey: string): boolean {
203211 }
204212 return true ;
205213}
214+
206215function sortColumnsByPosition ( columns : TableColumn [ ] ) : TableColumn [ ] {
207216 return columns . sort ( ( a , b ) => {
208217 if ( a . position < b . position ) {
Original file line number Diff line number Diff line change @@ -425,30 +425,9 @@ export function Table(tableData: TableDataType) {
425425 className = { `${ c ( "td" ) } ` }
426426 onClick = { handleAddNewRow }
427427 >
428- < div
429- key = { `div-add-row-cell-button-internal-table` }
430- className = { `${ c ( "table" ) } ` }
431- >
432- < div
433- key = { `div-add-row-cell-button-internal-table-tr` }
434- className = { `${ c ( "tr" ) } ` }
435- >
436- < div
437- key = { `div-add-row-cell-button-internal-table-td-icon` }
438- className = { `${ c ( "td" ) } ` }
439- >
440- < span className = "svg-icon svg-gray" style = { { marginRight : 8 } } >
441- < PlusIcon />
442- </ span >
443- </ div >
444- < div
445- key = { `div-add-row-cell-button-internal-table-td-text` }
446- className = { `${ c ( "td" ) } ` }
447- >
448- New
449- </ div >
450- </ div >
451- </ div >
428+ < span className = "svg-icon svg-gray" style = { { marginRight : 8 } } >
429+ < PlusIcon />
430+ </ span >
452431 </ div >
453432 < div
454433 key = { `div-add-row-cell-padding-left` }
You can’t perform that action at this time.
0 commit comments