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
3 changed files with 35 additions and 29 deletions

View File

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

View File

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

View File

@@ -119,7 +119,8 @@ class Template extends Component {
<Route <Route
key="not-found" key="not-found"
path="*" path="*"
render={() => ( render={() =>
!hasContentLoading && (
<ContentError isNotFound> <ContentError isNotFound>
{match.params.id && ( {match.params.id && (
<Link <Link
@@ -129,7 +130,8 @@ class Template extends Component {
</Link> </Link>
)} )}
</ContentError> </ContentError>
)} )
}
/>, />,
]} ]}
</Switch> </Switch>