mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Merge pull request #8938 from jakemcdermott/fix-8936
Don't build job redirect until data available Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -18,8 +18,11 @@ function JobTypeRedirect({ id, path, view, i18n }) {
|
|||||||
request: loadJob,
|
request: loadJob,
|
||||||
} = useRequest(
|
} = useRequest(
|
||||||
useCallback(async () => {
|
useCallback(async () => {
|
||||||
const { data } = await UnifiedJobsAPI.read({ id });
|
const {
|
||||||
return { job: data };
|
data: { results },
|
||||||
|
} = await UnifiedJobsAPI.read({ id });
|
||||||
|
const [item] = results;
|
||||||
|
return { job: item };
|
||||||
}, [id]),
|
}, [id]),
|
||||||
{ job: {} }
|
{ job: {} }
|
||||||
);
|
);
|
||||||
@@ -42,7 +45,7 @@ function JobTypeRedirect({ id, path, view, i18n }) {
|
|||||||
</PageSection>
|
</PageSection>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (isLoading) {
|
if (isLoading || !job?.id) {
|
||||||
// TODO show loading state
|
// TODO show loading state
|
||||||
return <div>Loading...</div>;
|
return <div>Loading...</div>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function Templates({ i18n }) {
|
|||||||
[`${templatePath}/notifications`]: i18n._(t`Notifications`),
|
[`${templatePath}/notifications`]: i18n._(t`Notifications`),
|
||||||
[`${templatePath}/completed_jobs`]: i18n._(t`Completed Jobs`),
|
[`${templatePath}/completed_jobs`]: i18n._(t`Completed Jobs`),
|
||||||
[surveyPath]: i18n._(t`Survey`),
|
[surveyPath]: i18n._(t`Survey`),
|
||||||
[`${surveyPath}add`]: i18n._(t`Add Question`),
|
[`${surveyPath}/add`]: i18n._(t`Add Question`),
|
||||||
[`${surveyPath}/edit`]: i18n._(t`Edit Question`),
|
[`${surveyPath}/edit`]: i18n._(t`Edit Question`),
|
||||||
[schedulesPath]: i18n._(t`Schedules`),
|
[schedulesPath]: i18n._(t`Schedules`),
|
||||||
[`${schedulesPath}/add`]: i18n._(t`Create New Schedule`),
|
[`${schedulesPath}/add`]: i18n._(t`Create New Schedule`),
|
||||||
|
|||||||
Reference in New Issue
Block a user