Skip to content

Commit

Permalink
fix cutsom button violation in properties table
Browse files Browse the repository at this point in the history
Signed-off-by: srikant <[email protected]>
  • Loading branch information
srikant-ch5 committed Jan 21, 2025
1 parent d2b3ba1 commit fc8fc7c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"table.toolbar.button.delete": "Delete",
"table.toolbar.button.edit": "Edit",
"table.toolbar.button.cancel": "Cancel",
"table.toolbar.overflow.label": "Table Toolbar Overflow",
"list.table.label": "Values",
"dropdown.tooltip.openMenu": "Open menu",
"dropdown.tooltip.closeMenu": "Close menu",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class TableButtons extends React.Component {
instanceId={0}
size="sm"
toolbarActionHandler={this.customButtonOnClick}
additionalText={{ overflowMenuLabel: this.props.toolbarOverflowLabel }}
/>
</div>);
}
Expand All @@ -123,6 +124,7 @@ TableButtons.propTypes = {
propertyId: PropTypes.object.isRequired,
customButtons: PropTypes.array.isRequired,
tableState: PropTypes.string,
toolbarOverflowLabel: PropTypes.string,
customButtonsState: PropTypes.object // set in by redux
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const MESSAGE_KEYS = {
TABLE_TOOLBAR_BUTTON_DELETE: "table.toolbar.button.delete",
TABLE_TOOLBAR_BUTTON_EDIT: "table.toolbar.button.edit",
TABLE_TOOLBAR_BUTTON_CANCEL: "table.toolbar.button.cancel",
TABLE_TOOLBAR_OVERFLOW_LABEL: "table.toolbar.overflow.label",
TABLE_DELETEICON_TOOLTIP: "table.deleteIcon.tooltip"

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ export default class AbstractTable extends React.Component {
return row;
}

// Returns the label for the overflow menu in the table toolbar
getTableToolbarOverflowLabel() {
return PropertyUtils.formatMessage(this.props.controller.getReactIntl(), MESSAGE_KEYS.TABLE_TOOLBAR_OVERFLOW_LABEL);
}

setScrollToRow(row) {
this.scrollToRow = row;
}
Expand Down Expand Up @@ -534,6 +539,7 @@ export default class AbstractTable extends React.Component {
tableState={tableState}
customButtons={customButtons}
customButtonsState={this.props.tableButtons}
toolbarOverflowLabel={this.getTableToolbarOverflowLabel()}
/>
</div>);
}
Expand Down

0 comments on commit fc8fc7c

Please sign in to comment.