Skip to content

Commit

Permalink
PROD-1396 Fix typeerror when tcf vendors have no dataDeclaration (#4465)
Browse files Browse the repository at this point in the history
  • Loading branch information
eastandwestwind authored Nov 29, 2023
1 parent 1c500ab commit 4f990a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 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.25.0...main)

### Fixed
- Fix type errors when TCF vendors have no dataDeclaration [#4465](https://github.com/ethyca/fides/pull/4465)

## [2.25.0](https://github.com/ethyca/fides/compare/2.24.1...2.25.0)

### Added
Expand Down
7 changes: 4 additions & 3 deletions clients/fides-js/src/components/tcf/TcfVendors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ const DataCategories = ({
}

// @ts-ignore this type doesn't exist in v2.2 but does in v3
const declarations: GvlDataDeclarations = gvlVendor.dataDeclaration;
const declarations: GvlDataDeclarations | undefined =
gvlVendor.dataDeclaration;

return (
<table className="fides-vendor-details-table">
Expand All @@ -109,11 +110,11 @@ const DataCategories = ({
</tr>
</thead>
<tbody>
{declarations.map((id) => {
{declarations?.map((id) => {
const category = dataCategories[id];
return (
<tr key={id}>
<td>{category.name}</td>
<td>{category?.name || ""}</td>
</tr>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@
"vendorListVersion": 19,
"tcfPolicyVersion": 4,
"lastUpdated": "2023-09-21T16:07:34Z",
"dataCategories": {
"1": {
"id": 1,
"name": "Device Data",
"description": "Data that pertains to a device, including OS information and cross-device identification capabilities."
}
},
"purposes": {
"1": {
"id": 1,
Expand Down Expand Up @@ -457,7 +464,7 @@
"legIntClaim": "https://www.captifytechnologies.com/privacy-notice/"
}
],
"dataDeclaration": [],
"dataDeclaration": null,
"deviceStorageDisclosureUrl": "https://static.cpx.to/gvl/deviceStorageDisclosure.json"
}
},
Expand Down

0 comments on commit 4f990a3

Please sign in to comment.