Skip to content
Open
Show file tree
Hide file tree
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 @@ -42,7 +42,12 @@ const ListGroup = ({
'data-testid': dataTestId = undefined,
style = undefined,
}: Props) => (
<StyledList as={componentClass} aria-label={ariaLabel} className={`${className ?? ''} ${bsClass ?? ''}`} style={style} data-testid={dataTestId}>
<StyledList
as={componentClass}
aria-label={ariaLabel}
className={`${className ?? ''} ${bsClass ?? ''}`}
style={style}
data-testid={dataTestId}>
{children}
</StyledList>
);
Expand Down
23 changes: 20 additions & 3 deletions graylog2-web-interface/src/components/bootstrap/ListGroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,31 @@ type ItemBodyProps = StyledProps & {
onKeyDown?: React.KeyboardEventHandler;
};

const ItemBody = ({ href = undefined, disabled = undefined, onClick = undefined, onKeyDown = undefined, children, ...styledProps }: ItemBodyProps) => {
const ItemBody = ({
href = undefined,
disabled = undefined,
onClick = undefined,
onKeyDown = undefined,
children,
...styledProps
}: ItemBodyProps) => {
if (href) {
return <InnerContainer as="a" href={href} {...styledProps}>{children}</InnerContainer>;
return (
<InnerContainer as="a" href={href} {...styledProps}>
{children}
</InnerContainer>
);
}

if (onClick) {
return (
<InnerContainer as="button" type="button" disabled={disabled} onClick={onClick} onKeyDown={onKeyDown} {...styledProps}>
<InnerContainer
as="button"
type="button"
disabled={disabled}
onClick={onClick}
onKeyDown={onKeyDown}
{...styledProps}>
{children}
</InnerContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import type { PendingChangesResponse } from '../types';
export const pendingChangesKey = (instanceUid: string) => ['collectors', 'instances', instanceUid, 'pending_changes'];

const fetchPendingChanges = (instanceUid: string): Promise<PendingChangesResponse> =>
Collectors.instancePendingChanges(instanceUid, { requestShouldExtendSession: false }) as Promise<PendingChangesResponse>;
Collectors.instancePendingChanges(instanceUid, {
requestShouldExtendSession: false,
}) as Promise<PendingChangesResponse>;

const useInstancePendingChanges = (
instanceUid: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ describe('InstanceDetailDrawer', () => {
const staleInstance = { ...mockInstance, has_pending_changes: false };

render(
<InstanceDetailDrawer instance={staleInstance} sources={mockSources} fleetName="production" onClose={jest.fn()} />,
<InstanceDetailDrawer
instance={staleInstance}
sources={mockSources}
fleetName="production"
onClose={jest.fn()}
/>,
);

await screen.findByText('Synchronization');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import styled, { css } from 'styled-components';
import useResizeObserver from '@react-hook/resize-observer';

import { ButtonToolbar } from 'components/bootstrap';
import { TABLE_ROW_HOVER_TRANSITION, TABLE_ROW_PINNED_HOVER_BG_VAR, flattenTableBackground } from 'components/bootstrap/Table';
import {
TABLE_ROW_HOVER_TRANSITION,
TABLE_ROW_PINNED_HOVER_BG_VAR,
flattenTableBackground,
} from 'components/bootstrap/Table';
import type { EntityBase } from 'components/common/EntityDataTable/types';
import { ACTIONS_COL_ID, CELL_PADDING } from 'components/common/EntityDataTable/Constants';
import { actionsHeaderWidthVar } from 'components/common/EntityDataTable/CSSVariables';
Expand All @@ -50,7 +54,10 @@ const Actions = styled.div<{ $isEvenRow: boolean }>(
display: flex;
justify-content: flex-end;
padding: ${CELL_PADDING}px;
background-color: ${flattenTableBackground(theme, $isEvenRow ? theme.colors.table.row.background : theme.colors.table.row.backgroundStriped)};
background-color: ${flattenTableBackground(
theme,
$isEvenRow ? theme.colors.table.row.background : theme.colors.table.row.backgroundStriped,
)};
height: 100%;
align-items: flex-start;
transition: ${TABLE_ROW_HOVER_TRANSITION};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ const getConditionType = (config: EventDefinition['config']) => {
: 'aggregation';
};

const QueryParameters = ({
queryParameters,
}: {
queryParameters: Array<ParameterJson & { embryonic?: boolean }>;
}) => {
const QueryParameters = ({ queryParameters }: { queryParameters: Array<ParameterJson & { embryonic?: boolean }> }) => {
if (queryParameters.some((p) => p.embryonic)) {
const undeclaredParameters = queryParameters
.filter((p) => p.embryonic)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ const QueryParameters = ({ eventDefinition, onChange, validation, userCanViewLoo
);

if (!userCanViewLookupTables) {
return (
<Alert bsStyle="info">This account lacks permission to declare Query Parameters from Lookup Tables.</Alert>
);
return <Alert bsStyle="info">This account lacks permission to declare Query Parameters from Lookup Tables.</Alert>;
}

const parameterButtons = queryParameters.map((queryParam) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ import { MoreActions } from 'components/common/EntityDataTable';
import usePluggableEntitySharedActions from 'hooks/usePluggableEntitySharedActions';

import type { EventDefinition } from '../event-definitions-types';
import {
isAggregationEventDefinition,
isSystemEventDefinition,
} from '../event-definitions-types';
import { isAggregationEventDefinition, isSystemEventDefinition } from '../event-definitions-types';

type Props = {
eventDefinition: EventDefinition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ const InputDiagnosisOverviewTab = ({
{Object.keys(inputNodeStates.states).map((state: InputState) => (
<StateListItem key={state} state={state} inputNodeStates={inputNodeStates} />
))}
{Object.keys(inputNodeStates.states).length === 0 && <StyledListGroupItem>Input is not running.</StyledListGroupItem>}
{Object.keys(inputNodeStates.states).length === 0 && (
<StyledListGroupItem>Input is not running.</StyledListGroupItem>
)}
</StyledListGroup>
</Section>
</StyledSectionGrid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ const getStreamTableElements = (
METRIC_COLUMN_IDS.maxProcessingTime,
];

const defaultColumnOrder = [
...defaultCols,
...routingCols,
...performanceCols,
...ungroupedExtNames,
'created_at',
];
const defaultColumnOrder = [...defaultCols, ...routingCols, ...performanceCols, ...ungroupedExtNames, 'created_at'];

const defaultVariantLayout = {
...SHARED_LAYOUT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ type Props = {
title: string;
};

const ProcessingTimeBadge = ({ ms, title }: Props) => (
<span title={title}>{formatProcessingTime(ms)}</span>
);
const ProcessingTimeBadge = ({ ms, title }: Props) => <span title={title}>{formatProcessingTime(ms)}</span>;

export default ProcessingTimeBadge;
9 changes: 2 additions & 7 deletions graylog2-web-interface/src/integrations/aws/StepAuthorize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ const StepAuthorize = ({ onChange, onSubmit, sidebarComponent = null }: StepAuth
}, [setStreamsFetch]);

const handleSubmit = () => {
const arnError = validateExternalIdRequiresArn(
formData?.awsAssumeRoleARN?.value,
formData?.awsExternalId?.value,
);
const arnError = validateExternalIdRequiresArn(formData?.awsAssumeRoleARN?.value, formData?.awsExternalId?.value);

if (arnError) {
setExternalIdError(arnError);
Expand All @@ -137,9 +134,7 @@ const StepAuthorize = ({ onChange, onSubmit, sidebarComponent = null }: StepAuth
};
}, [clearSidebar, setSidebar, sidebarComponent]);

const formError = externalIdError
? { full_message: externalIdError, nice_message: externalIdError }
: fetchError;
const formError = externalIdError ? { full_message: externalIdError, nice_message: externalIdError } : fetchError;

const authType = formData.awsAuthenticationType && formData.awsAuthenticationType.value;
const isFormValid = formValidation.isFormValid(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import { validateExternalIdRequiresArn } from './awsValidation';
describe('awsValidation', () => {
describe('validateExternalIdRequiresArn', () => {
it('returns undefined when both ARN and External ID are provided', () => {
const result = validateExternalIdRequiresArn(
'arn:aws:iam::123456789012:role/test-role',
'test-external-id',
);
const result = validateExternalIdRequiresArn('arn:aws:iam::123456789012:role/test-role', 'test-external-id');
expect(result).toBeUndefined();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
* @param externalId - The External ID value
* @returns An error message if validation fails, undefined if valid
*/
export const validateExternalIdRequiresArn = (
assumeRoleArn?: string,
externalId?: string,
): string | undefined => {
export const validateExternalIdRequiresArn = (assumeRoleArn?: string, externalId?: string): string | undefined => {
const hasExternalId = externalId && externalId.trim().length > 0;
const hasAssumeRoleArn = assumeRoleArn && assumeRoleArn.trim().length > 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
EVENT_DEFINITIONS_QUERY_KEY,
} from 'components/event-definitions/hooks/useEventDefinitions';


const ViewEventDefinitionPage = () => {
const params = useParams<{ definitionId?: string }>();
const currentUser = useCurrentUser();
Expand Down
Loading