Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

874 implement automatic generation of api client log api #876

Merged
Prev Previous commit
Next Next commit
skip queries on missing parameters
  • Loading branch information
Pespiri committed Nov 22, 2023
commit fde609aa5d60c41330ce96be6e5a6af31454e865
11 changes: 4 additions & 7 deletions src/components/page-scheduled-job/replica-log-accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,10 @@ export const JobReplicaLogAccordion: FunctionComponent<
timeSpan,
isExpanded,
}) => {
const jobInventory = useGetJobInventoryQuery({
appName,
envName,
jobComponentName,
jobName,
...getTimespan(timeSpan),
});
const jobInventory = useGetJobInventoryQuery(
{ appName, envName, jobComponentName, jobName, ...getTimespan(timeSpan) },
{ skip: !appName || !envName || !jobComponentName || !jobName }
);

const [sortedData, setSortedData] = useState<Array<ModelsReplica>>([]);
const [dateSort, setDateSort] = useState<sortDirection>('descending');
Expand Down
26 changes: 14 additions & 12 deletions src/components/page-step/job-step-logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ const HistoricalLog: FunctionComponent<StepLogsProps> = ({
stepName,
timeSpan,
}) => {
const { data, ...state } = useGetPipelineJobInventoryQuery({
appName,
pipelineJobName: jobName,
...getTimespan(timeSpan),
});
const { data, ...state } = useGetPipelineJobInventoryQuery(
{ appName, pipelineJobName: jobName, ...getTimespan(timeSpan) },
{ skip: !appName || !jobName }
);
const [container, setContainer] = useState<BrandedContainerModel>();

useEffect(() => {
Expand Down Expand Up @@ -87,13 +86,16 @@ const ContainerLog: FunctionComponent<
'appName' | 'jobName' | 'timeSpan'
>
> = ({ appName, container: { name, parentId, id }, jobName, timeSpan }) => {
const { data, ...state } = useGetPipelineJobContainerLogQuery({
appName,
pipelineJobName: jobName,
replicaName: parentId,
containerId: id,
...getTimespan(timeSpan),
});
const { data, ...state } = useGetPipelineJobContainerLogQuery(
{
appName,
pipelineJobName: jobName,
replicaName: parentId,
containerId: id,
...getTimespan(timeSpan),
},
{ skip: !appName || !jobName || !parentId || !id }
);

return (
<AsyncResource asyncState={state}>
Expand Down