mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Typo: fix threshodsWithoutKey (#18228)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { ChangeEvent } from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { ThresholdsEditor, Props, threshodsWithoutKey } from './ThresholdsEditor';
|
||||
import { ThresholdsEditor, Props, thresholdsWithoutKey } from './ThresholdsEditor';
|
||||
import { colors } from '../../utils';
|
||||
|
||||
const setup = (propOverrides?: Partial<Props>) => {
|
||||
@@ -21,7 +21,7 @@ const setup = (propOverrides?: Partial<Props>) => {
|
||||
};
|
||||
|
||||
function getCurrentThresholds(editor: ThresholdsEditor) {
|
||||
return threshodsWithoutKey(editor.state.thresholds);
|
||||
return thresholdsWithoutKey(editor.state.thresholds);
|
||||
}
|
||||
|
||||
describe('Render', () => {
|
||||
|
||||
@@ -155,7 +155,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
|
||||
|
||||
onChange = () => {
|
||||
const { thresholds } = this.state;
|
||||
this.props.onChange(threshodsWithoutKey(thresholds));
|
||||
this.props.onChange(thresholdsWithoutKey(thresholds));
|
||||
};
|
||||
|
||||
renderInput = (threshold: ThresholdWithKey) => {
|
||||
@@ -231,7 +231,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
export function threshodsWithoutKey(thresholds: ThresholdWithKey[]): Threshold[] {
|
||||
export function thresholdsWithoutKey(thresholds: ThresholdWithKey[]): Threshold[] {
|
||||
return thresholds.map(t => {
|
||||
const { key, ...rest } = t;
|
||||
return rest; // everything except key
|
||||
|
||||
Reference in New Issue
Block a user