Skip to content

Commit

Permalink
apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Sep 17, 2024
1 parent 92a2aff commit 2ef7c2d
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 53 deletions.
7 changes: 5 additions & 2 deletions src/app/Archives/AllTargetsArchivedRecordingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ const tableColumns: TableColumn[] = [
return target.alias === target.connectUrl || !target.alias
? `${target.connectUrl}`
: t
? t('AllTargetsArchivedRecordingsTable.TARGET_DISPLAY', { alias: target.alias, connectUrl: target.connectUrl })
: `${target.alias} (${target.connectUrl})`;
? t('AllTargetsArchivedRecordingsTable.TARGET_DISPLAY', {
alias: target.alias,
connectUrl: target.connectUrl,
})
: `${target.alias} (${target.connectUrl})`;
},
sortable: true,
width: 80,
Expand Down
14 changes: 7 additions & 7 deletions src/app/CreateRecording/CustomRecordingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,14 @@ export const CustomRecordingForm: React.FC = () => {
nameValid: !name
? ValidatedOptions.default
: isRecordingNameValid(name)
? ValidatedOptions.success
: ValidatedOptions.error,
? ValidatedOptions.success
: ValidatedOptions.error,
template,
restart: restart ?? false,
continuous: continuous || false,
labels: labels ?? [],
labelsValid: ValidatedOptions.default, // RecordingLabelFields component handles validating
duration: continuous ? 0 : duration ?? 30,
duration: continuous ? 0 : (duration ?? 30),
durationUnit: durationUnit ?? 1000,
durationValid:
skipDurationCheck || continuous || (duration ?? 30) > 0 ? ValidatedOptions.success : ValidatedOptions.error,
Expand Down Expand Up @@ -479,10 +479,10 @@ export const CustomRecordingForm: React.FC = () => {
{formData.durationValid === ValidatedOptions.error
? 'The Recording duration must be a positive integer.'
: formData.continuous
? 'A continuous recording will never be automatically stopped.'
: formData.archiveOnStop
? 'Time before the Recording is automatically stopped and copied to archive.'
: 'Time before the Recording is automatically stopped.'}
? 'A continuous recording will never be automatically stopped.'
: formData.archiveOnStop
? 'Time before the Recording is automatically stopped and copied to archive.'
: 'Time before the Recording is automatically stopped.'}
</HelperTextItem>
</HelperText>
</FormHelperText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,9 @@ export const AutomatedAnalysisConfigForm: React.FC<AutomatedAnalysisConfigFormPr
() => !target,
of([]),
context.api
.doGet<EventTemplate[]>(
`targets/${encodeURIComponent(target?.connectUrl || '')}/templates`,
'v1',
undefined,
undefined,
true,
)
.doGet<
EventTemplate[]
>(`targets/${encodeURIComponent(target?.connectUrl || '')}/templates`, 'v1', undefined, undefined, true)
.pipe(first()),
).subscribe({
next: (templates: EventTemplate[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ export const ClickableAutomatedAnalysisLabel: React.FC<ClickableAutomatedAnalysi
return result.score == AutomatedAnalysisScore.NA_SCORE
? 'grey'
: result.score < AutomatedAnalysisScore.ORANGE_SCORE_THRESHOLD
? 'green'
: result.score < AutomatedAnalysisScore.RED_SCORE_THRESHOLD
? 'orange'
: 'red';
? 'green'
: result.score < AutomatedAnalysisScore.RED_SCORE_THRESHOLD
? 'orange'
: 'red';
}, [result.score]);

const alertPopoverVariant = React.useMemo(() => {
return result.score == AutomatedAnalysisScore.NA_SCORE
? 'custom'
: result.score < AutomatedAnalysisScore.ORANGE_SCORE_THRESHOLD
? 'success'
: result.score < AutomatedAnalysisScore.RED_SCORE_THRESHOLD
? 'warning'
: 'danger';
? 'success'
: result.score < AutomatedAnalysisScore.RED_SCORE_THRESHOLD
? 'warning'
: 'danger';
}, [result.score]);

const icon = React.useMemo(() => {
Expand Down
22 changes: 9 additions & 13 deletions src/app/Rules/CreateRule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export const CreateRuleForm: React.FC<CreateRuleFormProps> = (_props) => {
nameValid: !name
? ValidatedOptions.default
: isRuleNameValid(name)
? ValidatedOptions.success
: ValidatedOptions.error,
? ValidatedOptions.success
: ValidatedOptions.error,
})),
[setFormData],
);
Expand Down Expand Up @@ -274,13 +274,9 @@ export const CreateRuleForm: React.FC<CreateRuleFormProps> = (_props) => {
forkJoin(
targets.map((t) =>
context.api
.doGet<EventTemplate[]>(
`targets/${encodeURIComponent(t.connectUrl)}/templates`,
'v1',
undefined,
true,
true,
)
.doGet<
EventTemplate[]
>(`targets/${encodeURIComponent(t.connectUrl)}/templates`, 'v1', undefined, true, true)
.pipe(
catchError((_) => of<EventTemplate[]>([])), // Fail silently
),
Expand Down Expand Up @@ -336,10 +332,10 @@ export const CreateRuleForm: React.FC<CreateRuleFormProps> = (_props) => {
matchExpressionValid: err
? ValidatedOptions.error
: !ts
? ValidatedOptions.default
: ts.length
? ValidatedOptions.success
: ValidatedOptions.warning,
? ValidatedOptions.default
: ts.length
? ValidatedOptions.success
: ValidatedOptions.warning,
}));
matchedTargets.next(ts || []);
}),
Expand Down
8 changes: 4 additions & 4 deletions src/app/SecurityPanel/Credentials/CreateCredentialModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ export const AuthForm: React.FC<AuthFormProps> = ({ onDismiss, onPropsSave, prog
err
? ValidatedOptions.error
: !ts
? ValidatedOptions.default
: ts.length
? ValidatedOptions.success
: ValidatedOptions.warning,
? ValidatedOptions.default
: ts.length
? ValidatedOptions.success
: ValidatedOptions.warning,
);
}),
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/SecurityPanel/Credentials/CredentialTestTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ export const CredentialTestRow: React.FC<CredentialTestRowProps> = ({
state: !err
? CredentialTestState.VALID
: err.severeLevel === ValidatedOptions.warning
? CredentialTestState.NA
: CredentialTestState.INVALID,
? CredentialTestState.NA
: CredentialTestState.INVALID,
});
}),
);
Expand Down
14 changes: 7 additions & 7 deletions src/app/Topology/Actions/CreateTarget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export const CreateTarget: React.FC<CreateTargetProps> = ({ prefilled }) => {
connectUrl === ''
? ValidatedOptions.default
: isValidTargetConnectURL(connectUrl)
? ValidatedOptions.success
: ValidatedOptions.error,
? ValidatedOptions.success
: ValidatedOptions.error,
}));
resetTestState();
},
Expand Down Expand Up @@ -461,11 +461,11 @@ export const SampleNodeDonut: React.FC<SampleNodeDonutProps> = ({
message: 'Target definition is valid.',
}
: validation.option === ValidatedOptions.error
? {
icon: <ExclamationCircleIcon color="var(--pf-global--danger-color--100)" />,
message: validation.errorMessage,
}
: { icon: <PendingIcon />, message: '' };
? {
icon: <ExclamationCircleIcon color="var(--pf-global--danger-color--100)" />,
message: validation.errorMessage,
}
: { icon: <PendingIcon />, message: '' };
}, [validation, testing]);

return (
Expand Down
4 changes: 1 addition & 3 deletions src/app/Topology/Entity/EntityDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,7 @@ const MBeanDetails: React.FC<{
helperDescription: 'The time when this JVM process started.',
content:
(mbeanMetrics?.runtime?.startTime || 0) > 0 ? (
dayjs(mbeanMetrics?.runtime?.startTime)
.tz(dateTimeFormat.timeZone.full)
.format('LLLL')
dayjs(mbeanMetrics?.runtime?.startTime).tz(dateTimeFormat.timeZone.full).format('LLLL')
) : (
<EmptyText text="Unknown start time" />
),
Expand Down

0 comments on commit 2ef7c2d

Please sign in to comment.