diff --git a/changelog/unreleased/pr-20714.toml b/changelog/unreleased/pr-20714.toml new file mode 100644 index 000000000000..f855a42969d8 --- /dev/null +++ b/changelog/unreleased/pr-20714.toml @@ -0,0 +1,4 @@ +type = "fixed" +message = "Hide stream rule Matching-Type-Switcher when stream is not editable" + +pulls = ["20714"] diff --git a/graylog2-web-interface/src/components/streams/MatchingTypeSwitcher.tsx b/graylog2-web-interface/src/components/streams/MatchingTypeSwitcher.tsx index b4929fc1500e..4ce8a8b22392 100644 --- a/graylog2-web-interface/src/components/streams/MatchingTypeSwitcher.tsx +++ b/graylog2-web-interface/src/components/streams/MatchingTypeSwitcher.tsx @@ -53,6 +53,7 @@ type Props = { const MatchingTypeSwitcher = ({ stream, onChange }: Props) => { const [matchingType, setMatchingType] = useState<'AND'|'OR'|undefined>(undefined); + const disabled = stream.is_default || !stream.is_editable; const handleTypeChange = (newValue: 'AND'|'OR') => { StreamsStore.update(stream.id, { matching_type: newValue }, (response) => { @@ -72,12 +73,14 @@ const MatchingTypeSwitcher = ({ stream, onChange }: Props) => { type="radio" label="A message must match all of the following rules" checked={stream.matching_type === 'AND'} - onChange={() => setMatchingType('AND')} /> + onChange={() => setMatchingType('AND')} + disabled={disabled} /> setMatchingType('OR')} /> + onChange={() => setMatchingType('OR')} + disabled={disabled} /> {matchingType && (