From ec70d25cb4cc1bfa6476ddabc88f998d11135393 Mon Sep 17 00:00:00 2001 From: Allison King Date: Mon, 17 Jul 2023 11:23:28 -0400 Subject: [PATCH] Update TS types for privacy notice locations (#3787) --- CHANGELOG.md | 3 + .../fixtures/privacy-notices/list.json | 8 +-- .../fixtures/privacy-notices/notice.json | 2 +- .../ConnectionGridItem.tsx | 2 +- .../ConnectionTypeLogo.tsx | 2 +- .../forms/ConnectorParametersForm.tsx | 2 +- .../manual/ConnectorParametersForm.tsx | 2 +- .../forms/ConnectorParametersForm.tsx | 4 +- .../models/ConnectionConfigurationResponse.ts | 2 +- .../src/types/api/models/ConsentMethod.ts | 2 +- .../api/models/ConsentReportingSchema.ts | 3 +- ...reateConnectionConfigurationWithSecrets.ts | 2 +- .../types/api/models/PrivacyNoticeRegion.ts | 60 +++++++++---------- .../api/models/PrivacyPreferencesRequest.ts | 3 +- .../models/SaasConnectionTemplateValues.ts | 2 +- 15 files changed, 50 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bd9a04040..c5b5f4859e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,9 @@ The types of changes are: ### Added - Record when consent is served [#3777](https://github.com/ethyca/fides/pull/3777) +### Fixed +- Privacy notice UI's list of possible regions now matches the backend's list [#3787](https://github.com/ethyca/fides/pull/3787) + ## [2.16.0](https://github.com/ethyca/fides/compare/2.15.1...2.16.0) ### Added diff --git a/clients/admin-ui/cypress/fixtures/privacy-notices/list.json b/clients/admin-ui/cypress/fixtures/privacy-notices/list.json index 65c3c24ada..934666fa55 100644 --- a/clients/admin-ui/cypress/fixtures/privacy-notices/list.json +++ b/clients/admin-ui/cypress/fixtures/privacy-notices/list.json @@ -27,7 +27,7 @@ "description": "Ensures you are correctly notifying the user about your advertising practices and for appropriate locations, collecting the users consent preferences.", "internal_description": null, "origin": null, - "regions": ["eu_fr", "eu_ie"], + "regions": ["fr", "ie"], "consent_mechanism": "opt_in", "data_uses": ["advertising.first_party.contextual"], "enforcement_level": "system_wide", @@ -48,7 +48,7 @@ "description": "Ensures you are correctly notifying the user about your advertising practices and for appropriate locations, collecting the users consent preferences.", "internal_description": null, "origin": null, - "regions": ["eu_fr", "eu_ie"], + "regions": ["fr", "ie"], "consent_mechanism": "opt_in", "data_uses": ["collect"], "enforcement_level": "system_wide", @@ -69,7 +69,7 @@ "description": "This is for data processing activities that enhance the capability or features of your site but may not be strictly necessary.", "internal_description": null, "origin": null, - "regions": ["eu_fr", "eu_ie"], + "regions": ["fr", "ie"], "consent_mechanism": "opt_in", "data_uses": ["improve.system"], "enforcement_level": "system_wide", @@ -90,7 +90,7 @@ "description": "Notify the user about data processing activities that are essential to your services functionality. Typically consent is not required for this.", "internal_description": null, "origin": null, - "regions": ["eu_fr", "eu_ie"], + "regions": ["fr", "ie"], "consent_mechanism": "notice_only", "data_uses": ["provide.service"], "enforcement_level": "system_wide", diff --git a/clients/admin-ui/cypress/fixtures/privacy-notices/notice.json b/clients/admin-ui/cypress/fixtures/privacy-notices/notice.json index 4824ec44ae..b2e4fd85bc 100644 --- a/clients/admin-ui/cypress/fixtures/privacy-notices/notice.json +++ b/clients/admin-ui/cypress/fixtures/privacy-notices/notice.json @@ -4,7 +4,7 @@ "description": "Notify the user about data processing activities that are essential to your services functionality. Typically consent is not required for this.", "internal_description": null, "origin": null, - "regions": ["eu_fr", "eu_ie"], + "regions": ["fr", "ie"], "consent_mechanism": "notice_only", "data_uses": ["provide.service"], "enforcement_level": "not_applicable", diff --git a/clients/admin-ui/src/features/datastore-connections/ConnectionGridItem.tsx b/clients/admin-ui/src/features/datastore-connections/ConnectionGridItem.tsx index 56f943947b..f21bd57bae 100644 --- a/clients/admin-ui/src/features/datastore-connections/ConnectionGridItem.tsx +++ b/clients/admin-ui/src/features/datastore-connections/ConnectionGridItem.tsx @@ -58,7 +58,7 @@ const ConnectionGridItem: React.FC = ({ diff --git a/clients/admin-ui/src/features/datastore-connections/ConnectionTypeLogo.tsx b/clients/admin-ui/src/features/datastore-connections/ConnectionTypeLogo.tsx index be7c752110..66cf2696d5 100644 --- a/clients/admin-ui/src/features/datastore-connections/ConnectionTypeLogo.tsx +++ b/clients/admin-ui/src/features/datastore-connections/ConnectionTypeLogo.tsx @@ -48,7 +48,7 @@ const ConnectionTypeLogo: React.FC = ({ }; const getAltValue = (): string => { if (isDatastoreConnection(data)) { - return data.name; + return data.name ?? data.key; } if (isConnectionSystemTypeMap(data)) { return data.human_readable; diff --git a/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx index b47559edc5..ebaafbff06 100644 --- a/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx @@ -195,7 +195,7 @@ const ConnectorParametersForm: React.FC = ({ const getInitialValues = () => { const initialValues = { ...defaultValues }; if (connection?.key) { - initialValues.name = connection.name; + initialValues.name = connection.name ?? ""; initialValues.description = connection.description as string; initialValues.instance_key = connection.connection_type === ConnectionType.SAAS diff --git a/clients/admin-ui/src/features/datastore-connections/add-connection/manual/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/add-connection/manual/ConnectorParametersForm.tsx index 160086262d..d33ec9c540 100644 --- a/clients/admin-ui/src/features/datastore-connections/add-connection/manual/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/add-connection/manual/ConnectorParametersForm.tsx @@ -30,7 +30,7 @@ const ConnectorParametersForm: React.FC = ({ ); const getInitialValues = () => { if (connection?.key) { - defaultValues.name = connection.name; + defaultValues.name = connection.name ?? ""; defaultValues.description = connection.description as string; } return defaultValues; diff --git a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx index 927f56053d..c3ccc1c609 100644 --- a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx @@ -213,7 +213,7 @@ const ConnectorParametersForm: React.FC = ({ const getInitialValues = () => { const initialValues = { ...defaultValues }; if (connectionConfig?.key) { - initialValues.name = connectionConfig.name; + initialValues.name = connectionConfig.name ?? ""; initialValues.description = connectionConfig.description as string; initialValues.instance_key = connectionConfig.connection_type === ConnectionType.SAAS @@ -367,7 +367,7 @@ const ConnectorParametersForm: React.FC = ({ disabled={isDisabledConnection} connection_type={connectionConfig?.connection_type} access_type={connectionConfig?.access} - name={connectionConfig?.name} + name={connectionConfig?.name ?? connectionConfig.key} isSwitch /> ) : null} diff --git a/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts b/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts index df2af50827..897bf2b827 100644 --- a/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts +++ b/clients/admin-ui/src/types/api/models/ConnectionConfigurationResponse.ts @@ -12,7 +12,7 @@ import type { SaaSConfigBase } from "./SaaSConfigBase"; * Do *NOT* add "secrets" to this schema. */ export type ConnectionConfigurationResponse = { - name: string; + name?: string; key: string; description?: string; connection_type: ConnectionType; diff --git a/clients/admin-ui/src/types/api/models/ConsentMethod.ts b/clients/admin-ui/src/types/api/models/ConsentMethod.ts index 951ebc7a4e..8d0b4dd52c 100644 --- a/clients/admin-ui/src/types/api/models/ConsentMethod.ts +++ b/clients/admin-ui/src/types/api/models/ConsentMethod.ts @@ -8,5 +8,5 @@ export enum ConsentMethod { BUTTON = "button", GPC = "gpc", - API = "api", + INDIVIDUAL_NOTICE = "individual_notice", } diff --git a/clients/admin-ui/src/types/api/models/ConsentReportingSchema.ts b/clients/admin-ui/src/types/api/models/ConsentReportingSchema.ts index 94a00c40cb..13138ef47c 100644 --- a/clients/admin-ui/src/types/api/models/ConsentReportingSchema.ts +++ b/clients/admin-ui/src/types/api/models/ConsentReportingSchema.ts @@ -5,7 +5,6 @@ import type { ActionType } from "./ActionType"; import type { ConsentMethod } from "./ConsentMethod"; import type { ExecutionLogStatus } from "./ExecutionLogStatus"; -import type { PrivacyNoticeRegion } from "./PrivacyNoticeRegion"; import type { PrivacyRequestStatus } from "./PrivacyRequestStatus"; import type { RequestOrigin } from "./RequestOrigin"; import type { UserConsentPreference } from "./UserConsentPreference"; @@ -27,7 +26,7 @@ export type ConsentReportingSchema = { approver_id?: string; privacy_notice_history_id: string; preference: UserConsentPreference; - user_geography?: PrivacyNoticeRegion; + user_geography?: string; relevant_systems?: Array; affected_system_status: Record; url_recorded?: string; diff --git a/clients/admin-ui/src/types/api/models/CreateConnectionConfigurationWithSecrets.ts b/clients/admin-ui/src/types/api/models/CreateConnectionConfigurationWithSecrets.ts index 8096369510..a8c39fe9a2 100644 --- a/clients/admin-ui/src/types/api/models/CreateConnectionConfigurationWithSecrets.ts +++ b/clients/admin-ui/src/types/api/models/CreateConnectionConfigurationWithSecrets.ts @@ -25,7 +25,7 @@ import type { TimescaleDocsSchema } from "./TimescaleDocsSchema"; * Schema for creating a connection configuration including secrets. */ export type CreateConnectionConfigurationWithSecrets = { - name: string; + name?: string; key?: string; connection_type: ConnectionType; access: AccessLevel; diff --git a/clients/admin-ui/src/types/api/models/PrivacyNoticeRegion.ts b/clients/admin-ui/src/types/api/models/PrivacyNoticeRegion.ts index 797d8482b1..45837854b2 100644 --- a/clients/admin-ui/src/types/api/models/PrivacyNoticeRegion.ts +++ b/clients/admin-ui/src/types/api/models/PrivacyNoticeRegion.ts @@ -3,7 +3,7 @@ /* eslint-disable */ /** - * Enum is not formalized in the DB because it is subject to frequent change + * An enumeration. */ export enum PrivacyNoticeRegion { US_AL = "us_al", @@ -56,38 +56,38 @@ export enum PrivacyNoticeRegion { US_WV = "us_wv", US_WI = "us_wi", US_WY = "us_wy", - EU_BE = "eu_be", - EU_BG = "eu_bg", - EU_CZ = "eu_cz", - EU_DK = "eu_dk", - EU_DE = "eu_de", - EU_EE = "eu_ee", - EU_IE = "eu_ie", - EU_EL = "eu_el", - EU_ES = "eu_es", - EU_FR = "eu_fr", - EU_HR = "eu_hr", - EU_IT = "eu_it", - EU_CY = "eu_cy", - EU_LV = "eu_lv", - EU_LT = "eu_lt", - EU_LU = "eu_lu", - EU_HU = "eu_hu", - EU_MT = "eu_mt", - EU_NL = "eu_nl", - EU_AT = "eu_at", - EU_PL = "eu_pl", - EU_PT = "eu_pt", - EU_RO = "eu_ro", - EU_SI = "eu_si", - EU_SK = "eu_sk", - EU_FI = "eu_fi", - EU_SE = "eu_se", + BE = "be", + BG = "bg", + CZ = "cz", + DK = "dk", + DE = "de", + EE = "ee", + IE = "ie", + GR = "gr", + ES = "es", + FR = "fr", + HR = "hr", + IT = "it", + CY = "cy", + LV = "lv", + LT = "lt", + LU = "lu", + HU = "hu", + MT = "mt", + NL = "nl", + AT = "at", + PL = "pl", + PT = "pt", + RO = "ro", + SI = "si", + SK = "sk", + FI = "fi", + SE = "se", GB_ENG = "gb_eng", GB_SCT = "gb_sct", GB_WLS = "gb_wls", GB_NIR = "gb_nir", - ISL = "isl", - NOR = "nor", + IS = "is", + NO = "no", LI = "li", } diff --git a/clients/admin-ui/src/types/api/models/PrivacyPreferencesRequest.ts b/clients/admin-ui/src/types/api/models/PrivacyPreferencesRequest.ts index 618986f031..0846cde464 100644 --- a/clients/admin-ui/src/types/api/models/PrivacyPreferencesRequest.ts +++ b/clients/admin-ui/src/types/api/models/PrivacyPreferencesRequest.ts @@ -5,7 +5,6 @@ import type { ConsentMethod } from "./ConsentMethod"; import type { ConsentOptionCreate } from "./ConsentOptionCreate"; import type { Identity } from "./Identity"; -import type { PrivacyNoticeRegion } from "./PrivacyNoticeRegion"; /** * Request body for creating PrivacyPreferences. @@ -16,6 +15,6 @@ export type PrivacyPreferencesRequest = { preferences: Array; policy_key?: string; privacy_experience_id?: string; - user_geography?: PrivacyNoticeRegion; + user_geography?: string; method?: ConsentMethod; }; diff --git a/clients/admin-ui/src/types/api/models/SaasConnectionTemplateValues.ts b/clients/admin-ui/src/types/api/models/SaasConnectionTemplateValues.ts index 4d394114de..e364b5081e 100644 --- a/clients/admin-ui/src/types/api/models/SaasConnectionTemplateValues.ts +++ b/clients/admin-ui/src/types/api/models/SaasConnectionTemplateValues.ts @@ -22,7 +22,7 @@ import type { TimescaleDocsSchema } from "./TimescaleDocsSchema"; * Schema with values to create both a Saas ConnectionConfig and DatasetConfig from a template */ export type SaasConnectionTemplateValues = { - name: string; + name?: string; key?: string; description?: string; secrets: