From aa1cf1bf167d9833195262844e24c761e141889d Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:37:16 +0100 Subject: [PATCH 1/2] 2331: Fixed feed source issues --- CHANGELOG.md | 2 ++ .../feed-sources/templates/calendar-api-feed-type.jsx | 1 + src/components/slide/content/feed-selector.jsx | 4 +--- src/components/slide/content/multiselect-from-endpoint.jsx | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64be114e..59face0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#272](https://github.com/os2display/display-admin-client/pull/272) + - Fixed feed source selector. - [#264](https://github.com/os2display/display-admin-client/pull/264) - Added checkbox options component for use in calendar modifiers. - Fixed multiselect when more than one feed source of the given type is installed. diff --git a/src/components/feed-sources/templates/calendar-api-feed-type.jsx b/src/components/feed-sources/templates/calendar-api-feed-type.jsx index 4d1b56f6..733cac5f 100644 --- a/src/components/feed-sources/templates/calendar-api-feed-type.jsx +++ b/src/components/feed-sources/templates/calendar-api-feed-type.jsx @@ -35,6 +35,7 @@ const CalendarApiFeedType = ({ { - if (feedSourceOptions?.length === 1) { + if (!value.feedSource && feedSourceOptions?.length === 1) { // If there's only one feed source option select it. const feedSource = feedSourceOptions[0]["@id"]; const configuration = value?.configuration ?? {}; diff --git a/src/components/slide/content/multiselect-from-endpoint.jsx b/src/components/slide/content/multiselect-from-endpoint.jsx index 1a4fdb99..1f30dae8 100644 --- a/src/components/slide/content/multiselect-from-endpoint.jsx +++ b/src/components/slide/content/multiselect-from-endpoint.jsx @@ -23,6 +23,7 @@ function MultiselectFromEndpoint({ optionsEndpoint, label = null, value = [], + disableSearch = true, singleSelect = false, }) { const { t } = useTranslation("common"); @@ -81,7 +82,7 @@ function MultiselectFromEndpoint({ options={options} selected={getSelected(value)} name={name} - disableSearch + disableSearch={disableSearch} singleSelect={singleSelect} labelledBy="Select" overrideStrings={{ @@ -109,6 +110,7 @@ MultiselectFromEndpoint.propTypes = { onChange: PropTypes.func.isRequired, optionsEndpoint: PropTypes.string.isRequired, singleSelect: PropTypes.bool, + disableSearch: PropTypes.bool, }; export default MultiselectFromEndpoint; From 78a22a92836b725bcf86f74b4eca4f59f89a66ad Mon Sep 17 00:00:00 2001 From: Troels Ugilt Jensen <6103205+tuj@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:44:51 +0100 Subject: [PATCH 2/2] 2331: Applied coding standards --- src/components/slide/content/multiselect-from-endpoint.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/slide/content/multiselect-from-endpoint.jsx b/src/components/slide/content/multiselect-from-endpoint.jsx index 1f30dae8..c4fcef82 100644 --- a/src/components/slide/content/multiselect-from-endpoint.jsx +++ b/src/components/slide/content/multiselect-from-endpoint.jsx @@ -15,6 +15,7 @@ import { displayError } from "../../util/list/toast-component/display-toast"; * @param {Function} props.onChange - On change callback. * @param {string} props.optionsEndpoint - Endpoint from which to fetch the options. * @param {boolean} props.singleSelect - Allow only to select one option. + * @param {boolean} props.disableSearch - Disable search. Defaults to true. * @returns {object} - The FeedSelector component. */ function MultiselectFromEndpoint({