Skip to content

Commit

Permalink
Merge branch 'main' into virtualized-table-double-click
Browse files Browse the repository at this point in the history
  • Loading branch information
matthoward366 authored Jun 14, 2024
2 parents e6d237d + 25ed4e5 commit 9334dd5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"expression.values.empty.table.label": "No values found",
"expression.functions.table.label": "Functions table",
"expression.fields.dropdown": "Fields",
"expression.functions.dropdown": "General Functions",
"expression.add.column": "Add",
"expression.fields.title": "Fields",
"expression.values.title": "Values",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ class FlexibleTable extends React.Component {
FlexibleTable.defaultProps = {
showHeader: true,
light: true,
emptyTablePlaceholder: ""
emptyTablePlaceholder: "",
selectedRows: [] // Required for consumers using FlexibleTable directly
};

FlexibleTable.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
display: none;
}

.properties-apply-button, .properties-cancel-button {
button.properties-apply-button, button.properties-cancel-button {
width: 50%;
max-width: unset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const MESSAGE_KEYS = {
EXPRESSION_VALUES_EMPTY_TABLE_LABEL: "expression.values.empty.table.label",
EXPRESSION_FUNCTIONS_TABLE_LABEL: "expression.functions.table.label",
EXPRESSION_FIELDS_DROPDOWN_TITLE: "expression.fields.dropdown",
EXPRESSION_FUNCTIONS_DROPDOWN_TITLE: "expression.functions.dropdown",
EXPRESSION_FIELDS_TITLE: "expression.fields.title",
EXPRESSION_VALUES_TITLE: "expression.values.title",
EXPRESSION_FIELD_COLUMN: "expression.field.column",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
const first = items.slice(0, 1);
const last = items.slice(1);
items = first.concat({ value: this.recentUseCat, label: this.recentUseCat }, last);
const label = (this.state.functionCategory === this.recentUseCat) ? this.recentUseCat : this.props.functionList[this.state.functionCategory].locLabel;
const selectedFunctionItem = (this.state.functionCategory === this.recentUseCat) ? this.recentUseCat : this.props.functionList[this.state.functionCategory].locLabel;
const header = formatMessage(this.reactIntl,
MESSAGE_KEYS.TABLE_SEARCH_HEADER);
const listBoxMenuIconTranslationIds = {
Expand All @@ -612,7 +612,8 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
<Layer level={this.props.controller.getLight() ? 1 : 0}>
<Dropdown
id={"properties-expression-function-select-dropdown-" + this.uuid}
label={label}
label={formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_FUNCTIONS_DROPDOWN_TITLE)}
selectedItem={selectedFunctionItem}
items={items}
onChange={this.onFunctionCatChange}
translateWithId={(id) => listBoxMenuIconTranslationIds[id]}
Expand All @@ -624,13 +625,18 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {

_makeFieldDropdown() {
const items = [];
let selectedFieldItemLabel = "";
const selectedField = this.fields.field_categories.find((category) => category.id === this.state.fieldCategory);
if (selectedField) {
selectedFieldItemLabel = selectedField.locLabel;
}
for (let i = 0; i < this.fields.field_categories.length; i++) {
items.push({ value: this.fields.field_categories[i].id, label: this.fields.field_categories[i].locLabel });
}
const first = items.slice(0, 1);
const last = items.slice(1);
const newItems = first.concat({ value: this.recentUseCat, label: this.recentUseCat }, last);
const label = (this.state.fieldCategory === this.recentUseCat) ? this.recentUseCat : items[0].label;
const selectedFieldItem = (this.state.fieldCategory === this.recentUseCat) ? this.recentUseCat : selectedFieldItemLabel;
const header = formatMessage(this.reactIntl,
MESSAGE_KEYS.TABLE_SEARCH_HEADER);
const listBoxMenuIconTranslationIds = {
Expand All @@ -642,7 +648,8 @@ export default class ExpressionSelectFieldOrFunction extends React.Component {
<Layer level={this.props.controller.getLight() ? 1 : 0}>
<Dropdown
id={"properties-expression-field-select-dropdown-" + this.uuid}
label={label}
label={formatMessage(this.reactIntl, MESSAGE_KEYS.EXPRESSION_FIELDS_DROPDOWN_TITLE)}
selectedItem={selectedFieldItem}
items={newItems}
onChange={this.onFieldCatChange}
translateWithId={(id) => listBoxMenuIconTranslationIds[id]}
Expand Down

0 comments on commit 9334dd5

Please sign in to comment.