diff --git a/.eslintrc b/.eslintrc index 1eb6dab4..9d1f2b79 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,6 +7,11 @@ "plugin:prettier/recommended" ], "ignorePatterns": ["*.yml"], + "globals": { + "window": true, + "localStorage": true, + "document": true + }, "parser": "babel-eslint", "parserOptions": { "sourceType": "module", diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c601206e..c5a43926 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -29,7 +29,7 @@ jobs: run: | docker network create frontend docker compose run --rm node yarn install - docker compose run --rm node yarn check-coding-standards + docker compose run --rm node yarn check-coding-standards-actions playwright-tests: name: Playwright diff --git a/CHANGELOG.md b/CHANGELOG.md index 427ca56f..64be114e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- [#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. + - Fixed github action to fail on warnings. - [#268](https://github.com/os2display/display-admin-client/pull/268) - Added feed source UI. @@ -23,8 +27,6 @@ All notable changes to this project will be documented in this file. - Add validation checking if template is selected on slide before save - [#260](https://github.com/os2display/display-admin-client/pull/260) - Bug in multiselect, fixed by removing duplicates by key both `@id`and `id` -- [#265](https://github.com/os2display/display-admin-client/pull/265) - - Bug in multiselect, fixed by removing duplicates by key both `@id`and `id` - [#259](https://github.com/os2display/display-admin-client/pull/259) - Add saving of playlists/groups with screen (as opposed to _after_) - Clean up `screen-manager.jsx` diff --git a/package.json b/package.json index ebfc2914..b27461f6 100644 --- a/package.json +++ b/package.json @@ -49,11 +49,14 @@ }, "scripts": { "lint:js": "eslint --ext .js --ext .jsx ./src", + "lint-actions:js": "eslint --ext .js --ext .jsx ./src --max-warnings=0", "lint:js:fix": "eslint --ext .js --ext .jsx --fix ./src", "lint:scss": "stylelint \"./src/**/*.scss\"", + "lint-actions:scss": "stylelint \"./src/**/*.scss\" --max-warnings=0", "lint:scss:fix": "stylelint --fix \"./src/**/*.scss\"", "check-coding-standards": "yarn lint:js && yarn lint:scss", "apply-coding-standards": "yarn lint:js:fix && yarn lint:scss:fix", + "check-coding-standards-actions": "yarn lint-actions:js && yarn lint-actions:scss", "start": "vite --host 0.0.0.0", "build": "vite build", "preview": "vite preview" diff --git a/src/components/feed-sources/feed-source-form.jsx b/src/components/feed-sources/feed-source-form.jsx index f9a4b694..2cce65ae 100644 --- a/src/components/feed-sources/feed-source-form.jsx +++ b/src/components/feed-sources/feed-source-form.jsx @@ -10,9 +10,9 @@ import FormSelect from "../util/forms/select"; import ContentBody from "../util/content-body/content-body"; import ContentFooter from "../util/content-footer/content-footer"; import FormInput from "../util/forms/form-input"; -import CalendarFeedType from "./templates/calendar-feed-type.jsx"; -import NotifiedFeedType from "./templates/notified-feed-type.jsx"; -import EventDatabaseFeedType from "./templates/event-database-feed-type.jsx"; +import CalendarApiFeedType from "./templates/calendar-api-feed-type"; +import NotifiedFeedType from "./templates/notified-feed-type"; +import EventDatabaseApiFeedType from "./templates/event-database-feed-type"; /** * The feed-source form component. @@ -22,13 +22,14 @@ import EventDatabaseFeedType from "./templates/event-database-feed-type.jsx"; * @param {Function} props.handleInput Handles form input. * @param {Function} props.handleSubmit Handles form submit. * @param {string} props.headerText Headline text. - * @param {boolean} [props.isLoading=false] Indicator of whether the form is - * loading. Default is `false` - * @param {string} [props.loadingMessage=""] The loading message for the - * spinner. Default is `""` - * @param {object} props.feedSource The feed source object + * @param {boolean} [props.isLoading] Indicator of whether the form is loading. + * Default is `false` + * @param {string} [props.loadingMessage] The loading message for the spinner. + * Default is `""` * @param {object} props.feedSourceTypeOptions The options for feed source types * @param {string} props.mode The mode + * @param {Function} props.onFeedTypeChange Callback on feed type change. + * @param {Function} props.handleSecretInput Callback on secret input change. * @returns {object} The feed-source form. */ function FeedSourceForm({ @@ -81,15 +82,28 @@ function FeedSourceForm({ options={feedSourceTypeOptions} /> - {feedSource?.feedType === "App\\Feed\\CalendarApiFeedType" && - () - } - {feedSource?.feedType === "App\\Feed\\NotifiedFeedType" && - () - } - {feedSource?.feedType === "App\\Feed\\EventDatabaseApiFeedType" && - () - } + {feedSource?.feedType === "App\\Feed\\CalendarApiFeedType" && ( + + )} + {feedSource?.feedType === "App\\Feed\\EventDatabaseApiFeedType" && ( + + )} + {feedSource?.feedType === "App\\Feed\\NotifiedFeedType" && ( + + )}