From 9b2cf7fd45217ebc340062907dfdd90a86bee248 Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Fri, 15 Dec 2023 12:07:29 -0800 Subject: [PATCH] CompleteOptionsInverted description customizable (#152) * CompleteOptionsInverted description customizable * Adds new message --- .vscode/settings.json | 2 +- package.json | 2 +- src/components/CompleteOptionsInverted.tsx | 21 ++++++++++++++++++++- src/messages.ts | 5 +++++ src/translations/af-ZA.json | 1 + src/translations/ar-AE.json | 1 + src/translations/bg-BG.json | 1 + src/translations/cs-CZ.json | 1 + src/translations/da-DK.json | 1 + src/translations/de-DE.json | 1 + src/translations/description.json | 1 + src/translations/el-GR.json | 1 + src/translations/en.json | 1 + src/translations/es-419.json | 1 + src/translations/es-ES.json | 1 + src/translations/fi-FI.json | 1 + src/translations/fr-FR.json | 1 + src/translations/he-IL.json | 1 + src/translations/hi-IN.json | 1 + src/translations/hr-HR.json | 1 + src/translations/hu-HU.json | 1 + src/translations/id-ID.json | 1 + src/translations/it-IT.json | 1 + src/translations/ja-JP.json | 1 + src/translations/ko-KR.json | 1 + src/translations/lt-LT.json | 1 + src/translations/mr-IN.json | 1 + src/translations/ms-MY.json | 1 + src/translations/nb-NO.json | 1 + src/translations/nl-NL.json | 1 + src/translations/pl-PL.json | 1 + src/translations/pt-BR.json | 1 + src/translations/ro-RO.json | 1 + src/translations/ru-RU.json | 1 + src/translations/sr-Latn-RS.json | 1 + src/translations/sv-SE.json | 1 + src/translations/ta-IN.json | 1 + src/translations/th-TH.json | 1 + src/translations/tr-TR.json | 1 + src/translations/uk-UA.json | 1 + src/translations/vi-VN.json | 1 + src/translations/zh-CN.json | 1 + src/translations/zh-HK.json | 1 + 43 files changed, 66 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b251436e..53d403c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,7 +34,7 @@ "**/.pnp.*": true }, "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "cSpell.words": [ "airgap", diff --git a/package.json b/package.json index 37f1a456..34231629 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/transcend-io/consent-manager-ui.git" }, "homepage": "https://github.com/transcend-io/consent-manager-ui", - "version": "4.10.0", + "version": "4.11.0", "license": "MIT", "main": "build/ui", "files": [ diff --git a/src/components/CompleteOptionsInverted.tsx b/src/components/CompleteOptionsInverted.tsx index a65631a6..de4da612 100644 --- a/src/components/CompleteOptionsInverted.tsx +++ b/src/components/CompleteOptionsInverted.tsx @@ -2,7 +2,11 @@ import { h, JSX } from 'preact'; import { useState } from 'preact/hooks'; import { useIntl } from 'react-intl'; import { useAirgap, useGetPurposeMessageKeys } from '../hooks'; -import { messages, completeOptionsMessages } from '../messages'; +import { + messages, + completeOptionsMessages, + completeOptionsInvertedMessages, +} from '../messages'; import type { ConsentSelection, HandleSetViewState } from '../types'; import { getConsentSelections } from '../consent-selections'; import { Button } from './Button'; @@ -69,6 +73,11 @@ export function CompleteOptionsInverted({ ORDER_OF_PURPOSES.indexOf(a) - ORDER_OF_PURPOSES.indexOf(b), ); + // Render description + const description = formatMessage( + completeOptionsInvertedMessages.description, + ); + return (
+ {description && description !== '-' ? ( +

+

+

+ ) : undefined}
{orderedSelections.map(([purpose, isChecked]) => (