Skip to content

Commit

Permalink
Update TS types for privacy notice locations (#3787)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking authored Jul 17, 2023
1 parent 55acc85 commit ec70d25
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 49 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions clients/admin-ui/cypress/fixtures/privacy-notices/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const ConnectionGridItem: React.FC<ConnectionGridItemProps> = ({
<ConnectionMenu
connection_key={connectionData.key}
disabled={!!connectionData.disabled}
name={connectionData.name}
name={connectionData.name ?? connectionData.key}
connection_type={connectionData.connection_type}
access_type={connectionData.access}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ConnectionTypeLogo: React.FC<ConnectionTypeLogoProps & ImageProps> = ({
};
const getAltValue = (): string => {
if (isDatastoreConnection(data)) {
return data.name;
return data.name ?? data.key;
}
if (isConnectionSystemTypeMap(data)) {
return data.human_readable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const ConnectorParametersForm: React.FC<ConnectorParametersFormProps> = ({
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ConnectorParametersForm: React.FC<ConnectorParametersFormProps> = ({
);
const getInitialValues = () => {
if (connection?.key) {
defaultValues.name = connection.name;
defaultValues.name = connection.name ?? "";
defaultValues.description = connection.description as string;
}
return defaultValues;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const ConnectorParametersForm: React.FC<ConnectorParametersFormProps> = ({
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
Expand Down Expand Up @@ -367,7 +367,7 @@ const ConnectorParametersForm: React.FC<ConnectorParametersFormProps> = ({
disabled={isDisabledConnection}
connection_type={connectionConfig?.connection_type}
access_type={connectionConfig?.access}
name={connectionConfig?.name}
name={connectionConfig?.name ?? connectionConfig.key}
isSwitch
/>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/src/types/api/models/ConsentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
export enum ConsentMethod {
BUTTON = "button",
GPC = "gpc",
API = "api",
INDIVIDUAL_NOTICE = "individual_notice",
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<string>;
affected_system_status: Record<string, ExecutionLogStatus>;
url_recorded?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
60 changes: 30 additions & 30 deletions clients/admin-ui/src/types/api/models/PrivacyNoticeRegion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -16,6 +15,6 @@ export type PrivacyPreferencesRequest = {
preferences: Array<ConsentOptionCreate>;
policy_key?: string;
privacy_experience_id?: string;
user_geography?: PrivacyNoticeRegion;
user_geography?: string;
method?: ConsentMethod;
};
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ec70d25

Please sign in to comment.