This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/components/modals/newColumn/handlers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11import { AddColumnModalHandlerResponse } from "cdm/ModalsModel" ;
22import { obtainColumnsFromRows } from "components/Columns" ;
3- import { DynamicInputType , MetadataColumns } from "helpers/Constants" ;
3+ import { DatabaseCore , DynamicInputType , MetadataColumns } from "helpers/Constants" ;
44import { t } from "lang/helpers" ;
55import { Notice , Setting } from "obsidian" ;
66import { AbstractHandlerClass } from "patterns/chain/AbstractHandler" ;
@@ -32,11 +32,15 @@ export class AddExistingColumnHandler extends AbstractHandlerClass<AddColumnModa
3232 }
3333
3434 promiseOfObtainColumnsFromRows . then ( ( columnsRaw : string [ ] ) => {
35- // Filter out the columns that are already in the table
3635 const currentColumns = ( columnState . info . getValueOfAllColumnsAsociatedWith ( 'id' ) as string [ ] ) . map ( id => id . toLowerCase ( ) ) ;
3736 const filteredColumns : Record < string , string > = { } ;
3837 columnsRaw
3938 . sort ( ( a , b ) => a . localeCompare ( b ) )
39+ // Filter reserved columns
40+ . filter ( ( columnName : string ) => {
41+ return DatabaseCore . FRONTMATTER_KEY !== columnName ;
42+ } )
43+ // Filter out the columns that are already in the table
4044 . filter ( ( columnName : string ) => {
4145 return ! currentColumns . includes ( columnName . toLowerCase ( ) )
4246 } ) . forEach ( ( columnName : string ) => {
You can’t perform that action at this time.
0 commit comments