Merge pull request #4699 from mabashian/4549-not-found

Don't render the 404 not found page until the content's finished loading

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-09-10 17:14:32 +00:00 committed by GitHub
commit 5193209ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 29 deletions

View File

@ -149,15 +149,17 @@ class Job extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
<Link
to={`/jobs/${match.params.type}/${match.params.id}/details`}
>
{i18n._(`View Job Details`)}
</Link>
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
<Link
to={`/jobs/${match.params.type}/${match.params.id}/details`}
>
{i18n._(`View Job Details`)}
</Link>
</ContentError>
)
}
/>,
]}
</Switch>

View File

@ -238,15 +238,17 @@ class Organization extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
{match.params.id && (
<Link to={`/organizations/${match.params.id}/details`}>
{i18n._(`View Organization Details`)}
</Link>
)}
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
{match.params.id && (
<Link to={`/organizations/${match.params.id}/details`}>
{i18n._(`View Organization Details`)}
</Link>
)}
</ContentError>
)
}
/>
,
</Switch>

View File

@ -119,17 +119,19 @@ class Template extends Component {
<Route
key="not-found"
path="*"
render={() => (
<ContentError isNotFound>
{match.params.id && (
<Link
to={`/templates/${match.params.templateType}/${match.params.id}/details`}
>
{i18n._(`View Template Details`)}
</Link>
)}
</ContentError>
)}
render={() =>
!hasContentLoading && (
<ContentError isNotFound>
{match.params.id && (
<Link
to={`/templates/${match.params.templateType}/${match.params.id}/details`}
>
{i18n._(`View Template Details`)}
</Link>
)}
</ContentError>
)
}
/>,
]}
</Switch>