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

Dataset reference field styling #5408

Merged
merged 10 commits into from
Oct 23, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The types of changes are:
- Fixed issue where multiple login redirects could end up losing login return path [#5389](https://github.com/ethyca/fides/pull/5389)
- Fixed issue where Dataset with nested fields was unable to edit Categories [#5383](https://github.com/ethyca/fides/pull/5383)
- Fixed a visual bug where the "download" icon was off-center in some buttons [#5409](https://github.com/ethyca/fides/pull/5409)
- Fixed styling on "Dataset" field on system integration form [#5408](https://github.com/ethyca/fides/pull/5408)

### Developer Experience
- Fix warning messages from slowapi and docker [#5385](https://github.com/ethyca/fides/pull/5385)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomSelect, Option, SelectInput } from "common/form/inputs";
import { Option, SelectInput } from "common/form/inputs";
import {
ConnectionTypeSecretSchemaProperty,
ConnectionTypeSecretSchemaResponse,
Expand Down Expand Up @@ -30,6 +30,7 @@ import { DatastoreConnectionStatus } from "src/features/datastore-connections/ty

import { useFeatures } from "~/features/common/features";
import DisableConnectionModal from "~/features/datastore-connections/DisableConnectionModal";
import SelectDataset from "~/features/datastore-connections/system_portal_config/forms/SelectDataset";
import {
ConnectionConfigurationResponse,
ConnectionSystemTypeMap,
Expand Down Expand Up @@ -485,18 +486,7 @@ export const ConnectorParametersForm = ({
)}
{SystemType.DATABASE === connectionOption.type &&
!isCreatingConnectionConfig && (
<CustomSelect
label="Datasets"
labelProps={{
fontWeight: "semibold",
fontSize: "sm",
minWidth: "150px",
}}
name="dataset"
options={datasetDropdownOptions}
isMulti
size="sm"
/>
<SelectDataset options={datasetDropdownOptions} />
)}
<div className="flex gap-4">
{!connectionOption.authorization_required || authorized ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {
Box,
CircleHelpIcon,
Flex,
FormControl,
FormErrorMessage,
FormLabel,
Tooltip,
VStack,
} from "fidesui";
import { useField } from "formik";

import { Option, SelectInput } from "~/features/common/form/inputs";

const SelectDataset = ({ options }: { options?: Option[] }) => {
const [, { error }] = useField("dataset");
return (
<FormControl display="flex">
<FormLabel
color="gray.900"
fontWeight="semibold"
fontSize="sm"
htmlFor="dataset"
minWidth="150px"
>
Datasets
</FormLabel>
<VStack align="flex-start" w="100%">
<Box w="full">
<SelectInput
fieldName="dataset"
options={options}
isMulti
size="sm"
isSearchable
/>
</Box>
<FormErrorMessage>{error}</FormErrorMessage>
</VStack>
<Tooltip
aria-label="Select datasets to associate with this integration"
hasArrow
label="Select datasets to associate with this integration"
placement="right-start"
openDelay={500}
>
<Flex alignItems="center" h="32px">
<CircleHelpIcon marginLeft="8px" _hover={{ cursor: "pointer" }} />
</Flex>
</Tooltip>
</FormControl>
);
};

export default SelectDataset;
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ class BigQuerySchema(ConnectionConfigSecretsSchema):
"""Schema to validate the secrets needed to connect to BigQuery"""

keyfile_creds: KeyfileCreds = Field(
title="Keyfile Creds",
title="Keyfile creds",
json_schema_extra={"sensitive": True},
description="The contents of the key file that contains authentication credentials for a service account in GCP.",
)
dataset: Optional[str] = Field(
default=None,
title="Default BigQuery Dataset",
title="Default dataset",
description="The default BigQuery dataset that will be used if one isn't provided in the associated Fides datasets.",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,13 +839,13 @@ def test_get_connection_secret_schema_bigquery(
"type": "object",
"properties": {
"keyfile_creds": {
"title": "Keyfile Creds",
"title": "Keyfile creds",
"description": "The contents of the key file that contains authentication credentials for a service account in GCP.",
"sensitive": True,
"allOf": [{"$ref": "#/definitions/KeyfileCreds"}],
},
"dataset": {
"title": "Default BigQuery Dataset",
"title": "Default dataset",
"description": "The default BigQuery dataset that will be used if one isn't provided in the associated Fides datasets.",
"type": "string",
},
Expand Down
Loading