Skip to content

Commit

Permalink
fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
ousmaneo committed Jun 4, 2024
1 parent 4293844 commit b3243e4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ type FieldValueProvider = {
},
}


interface PluginDataWarehouse {
DataWarehouseStatus: React.ComponentType<{
stream: {
Expand All @@ -174,7 +173,6 @@ interface PluginDataWarehouse {
DataWarehouseJobs: React.ComponentType<{}>,
}


declare module 'graylog-web-plugin/plugin' {
interface PluginExports {
navigation?: Array<PluginNavigation>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import React, { useCallback, useState } from 'react';
import { Button } from 'components/bootstrap';
import type { BsSize } from 'components/bootstrap/types';
import type { StyleProps } from 'components/bootstrap/Button';
import StreamRuleModal from './StreamRuleModal';
import type { StreamRule } from 'stores/streams/StreamsStore';
import { StreamRulesStore } from 'stores/streams/StreamRulesStore';
import UserNotification from 'util/UserNotification';

import StreamRuleModal from './StreamRuleModal';

type Props = {
bsSize?: BsSize,
bsStyle?: StyleProps,
Expand All @@ -36,14 +37,12 @@ type Props = {
const CreateStreamRuleButton = ({ bsSize, bsStyle, buttonText, className, streamId }: Props) => {
const [showCreateModal, setShowCreateModal] = useState(false);

const toggleCreateModal = useCallback(() => {
return setShowCreateModal((cur) => !cur);
}, []);
const toggleCreateModal = useCallback(() => setShowCreateModal((cur) => !cur), []);

const onSaveStreamRule = useCallback((_streamRuleId: string, streamRule: StreamRule) => StreamRulesStore.create(streamId, streamRule, () => {
UserNotification.success('Stream rule was created successfully.', 'Success');
// TODO invalidate stream query
}), []);
}), [streamId]);

return (
<>
Expand Down Expand Up @@ -78,6 +77,7 @@ CreateStreamRuleButton.defaultProps = {
bsSize: undefined,
bsStyle: undefined,
className: undefined,
streamId: undefined,
};

export default CreateStreamRuleButton;
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const DetailsStreamRule = ({ stream, streamRule, onSubmit, onDelete }: Props) =>
StreamRulesInputsActions.list();
}, []);

const _onEdit = (event: React.SyntheticEvent ) => {
const _onEdit = (event: React.SyntheticEvent) => {
event.preventDefault();
setShowStreamRuleForm(true);
};
Expand Down Expand Up @@ -86,7 +86,7 @@ const DetailsStreamRule = ({ stream, streamRule, onSubmit, onDelete }: Props) =>
});

const _formatActionItems = () => (
<ActionButtonsWrap className='align-right'>
<ActionButtonsWrap className="align-right">
<Button bsStyle="link"
bsSize="xsmall"
onClick={_onDelete}
Expand All @@ -102,13 +102,14 @@ const DetailsStreamRule = ({ stream, streamRule, onSubmit, onDelete }: Props) =>
</ActionButtonsWrap>
);

/* const matchDataStyle = () => (matchData.rules[streamRule.id] ? 'success' : 'danger'); */
/* const matchDataStyle = () => (matchData.rules[streamRule.id] ? 'success' : 'danger'); */
const actionItems = isPermitted(permissions, [`streams:edit:${stream.id}`]) ? _formatActionItems() : null;
const description = streamRule.description ? <small>{' '}({streamRule.description})</small> : null;
/* const listGroupStyle = !isEmpty(matchData) ? matchDataStyle() : null; */
/* const listGroupStyle = !isEmpty(matchData) ? matchDataStyle() : null; */

return (
<tr key={streamRule.id}>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<td>
<HumanReadableStreamRule streamRule={streamRule} inputs={inputs} />
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
* along with this program. If not, see
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/
import { qualifyUrl } from 'util/URLUtils';

import { useQuery } from '@tanstack/react-query';

import { qualifyUrl } from 'util/URLUtils';
import fetch from 'logic/rest/FetchProvider';
import ApiRoutes from 'routing/ApiRoutes';
import type FetchError from 'logic/errors/FetchError';
Expand Down
2 changes: 1 addition & 1 deletion graylog2-web-interface/src/pages/StreamDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import * as React from 'react';
import { useParams } from 'react-router-dom';

import { Spinner } from 'components/common';
import { Spinner } from 'components/common';
import useStream from 'hooks/useStream';
import StreamDetails from 'components/streams/StreamDetails/StreamDetails';

Expand Down

0 comments on commit b3243e4

Please sign in to comment.