From 29c8869e01de3fcb2f6ce95d632af69a89ce9485 Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:20:18 +0100 Subject: [PATCH] 3208: Adjusted to allowed recipients --- .../feed-sources/templates/colibo-feed-type.jsx | 10 +++++----- src/components/slide/content/content-form.jsx | 2 +- src/components/slide/content/feed-selector.jsx | 1 + .../slide/content/multiselect-from-endpoint.jsx | 3 +++ src/translations/da/common.json | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/feed-sources/templates/colibo-feed-type.jsx b/src/components/feed-sources/templates/colibo-feed-type.jsx index aec9f1c2..119fd378 100644 --- a/src/components/feed-sources/templates/colibo-feed-type.jsx +++ b/src/components/feed-sources/templates/colibo-feed-type.jsx @@ -24,7 +24,7 @@ const ColiboFeedType = ({ let endpoint = config.api; endpoint = endpoint.replace(/\/$/, ""); endpoint += feedSourceId; - endpoint += "/config/FeedEntryRecipients"; + endpoint += "/config/recipients"; setOptionsEndpoint(endpoint); }); @@ -81,10 +81,10 @@ const ColiboFeedType = ({ {optionsEndpoint && ( )} @@ -98,7 +98,7 @@ ColiboFeedType.propTypes = { api_base_uri: PropTypes.string, client_id: PropTypes.string, client_secret: PropTypes.string, - recipients: PropTypes.arrayOf(PropTypes.string), + allowed_recipients: PropTypes.arrayOf(PropTypes.string), }), feedSourceId: PropTypes.string, mode: PropTypes.string, diff --git a/src/components/slide/content/content-form.jsx b/src/components/slide/content/content-form.jsx index 435c1f9e..bc553643 100644 --- a/src/components/slide/content/content-form.jsx +++ b/src/components/slide/content/content-form.jsx @@ -123,7 +123,7 @@ function ContentForm({ errors={formData.required ? errors : null} label={formData.label} helpText={formData.helpText} - value={formStateObject[formData.name]} + value={formStateObject[formData.name] ?? formData?.defaultValue} onChange={onChange} formGroupClasses={formData.formGroupClasses} /> diff --git a/src/components/slide/content/feed-selector.jsx b/src/components/slide/content/feed-selector.jsx index f20f1b7a..e806cdc3 100644 --- a/src/components/slide/content/feed-selector.jsx +++ b/src/components/slide/content/feed-selector.jsx @@ -125,6 +125,7 @@ function FeedSelector({ optionsEndpoint={element.endpoint} disableSearch={element.disableSearch ?? false} singleSelect={element.singleSelect ?? false} + helpText={element.helpText ?? null} /> ); } diff --git a/src/components/slide/content/multiselect-from-endpoint.jsx b/src/components/slide/content/multiselect-from-endpoint.jsx index c4fcef82..8bb50d83 100644 --- a/src/components/slide/content/multiselect-from-endpoint.jsx +++ b/src/components/slide/content/multiselect-from-endpoint.jsx @@ -26,6 +26,7 @@ function MultiselectFromEndpoint({ value = [], disableSearch = true, singleSelect = false, + helpText = null, }) { const { t } = useTranslation("common"); const [options, setOptions] = useState(null); @@ -98,6 +99,7 @@ function MultiselectFromEndpoint({ }} filterCallback={() => {}} label={label ?? t("multiselect.select")} + helpText={helpText} /> )} @@ -112,6 +114,7 @@ MultiselectFromEndpoint.propTypes = { optionsEndpoint: PropTypes.string.isRequired, singleSelect: PropTypes.bool, disableSearch: PropTypes.bool, + helpText: PropTypes.string, }; export default MultiselectFromEndpoint; diff --git a/src/translations/da/common.json b/src/translations/da/common.json index d0c2fc27..2107698c 100644 --- a/src/translations/da/common.json +++ b/src/translations/da/common.json @@ -1086,8 +1086,8 @@ "client-id": "Client ID", "client-secret": "Client Secret", "values-info": "Værdierne Client ID og Client Secret findes ved at oprette en API klient i \"Systemadministration\" -> \"API adgangshåndtering\" i Colibo intranet.", - "recipients": "Modtagergrupper", + "allowed-recipients": "Tilladte modtagergrupper", "redacted-value-input-placeholder": "Skjult værdi", - "save-before-recipients-can-be-set": "Bemærk! Datakilden skal gemmes før der kan tilkobles modtagergrupper. Gem og åbn datakilden igen." + "save-before-recipients-can-be-set": "Bemærk! Datakilden skal gemmes før der kan tilkobles tilladte modtagergrupper. Gem og åbn datakilden igen." } }