mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
Running lint --fix & prettier (#25179)
Co-authored-by: Dr. Lint-a-lot <garybot2@graylog.com>
This commit is contained in:
committed by
GitHub
parent
48998ad165
commit
84b23497b9
@@ -58,7 +58,10 @@ const getNotificationItems = (
|
||||
const result: Array<NotificationItem> = [];
|
||||
|
||||
if (hasInputInState(inputStates, [INPUT_STATES.FAILED, INPUT_STATES.FAILING])) {
|
||||
result.push({ severity: 'danger', message: 'in failed state. Failed or failing inputs will not receive traffic until fixed.' });
|
||||
result.push({
|
||||
severity: 'danger',
|
||||
message: 'in failed state. Failed or failing inputs will not receive traffic until fixed.',
|
||||
});
|
||||
}
|
||||
|
||||
if (hasInputInState(inputStates, INPUT_STATES.SETUP)) {
|
||||
|
||||
@@ -28,9 +28,7 @@ describe('<NotificationBanner>', () => {
|
||||
});
|
||||
|
||||
it('renders the title text', () => {
|
||||
const items: Array<NotificationItem> = [
|
||||
{ severity: 'danger', message: 'something failed' },
|
||||
];
|
||||
const items: Array<NotificationItem> = [{ severity: 'danger', message: 'something failed' }];
|
||||
|
||||
render(<NotificationBanner title="One or more inputs are currently" items={items} />);
|
||||
|
||||
|
||||
@@ -63,16 +63,11 @@ const StreamRulesEditor = ({ streamId, messageId = '', index = '' }: Props) => {
|
||||
const [message, setMessage] = useState<{ [fieldName: string]: unknown } | undefined>();
|
||||
const [matchData, setMatchData] = useState<MatchData | undefined>();
|
||||
const { data: stream, refetch } = useStream(streamId);
|
||||
const {
|
||||
onCreateStreamRule,
|
||||
showStartStreamDialog,
|
||||
onCancelStartStreamDialog,
|
||||
onStartStream,
|
||||
isStartingStream,
|
||||
} = useCreateStreamRule({
|
||||
streamId,
|
||||
streamIsPaused: stream?.disabled ?? false,
|
||||
});
|
||||
const { onCreateStreamRule, showStartStreamDialog, onCancelStartStreamDialog, onStartStream, isStartingStream } =
|
||||
useCreateStreamRule({
|
||||
streamId,
|
||||
streamIsPaused: stream?.disabled ?? false,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const refetchStrems = () => refetch();
|
||||
|
||||
@@ -42,7 +42,13 @@ jest.mock('stores/streams/StreamsStore', () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
jest.mock('logic/telemetry/useSendTelemetry', () => () => (...args) => mockSendTelemetry(...args));
|
||||
jest.mock(
|
||||
'logic/telemetry/useSendTelemetry',
|
||||
() =>
|
||||
() =>
|
||||
(...args) =>
|
||||
mockSendTelemetry(...args),
|
||||
);
|
||||
|
||||
jest.mock('@tanstack/react-query', () => ({
|
||||
...jest.requireActual('@tanstack/react-query'),
|
||||
@@ -73,12 +79,7 @@ type TestComponentProps = {
|
||||
};
|
||||
|
||||
const TestComponent = ({ streamIsPaused }: TestComponentProps) => {
|
||||
const {
|
||||
onCreateStreamRule,
|
||||
showStartStreamDialog,
|
||||
onCancelStartStreamDialog,
|
||||
onStartStream,
|
||||
} = useCreateStreamRule({
|
||||
const { onCreateStreamRule, showStartStreamDialog, onCancelStartStreamDialog, onStartStream } = useCreateStreamRule({
|
||||
streamId: 'stream-id',
|
||||
streamIsPaused,
|
||||
});
|
||||
|
||||
@@ -39,16 +39,11 @@ const RulesSectionActions = ({ stream }: Props) => {
|
||||
setShowAddRuleModal((cur) => !cur);
|
||||
}, []);
|
||||
|
||||
const {
|
||||
onCreateStreamRule,
|
||||
showStartStreamDialog,
|
||||
onCancelStartStreamDialog,
|
||||
onStartStream,
|
||||
isStartingStream,
|
||||
} = useCreateStreamRule({
|
||||
streamId: stream.id,
|
||||
streamIsPaused: stream.disabled,
|
||||
});
|
||||
const { onCreateStreamRule, showStartStreamDialog, onCancelStartStreamDialog, onStartStream, isStartingStream } =
|
||||
useCreateStreamRule({
|
||||
streamId: stream.id,
|
||||
streamIsPaused: stream.disabled,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -129,16 +129,11 @@ const StreamActions = ({ stream, indexSets }: { stream: Stream; indexSets: Array
|
||||
});
|
||||
}, [deselectEntity, sendTelemetry, stream.id, stream.title, toggleDeleteModal]);
|
||||
|
||||
const {
|
||||
onCreateStreamRule,
|
||||
showStartStreamDialog,
|
||||
onCancelStartStreamDialog,
|
||||
onStartStream,
|
||||
isStartingStream,
|
||||
} = useCreateStreamRule({
|
||||
streamId: stream.id,
|
||||
streamIsPaused: stream.disabled,
|
||||
});
|
||||
const { onCreateStreamRule, showStartStreamDialog, onCancelStartStreamDialog, onStartStream, isStartingStream } =
|
||||
useCreateStreamRule({
|
||||
streamId: stream.id,
|
||||
streamIsPaused: stream.disabled,
|
||||
});
|
||||
|
||||
const onUpdate = useCallback(
|
||||
(newStream: Stream) =>
|
||||
|
||||
@@ -82,10 +82,10 @@ const useStreamOutputFilters = (
|
||||
|
||||
queryFn: () =>
|
||||
defaultOnError(
|
||||
fetchStreamOutputFilters(
|
||||
streamId,
|
||||
{ ...pagination, query: destinationType ? `destination_type:${destinationType}` : pagination.query },
|
||||
),
|
||||
fetchStreamOutputFilters(streamId, {
|
||||
...pagination,
|
||||
query: destinationType ? `destination_type:${destinationType}` : pagination.query,
|
||||
}),
|
||||
'Loading stream output filters failed with status',
|
||||
'Could not load stream output filters',
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user