Skip to content

Commit

Permalink
Do not render create page if CRD model is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
rawagner committed Aug 3, 2021
1 parent 10788fd commit 0fe1bac
Showing 1 changed file with 37 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,39 +168,43 @@ const CreateOperandPage: React.FC<CreateOperandPageProps> = ({ match }) => {
<Helmet>
<title>{t('olm~Create {{item}}', { item: kindForReference(match.params.plural) })}</title>
</Helmet>
{loaded && !_.isEmpty(csv) && model && (
<div className="co-create-operand__breadcrumbs">
<BreadCrumbs
breadcrumbs={[
{
name: csv.spec.displayName,
path: resourcePathFromModel(
ClusterServiceVersionModel,
csv.metadata.name,
csv.metadata.namespace,
),
},
{
name: t('olm~Create {{item}}', { item: model.label }),
path: window.location.pathname,
},
]}
/>
</div>
)}
{createResourceExtension ? (
<AsyncComponent
loader={createResourceExtension.properties.component}
namespace={match.params.ns}
/>
) : (
<CreateOperand
match={match}
initialEditorType={EditorType.Form}
csv={csv}
loaded={loaded}
loadError={loadError}
/>
{model && (
<>
{loaded && !_.isEmpty(csv) && (
<div className="co-create-operand__breadcrumbs">
<BreadCrumbs
breadcrumbs={[
{
name: csv.spec.displayName,
path: resourcePathFromModel(
ClusterServiceVersionModel,
csv.metadata.name,
csv.metadata.namespace,
),
},
{
name: t('olm~Create {{item}}', { item: model.label }),
path: window.location.pathname,
},
]}
/>
</div>
)}
{createResourceExtension ? (
<AsyncComponent
loader={createResourceExtension.properties.component}
namespace={match.params.ns}
/>
) : (
<CreateOperand
match={match}
initialEditorType={EditorType.Form}
csv={csv}
loaded={loaded}
loadError={loadError}
/>
)}
</>
)}
</>
);
Expand Down

0 comments on commit 0fe1bac

Please sign in to comment.