mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03: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:
parent
64631fca56
commit
f422677145
@ -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) {
|
||||
return <ContentLoading />;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Switch, Route, useRouteMatch } from 'react-router-dom';
|
||||
|
||||
import Schedule from './Schedule';
|
||||
import ScheduleAdd from './ScheduleAdd';
|
||||
import ScheduleList from './ScheduleList';
|
||||
@ -19,6 +19,7 @@ function Schedules({
|
||||
|
||||
// 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.
|
||||
|
||||
const hasDaysToKeepField = [
|
||||
'cleanup_activitystream',
|
||||
'cleanup_jobs',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user