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

Undeclared data categories #4781

Merged
merged 12 commits into from
Apr 22, 2024
52 changes: 51 additions & 1 deletion clients/admin-ui/cypress/e2e/datamap-report.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const mockCustomField = (overrides?: Partial<CustomFieldDefinition>) => {
return base;
};

describe("Datamap table and spatial view", () => {
describe("Minimal datamap report table", () => {
beforeEach(() => {
cy.login();
stubPlus(true);
Expand Down Expand Up @@ -81,4 +81,54 @@ describe("Datamap table and spatial view", () => {
}).as("getDatamapMinimalEmpty");
cy.getByTestId("datamap-report-heading").should("be.visible");
});

describe("Undeclared data category columns", () => {
it("should have the undeclared data columns disabled by default", () => {
cy.getByTestId("row-0-col-system_undeclared_data_categories").should(
"not.exist"
);
cy.getByTestId("row-0-col-data_use_undeclared_data_categories").should(
"not.exist"
);
});

it("should show undeclared data columns when enabled", () => {
cy.getByTestId("edit-columns-btn").click();
cy.contains("div", "System undeclared data categories").click();
cy.contains("div", "Data use undeclared data categories").click();
cy.getByTestId("save-button").click();

cy.getByTestId("row-0-col-system_undeclared_data_categories").contains(
"2 system undeclared data categories"
);
cy.getByTestId("row-0-col-data_use_undeclared_data_categories").contains(
"2 data use undeclared data categories"
);

// should be able to expand columns
cy.getByTestId("system_undeclared_data_categories-header-menu").click();
cy.getByTestId(
"system_undeclared_data_categories-header-menu-list"
).within(() => {
cy.get("button").contains("Display all").click();
});
["User Contact Email", "Cookie ID"].forEach((pokemon) => {
cy.getByTestId("row-0-col-system_undeclared_data_categories").contains(
pokemon
);
});

cy.getByTestId("data_use_undeclared_data_categories-header-menu").click();
cy.getByTestId(
"data_use_undeclared_data_categories-header-menu-list"
).within(() => {
cy.get("button").contains("Display all").click();
});
["User Contact Email", "Cookie ID"].forEach((pokemon) => {
cy.getByTestId(
"row-0-col-data_use_undeclared_data_categories"
).contains(pokemon);
});
});
});
});
37 changes: 37 additions & 0 deletions clients/admin-ui/cypress/fixtures/datamap/minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [
"user.contact.email",
"user.device.cookie_id"
],
"data_uses": "analytics.reporting.ad_performance",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -40,6 +44,10 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [
"user.contact.email",
"user.device.cookie_id"
],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -59,6 +67,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "essential.fraud_detection",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -90,6 +99,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -109,6 +119,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "essential.service.security",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -140,6 +151,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -159,6 +171,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "functional.service.improve",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -190,6 +203,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -209,6 +223,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "functional.storage",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -240,6 +255,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -259,6 +275,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.first_party.contextual",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -290,6 +307,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -309,6 +327,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.first_party.targeted",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -340,6 +359,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -359,6 +379,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.frequency_capping",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -390,6 +411,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -409,6 +431,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.negative_targeting",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -440,6 +463,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -459,6 +483,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.profiling",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -490,6 +515,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -509,6 +535,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.serving",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -540,6 +567,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand All @@ -559,6 +587,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.third_party.targeted",
"declaration_name": "",
"description": "1Agency sees itself as a creative agency with a focus on online marketing and events.",
Expand Down Expand Up @@ -590,6 +619,7 @@
"special_category_legal_basis": null,
"system_dependencies": null,
"system_name": "1Agency",
"system_undeclared_data_categories": [],
"third_country_safeguards": null,
"third_parties": null,
"uses_cookies": true,
Expand Down Expand Up @@ -623,6 +653,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "analytics.reporting.ad_performance",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -690,6 +721,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "analytics.reporting.campaign_insights",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -757,6 +789,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "analytics.reporting.content_performance",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -824,6 +857,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "functional.storage",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -891,6 +925,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.profiling",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -958,6 +993,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "personalize.content.profiling",
"declaration_name": "",
"description": "1plusX is a data management and AI-driven marketing platform that enables personalized content and advertising experiences based on audience insights.",
Expand Down Expand Up @@ -1060,6 +1096,7 @@
"data_shared_with_third_parties": false,
"data_stewards": [],
"data_subjects": [],
"data_use_undeclared_data_categories": [],
"data_uses": "marketing.advertising.third_party.targeted",
"declaration_name": "",
"description": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const ColumnSettingsModal = <T,>({
.map((c) => ({
id: c.id,
displayText: c.columnDef?.meta?.displayText || c.id,
isVisible: c.getIsVisible(),
isVisible:
tableInstance.getState().columnVisibility[c.id] ?? c.getIsVisible(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

})),
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
Expand Down Expand Up @@ -111,6 +112,7 @@ export const ColumnSettingsModal = <T,>({
Cancel
</Button>
<Button
data-testid="save-button"
colorScheme="primary"
size="sm"
onClick={handleSave}
Expand Down
1 change: 1 addition & 0 deletions clients/admin-ui/src/features/datamap/datamap.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const datamapApi = baseApi.injectEndpoints({
url: `plus/datamap/minimal?${queryString}`,
};
},
providesTags: ["Datamap"],
galvana marked this conversation as resolved.
Show resolved Hide resolved
}),
getDatamap: build.query<DatamapTableData, { organizationName: string }>({
query: ({ organizationName }) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const SettingsModal: React.FC<SettingsModalProps> = ({ isOpen, onClose }) => {
<Modal isOpen={isOpen} onClose={onClose} isCentered size="2xl">
<ModalOverlay />
<ModalContent>
<ModalHeader pb={0}>Data Map Settings</ModalHeader>
<ModalHeader pb={0}>Data map settings</ModalHeader>
galvana marked this conversation as resolved.
Show resolved Hide resolved
<ModalCloseButton />
<ModalBody>
<Text fontSize="sm" color="gray.500" mb={2}>
Expand Down
Loading
Loading