Skip to content

Commit

Permalink
3208: Adjusted to allowed recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Dec 19, 2024
1 parent fa107ff commit 29c8869
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/components/feed-sources/templates/colibo-feed-type.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ColiboFeedType = ({
let endpoint = config.api;
endpoint = endpoint.replace(/\/$/, "");
endpoint += feedSourceId;
endpoint += "/config/FeedEntryRecipients";
endpoint += "/config/recipients";

setOptionsEndpoint(endpoint);
});
Expand Down Expand Up @@ -81,10 +81,10 @@ const ColiboFeedType = ({
{optionsEndpoint && (
<MultiselectFromEndpoint
onChange={handleInput}
name="recipients"
name="allowed_recipients"
disableSearch={false}
label={t("recipients")}
value={formStateObject.recipients ?? []}
label={t("allowed-recipients")}
value={formStateObject.allowed_recipients ?? []}
optionsEndpoint={optionsEndpoint}
/>
)}
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/components/slide/content/content-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/slide/content/feed-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function FeedSelector({
optionsEndpoint={element.endpoint}
disableSearch={element.disableSearch ?? false}
singleSelect={element.singleSelect ?? false}
helpText={element.helpText ?? null}
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/components/slide/content/multiselect-from-endpoint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function MultiselectFromEndpoint({
value = [],
disableSearch = true,
singleSelect = false,
helpText = null,
}) {
const { t } = useTranslation("common");
const [options, setOptions] = useState(null);
Expand Down Expand Up @@ -98,6 +99,7 @@ function MultiselectFromEndpoint({
}}
filterCallback={() => {}}
label={label ?? t("multiselect.select")}
helpText={helpText}
/>
)}
</>
Expand All @@ -112,6 +114,7 @@ MultiselectFromEndpoint.propTypes = {
optionsEndpoint: PropTypes.string.isRequired,
singleSelect: PropTypes.bool,
disableSearch: PropTypes.bool,
helpText: PropTypes.string,
};

export default MultiselectFromEndpoint;
4 changes: 2 additions & 2 deletions src/translations/da/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}

0 comments on commit 29c8869

Please sign in to comment.