Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sherfin94 committed Jul 2, 2022
2 parents 126bdcd + 7cbac49 commit 79b1067
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.2
1.19.3
14 changes: 14 additions & 0 deletions frontend/src/Editor/Components/Table/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export function Table({
filter: customFilter,
width: width,
columnOptions,
cellBackgroundColor: column.cellBackgroundColor,
columnType,
isEditable: column.isEditable,
Cell: function (cell) {
Expand Down Expand Up @@ -954,6 +955,18 @@ export function Table({
}
}
const wrapAction = textWrapActions(cell.column.id);
const rowChangeSet = changeSet ? changeSet[cell.row.index] : null;
const cellValue = rowChangeSet ? rowChangeSet[cell.column.name] || cell.value : cell.value;
const rowData = tableData[cell.row.index];
const cellBackgroundColor = resolveReferences(
cell.column?.cellBackgroundColor,
currentState,
'',
{
cellValue,
rowData,
}
);
return (
// Does not require key as its already being passed by react-table via cellProps
// eslint-disable-next-line react/jsx-key
Expand All @@ -968,6 +981,7 @@ export function Table({
[cellSizeType]: true,
})}
{...cellProps}
style={{ ...cellProps.style, backgroundColor: cellBackgroundColor ?? 'inherit' }}
>
<div className="td-container">{cell.render('Cell')}</div>
</td>
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/Editor/Inspector/Components/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,20 @@ class Table extends React.Component {
</>
)}

<div className="field mb-2">
<label className="form-label">Cell background color</label>
<CodeHinter
currentState={this.props.currentState}
initialValue={column.cellBackgroundColor ?? 'inherit'}
theme={this.props.darkMode ? 'monokai' : 'default'}
mode="javascript"
lineNumbers={false}
placeholder={''}
onChange={(value) => this.onColumnItemChange(index, 'cellBackgroundColor', value)}
componentName={this.getPopoverFieldSource(column.columnType, 'cellBackgroundColor')}
/>
</div>

{column.columnType === 'datepicker' && (
<div>
<label className="form-label">Date Display Format</label>
Expand Down
2 changes: 1 addition & 1 deletion server/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.2
1.19.3

0 comments on commit 79b1067

Please sign in to comment.