Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add env var to field details popover #3454

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import * as React from 'react';
import { FormGroup, GenerateId, Popover } from '@patternfly/react-core';
import {
DescriptionList,
DescriptionListDescription,
DescriptionListGroup,
DescriptionListTerm,
FormGroup,
GenerateId,
Popover,
} from '@patternfly/react-core';
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons';
import { ConnectionTypeDataField } from '~/concepts/connectionTypes/types';
import DashboardPopupIconButton from '~/concepts/dashboard/DashboardPopupIconButton';
Expand All @@ -19,14 +27,28 @@
// do not mark read only fields as required
isRequired={field.required && !field.properties.defaultReadOnly}
labelIcon={
field.description ? (
<Popover bodyContent={field.description}>
<DashboardPopupIconButton
icon={<OutlinedQuestionCircleIcon />}
aria-label="More info"
/>
</Popover>
) : undefined
<Popover
headerContent="Field details"
bodyContent={
<DescriptionList isCompact>
<DescriptionListGroup>
<DescriptionListTerm>Environment variable</DescriptionListTerm>
<DescriptionListDescription>{field.envVar}</DescriptionListDescription>
</DescriptionListGroup>
{field.description ? (
<DescriptionListGroup>

Check warning on line 39 in frontend/src/concepts/connectionTypes/fields/DataFormFieldGroup.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/src/concepts/connectionTypes/fields/DataFormFieldGroup.tsx#L39

Added line #L39 was not covered by tests
<DescriptionListTerm>Description</DescriptionListTerm>
<DescriptionListDescription>{field.description}</DescriptionListDescription>
</DescriptionListGroup>
) : null}
</DescriptionList>
}
>
<DashboardPopupIconButton
icon={<OutlinedQuestionCircleIcon />}
aria-label="More info"
/>
</Popover>
}
>
{children(id)}
Expand Down
Loading