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

Remove deprecated fields from form #3909

Merged
merged 4 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The types of changes are:

## [Unreleased](https://github.com/ethyca/fides/compare/2.18.0...main)

### Changed
- Removed deprecated fields from the taxonomy editor [#3909](https://github.com/ethyca/fides/pull/3909)

### Fixed
- Fixed issue when generating masked values for invalid data paths (#3906)[https://github.com/ethyca/fides/pull/3906]

Expand All @@ -26,17 +29,14 @@ The types of changes are:
- Additional consent reporting calls from `fides-js` [#3845](https://github.com/ethyca/fides/pull/3845)
- Additional consent reporting calls from privacy center [#3847](https://github.com/ethyca/fides/pull/3847)
- Access support for Recurly [#3595](https://github.com/ethyca/fides/pull/3595)
- HTTP Logging for the Privacy Center [#3783](https://github.com/ethyca/fides/pull/3783)
- UI support for OAuth2 authorization flow [#3819](https://github.com/ethyca/fides/pull/3819)
- Changes in the `data` directory now trigger a server reload (for local development) [#3874](https://github.com/ethyca/fides/pull/3874)

### Fixed
- Fix datamap zoom for low system counts [#3835](https://github.com/ethyca/fides/pull/3835)
- Fixed connector forms with external dataset reference fields [#3873](https://github.com/ethyca/fides/pull/3873)

### Added

- HTTP Logging for the Privacy Center [#3783](https://github.com/ethyca/fides/pull/3783)
- UI support for OAuth2 authorization flow [#3819](https://github.com/ethyca/fides/pull/3819)
- Changes in the `data` directory now trigger a server reload (for local development) [#3874](https://github.com/ethyca/fides/pull/3874)

### Changed

- Simplified the file structure for HTML DSR packages [#3848](https://github.com/ethyca/fides/pull/3848)
Expand Down
7 changes: 6 additions & 1 deletion clients/admin-ui/cypress/e2e/taxonomy.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ describe("Taxonomy management page", () => {
);
});

it("Can render an extended form for Data Uses", () => {
/*
* These fields are deprecated.
* This test is being kept so it can be updated
* with new fields in the future
*/
it.skip("Can render an extended form for Data Uses", () => {
cy.getByTestId("tab-Data Uses").click();

// check an entity that has optional fields filled in ("provides")
Expand Down
85 changes: 5 additions & 80 deletions clients/admin-ui/src/features/taxonomy/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,11 @@ import {
DataSubjectRightsEnum,
DataUse,
IncludeExcludeEnum,
LegalBasisEnum,
ResourceTypes,
SpecialCategoriesEnum,
} from "~/types/api";

import { YesNoOptions } from "../common/constants";
import {
CustomCreatableSelect,
CustomRadioGroup,
CustomSelect,
CustomTextInput,
} from "../common/form/inputs";
import { CustomRadioGroup, CustomSelect } from "../common/form/inputs";
import { enumToOptions } from "../common/helpers";
import {
useCreateDataSubjectMutation,
Expand Down Expand Up @@ -221,12 +214,6 @@ export const useDataUse = (): TaxonomyHookData<DataUse> => {
name: "Data use name",
description: "Data use description",
parent_key: "Parent data use",
legal_basis: "Legal basis",
special_category: "Special category",
recipient: "Recipient",
legitimate_interest: "Legitimate interest",
legitimate_interest_impact_assessment:
"Legitimate interest impact assessment",
};

const [createDataUseMutationTrigger] = useCreateDataUseMutation();
Expand All @@ -235,23 +222,6 @@ export const useDataUse = (): TaxonomyHookData<DataUse> => {

const transformFormValuesToEntity = (formValues: DataUse) => ({
...formValues,
// text inputs don't like having undefined, so we originally converted
// to "", but on submission we need to convert back to undefined
legitimate_interest_impact_assessment:
formValues.legitimate_interest_impact_assessment === ""
? undefined
: formValues.legitimate_interest_impact_assessment,
legitimate_interest: !!(
formValues.legitimate_interest?.toString() === "true"
),
legal_basis:
formValues.legal_basis?.toString() === ""
? undefined
: formValues.legal_basis,
special_category:
formValues.special_category?.toString() === ""
? undefined
: formValues.special_category,
});

const customFields = useCustomFields({
Expand Down Expand Up @@ -300,15 +270,6 @@ export const useDataUse = (): TaxonomyHookData<DataUse> => {
);
return {
...base,
legal_basis: du.legal_basis,
special_category: du.special_category,
recipients: du.recipients ?? [],
legitimate_interest:
du.legitimate_interest == null
? "false"
: du.legitimate_interest.toString(),
legitimate_interest_impact_assessment:
du.legitimate_interest_impact_assessment ?? "",
};
};

Expand All @@ -330,47 +291,11 @@ export const useDataUse = (): TaxonomyHookData<DataUse> => {
return result;
};

const legalBases = enumToOptions(LegalBasisEnum);
const specialCategories = enumToOptions(SpecialCategoriesEnum);

const renderExtraFormFields = (formValues: DataUse) => (
<>
<CustomSelect
name="legal_basis"
label={labels.legal_basis}
options={legalBases}
isClearable
/>
<CustomSelect
name="special_category"
label={labels.special_category}
options={specialCategories}
isClearable
/>
<CustomCreatableSelect
name="recipients"
label={labels.recipient}
options={[]}
size="sm"
disableMenu
isMulti
/>
<CustomRadioGroup
name="legitimate_interest"
label={labels.legitimate_interest}
options={YesNoOptions}
/>
{formValues.legitimate_interest?.toString() === "true" ? (
<CustomTextInput
name="legitimate_interest_impact_assessment"
label={labels.legitimate_interest_impact_assessment}
/>
) : null}
<CustomFieldsList
resourceFidesKey={formValues.fides_key}
resourceType={resourceType}
/>
</>
<CustomFieldsList
resourceFidesKey={formValues.fides_key}
resourceType={resourceType}
/>
);

return {
Expand Down