Skip to content

Commit

Permalink
fixed translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshamoon committed Nov 27, 2023
1 parent 92327ca commit ac5ba62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/components/UI/Pager/Pager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@ const collapsedRowData = (dataObj: any, columnStyles: any, recordId: any) => {
</TableRow>
);
}
console.log(dataObj);

const additionalRowInformation = Object.keys(dataObj).map((key, index) => {
const rowIdentifier = `collapsedRowData-${recordId}-${index}`;

// This is for location translation type where the text is inside body.
const body = typeof dataObj[key].body === 'string' ? dataObj[key].body : dataObj[key].body.text;

return (
<TableRow className={styles.CollapseTableRow} key={rowIdentifier}>
<TableCell className={`${styles.TableCell} ${columnStyles ? columnStyles[0] : null}`}>
Expand All @@ -58,11 +62,9 @@ const collapsedRowData = (dataObj: any, columnStyles: any, recordId: any) => {
</TableCell>
<TableCell className={`${styles.TableCell} ${columnStyles ? columnStyles[1] : null}`}>
<div>
<p className={styles.TableText}>{dataObj[key].body}</p>
<p className={styles.TableText}>{body}</p>
</div>
</TableCell>
<TableCell className={`${styles.TableCell} ${columnStyles ? columnStyles[2] : null}`} />
<TableCell className={`${styles.TableCell} ${columnStyles ? columnStyles[3] : null}`} />
</TableRow>
);
});
Expand Down
9 changes: 6 additions & 3 deletions src/containers/InteractiveMessage/InteractiveMessage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ describe('location request message', () => {
expect(interactiveType.querySelector('input')).toHaveValue('Location request');
});

fireEvent.change(screen.getAllByTestId('outlinedInput')[0]?.querySelector('input'), {
target: { value: 'Section 1' },
});
fireEvent.change(
screen.getAllByTestId('outlinedInput')[0]?.querySelector('input') as HTMLElement,
{
target: { value: 'Section 1' },
}
);

// have send location in simulator preview
await waitFor(() => {
Expand Down

0 comments on commit ac5ba62

Please sign in to comment.