Skip to content

Commit

Permalink
2331: Fixed feed source issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Nov 28, 2024
1 parent e1f2fa3 commit aa1cf1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const CalendarApiFeedType = ({
<MultiselectFromEndpoint
onChange={handleInput}
name="locations"
disableSearch={false}
label={t("locations")}
value={formStateObject.locations ?? []}
optionsEndpoint={optionsEndpoint}
Expand Down
4 changes: 1 addition & 3 deletions src/components/slide/content/feed-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ function FeedSelector({
const [feedSourceOptions, setFeedSourceOptions] = useState([]);
const [feedSourceData, setFeedSourceData] = useState();

// @TODO: Filter by dataType

const {
data: feedSourcesData,
error: feedSourcesLoadingError,
Expand All @@ -47,7 +45,7 @@ function FeedSelector({
});

useEffect(() => {
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 ?? {};
Expand Down
4 changes: 3 additions & 1 deletion src/components/slide/content/multiselect-from-endpoint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function MultiselectFromEndpoint({
optionsEndpoint,
label = null,
value = [],
disableSearch = true,
singleSelect = false,
}) {
const { t } = useTranslation("common");
Expand Down Expand Up @@ -81,7 +82,7 @@ function MultiselectFromEndpoint({
options={options}
selected={getSelected(value)}
name={name}
disableSearch
disableSearch={disableSearch}
singleSelect={singleSelect}
labelledBy="Select"
overrideStrings={{
Expand Down Expand Up @@ -109,6 +110,7 @@ MultiselectFromEndpoint.propTypes = {
onChange: PropTypes.func.isRequired,
optionsEndpoint: PropTypes.string.isRequired,
singleSelect: PropTypes.bool,
disableSearch: PropTypes.bool,
};

export default MultiselectFromEndpoint;

0 comments on commit aa1cf1b

Please sign in to comment.