Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 73e8af4

Browse files
committed
sanitized on tags
1 parent 64e8a9d commit 73e8af4

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/components/modals/columnSettings/handlers/SelectedColumnOptionsHandler.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { RowSelectOption } from "cdm/ComponentsModel";
22
import { ColumnSettingsHandlerResponse } from "cdm/ModalsModel";
33
import { randomColor, castStringtoHsl, castHslToString } from "helpers/Colors";
4+
import { satinizedColumnOption } from "helpers/FileManagement";
45
import { ButtonComponent, Notice, Setting } from "obsidian";
56
import { AbstractHandlerClass } from "patterns/chain/AbstractHandler";
67
import { LOGGER } from "services/Logger";
@@ -53,7 +54,8 @@ export class SelectedColumnOptionsHandler extends AbstractHandlerClass<ColumnSet
5354
.setPlaceholder("label of option")
5455
.setValue(newLabel)
5556
.onChange(async (value: string): Promise<void> => {
56-
newLabel = value;
57+
newLabel = satinizedColumnOption(value);
58+
text.setValue(newLabel);
5759
});
5860
text.inputEl.onkeydown = (e: KeyboardEvent) => {
5961
switch (e.key) {

src/components/modals/newColumn/handlers/QuickOptionsColumnsHandler.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { DynamicInputType } from "helpers/Constants";
55
import { t } from "lang/helpers";
66
import { Setting } from "obsidian";
77
import { AbstractHandlerClass } from "patterns/chain/AbstractHandler";
8-
import { StringSuggest } from "settings/suggesters/StringSuggester";
98

109
export class QuickOptionsColumnsHandler extends AbstractHandlerClass<AddColumnModalHandlerResponse> {
1110
settingTitle: string = "Column quick options";
@@ -68,14 +67,10 @@ export class QuickOptionsColumnsHandler extends AbstractHandlerClass<AddColumnMo
6867
if (!column.isMetadata) {
6968
// Select type
7069
columnSetting
71-
.addSearch(cb => {
72-
new StringSuggest(
73-
cb.inputEl,
74-
typesRecord
75-
);
76-
cb.setPlaceholder("Select type...")
77-
.setValue(column.input)
78-
.onChange(selectTypeHandler);
70+
.addDropdown((dropdown) => {
71+
dropdown.addOptions(typesRecord);
72+
dropdown.setValue(DynamicInputType.TEXT);
73+
dropdown.onChange(selectTypeHandler);
7974
});
8075
// Delete column
8176
columnSetting

src/services/ParseService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Parse {
3939
parsedLiteral = this.parseToEnableSorting(wrapped, localSettings, isInline);
4040
break;
4141
case InputType.TAGS:
42-
parsedLiteral = this.parseToOptionsArray(wrapped, localSettings);
42+
parsedLiteral = this.parseToOptionsArray(wrapped);
4343
break;
4444
case InputType.CALENDAR:
4545
parsedLiteral = this.parseToCalendar(wrapped, localSettings.date_format);
@@ -345,7 +345,7 @@ class Parse {
345345
return `[${stringArray}]`;
346346
}
347347

348-
private parseToOptionsArray(wrapped: WrappedLiteral, localSettings: LocalSettings): Literal {
348+
private parseToOptionsArray(wrapped: WrappedLiteral): Literal {
349349
if (wrapped.type !== 'array') {
350350
return wrapped.value.toString().split(",").map(s => satinizedColumnOption(s.toString().trim()));
351351
}

0 commit comments

Comments
 (0)