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

Commit 4386cea

Browse files
committed
Merge branch 'minor_bugs_3.1.0'
2 parents d63f9f8 + 8e96a0d commit 4386cea

File tree

16 files changed

+63
-77
lines changed

16 files changed

+63
-77
lines changed

src/cdm/SettingsModel.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export interface LocalSettings {
4040
remove_empty_folders: boolean;
4141
hoist_files_with_empty_attributes: boolean;
4242
automatically_group_files: boolean;
43-
frontmatter_quote_wrap: boolean;
4443
pagination_size: number;
4544
font_size: number;
4645
remove_field_when_delete_column: boolean;

src/components/TableRow.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { RowDataType } from "cdm/FolderModel";
33
import { StyleVariables } from "helpers/Constants";
44
import { c } from "helpers/StylesHelper";
55
import { Literal } from "obsidian-dataview";
6-
import React from "react";
6+
import React, { CSSProperties } from "react";
77
import { MdFileComponent } from "components/obsidianArq/embedMdInteractive";
88
import { TableRowProps } from "cdm/RowTypeModel";
99

@@ -38,9 +38,11 @@ export default function TableRow(tableRowProps: TableRowProps) {
3838
className={`${c(
3939
"td" + (cellIndex === 0 ? " row-context-menu" : "")
4040
)} data-input`}
41-
style={{
42-
fontSize: `${fontSize}px`,
43-
}}
41+
style={
42+
{
43+
"--dbfolder-font-size": `${fontSize}px`,
44+
} as CSSProperties
45+
}
4446
>
4547
{flexRender(cell.column.columnDef.cell, cell.getContext())}
4648
</div>

src/components/modals/columnSettings/handlers/automations/FormulaInputHandler.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AbstractHandlerClass } from "patterns/chain/AbstractHandler";
33
import { Setting } from "obsidian";
44
import { add_toggle } from "settings/SettingsComponents";
55
import { t } from "lang/helpers";
6+
import { c } from "helpers/StylesHelper";
67
export class FormulaInputHandler extends AbstractHandlerClass<ColumnSettingsHandlerResponse> {
78
settingTitle: string = 'Formula properties';
89
handle(columnHandlerResponse: ColumnSettingsHandlerResponse): ColumnSettingsHandlerResponse {
@@ -41,11 +42,7 @@ export class FormulaInputHandler extends AbstractHandlerClass<ColumnSettingsHand
4142
textArea.setValue(config.formula_query);
4243
textArea.setPlaceholder(t("column_settings_modal_formula_input_textarea_placeholder"));
4344
textArea.onChange(formula_promise);
44-
// style textarea size in function of formula length
45-
const formula_length = config.formula_query ? config.formula_query.length : 0;
46-
textArea.inputEl.rows = Math.max(4, formula_length / 30);
47-
textArea.inputEl.cols = Math.min(Math.max(10, formula_length * 2), 45);
48-
textArea.inputEl.style.width = 'auto';
45+
textArea.inputEl.addClass(c("textarea-setting"));
4946

5047
});
5148
const mainDesc = containerEl.createEl('p');

src/helpers/Constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ export const DEFAULT_SETTINGS: DatabaseSettings = {
396396
source_data: SourceDataTypes.CURRENT_FOLDER,
397397
source_form_result: 'root',
398398
source_destination_path: '/',
399-
frontmatter_quote_wrap: false,
400399
row_templates_folder: '/',
401400
current_row_template: '',
402401
pagination_size: 10,

src/lang/locale/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,5 +332,4 @@ export default {
332332
"settings_source_form_destination_title": "Select destination folder",
333333
"settings_source_form_destination_desc": "Select the destination of new entries for this source",
334334
"settings_source_form_destination_placeholder": "Example: folder1/folder2",
335-
336335
};

src/lang/locale/es.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@ export default {
2626
"outgoing_link": "Enlace saliente",
2727
"incoming_link": "Enlace entrante",
2828
"query": "Consulta de Dataview",
29+
/** COMMAND OPTIONS */
30+
"active_go_next_page": "Ir a la página siguiente",
31+
"active_go_previous_page": "Ir a la página anterior",
32+
"active_add_new_row": "Añadir nueva fila",
33+
"active_open_settings": "Abrir configuración",
34+
"active_toggle_filters": "Mostrar/Ocultar filtros",
35+
"active_open_filters": "Abrir filtros",
36+
/** FOOTER MENU OPTIONS */
37+
"footer_menu_none": "Nada",
38+
"footer_menu_count_unique": "Contar valores únicos",
39+
"footer_menu_count_empty": "Contar valores vacíos",
2940
};

src/parsers/RowDatabaseFieldsToFile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export const parseInlineFieldsToString = (inlineFields: RowDatabaseFields): stri
2727
return array.join('\n');
2828
}
2929

30-
export function parseValuetoSanitizeYamlValue(value: string, localSettings: LocalSettings): string {
31-
return ParseService.parseLiteral(value, InputType.MARKDOWN, localSettings).toString();
30+
export function parseValuetoSanitizeYamlValue(value: string, localSettings: LocalSettings, wrapQuote = false): string {
31+
return ParseService.parseLiteral(value, InputType.MARKDOWN, localSettings, undefined, wrapQuote).toString();
3232
}
3333

3434
function stringifyDbYaml(literal: Literal, level: number, localSettings: LocalSettings, key?: string): string[] {
@@ -58,7 +58,7 @@ function stringifyDbYaml(literal: Literal, level: number, localSettings: LocalSe
5858
else if (key) {
5959
literalBlock.push(`${" ".repeat(level)}${key}: ${ParseService.parseLiteral(literal, InputType.MARKDOWN, localSettings)}`);
6060
} else {
61-
literalBlock.push(`${" ".repeat(level)}- ${ParseService.parseLiteral(literal, InputType.MARKDOWN, { ...localSettings, frontmatter_quote_wrap: true })}`);
61+
literalBlock.push(`${" ".repeat(level)}- ${ParseService.parseLiteral(literal, InputType.MARKDOWN, localSettings, undefined, true)}`);
6262
}
6363
return literalBlock;
6464
}

src/parsers/handlers/unmarshall/UnmarshallColumnsHandler.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ export class UnmarshallColumnsHandler extends AbstractDiskHandler {
3131

3232
// Lvl4: column config
3333
Object.keys(column.config).forEach(key => {
34-
let quoteConfig = config;
35-
if (column.config[key] && typeof column.config[key] === 'string') {
36-
quoteConfig = { ...config, frontmatter_quote_wrap: true };
37-
}
38-
const confValue = parseValuetoSanitizeYamlValue(column.config[key]?.toString(), quoteConfig);
34+
// Wrap quotes if it is a string
35+
const requiredWrap = column.config[key] && typeof column.config[key] === 'string';
36+
const confValue = parseValuetoSanitizeYamlValue(
37+
column.config[key]?.toString(),
38+
config,
39+
requiredWrap
40+
);
3941
this.localDisk.push(`${YAML_INDENT.repeat(3)}${key}: ${confValue}`);
4042
});
4143
};

src/parsers/handlers/unmarshall/UnmarshallConfigHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class UnmarshallConfigHandler extends AbstractDiskHandler {
1919
this.localDisk.push(`${YAML_INDENT.repeat(2)}${key}: ${parseValuetoSanitizeYamlValue(valueInternal as string, config)}`);
2020
});
2121
} else if (typeof valueConfig === "string") {
22-
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: ${parseValuetoSanitizeYamlValue(escapeSpecialCharacters(valueConfig), config)}`);
22+
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: ${parseValuetoSanitizeYamlValue(escapeSpecialCharacters(valueConfig), config, true)}`);
2323
} else {
2424
// Lvl2: config properties
2525
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: ${parseValuetoSanitizeYamlValue(valueConfig, config)}`);

src/services/EditEngineService.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ class EditEngine {
158158

159159
async function persistFrontmatter(deletedColumn?: string): Promise<void> {
160160
await app.fileManager.processFrontMatter(file, (frontmatter) => {
161-
Object.assign(frontmatter, rowFields.frontmatter);
161+
frontmatter[columnId] = ParseService.parseLiteral(
162+
rowFields.frontmatter[columnId],
163+
InputType.MARKDOWN,
164+
ddbbConfig
165+
);
166+
162167
if (deletedColumn) {
163168
delete frontmatter[deletedColumn];
164169
}

0 commit comments

Comments
 (0)