Skip to content

Commit

Permalink
1241: Updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj committed Dec 10, 2024
2 parents 587f987 + c01afab commit ab060df
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

- [#TODO](https://github.com/os2display/display-admin-client/pull/TODO)
- [#274](https://github.com/os2display/display-admin-client/pull/274)
- Added screen status to screen list.
- Refactored screen status on screen edit.
- Change campaign icon in screen list to boolean text.
- [#273](https://github.com/os2display/display-admin-client/pull/273)
- Fixed calendar api feed source config endpoint.
- [#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 @@ -19,7 +19,12 @@ const CalendarApiFeedType = ({
useEffect(() => {
if (feedSourceId && feedSourceId !== "") {
ConfigLoader.loadConfig().then((config) => {
setOptionsEndpoint(`${config.api + feedSourceId}/config/locations`);
let endpoint = config.api;
endpoint = endpoint.replace(/\/$/, "");
endpoint += feedSourceId;
endpoint += "/config/locations";

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

export default MultiselectFromEndpoint;

0 comments on commit ab060df

Please sign in to comment.