Skip to content

Commit

Permalink
apply auto formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Sep 5, 2023
1 parent 91df2ab commit 48fca24
Show file tree
Hide file tree
Showing 187 changed files with 1,232 additions and 1,218 deletions.
2 changes: 1 addition & 1 deletion src/app/About/AboutDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const AboutDescription: React.FC = () => {
if (!result) {
notificationsContext.warning(
'Cryostat Version Parse Failure',
`Could not parse Cryostat version string '${cryostatVersion}'.`
`Could not parse Cryostat version string '${cryostatVersion}'.`,
);
return 'main';
}
Expand Down
30 changes: 15 additions & 15 deletions src/app/Agent/AgentLiveProbes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
},
columnIndex,
}),
[sortBy, setSortBy]
[sortBy, setSortBy],
);

const handleProbes = React.useCallback(
Expand All @@ -118,15 +118,15 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
setErrorMessage('');
setIsLoading(false);
},
[setProbes, setIsLoading, setErrorMessage]
[setProbes, setIsLoading, setErrorMessage],
);

const handleError = React.useCallback(
(error) => {
setErrorMessage(error.message);
setIsLoading(false);
},
[setIsLoading, setErrorMessage]
[setIsLoading, setErrorMessage],
);

const refreshProbes = React.useCallback(() => {
Expand All @@ -135,7 +135,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
context.api.getActiveProbes(true).subscribe({
next: (value) => handleProbes(value),
error: (err) => handleError(err),
})
}),
);
}, [addSubscription, context.api, setIsLoading, handleProbes, handleError]);

Expand All @@ -158,7 +158,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
REMOVE: false,
};
});
})
}),
);
}, [addSubscription, context.api, setActionLoadings]);

Expand All @@ -181,7 +181,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
context.target.target().subscribe(() => {
setFilterText('');
refreshProbes();
})
}),
);
}, [context, context.target, addSubscription, setFilterText, refreshProbes]);

Expand All @@ -191,7 +191,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
}
const id = window.setInterval(
() => refreshProbes(),
context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits()
context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(),
);
return () => window.clearInterval(id);
}, [context.settings, refreshProbes]);
Expand All @@ -200,7 +200,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
addSubscription(
context.target.authFailure().subscribe(() => {
setErrorMessage(authFailMessage);
})
}),
);
}, [addSubscription, context.target, setErrorMessage]);

Expand All @@ -221,13 +221,13 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
}
return old;
});
})
}),
);
}, [addSubscription, context, context.notificationChannel, context.target, setProbes]);

React.useEffect(() => {
addSubscription(
context.notificationChannel.messages(NotificationCategory.ProbesRemoved).subscribe((_) => setProbes([]))
context.notificationChannel.messages(NotificationCategory.ProbesRemoved).subscribe((_) => setProbes([])),
);
}, [addSubscription, context, context.notificationChannel, setProbes]);

Expand All @@ -243,7 +243,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
t.description.toLowerCase().includes(ft) ||
t.clazz.toLowerCase().includes(ft) ||
t.methodDescriptor.toLowerCase().includes(ft) ||
t.methodName.toLowerCase().includes(ft)
t.methodName.toLowerCase().includes(ft),
);
}

Expand All @@ -254,8 +254,8 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
direction: sortBy.direction ?? SortByDirection.asc,
},
filtered,
tableColumns
)
tableColumns,
),
);
}, [filterText, probes, sortBy, setFilteredProbes]);

Expand All @@ -280,7 +280,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
</Td>
</Tr>
)),
[filteredProbes]
[filteredProbes],
);

const actionLoadingProps = React.useMemo<Record<LiveProbeActions, LoadingPropsType>>(
Expand All @@ -291,7 +291,7 @@ export const AgentLiveProbes: React.FC<AgentLiveProbesProps> = (_) => {
isLoading: actionLoadings['REMOVE'],
} as LoadingPropsType,
}),
[actionLoadings]
[actionLoadings],
);

if (errorMessage != '') {
Expand Down
48 changes: 24 additions & 24 deletions src/app/Agent/AgentProbeTemplates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
},
columnIndex,
}),
[sortBy, setSortBy]
[sortBy, setSortBy],
);

const handleTemplates = React.useCallback(
Expand All @@ -115,14 +115,14 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
setIsLoading(false);
setErrorMessage('');
},
[setTemplates, setIsLoading, setErrorMessage]
[setTemplates, setIsLoading, setErrorMessage],
);
const handleError = React.useCallback(
(error) => {
setIsLoading(false);
setErrorMessage(error.message);
},
[setIsLoading, setErrorMessage]
[setIsLoading, setErrorMessage],
);

const refreshTemplates = React.useCallback(() => {
Expand All @@ -131,7 +131,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
context.api.getProbeTemplates().subscribe({
next: (value) => handleTemplates(value),
error: (err) => handleError(err),
})
}),
);
}, [addSubscription, context.api, setIsLoading, handleTemplates, handleError]);

Expand All @@ -140,10 +140,10 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
addSubscription(
context.api.deleteCustomProbeTemplate(template.name).subscribe(() => {
/** Do nothing. Notifications hook will handle */
})
}),
);
},
[addSubscription, context.api]
[addSubscription, context.api],
);

const handleWarningModalAccept = React.useCallback(() => {
Expand Down Expand Up @@ -176,7 +176,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
}
const id = window.setInterval(
() => refreshTemplates(),
context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits()
context.settings.autoRefreshPeriod() * context.settings.autoRefreshUnits(),
);
return () => window.clearInterval(id);
}, [context.settings, refreshTemplates]);
Expand All @@ -193,15 +193,15 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
} as ProbeTemplate,
];
});
})
}),
);
}, [addSubscription, context.notificationChannel, setTemplates]);

React.useEffect(() => {
addSubscription(
context.notificationChannel.messages(NotificationCategory.ProbeTemplateDeleted).subscribe((event) => {
setTemplates((old) => old.filter((t) => t.name !== event.message.probeTemplate));
})
}),
);
}, [addSubscription, context.notificationChannel, setTemplates]);

Expand All @@ -212,7 +212,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
} else {
const ft = filterText.trim().toLowerCase();
filtered = templates.filter(
(t: ProbeTemplate) => t.name.toLowerCase().includes(ft) || t.xml.toLowerCase().includes(ft)
(t: ProbeTemplate) => t.name.toLowerCase().includes(ft) || t.xml.toLowerCase().includes(ft),
);
}

Expand All @@ -223,8 +223,8 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
direction: sortBy.direction ?? SortByDirection.asc,
},
filtered,
tableColumns
)
tableColumns,
),
);
}, [filterText, templates, sortBy, setFilteredTemplates]);

Expand All @@ -237,7 +237,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
handleDelete(template);
}
},
[context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete]
[context.settings, setWarningModalOpen, setTemplateToDelete, handleDelete],
);

const handleInsertAction = React.useCallback(
Expand All @@ -246,10 +246,10 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
context.api
.insertProbes(template.name)
.pipe(first())
.subscribe(() => undefined)
.subscribe(() => undefined),
);
},
[addSubscription, context.api]
[addSubscription, context.api],
);

const templateRows = React.useMemo(
Expand All @@ -273,7 +273,7 @@ export const AgentProbeTemplates: React.FC<AgentProbeTemplatesProps> = (props) =
</Tr>
);
}),
[filteredTemplates, props.agentDetected, handleInsertAction, handleDeleteAction]
[filteredTemplates, props.agentDetected, handleInsertAction, handleDeleteAction],
);

if (errorMessage != '') {
Expand Down Expand Up @@ -393,7 +393,7 @@ export const AgentProbeTemplateUploadModal: React.FC<AgentProbeTemplateUploadMod
.addCustomProbeTemplate(
fileUpload.file,
getProgressUpdateCallback(fileUpload.file.name),
fileUpload.abortSignal
fileUpload.abortSignal,
)
.pipe(
tap({
Expand All @@ -404,8 +404,8 @@ export const AgentProbeTemplateUploadModal: React.FC<AgentProbeTemplateUploadMod
onSingleFailure(fileUpload.file.name, err);
},
}),
catchError((_) => of(false))
)
catchError((_) => of(false)),
),
);
});

Expand All @@ -415,10 +415,10 @@ export const AgentProbeTemplateUploadModal: React.FC<AgentProbeTemplateUploadMod
.subscribe((oks) => {
setUploading(false);
setAllOks(oks.reduce((prev, curr, _) => prev && curr, true));
})
}),
);
},
[addSubscription, context.api, setAllOks, setUploading]
[addSubscription, context.api, setAllOks, setUploading],
);

const handleSubmit = React.useCallback(() => {
Expand All @@ -430,7 +430,7 @@ export const AgentProbeTemplateUploadModal: React.FC<AgentProbeTemplateUploadMod
setAllOks(!fileUploads.some((f) => !f.progress || f.progress.progressVariant !== 'success'));
setNumOfFiles(fileUploads.length);
},
[setNumOfFiles, setAllOks]
[setNumOfFiles, setAllOks],
);

const submitButtonLoadingProps = React.useMemo(
Expand All @@ -439,8 +439,8 @@ export const AgentProbeTemplateUploadModal: React.FC<AgentProbeTemplateUploadMod
spinnerAriaValueText: 'Submitting',
spinnerAriaLabel: 'submitting-probe-template',
isLoading: uploading,
} as LoadingPropsType),
[uploading]
}) as LoadingPropsType,
[uploading],
);

return (
Expand Down
Loading

0 comments on commit 48fca24

Please sign in to comment.