Fix Yatai UI error when BentoBundle file upload fail
@@ -51,6 +51,20 @@ const BentoServiceTable = (props) => {
const { bentos } = props;
const parsedBentoServices = bentos.map((bento) => {
const metadata = bento.bento_service_metadata;
+ if (lodash.isEmpty(metadata)) {
+ // When a BentoBundle is created but bundle file upload is not finished, the
+ // metadata field will be empty
+ return {
+ content: [
+ `${bento.name}:${bento.version}`,
+ null,
+ null,
+ null,
+ null,
+ <Link to={`/repository/${bento.name}/${bento.version}`}>Detail</Link>,
+ ]
+ }
+ } else {
const apis = apisToDisplayFormat(metadata.apis);
const artifacts = artifactsToDisplayFormat(metadata.artifacts);
const labels = labelsToDisplayFormat(metadata.labels);
@@ -66,6 +80,7 @@ const BentoServiceTable = (props) => {
],
link: `/repository/${bento.name}/${bento.version}`,
};
+ }
});
return (
