mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Geomap: use string comparison for eq operator (#43181)
This commit is contained in:
@@ -152,7 +152,7 @@ export const StyleRuleEditor: FC<StandardEditorProps<FeatureStyleConfig, any, an
|
||||
options={comparators}
|
||||
onChange={onChangeComparison}
|
||||
aria-label={'Comparison operator'}
|
||||
width={6}
|
||||
width={8}
|
||||
/>
|
||||
</InlineField>
|
||||
<InlineField className={styles.inline} grow={true}>
|
||||
|
||||
@@ -18,6 +18,16 @@ describe('check if feature matches style rule', () => {
|
||||
feature
|
||||
)
|
||||
).toEqual(true);
|
||||
expect(
|
||||
checkFeatureMatchesStyleRule(
|
||||
{
|
||||
operation: ComparisonOperation.EQ,
|
||||
property: 'number',
|
||||
value: '3',
|
||||
},
|
||||
feature
|
||||
)
|
||||
).toEqual(true);
|
||||
expect(
|
||||
checkFeatureMatchesStyleRule(
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ export const checkFeatureMatchesStyleRule = (rule: FeatureRuleConfig, feature: F
|
||||
const val = feature.get(rule.property);
|
||||
switch (rule.operation) {
|
||||
case ComparisonOperation.EQ:
|
||||
return val === rule.value;
|
||||
return `${val}` === `${rule.value}`;
|
||||
case ComparisonOperation.NEQ:
|
||||
return val !== rule.value;
|
||||
case ComparisonOperation.GT:
|
||||
|
||||
Reference in New Issue
Block a user