Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/36838-report-form-one-vocabulary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@objectstack/spec': patch
'@objectstack/platform-objects': patch
'@object-ui/app-shell': patch
---

Clause-②: no
Metadata-protocol: none

The report authoring form now names its top-level data rows with the same words as its joined-blocks grid: Data Source, Metrics, Group By and Group Columns By, where they read Dataset, Values, Rows and Columns. One form no longer calls the same setting by two names. The Metrics hint no longer says a metric is only a total or a count; it can be any measure of the data source, such as an average or a ratio. The File Name hint now says what the download does: the prefix takes the place of the report's label, and an empty prefix names the file after the label, or after the report's name when it has no label.

Only prose moved. No key, accepted value, default or section title changed. The platform metadata-form bundles are regenerated, the File Name hint is re-translated in zh-CN, ja-JP and es-ES, and the console's zh-CN overlay now follows the current English for the Date Range and Runtime Filter hints.
Original file line number Diff line number Diff line change
Expand Up @@ -2206,19 +2206,19 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
helpText: "Report type: tabular, summary, matrix or joined."
},
dataset: {
label: "Dataset",
label: "Data Source",
helpText: "The report reads its numbers from here; everyone sees only the records they have access to."
},
values: {
label: "Values",
helpText: "The metrics to total or count (from the data source)."
label: "Metrics",
helpText: "The metrics to show, such as totals, counts, averages or ratios (from the data source)."
},
rows: {
label: "Rows",
label: "Group By",
helpText: "The fields to group by (from the data source)."
},
columns: {
label: "Columns",
label: "Group Columns By",
helpText: "Groups spread across the columns (matrix reports only)."
},
order: {
Expand Down Expand Up @@ -2307,7 +2307,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
"exportOptions.fileNamePrefix": {
label: "File Name",
helpText: "The start of the downloaded file’s name, used instead of the report name."
helpText: "The start of the downloaded file’s name. Left empty, the file is named after the report’s label, or its name when it has no label."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2307,7 +2307,7 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
"exportOptions.fileNamePrefix": {
label: "Nombre de archivo",
helpText: "El inicio del nombre del archivo descargado, en lugar del nombre del informe."
helpText: "El inicio del nombre del archivo descargado. Si se deja vacío, el archivo toma la etiqueta del informe, o su nombre si no tiene etiqueta."
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2307,7 +2307,7 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
"exportOptions.fileNamePrefix": {
label: "ファイル名",
helpText: "ダウンロードするファイル名の先頭部分。レポート名の代わりに使われます。"
helpText: "ダウンロードするファイル名の先頭部分。空欄の場合はレポートの表示名が使われ、表示名がない場合は名前が使われます。"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ const DECISIONS: readonly Decision[] = [
type: 'report',
key: 'dataset',
prop: 'label',
en: 'Dataset',
en: 'Data Source',
verdict: ALL_TRANSLATE,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.dataset'].`,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.dataset']. ⚠️ #36838 renamed this \`en\` label from "Dataset" to "Data Source", the title the blocks grid already gives the same key, so one form names it once. Re-read against the new English: each translated value is still byte-identical to its blocks twin, whose \`en\` is now the same string, so top level and blocks keep reading one word per locale. Those words carry the older dataset vocabulary at both positions; moving them to the business wording is a translator pass over both positions together, not this rename.`,
},
{
type: 'report',
Expand All @@ -100,26 +100,26 @@ const DECISIONS: readonly Decision[] = [
type: 'report',
key: 'values',
prop: 'label',
en: 'Values',
en: 'Metrics',
verdict: ALL_TRANSLATE,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.values'].`,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.values']. ⚠️ #36838 renamed this \`en\` label from "Values" to "Metrics", the title the blocks grid already gives the same key, so one form names it once. Re-read against the new English: each translated value is still byte-identical to its blocks twin, whose \`en\` is now the same string, so top level and blocks keep reading one word per locale. Those words carry the older dataset vocabulary at both positions; moving them to the business wording is a translator pass over both positions together, not this rename.`,
},
{
type: 'report',
key: 'values',
prop: 'helpText',
en: 'The metrics to total or count (from the data source).',
en: 'The metrics to show, such as totals, counts, averages or ratios (from the data source).',
verdict: ALL_TRANSLATE,
reason:
'Prose. Its own sibling order.helpText names the same two vocabularies (rows/columns dimensions, values measures) in authored text in every locale, so the vocabulary existed and this leaf simply never got it. ⚠️ #36447 reworded this `en` source into business terms (from "Measure names (from the dataset) to display"); the zh-CN / ja-JP / es-ES verdicts and values above were taken against the OLD English and were not re-judged.',
'Prose. Its own sibling order.helpText names the same two vocabularies (rows/columns dimensions, values measures) in authored text in every locale, so the vocabulary existed and this leaf simply never got it. ⚠️ #36447 reworded this `en` source into business terms (from "Measure names (from the dataset) to display"); the zh-CN / ja-JP / es-ES verdicts and values above were taken against the OLD English and were not re-judged. ⚠️ #36838 reworded it again (from "The metrics to total or count (from the data source)."), because a measure may be any dataset measure, not only a total or a count. Re-read against that English: the three values say "the measure names to show" and promise no narrower set, so they stay true; their dataset vocabulary is left to a translator pass (ja-JP and es-ES: #36836).',
},
{
type: 'report',
key: 'rows',
prop: 'label',
en: 'Rows',
en: 'Group By',
verdict: ALL_TRANSLATE,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.rows'], and the adjacent top-level columns is authored on the same panel.`,
reason: `${SIBLING_PRECEDENT} Precedent: report.fields['blocks.rows'], and the adjacent top-level columns is authored on the same panel. ⚠️ #36838 renamed this \`en\` label from "Rows" to "Group By", the title the blocks grid already gives the same key, so one form names it once. Re-read against the new English: each translated value is still byte-identical to its blocks twin, whose \`en\` is now the same string, so top level and blocks keep reading one word per locale. Those words carry the older axis vocabulary at both positions; moving them to the business wording is a translator pass over both positions together, not this rename.`,
},
{
type: 'report',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@
// `dataset_binding` description, the `drilldown` hint and the `runtimeFilter`
// hint — and each row says its verdicts were taken against the old English.)
//
// (#36838 gave the top-level `dataset` / `values` / `rows` / `columns` rows the
// blocks grid's titles — Data Source / Metrics / Group By / Group Columns By —
// where they read the humanized keys. Each label leaf already existed, so the
// population, the field leaves and the inward negatives did not move, and none
// of the six decided rows moved. The "Dataset" twin below now points at the
// English the heading was rendered from on the dataset type's own label.)
//
// ## ⚠️⚠️ The phantom-translation trap — and why this family is the SHARP case
//
// `reportForm` declares NO label on `drilldown` and NO label on `runtimeFilter`
Expand Down Expand Up @@ -788,7 +795,13 @@ describe('#19403 round 9 — one schema key, one rendering', () => {
// Round 5's discipline, from the other side: a row that names a twin has to
// be able to point at it.
const en = enMetadataForms as Record<string, any>;
expect(en.report?.fields?.dataset?.label).toBe('Dataset');
// #36838 renamed the report row's English to "Data Source", the blocks
// grid's term; its translated values (asserted below) did not move. The
// English word "Dataset" this heading was rendered from still has an
// authored home with the SAME three renderings: the metadata type's own
// label, asserted below as well.
expect(en.report?.fields?.dataset?.label).toBe('Data Source');
expect(en.dataset?.label).toBe('Dataset');
expect(en.dataset?.sections?.measures?.label).toBe('Measures');
expect(en.dataset?.sections?.dimensions?.label).toBe('Dimensions');
expect(String(en.dataset?.fields?.filter?.helpText)).toContain('ANDed into every query');
Expand Down Expand Up @@ -817,6 +830,7 @@ describe('#19403 round 9 — one schema key, one rendering', () => {
for (const [locale, forms] of TRANSLATED_LOCALES) {
const want = expected[locale];
expect(String(forms.report?.fields?.dataset?.label), `${locale} the Dataset twin moved`).toBe(want.dataset);
expect(String(forms.dataset?.label), `${locale} the dataset type label no longer reads the Dataset twin`).toBe(want.dataset);
expect(String(forms.dataset?.sections?.measures?.label), `${locale} the Measures twin moved`).toBe(want.measures);
expect(String(forms.dataset?.sections?.dimensions?.label), `${locale} the Dimensions twin moved`).toBe(
want.dimensions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2307,7 +2307,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
"exportOptions.fileNamePrefix": {
label: "文件名",
helpText: "下载文件名的开头,用来代替报表名称"
helpText: "下载文件名的开头。留空时以报表的显示名称命名,没有显示名称时用名称"
}
}
},
Expand Down
18 changes: 13 additions & 5 deletions packages/spec/src/ui/report.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ export const reportForm = defineForm({
// A `joined` report carries its data on `blocks` instead.
visibleWhen: "data.type != 'joined'",
fields: [
{ field: 'dataset', widget: 'ref:dataset', helpText: 'The report reads its numbers from here; everyone sees only the records they have access to.' },
{ field: 'values', widget: 'string-tags', helpText: 'The metrics to total or count (from the data source).' },
{ field: 'rows', widget: 'string-tags', helpText: 'The fields to group by (from the data source).' },
// #36838 — the four row titles are the blocks grid's terms below (and
// `JoinedReportBlockSchema`'s `.meta({ title })`), so one form never
// names the same key in two vocabularies. Without a `label` these rows
// read the prettified keys Dataset / Values / Rows / Columns.
{ field: 'dataset', label: 'Data Source', widget: 'ref:dataset', helpText: 'The report reads its numbers from here; everyone sees only the records they have access to.' },
// A measure may be any dataset measure (sum, count, average, ratio, derived).
{ field: 'values', label: 'Metrics', widget: 'string-tags', helpText: 'The metrics to show, such as totals, counts, averages or ratios (from the data source).' },
{ field: 'rows', label: 'Group By', widget: 'string-tags', helpText: 'The fields to group by (from the data source).' },
// CEL visibility — only Matrix reports pivot across a second dimension.
{ field: 'columns', widget: 'string-tags', visibleWhen: "data.type == 'matrix'", helpText: 'Groups spread across the columns (matrix reports only).' },
{ field: 'columns', label: 'Group Columns By', widget: 'string-tags', visibleWhen: "data.type == 'matrix'", helpText: 'Groups spread across the columns (matrix reports only).' },
// #3916 — ordering is authorable here or it is not authorable at all:
// `DatasetSelection.order` has always existed on the wire, but a report
// author had no channel to reach it. Optional — a selected time
Expand Down Expand Up @@ -145,7 +150,10 @@ export const reportForm = defineForm({
fields: [
{ field: 'formats', label: 'Formats', helpText: 'The download formats offered. Left unset, both csv and xlsx are offered; an empty list turns downloads off.' },
{ field: 'includeHeaders', label: 'Include Headers', helpText: 'Put the column names in the first row of the downloaded file.' },
{ field: 'fileNamePrefix', label: 'File Name', helpText: 'The start of the downloaded file’s name, used instead of the report name.' },
// The prefix replaces the report's label, which falls back to its
// name (`buildExportFileName` in @object-ui/core, called by the
// report export control); the date and time follow it.
{ field: 'fileNamePrefix', label: 'File Name', helpText: 'The start of the downloaded file’s name. Left empty, the file is named after the report’s label, or its name when it has no label.' },
],
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,13 @@ export const ZH_CN_SPEC_FORMS: NonNullable<TranslationData['metadataForms']> = {
'blocks.values': { label: '指标' },
'blocks.runtimeFilter': { label: '运行时筛选' },
'blocks.order': { label: '排序' },
runtimeFilter: { label: '运行时筛选', helpText: '渲染时的范围筛选,在查询时以 AND 方式并入' },
// ⟨36373⟩ follows the English (objectstack#36838); the platform's zh-CN row is
// the ledger-pinned rendering of the older render-time / AND sentence.
runtimeFilter: { label: '运行时筛选', helpText: '每次显示报表时都会应用的筛选,叠加在数据来源自身的条件之上' },
chart: { label: '图表', helpText: '图表类型与配置' },
// ⟨36373⟩ dateRange · exportOptions
dateRange: { label: '日期范围', helpText: '默认时间段与自定义范围开关。按数据来源里的一个日期分组筛选;只有一个日期分组时可留空' },
// The date-grouping sentence lives on the `dateRange.dimension` child below (objectstack#36838).
dateRange: { label: '日期范围', helpText: '打开报表时显示的时间段,以及使用者能否自己选择范围' },
exportOptions: { label: '导出选项', helpText: '下载格式(csv、xlsx)与文件名。谁可以下载由数据来源对象上的导出权限决定' },
// The children `report.form.ts` declares for both composites (objectstack#36447),
// copied from the platform zh-CN bundle like every unmarked row here.
Expand All @@ -355,7 +358,7 @@ export const ZH_CN_SPEC_FORMS: NonNullable<TranslationData['metadataForms']> = {
'dateRange.allowCustomRange': { label: '允许自定义范围', helpText: '允许使用者自己选择开始和结束日期' },
'exportOptions.formats': { label: '格式', helpText: '可下载的格式。不设置时提供 csv 与 xlsx;空列表则关闭下载' },
'exportOptions.includeHeaders': { label: '包含表头', helpText: '在下载文件的第一行写入列名' },
'exportOptions.fileNamePrefix': { label: '文件名', helpText: '下载文件名的开头,用来代替报表名称' },
'exportOptions.fileNamePrefix': { label: '文件名', helpText: '下载文件名的开头。留空时以报表的显示名称命名,没有显示名称时用名称' },
},
},

Expand Down
Loading