Skip to content

Commit

Permalink
geosolutions-it#10488: 'ilike' as default operator for text field in …
Browse files Browse the repository at this point in the history
…attribute table quick filter [resolve review comments]

Description:
- replace operator prop with defaultOperator
- remove unused prop operator from BaseDateTimeFilter component
  • Loading branch information
mahmoudadel54 committed Jul 30, 2024
1 parent 61fac34 commit 3e51e1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AttributeFilter extends React.PureComponent {
column: PropTypes.object,
placeholderMsgId: PropTypes.string,
tooltipMsgId: PropTypes.string,
operator: PropTypes.string,
defaultOperator: PropTypes.string,
type: PropTypes.string,
isWithinAttrTbl: PropTypes.bool
};
Expand All @@ -38,7 +38,7 @@ class AttributeFilter extends React.PureComponent {
onChange: () => {},
column: {},
placeholderMsgId: "featuregrid.filter.placeholders.default",
operator: "=",
defaultOperator: "=",
isWithinAttrTbl: false
};
constructor(props) {
Expand All @@ -50,7 +50,7 @@ class AttributeFilter extends React.PureComponent {
booleanOperators: ["="],
defaultOperators: ["=", ">", "<", ">=", "<=", "<>", "isNull"],
timeDateOperators: ["=", ">", "<", ">=", "<=", "<>", "><", "isNull"],
operator: this.props.isWithinAttrTbl ? (this.props.operator || '=') : "",
operator: this.props.isWithinAttrTbl ? (this.props.defaultOperator) : "",
isInputValid: true
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class DateFilter extends AttributeFilter {
/>);
}
handleChange = (value, stringValue) => {
this.props.onChange({ value, stringValue, attribute: this.props.column && this.props.column.name, inputOperator: this.state.operator || this.props.operator });
this.props.onChange({ value, stringValue, attribute: this.props.column && this.props.column.name, inputOperator: this.state.operator });
}
handleChangeRangeFilter = (value, stringValue, order = 'start') => {
let reqVal = {};
Expand All @@ -119,7 +119,7 @@ export class DateFilter extends AttributeFilter {
endDate: this.props.value?.endDate
};
}
this.props.onChange({ value: reqVal, stringValue, attribute: this.props.column && this.props.column.name, inputOperator: this.state.operator || this.props.operator });
this.props.onChange({ value: reqVal, stringValue, attribute: this.props.column && this.props.column.name, inputOperator: this.state.operator });
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default compose(
defaultProps({
onValueChange: () => {},
placeholderMsgId: "featuregrid.filter.placeholders.string",
operator: 'ilike'
defaultOperator: 'ilike'
}),
withHandlers({
onChange: props => ({value, attribute, inputOperator} = {}) => {
Expand Down

0 comments on commit 3e51e1a

Please sign in to comment.