Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow showing validation error for streams filter. #20756

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ import Select from 'components/common/Select';
import { defaultCompare } from 'logic/DefaultCompare';
import useSendTelemetry from 'logic/telemetry/useSendTelemetry';
import { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';
import { FormGroup } from 'components/bootstrap';

const Container = styled.div`
const Container = styled(FormGroup)`
flex: 1;
grid-area: streams;
`;
Expand All @@ -34,11 +35,12 @@ type Props = {
onChange: (newStreamIds: Array<string>) => void,
multi?: boolean,
clearable?: boolean
hasError?: boolean
};

const StreamsFilter = ({
disabled = false, value = [], streams, onChange, multi = true,
clearable = true,
clearable = true, hasError = false,
}: Props) => {
const sendTelemetry = useSendTelemetry();
const selectedStreams = value.join(',');
Expand All @@ -59,7 +61,7 @@ const StreamsFilter = ({
};

return (
<Container data-testid="streams-filter" title={placeholder}>
<Container data-testid="streams-filter" title={placeholder} validationState={hasError ? 'error' : undefined} bsClass="no-bm">
<Select placeholder={placeholder}
disabled={disabled}
clearable={clearable}
Expand All @@ -70,6 +72,7 @@ const StreamsFilter = ({
options={options}
multi={multi}
value={selectedStreams} />

</Container>
);
};
Expand Down
Loading