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
22 changes: 22 additions & 0 deletions .changeset/6759-gantt-unusable-date-range.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@object-ui/plugin-timeline': patch
'@object-ui/i18n': patch
---

fix(plugin-timeline): refuse an unusable gantt date range with a diagnostic that names the offending value

A gantt whose date range cannot be used now renders a `role="alert"` diagnostic
naming the value that made it unusable, instead of crashing or drawing a chart
that is confidently wrong. Two input classes, which failed in opposite
directions:

- A date that does not parse threw `RangeError: Invalid time value` mid-render —
the same crash site objectui#6750 guarded for the empty list, on a different
input. This covers a malformed value (`startDate: 'not-a-date'`), an absent
one, and an unparseable `minDate` / `maxDate` pinned on the schema.
- An inverted pinned range (`minDate` after `maxDate`) drew a bar at
`left: 157.9%; width: -4.3%` under a header row with zero cells, with no
error and no diagnostic.

Valid gantts, the empty-list sentinel from objectui#6750 and the degenerate
`minDate === maxDate` axis are unchanged.
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ const ar = {
},
gantt: {
rowLabel: "العناصر",
unusableRange: {
malformedDate:
"نطاق تواريخ جانت غير صالح للاستخدام — {{path}} يساوي {{value}}، وهو ليس تاريخًا صالحًا. يجب أن تكون كل تواريخ جانت قابلة للتحليل: startDate و endDate لكل عنصر صف، بالإضافة إلى أي minDate / maxDate مثبّت في المخطط.",
inverted:
"نطاق تواريخ جانت غير صالح للاستخدام — minDate {{minDate}} يقع بعد maxDate {{maxDate}}. يتجاوز minDate / maxDate المثبّت النطاق المحسوب من الصفوف، لذلك لا يحتوي هذا المحور على أي أعمدة ولا يمكن وضع أي شريط عليه؛ بدّل القيمتين.",
},
},
unsupported: {
objectBoundGantt: "النوع \"gantt\" غير مدعوم — المخطط الزمني المرتبط بكائن يعرض أنواع التغذية ({{variants}}). يحتاج مخطط جانت إلى صفوف صريحة، لكل منها عناصر items متداخلة خاصة به، لذلك لا يؤثر محور جانت (scale) هنا.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ const de = {
},
gantt: {
rowLabel: "Elemente",
unusableRange: {
malformedDate:
"Unbrauchbarer Gantt-Datumsbereich — {{path}} ist {{value}} und damit kein gültiges Datum. Jedes Gantt-Datum muss parsebar sein: startDate und endDate jedes Zeilenelements sowie ein am Schema gesetztes minDate / maxDate.",
inverted:
"Unbrauchbarer Gantt-Datumsbereich — minDate {{minDate}} liegt nach maxDate {{maxDate}}. Ein gesetztes minDate / maxDate überschreibt den aus den Zeilen berechneten Bereich, daher hat diese Achse keine Spalten und es kann kein Balken platziert werden; vertauschen Sie die beiden Werte.",
},
},
unsupported: {
objectBoundGantt: "Nicht unterstützte Variante „gantt“ — eine objektgebundene Timeline rendert die Feed-Varianten ({{variants}}). Gantt benötigt literale Zeilen mit jeweils eigenen verschachtelten items; die Gantt-Achse (scale) hat hier daher keine Wirkung.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,12 @@ const en = {
},
gantt: {
rowLabel: 'Items',
unusableRange: {
malformedDate:
'Unusable gantt date range — {{path}} is {{value}}, which is not a valid date. Every gantt date has to parse: the startDate and endDate on every row item, plus any minDate / maxDate pinned on the schema.',
inverted:
'Unusable gantt date range — minDate {{minDate}} is after maxDate {{maxDate}}. A pinned minDate / maxDate overrides the range computed from the rows, so this axis has no columns and no bar can be placed on it; swap the two values.',
},
},
unsupported: {
objectBoundGantt: 'Unsupported variant "gantt" — an object-bound timeline renders the feed variants ({{variants}}). Gantt needs literal rows, each with its own nested items, so the gantt axis (scale) has no effect here.',
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ const es = {
},
gantt: {
rowLabel: "Elementos",
unusableRange: {
malformedDate:
"Rango de fechas del gantt inutilizable: {{path}} es {{value}}, que no es una fecha válida. Todas las fechas del gantt deben poder analizarse: startDate y endDate de cada elemento de fila, además de cualquier minDate / maxDate fijado en el esquema.",
inverted:
"Rango de fechas del gantt inutilizable: minDate {{minDate}} es posterior a maxDate {{maxDate}}. Un minDate / maxDate fijado prevalece sobre el rango calculado a partir de las filas, por lo que este eje no tiene columnas y no se puede colocar ninguna barra; intercambie los dos valores.",
},
},
unsupported: {
objectBoundGantt: "Variante \"gantt\" no admitida: una línea de tiempo vinculada a un objeto representa las variantes de feed ({{variants}}). Gantt necesita filas literales, cada una con sus propios items anidados, por lo que el eje gantt (scale) no tiene efecto aquí.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ const fr = {
},
gantt: {
rowLabel: "Éléments",
unusableRange: {
malformedDate:
"Plage de dates du gantt inutilisable — {{path}} vaut {{value}}, ce qui n'est pas une date valide. Toutes les dates du gantt doivent être analysables : startDate et endDate de chaque élément de ligne, ainsi que tout minDate / maxDate fixé sur le schéma.",
inverted:
"Plage de dates du gantt inutilisable — minDate {{minDate}} est postérieur à maxDate {{maxDate}}. Un minDate / maxDate fixé l'emporte sur la plage calculée à partir des lignes ; cet axe n'a donc aucune colonne et aucune barre ne peut y être placée. Intervertissez les deux valeurs.",
},
},
unsupported: {
objectBoundGantt: "Variante « gantt » non prise en charge — une timeline liée à un objet affiche les variantes de flux ({{variants}}). Gantt nécessite des lignes littérales, chacune avec ses propres items imbriqués ; l'axe gantt (scale) est donc sans effet ici.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ const ja = {
},
gantt: {
rowLabel: "項目",
unusableRange: {
malformedDate:
"ガントの日付範囲が使用できません — {{path}} が {{value}} で、有効な日付として解析できません。ガントのすべての日付は解析可能である必要があります: 各行アイテムの startDate と endDate、およびスキーマで固定した minDate / maxDate。",
inverted:
"ガントの日付範囲が使用できません — minDate {{minDate}} が maxDate {{maxDate}} より後です。固定した minDate / maxDate は行から計算した範囲より優先されるため、この軸には列がなくバーを配置できません。2 つの値を入れ替えてください。",
},
},
unsupported: {
objectBoundGantt: "サポートされていないバリアント \"gantt\" — オブジェクト連動のタイムラインはフィードバリアント({{variants}})を描画します。ガントには、それぞれが入れ子の items を持つリテラル行が必要なため、ここではガント軸(scale)は効果がありません。",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,12 @@ const ko = {
},
gantt: {
rowLabel: "항목",
unusableRange: {
malformedDate:
"사용할 수 없는 간트 날짜 범위 — {{path}}은(는) {{value}}이며 유효한 날짜가 아닙니다. 모든 간트 날짜는 파싱할 수 있어야 합니다: 각 행 항목의 startDate와 endDate, 그리고 스키마에 고정한 minDate / maxDate.",
inverted:
"사용할 수 없는 간트 날짜 범위 — minDate {{minDate}}이(가) maxDate {{maxDate}}보다 뒤입니다. 고정한 minDate / maxDate는 행에서 계산한 범위보다 우선하므로 이 축에는 열이 없고 막대를 배치할 수 없습니다. 두 값을 서로 바꾸세요.",
},
},
unsupported: {
objectBoundGantt: "지원되지 않는 variant \"gantt\" — 객체 바인딩 타임라인은 피드 variant({{variants}})를 렌더링합니다. 간트는 각각 중첩된 items를 가진 리터럴 행이 필요하므로 여기서는 간트 축(scale)이 적용되지 않습니다.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,12 @@ const pt = {
},
gantt: {
rowLabel: "Itens",
unusableRange: {
malformedDate:
"Intervalo de datas do gantt inutilizável: {{path}} é {{value}}, que não é uma data válida. Todas as datas do gantt têm de ser analisáveis: startDate e endDate de cada item de linha, além de qualquer minDate / maxDate fixado no esquema.",
inverted:
"Intervalo de datas do gantt inutilizável: minDate {{minDate}} é posterior a maxDate {{maxDate}}. Um minDate / maxDate fixado prevalece sobre o intervalo calculado a partir das linhas, pelo que este eixo não tem colunas e nenhuma barra pode ser colocada; troque os dois valores.",
},
},
unsupported: {
objectBoundGantt: "Variante \"gantt\" não suportada: uma linha do tempo vinculada a um objeto renderiza as variantes de feed ({{variants}}). O gantt precisa de linhas literais, cada uma com os seus próprios items aninhados, por isso o eixo gantt (scale) não tem efeito aqui.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,12 @@ const ru = {
},
gantt: {
rowLabel: "Элементы",
unusableRange: {
malformedDate:
"Непригодный диапазон дат гантта — {{path}} равно {{value}}, что не является корректной датой. Все даты гантта должны разбираться: startDate и endDate каждого элемента строки, а также minDate / maxDate, заданные в схеме.",
inverted:
"Непригодный диапазон дат гантта — minDate {{minDate}} позже maxDate {{maxDate}}. Заданные minDate / maxDate имеют приоритет над диапазоном, вычисленным по строкам, поэтому у этой оси нет столбцов и полосу разместить негде; поменяйте оба значения местами.",
},
},
unsupported: {
objectBoundGantt: "Неподдерживаемый вариант \"gantt\" — временная шкала, привязанная к объекту, отображает ленточные варианты ({{variants}}). Для гантта нужны литеральные строки, каждая со своим вложенным items, поэтому ось гантта (scale) здесь не действует.",
Expand Down
6 changes: 6 additions & 0 deletions packages/i18n/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,12 @@ const zh = {
},
gantt: {
rowLabel: '条目',
unusableRange: {
malformedDate:
'甘特图日期区间不可用 —— {{path}} 的值是 {{value}},无法解析为日期。每个甘特图日期都必须能被解析:每行条目的 startDate 与 endDate,以及 schema 上钉住的 minDate / maxDate。',
inverted:
'甘特图日期区间不可用 —— minDate {{minDate}} 晚于 maxDate {{maxDate}}。钉住的 minDate / maxDate 会覆盖由行数据算出的区间,因此该坐标轴没有任何列,也无法放置任何条形;请对调这两个值。',
},
},
unsupported: {
objectBoundGantt: '不支持的变体 "gantt" —— 对象绑定的时间线只渲染 feed 变体({{variants}})。甘特图需要字面量行,每行自带嵌套的 items,因此此处的甘特轴(scale)不起作用。',
Expand Down
Loading
Loading