mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 10:57:35 -02:30
Display error message if schedule does not exist
Display error message if schedule does not exist when redirecting to details page. See: https://github.com/ansible/awx/issues/9550
This commit is contained in:
@@ -69,6 +69,19 @@ function Schedule({
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (!isLoading && error) {
|
||||||
|
return (
|
||||||
|
<ContentError isNotFound error={error}>
|
||||||
|
{error.response && error.response.status === 404 && (
|
||||||
|
<span>
|
||||||
|
{t`Schedule not found.`}{' '}
|
||||||
|
<Link to={`${pathRoot}schedules`}>{t`View Schedules`}</Link>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</ContentError>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (isLoading || !schedule?.summary_fields?.unified_job_template?.id) {
|
if (isLoading || !schedule?.summary_fields?.unified_job_template?.id) {
|
||||||
return <ContentLoading />;
|
return <ContentLoading />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { Switch, Route, useRouteMatch } from 'react-router-dom';
|
import { Switch, Route, useRouteMatch } from 'react-router-dom';
|
||||||
|
|
||||||
import Schedule from './Schedule';
|
import Schedule from './Schedule';
|
||||||
import ScheduleAdd from './ScheduleAdd';
|
import ScheduleAdd from './ScheduleAdd';
|
||||||
import ScheduleList from './ScheduleList';
|
import ScheduleList from './ScheduleList';
|
||||||
@@ -19,6 +19,7 @@ function Schedules({
|
|||||||
|
|
||||||
// For some management jobs that delete data, we want to provide an additional
|
// For some management jobs that delete data, we want to provide an additional
|
||||||
// field on the scheduler for configuring the number of days to retain.
|
// field on the scheduler for configuring the number of days to retain.
|
||||||
|
|
||||||
const hasDaysToKeepField = [
|
const hasDaysToKeepField = [
|
||||||
'cleanup_activitystream',
|
'cleanup_activitystream',
|
||||||
'cleanup_jobs',
|
'cleanup_jobs',
|
||||||
|
|||||||
Reference in New Issue
Block a user