Skip to content

Commit

Permalink
Remove "headers" for table to match Lunatic model (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart authored Jan 8, 2024
1 parent 3c1f84a commit bf3ab8b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/loop/roster-for-loop/roster-for-loop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const RosterForLoop = createCustomizableLunaticField<
handleChange,
declarations,
label,
headers,
header,
iterations,
id,
getComponents,
Expand Down Expand Up @@ -71,7 +71,7 @@ export const RosterForLoop = createCustomizableLunaticField<
<DeclarationsBeforeText declarations={declarations} id={id} />
<DeclarationsAfterText declarations={declarations} id={id} />
<Table id={id}>
<TableHeader header={headers} id={id} />
<TableHeader header={header} id={id} />
<Tbody id={id}>
{times(nbRows, (n) => {
const components = getComponents(n);
Expand Down
4 changes: 2 additions & 2 deletions src/components/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type ComponentPropsByType = {
getComponents: (n: number) => FilledLunaticComponentProps[];
executeExpression: LunaticState['executeExpression'];
value: Record<string, unknown[]>;
headers?: Array<{ label: ReactNode }>;
header?: Array<{ label: ReactNode }>;
paginatedLoop?: boolean;
};
Loop: LunaticBaseProps<unknown> & {
Expand All @@ -103,7 +103,7 @@ type ComponentPropsByType = {
getComponents: (n: number) => FilledLunaticComponentProps[];
executeExpression: LunaticState['executeExpression'];
value: Record<string, unknown[]>;
headers?: Array<{ label: ReactNode }>;
header?: Array<{ label: ReactNode }>;
paginatedLoop?: boolean;
};
Table: LunaticBaseProps<unknown> & {
Expand Down
2 changes: 1 addition & 1 deletion src/stories/loop/source-with-header.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"id": "loop-prenom",
"componentType": "RosterForLoop",
"headers": [
"header": [
{ "headerCell": true, "label": "Prénom" },
{ "headerCell": true, "label": "Age" }
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const VTL_ATTRIBUTES = [
'xAxisIterations',
'yAxisIterations',
'conditionFilter',
'headers.label',
'header.label',
'disabled',
'readOnly',
Expand Down

0 comments on commit bf3ab8b

Please sign in to comment.