1 parent
8a385c3348
commit
8b3843dfd8
14 files changed
+252
-37
No files matched your search
@@ -1277,14 +1277,9 @@ let structuredFilterHydrationRequestId = 0;
|
|||||||
const draftStructuredWhereInput = ref("");
|
const draftStructuredWhereInput = ref("");
|
||||||
const filterEditorView = computed(() => settingsStore.editorSettings.dataGridFilterEditorView);
|
const filterEditorView = computed(() => settingsStore.editorSettings.dataGridFilterEditorView);
|
||||||
const isPersistentFilterView = computed(() => filterEditorView.value === "conditions" || filterEditorView.value === "text");
|
const isPersistentFilterView = computed(() => filterEditorView.value === "conditions" || filterEditorView.value === "text");
|
||||||
const isFilterEditorPinnedOpen = computed(() => isPersistentFilterView.value && settingsStore.editorSettings.dataGridKeepFilterEditorExpanded);
|
// Keep the persisted preference as the initial state for persistent views, but
|
||||||
const effectiveFilterBuilderOpen = computed({
|
// do not use it as a lock: the toolbar toggle must always be able to close them.
|
||||||
get: () => isFilterEditorPinnedOpen.value || filterBuilderOpen.value,
|
filterBuilderOpen.value = isPersistentFilterView.value && settingsStore.editorSettings.dataGridKeepFilterEditorExpanded;
|
||||||
set: (open: boolean) => {
|
|
||||||
if (isFilterEditorPinnedOpen.value) return;
|
|
||||||
filterBuilderOpen.value = open;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const structuredFilterCount = computed(() => structuredFilterRules.value.filter((rule) => !rule.disabled && !!rule.columnName && filterModeHasCompleteValue(rule.mode, rule.rawValue, rule.rawEndValue)).length);
|
const structuredFilterCount = computed(() => structuredFilterRules.value.filter((rule) => !rule.disabled && !!rule.columnName && filterModeHasCompleteValue(rule.mode, rule.rawValue, rule.rawEndValue)).length);
|
||||||
const hasStructuredFilters = computed(() => !!combineWhereInputs(undefined, appliedStructuredWhereInput.value));
|
const hasStructuredFilters = computed(() => !!combineWhereInputs(undefined, appliedStructuredWhereInput.value));
|
||||||
interface ForeignKeyDisplayLabelState {
|
interface ForeignKeyDisplayLabelState {
|
||||||
@@ -1652,7 +1647,7 @@ function buildGroupedWhere(conditions: string[], rules: StructuredFilterRule[]):
|
|||||||
|
|
||||||
async function applyStructuredWhere(where: string) {
|
async function applyStructuredWhere(where: string) {
|
||||||
appliedStructuredWhereInput.value = where;
|
appliedStructuredWhereInput.value = where;
|
||||||
if (!isFilterEditorPinnedOpen.value) filterBuilderOpen.value = false;
|
if (filterEditorView.value === "quick") filterBuilderOpen.value = false;
|
||||||
await applyWhereFilter();
|
await applyWhereFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1712,10 +1707,17 @@ function copyFilterSqlPreview() {
|
|||||||
watch([structuredFilterCacheKey, structuredFilterScopeKey], loadStructuredFilterStateForScope, { immediate: true });
|
watch([structuredFilterCacheKey, structuredFilterScopeKey], loadStructuredFilterStateForScope, { immediate: true });
|
||||||
|
|
||||||
watch(filterEditorView, (view) => {
|
watch(filterEditorView, (view) => {
|
||||||
filterBuilderOpen.value = false;
|
filterBuilderOpen.value = (view === "conditions" || view === "text") && settingsStore.editorSettings.dataGridKeepFilterEditorExpanded;
|
||||||
if (view === "conditions" || view === "text") ensureStructuredFilterRule();
|
if (view === "conditions" || view === "text") ensureStructuredFilterRule();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => settingsStore.editorSettings.dataGridKeepFilterEditorExpanded,
|
||||||
|
(expanded) => {
|
||||||
|
if (isPersistentFilterView.value) filterBuilderOpen.value = expanded;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const filterPreviewVisible = computed(() => canUseWhereSearch.value && (filterEditorView.value === "conditions" || filterEditorView.value === "text"));
|
const filterPreviewVisible = computed(() => canUseWhereSearch.value && (filterEditorView.value === "conditions" || filterEditorView.value === "text"));
|
||||||
watch(
|
watch(
|
||||||
[filterPreviewVisible, structuredFilterRules],
|
[filterPreviewVisible, structuredFilterRules],
|
||||||
@@ -12202,7 +12204,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
|
|||||||
<DataGridQueryControls
|
<DataGridQueryControls
|
||||||
v-model:where-input="whereFilterInput"
|
v-model:where-input="whereFilterInput"
|
||||||
v-model:order-by-input="orderByInput"
|
v-model:order-by-input="orderByInput"
|
||||||
v-model:filter-builder-open="effectiveFilterBuilderOpen"
|
v-model:filter-builder-open="filterBuilderOpen"
|
||||||
:filter-editor-view="filterEditorView"
|
:filter-editor-view="filterEditorView"
|
||||||
:columns="props.tableMeta?.columns.map((column) => column.name) ?? props.result.columns"
|
:columns="props.tableMeta?.columns.map((column) => column.name) ?? props.result.columns"
|
||||||
:condition-columns="conditionColumns"
|
:condition-columns="conditionColumns"
|
||||||
@@ -12372,7 +12374,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
|
|||||||
</DataGridToolbar>
|
</DataGridToolbar>
|
||||||
</div>
|
</div>
|
||||||
<DataGridFilterWorkbench
|
<DataGridFilterWorkbench
|
||||||
v-if="canUseWhereSearch && filterEditorView === 'conditions' && effectiveFilterBuilderOpen"
|
v-if="canUseWhereSearch && filterEditorView === 'conditions' && filterBuilderOpen"
|
||||||
:sql-preview="filterSqlPreview"
|
:sql-preview="filterSqlPreview"
|
||||||
:rules="structuredFilterRules"
|
:rules="structuredFilterRules"
|
||||||
:columns="filterBuilderColumnOptions"
|
:columns="filterBuilderColumnOptions"
|
||||||
@@ -12394,7 +12396,7 @@ useUpdateBlocker(() => (hasPendingChanges.value || hasPendingDataEditorDraft.val
|
|||||||
@update-rule="updateStructuredFilterRule"
|
@update-rule="updateStructuredFilterRule"
|
||||||
/>
|
/>
|
||||||
<DataGridTextFilterWorkbench
|
<DataGridTextFilterWorkbench
|
||||||
v-if="canUseWhereSearch && filterEditorView === 'text' && effectiveFilterBuilderOpen"
|
v-if="canUseWhereSearch && filterEditorView === 'text' && filterBuilderOpen"
|
||||||
:height="settingsStore.editorSettings.dataGridTextFilterPanelHeight"
|
:height="settingsStore.editorSettings.dataGridTextFilterPanelHeight"
|
||||||
:sql-preview="filterSqlPreview"
|
:sql-preview="filterSqlPreview"
|
||||||
:rules="structuredFilterRules"
|
:rules="structuredFilterRules"
|
||||||
|
|||||||
+205
@@ -0,0 +1,205 @@
|
|||||||
|
// @vitest-environment happy-dom
|
||||||
|
|
||||||
|
import { createApp, defineComponent, h, markRaw, nextTick, type App, type PropType } from "vue";
|
||||||
|
import { createPinia, setActivePinia } from "pinia";
|
||||||
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import i18n from "@/i18n";
|
||||||
|
import type { DataGridFilterEditorView } from "@/stores/settingsStore";
|
||||||
|
import type { QueryResult } from "@/types/database";
|
||||||
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||||
|
import { clearDataGridStructuredFilterStates } from "@/lib/dataGrid/dataGridFilterBuilderPersistence";
|
||||||
|
|
||||||
|
const backendMocks = vi.hoisted(() => ({
|
||||||
|
buildTableSelectSql: vi.fn(async ({ tableName, whereInput }: { tableName: string; whereInput?: string }) => `SELECT * FROM ${tableName}${whereInput ? ` WHERE ${whereInput}` : ""}`),
|
||||||
|
loadEditorSettings: vi.fn().mockResolvedValue({}),
|
||||||
|
saveEditorSettings: vi.fn().mockResolvedValue(undefined),
|
||||||
|
}));
|
||||||
|
|
||||||
|
vi.mock("@/lib/backend/api", async (importOriginal) => {
|
||||||
|
const actual = await importOriginal<typeof import("@/lib/backend/api")>();
|
||||||
|
return {
|
||||||
|
...actual,
|
||||||
|
buildTableSelectSql: backendMocks.buildTableSelectSql,
|
||||||
|
loadEditorSettings: backendMocks.loadEditorSettings,
|
||||||
|
saveEditorSettings: backendMocks.saveEditorSettings,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.mock("vue-virtual-scroller", async () => {
|
||||||
|
const { defineComponent, h } = await import("vue");
|
||||||
|
return {
|
||||||
|
RecycleScroller: defineComponent({
|
||||||
|
props: {
|
||||||
|
items: {
|
||||||
|
type: Array as PropType<unknown[]>,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
setup(props, { attrs, slots }) {
|
||||||
|
return () =>
|
||||||
|
h(
|
||||||
|
"div",
|
||||||
|
attrs,
|
||||||
|
props.items.map((item) => slots.default?.({ item })),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.mock("@/composables/useDataGridColumnResize", async (importOriginal) => {
|
||||||
|
const actual = await importOriginal<typeof import("@/composables/useDataGridColumnResize")>();
|
||||||
|
const { ref } = await import("vue");
|
||||||
|
return {
|
||||||
|
...actual,
|
||||||
|
useDataGridColumnResize: () => ({
|
||||||
|
initColumnWidths: vi.fn(),
|
||||||
|
onResizeStart: vi.fn(),
|
||||||
|
autoFitColumn: vi.fn(),
|
||||||
|
renderedColumnWidths: ref([120]),
|
||||||
|
totalWidth: ref(120),
|
||||||
|
columnVars: ref({ "--total-w": "120px" }),
|
||||||
|
getIsResizing: () => false,
|
||||||
|
}),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
import DataGrid from "../DataGrid.vue";
|
||||||
|
import { useSettingsStore } from "@/stores/settingsStore";
|
||||||
|
|
||||||
|
const mountedApps: Array<{ app: App; host: HTMLElement }> = [];
|
||||||
|
|
||||||
|
function panelSelector(view: DataGridFilterEditorView): string {
|
||||||
|
return view === "conditions" ? "[data-grid-filter-workbench]" : "[data-grid-text-filter-workbench]";
|
||||||
|
}
|
||||||
|
|
||||||
|
function filterToggle(host: HTMLElement): HTMLButtonElement {
|
||||||
|
const toggle = host.querySelector<HTMLButtonElement>('button[aria-label="Filter"][aria-expanded]');
|
||||||
|
if (!toggle) throw new Error("Filter editor toggle not found");
|
||||||
|
return toggle;
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyButton(host: HTMLElement, view: DataGridFilterEditorView): HTMLButtonElement {
|
||||||
|
const panel = host.querySelector(panelSelector(view));
|
||||||
|
const button = [...(panel?.querySelectorAll<HTMLButtonElement>("button") ?? [])].find((candidate) => candidate.textContent?.trim() === "Apply Filter");
|
||||||
|
if (!button) throw new Error("Filter editor apply button not found");
|
||||||
|
return button;
|
||||||
|
}
|
||||||
|
|
||||||
|
function mountGrid(view: DataGridFilterEditorView, keepExpanded: boolean) {
|
||||||
|
const pinia = createPinia();
|
||||||
|
setActivePinia(pinia);
|
||||||
|
const settingsStore = useSettingsStore();
|
||||||
|
settingsStore.updateEditorSettings({
|
||||||
|
dataGridRenderMode: "canvas",
|
||||||
|
dataGridFilterEditorView: view,
|
||||||
|
dataGridKeepFilterEditorExpanded: keepExpanded,
|
||||||
|
});
|
||||||
|
const result = markRaw<QueryResult>({
|
||||||
|
columns: ["id"],
|
||||||
|
rows: [[1]],
|
||||||
|
affected_rows: 0,
|
||||||
|
execution_time_ms: 0,
|
||||||
|
});
|
||||||
|
const onExecuteSql = vi.fn().mockResolvedValue(undefined);
|
||||||
|
const host = document.createElement("div");
|
||||||
|
document.body.append(host);
|
||||||
|
const Root = defineComponent({
|
||||||
|
setup() {
|
||||||
|
return () =>
|
||||||
|
h(
|
||||||
|
TooltipProvider,
|
||||||
|
{ delayDuration: 0 },
|
||||||
|
{
|
||||||
|
default: () =>
|
||||||
|
h(DataGrid, {
|
||||||
|
result,
|
||||||
|
databaseType: "mysql",
|
||||||
|
context: "table-data",
|
||||||
|
tableMeta: {
|
||||||
|
tableName: "items",
|
||||||
|
columns: [{ name: "id", data_type: "int" }],
|
||||||
|
primaryKeys: ["id"],
|
||||||
|
},
|
||||||
|
onExecuteSql,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const app = createApp(Root);
|
||||||
|
app.use(pinia);
|
||||||
|
app.use(i18n);
|
||||||
|
app.mount(host);
|
||||||
|
mountedApps.push({ app, host });
|
||||||
|
return { host, onExecuteSql };
|
||||||
|
}
|
||||||
|
|
||||||
|
async function settle() {
|
||||||
|
await nextTick();
|
||||||
|
await Promise.resolve();
|
||||||
|
await nextTick();
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
for (const { app, host } of mountedApps.splice(0)) {
|
||||||
|
app.unmount();
|
||||||
|
host.remove();
|
||||||
|
}
|
||||||
|
clearDataGridStructuredFilterStates();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe.each(["conditions", "text"] as const)("DataGrid %s filter editor state", (view) => {
|
||||||
|
it("keeps a manually opened editor open after apply and still allows manual close", async () => {
|
||||||
|
const { host, onExecuteSql } = mountGrid(view, false);
|
||||||
|
await settle();
|
||||||
|
|
||||||
|
expect(host.querySelector(panelSelector(view))).toBeNull();
|
||||||
|
filterToggle(host).click();
|
||||||
|
await settle();
|
||||||
|
expect(host.querySelector(panelSelector(view))).not.toBeNull();
|
||||||
|
|
||||||
|
applyButton(host, view).click();
|
||||||
|
await vi.waitFor(() => expect(onExecuteSql).toHaveBeenCalledOnce());
|
||||||
|
expect(host.querySelector(panelSelector(view))).not.toBeNull();
|
||||||
|
|
||||||
|
filterToggle(host).click();
|
||||||
|
await settle();
|
||||||
|
expect(host.querySelector(panelSelector(view))).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("uses the persisted expansion preference only as the initial state", async () => {
|
||||||
|
const { host } = mountGrid(view, true);
|
||||||
|
await settle();
|
||||||
|
|
||||||
|
expect(host.querySelector(panelSelector(view))).not.toBeNull();
|
||||||
|
expect(filterToggle(host).getAttribute("aria-expanded")).toBe("true");
|
||||||
|
|
||||||
|
filterToggle(host).click();
|
||||||
|
await settle();
|
||||||
|
expect(host.querySelector(panelSelector(view))).toBeNull();
|
||||||
|
|
||||||
|
filterToggle(host).click();
|
||||||
|
await settle();
|
||||||
|
expect(host.querySelector(panelSelector(view))).not.toBeNull();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("DataGrid quick filter editor state", () => {
|
||||||
|
it("continues to close its popover after apply", async () => {
|
||||||
|
const { host, onExecuteSql } = mountGrid("quick", true);
|
||||||
|
await settle();
|
||||||
|
|
||||||
|
const toggle = filterToggle(host);
|
||||||
|
expect(toggle.getAttribute("aria-expanded")).toBe("false");
|
||||||
|
toggle.click();
|
||||||
|
await settle();
|
||||||
|
expect(toggle.getAttribute("aria-expanded")).toBe("true");
|
||||||
|
|
||||||
|
const apply = [...document.querySelectorAll<HTMLButtonElement>("button")].find((candidate) => candidate.textContent?.trim() === "Apply Filter");
|
||||||
|
if (!apply) throw new Error("Quick filter apply button not found");
|
||||||
|
apply.click();
|
||||||
|
await vi.waitFor(() => expect(onExecuteSql).toHaveBeenCalledOnce());
|
||||||
|
expect(toggle.getAttribute("aria-expanded")).toBe("false");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -7979,8 +7979,8 @@ export default {
|
|||||||
dataGridToolbarLayoutSingle: "Single row (original layout)",
|
dataGridToolbarLayoutSingle: "Single row (original layout)",
|
||||||
dataGridFilterView: "Table filter view",
|
dataGridFilterView: "Table filter view",
|
||||||
dataGridFilterViewDescription: "Use a filter popover, a fixed conditions panel, or a compact text conditions panel.",
|
dataGridFilterViewDescription: "Use a filter popover, a fixed conditions panel, or a compact text conditions panel.",
|
||||||
dataGridKeepFilterEditorExpanded: "Keep filter editor expanded",
|
dataGridKeepFilterEditorExpanded: "Expand filter editor by default",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Always keep the editor expanded in Conditions and Text views.",
|
dataGridKeepFilterEditorExpandedDescription: "Open the editor initially in Conditions and Text views. You can still collapse it manually.",
|
||||||
dataGridFilterViewPreview: "Effect preview",
|
dataGridFilterViewPreview: "Effect preview",
|
||||||
dataGridFilterViewPreviewExpand: "Expand effect preview",
|
dataGridFilterViewPreviewExpand: "Expand effect preview",
|
||||||
dataGridFilterViewPreviewCollapse: "Collapse effect preview",
|
dataGridFilterViewPreviewCollapse: "Collapse effect preview",
|
||||||
|
|||||||
@@ -8307,8 +8307,8 @@ export default withEnglishFallback({
|
|||||||
customUiBorder: "Borde",
|
customUiBorder: "Borde",
|
||||||
customUiSidebar: "Barra lateral",
|
customUiSidebar: "Barra lateral",
|
||||||
shortcutConvertNamingStyle: "Cambiar estilo de nomenclatura",
|
shortcutConvertNamingStyle: "Cambiar estilo de nomenclatura",
|
||||||
dataGridKeepFilterEditorExpanded: "Mantener expandido el editor de filtros",
|
dataGridKeepFilterEditorExpanded: "Expandir el editor de filtros de forma predeterminada",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Mantiene siempre expandido el editor en las vistas Condiciones y Texto.",
|
dataGridKeepFilterEditorExpandedDescription: "Abre inicialmente el editor en las vistas Condiciones y Texto; aún puedes contraerlo manualmente.",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "Guardando...",
|
mcpQueryTimeoutSaveStatus_saving: "Guardando...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "Guardado",
|
mcpQueryTimeoutSaveStatus_saved: "Guardado",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "Error al guardar",
|
mcpQueryTimeoutSaveStatus_failed: "Error al guardar",
|
||||||
|
|||||||
@@ -8232,8 +8232,8 @@ export default withEnglishFallback({
|
|||||||
customUiBorder: "Bordo",
|
customUiBorder: "Bordo",
|
||||||
customUiSidebar: "Barra laterale",
|
customUiSidebar: "Barra laterale",
|
||||||
shortcutConvertNamingStyle: "Cambia stile di denominazione",
|
shortcutConvertNamingStyle: "Cambia stile di denominazione",
|
||||||
dataGridKeepFilterEditorExpanded: "Mantieni espanso l'editor dei filtri",
|
dataGridKeepFilterEditorExpanded: "Espandi l'editor dei filtri per impostazione predefinita",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Mantiene sempre espanso l'editor nelle viste Condizioni e Testo.",
|
dataGridKeepFilterEditorExpandedDescription: "Apre inizialmente l'editor nelle viste Condizioni e Testo; puoi comunque comprimerlo manualmente.",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "Salvataggio in corso...",
|
mcpQueryTimeoutSaveStatus_saving: "Salvataggio in corso...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "Salvato",
|
mcpQueryTimeoutSaveStatus_saved: "Salvato",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "Salvataggio non riuscito",
|
mcpQueryTimeoutSaveStatus_failed: "Salvataggio non riuscito",
|
||||||
|
|||||||
@@ -8281,8 +8281,8 @@ export default withEnglishFallback({
|
|||||||
customUiBorder: "枠線",
|
customUiBorder: "枠線",
|
||||||
customUiSidebar: "サイドバー",
|
customUiSidebar: "サイドバー",
|
||||||
shortcutConvertNamingStyle: "命名スタイルの切り替え",
|
shortcutConvertNamingStyle: "命名スタイルの切り替え",
|
||||||
dataGridKeepFilterEditorExpanded: "フィルターエディターを常に展開する",
|
dataGridKeepFilterEditorExpanded: "フィルターエディターを既定で展開",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "条件ビューとテキストビューでエディターを常に展開します。",
|
dataGridKeepFilterEditorExpandedDescription: "条件ビューとテキストビューでエディターを初期表示時に展開します。手動で折りたたむこともできます。",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "保存中...",
|
mcpQueryTimeoutSaveStatus_saving: "保存中...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "保存済み",
|
mcpQueryTimeoutSaveStatus_saved: "保存済み",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "保存失敗",
|
mcpQueryTimeoutSaveStatus_failed: "保存失敗",
|
||||||
|
|||||||
@@ -7984,8 +7984,8 @@ export default withEnglishFallback({
|
|||||||
csvQuoteModeAll: "모든 필드",
|
csvQuoteModeAll: "모든 필드",
|
||||||
csvQuoteModeNecessary: "필수 필드만",
|
csvQuoteModeNecessary: "필수 필드만",
|
||||||
shortcutConvertNamingStyle: "네이밍 스타일 전환",
|
shortcutConvertNamingStyle: "네이밍 스타일 전환",
|
||||||
dataGridKeepFilterEditorExpanded: "필터 편집기 항상 펼치기",
|
dataGridKeepFilterEditorExpanded: "필터 편집기 기본 펼치기",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "조건 및 텍스트 보기에서 편집기를 항상 펼칩니다.",
|
dataGridKeepFilterEditorExpandedDescription: "조건 및 텍스트 보기에서 편집기를 처음에 펼칩니다. 수동으로 접을 수도 있습니다.",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "저장 중...",
|
mcpQueryTimeoutSaveStatus_saving: "저장 중...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "저장됨",
|
mcpQueryTimeoutSaveStatus_saved: "저장됨",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "저장 실패",
|
mcpQueryTimeoutSaveStatus_failed: "저장 실패",
|
||||||
|
|||||||
@@ -8233,8 +8233,8 @@ export default withEnglishFallback({
|
|||||||
customUiBorder: "Borda",
|
customUiBorder: "Borda",
|
||||||
customUiSidebar: "Barra lateral",
|
customUiSidebar: "Barra lateral",
|
||||||
shortcutConvertNamingStyle: "Alternar estilo de nomenclatura",
|
shortcutConvertNamingStyle: "Alternar estilo de nomenclatura",
|
||||||
dataGridKeepFilterEditorExpanded: "Manter o editor de filtros expandido",
|
dataGridKeepFilterEditorExpanded: "Expandir editor de filtros por padrão",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Mantém o editor sempre expandido nas visualizações Condições e Texto.",
|
dataGridKeepFilterEditorExpandedDescription: "Abre inicialmente o editor nas visualizações Condições e Texto; ainda é possível recolhê-lo manualmente.",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "Salvando...",
|
mcpQueryTimeoutSaveStatus_saving: "Salvando...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "Salvo",
|
mcpQueryTimeoutSaveStatus_saved: "Salvo",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "Falha ao salvar",
|
mcpQueryTimeoutSaveStatus_failed: "Falha ao salvar",
|
||||||
|
|||||||
@@ -8513,8 +8513,8 @@ export default withEnglishFallback({
|
|||||||
dataGridToolbarLayoutSingle: "Одна строка (исходный макет)",
|
dataGridToolbarLayoutSingle: "Одна строка (исходный макет)",
|
||||||
dataGridFilterView: "Вид фильтра таблицы",
|
dataGridFilterView: "Вид фильтра таблицы",
|
||||||
dataGridFilterViewDescription: "Используйте всплывающее окно фильтра, фиксированную панель условий или компактную текстовую панель условий.",
|
dataGridFilterViewDescription: "Используйте всплывающее окно фильтра, фиксированную панель условий или компактную текстовую панель условий.",
|
||||||
dataGridKeepFilterEditorExpanded: "Держать редактор фильтра развёрнутым",
|
dataGridKeepFilterEditorExpanded: "Разворачивать редактор фильтра по умолчанию",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Всегда держать редактор развёрнутым в видах «Условия» и «Текст».",
|
dataGridKeepFilterEditorExpandedDescription: "Изначально разворачивает редактор в режимах «Условия» и «Текст»; его по-прежнему можно свернуть вручную.",
|
||||||
dataGridFilterViewPreview: "Предпросмотр результата",
|
dataGridFilterViewPreview: "Предпросмотр результата",
|
||||||
dataGridFilterViewPreviewExpand: "Развернуть предпросмотр",
|
dataGridFilterViewPreviewExpand: "Развернуть предпросмотр",
|
||||||
dataGridFilterViewPreviewCollapse: "Свернуть предпросмотр",
|
dataGridFilterViewPreviewCollapse: "Свернуть предпросмотр",
|
||||||
|
|||||||
@@ -7209,8 +7209,8 @@ export default withEnglishFallback({
|
|||||||
dataGridDisplay: "Veri tablosu görünümü",
|
dataGridDisplay: "Veri tablosu görünümü",
|
||||||
dataGridFilterView: "Tablo filtresi görünümü",
|
dataGridFilterView: "Tablo filtresi görünümü",
|
||||||
dataGridFilterViewDescription: "Filtre açılır penceresi, sabit koşullar paneli ya da sıkışık metin koşulları paneli kullanın.",
|
dataGridFilterViewDescription: "Filtre açılır penceresi, sabit koşullar paneli ya da sıkışık metin koşulları paneli kullanın.",
|
||||||
dataGridKeepFilterEditorExpanded: "Filtre düzenleyicisini açık tut",
|
dataGridKeepFilterEditorExpanded: "Filtre düzenleyicisini varsayılan olarak aç",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "Koşullar ve Metin görünümlerinde düzenleyiciyi her zaman açık tutar.",
|
dataGridKeepFilterEditorExpandedDescription: "Koşullar ve Metin görünümlerinde düzenleyiciyi başlangıçta açar; yine de elle kapatabilirsiniz.",
|
||||||
dataGridFilterViewPreview: "Etki önizlemesi",
|
dataGridFilterViewPreview: "Etki önizlemesi",
|
||||||
dataGridFilterViewPreviewExpand: "Etki önizlemesini genişlet",
|
dataGridFilterViewPreviewExpand: "Etki önizlemesini genişlet",
|
||||||
dataGridFilterViewPreviewCollapse: "Etki önizlemesini daralt",
|
dataGridFilterViewPreviewCollapse: "Etki önizlemesini daralt",
|
||||||
|
|||||||
@@ -7951,8 +7951,8 @@ export default withEnglishFallback({
|
|||||||
dataGridToolbarLayoutSingle: "单行显示(原布局)",
|
dataGridToolbarLayoutSingle: "单行显示(原布局)",
|
||||||
dataGridFilterView: "表格筛选视图",
|
dataGridFilterView: "表格筛选视图",
|
||||||
dataGridFilterViewDescription: "选择弹出式快捷筛选、固定条件面板或紧凑文本条件面板。",
|
dataGridFilterViewDescription: "选择弹出式快捷筛选、固定条件面板或紧凑文本条件面板。",
|
||||||
dataGridKeepFilterEditorExpanded: "筛选编辑器常驻展开",
|
dataGridKeepFilterEditorExpanded: "默认展开筛选编辑器",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "始终在条件视图和文本视图中展开编辑器。",
|
dataGridKeepFilterEditorExpandedDescription: "在条件视图和文本视图中初始展开编辑器;仍可手动折叠。",
|
||||||
dataGridFilterViewPreview: "效果预览",
|
dataGridFilterViewPreview: "效果预览",
|
||||||
dataGridFilterViewPreviewExpand: "展开效果预览",
|
dataGridFilterViewPreviewExpand: "展开效果预览",
|
||||||
dataGridFilterViewPreviewCollapse: "收起效果预览",
|
dataGridFilterViewPreviewCollapse: "收起效果预览",
|
||||||
|
|||||||
@@ -7558,8 +7558,8 @@ export default withEnglishFallback({
|
|||||||
customUiBorder: "邊框",
|
customUiBorder: "邊框",
|
||||||
customUiSidebar: "側邊欄",
|
customUiSidebar: "側邊欄",
|
||||||
shortcutConvertNamingStyle: "切換命名風格",
|
shortcutConvertNamingStyle: "切換命名風格",
|
||||||
dataGridKeepFilterEditorExpanded: "篩選編輯器常駐展開",
|
dataGridKeepFilterEditorExpanded: "預設展開篩選編輯器",
|
||||||
dataGridKeepFilterEditorExpandedDescription: "始終在條件檢視和文字檢視中展開編輯器。",
|
dataGridKeepFilterEditorExpandedDescription: "在條件檢視和文字檢視中初始展開編輯器;仍可手動收合。",
|
||||||
mcpQueryTimeoutSaveStatus_saving: "儲存中...",
|
mcpQueryTimeoutSaveStatus_saving: "儲存中...",
|
||||||
mcpQueryTimeoutSaveStatus_saved: "已儲存",
|
mcpQueryTimeoutSaveStatus_saved: "已儲存",
|
||||||
mcpQueryTimeoutSaveStatus_failed: "儲存失敗",
|
mcpQueryTimeoutSaveStatus_failed: "儲存失敗",
|
||||||
|
|||||||
+9
-2
@@ -59,7 +59,7 @@ describe("normalizeEditorSettings", () => {
|
|||||||
expect(normalizeEditorSettings({ dataGridToolbarLayout: "invalid" } as any).dataGridToolbarLayout).toBe("single");
|
expect(normalizeEditorSettings({ dataGridToolbarLayout: "invalid" } as any).dataGridToolbarLayout).toBe("single");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("keeps filter editor expansion disabled unless explicitly enabled", () => {
|
it("keeps initial filter editor expansion disabled unless explicitly enabled", () => {
|
||||||
expect(normalizeEditorSettings({}).dataGridKeepFilterEditorExpanded).toBe(false);
|
expect(normalizeEditorSettings({}).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: true }).dataGridKeepFilterEditorExpanded).toBe(true);
|
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: true }).dataGridKeepFilterEditorExpanded).toBe(true);
|
||||||
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: false }).dataGridKeepFilterEditorExpanded).toBe(false);
|
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: false }).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
@@ -68,10 +68,17 @@ describe("normalizeEditorSettings", () => {
|
|||||||
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: "true", dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: "true", dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("migrates the legacy auto-hide preference when the current preference is absent", () => {
|
it("normalizes the legacy auto-hide preference into the initial expansion preference", () => {
|
||||||
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(true);
|
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(true);
|
||||||
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: true } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: true } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: false, dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: false, dataGridAutoHideFilterBuilder: false } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
|
expect(normalizeEditorSettings({ dataGridKeepFilterEditorExpanded: true, dataGridAutoHideFilterBuilder: true } as any).dataGridKeepFilterEditorExpanded).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("ignores malformed legacy auto-hide values during expansion normalization", () => {
|
||||||
|
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: "false" } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
|
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: 0 } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
|
expect(normalizeEditorSettings({ dataGridAutoHideFilterBuilder: null } as any).dataGridKeepFilterEditorExpanded).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("normalizes persisted tab group names and colors", () => {
|
it("normalizes persisted tab group names and colors", () => {
|
||||||
|
|||||||
@@ -884,6 +884,7 @@ export interface EditorSettings {
|
|||||||
dataGridQuickEntry: boolean;
|
dataGridQuickEntry: boolean;
|
||||||
dataGridFilterEditorView: DataGridFilterEditorView;
|
dataGridFilterEditorView: DataGridFilterEditorView;
|
||||||
dataGridToolbarLayout: DataGridToolbarLayout;
|
dataGridToolbarLayout: DataGridToolbarLayout;
|
||||||
|
/** Opens Conditions/Text filter editors initially; users can still collapse them. */
|
||||||
dataGridKeepFilterEditorExpanded: boolean;
|
dataGridKeepFilterEditorExpanded: boolean;
|
||||||
dataGridTextFilterPanelHeight: number;
|
dataGridTextFilterPanelHeight: number;
|
||||||
localFilterPopoverWidth: number;
|
localFilterPopoverWidth: number;
|
||||||
@@ -1875,8 +1876,8 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud snapshots are applied as partial settings updates rather than loaded
|
* Cloud snapshots are applied as partial settings updates rather than loaded
|
||||||
* through `normalizeEditorSettings`. Translate the removed inverse flag here
|
* through `normalizeEditorSettings`. Translate the removed inverse flag into
|
||||||
* so older snapshots retain their behavior on every incremental update path.
|
* the current initial-expansion preference on every incremental update path.
|
||||||
*/
|
*/
|
||||||
function migrateLegacyFilterEditorExpansionPatch(partial: Partial<EditorSettings>): Partial<EditorSettings> {
|
function migrateLegacyFilterEditorExpansionPatch(partial: Partial<EditorSettings>): Partial<EditorSettings> {
|
||||||
const patch = partial as Partial<EditorSettings> & { dataGridAutoHideFilterBuilder?: unknown };
|
const patch = partial as Partial<EditorSettings> & { dataGridAutoHideFilterBuilder?: unknown };
|
||||||
|
|||||||
Reference in new issue
Block a user