fix inventory saving without insights credential specified

This commit is contained in:
Keith Grant
2019-12-19 10:59:16 -08:00
parent d0c891764f
commit f3c5cb5a2e
2 changed files with 13 additions and 3 deletions

View File

@@ -16,7 +16,7 @@ import ErrorDetail from '@components/ErrorDetail';
const EmptyState = styled(PFEmptyState)` const EmptyState = styled(PFEmptyState)`
width: var(--pf-c-empty-state--m-lg--MaxWidth); width: var(--pf-c-empty-state--m-lg--MaxWidth);
max-width: 100%; margin: 0 auto;
`; `;
async function logout() { async function logout() {

View File

@@ -54,7 +54,9 @@ function InventoryAdd({ history, i18n }) {
data: { id: inventoryId }, data: { id: inventoryId },
} = await InventoriesAPI.create({ } = await InventoriesAPI.create({
organization: organization.id, organization: organization.id,
insights_credential: insights_credential.id, insights_credential: insights_credential
? insights_credential.id
: null,
...remainingValues, ...remainingValues,
}); });
if (instanceGroups) { if (instanceGroups) {
@@ -74,7 +76,15 @@ function InventoryAdd({ history, i18n }) {
}; };
if (error) { if (error) {
return <ContentError />; return (
<PageSection>
<Card>
<CardBody>
<ContentError error={error} />
</CardBody>
</Card>
</PageSection>
);
} }
if (isLoading) { if (isLoading) {
return <ContentLoading />; return <ContentLoading />;