From 03075a1acd0a6e3a067ce9331ea6c59d848d502a Mon Sep 17 00:00:00 2001 From: Darya Plotnytska Date: Mon, 5 Feb 2024 16:08:46 +0100 Subject: [PATCH] console: Fix code quality errors --- config/storybook/preview.js | 1 - .../containers/collaborators-table/index.js | 5 ++++- .../application-general-settings-form/index.js | 6 +++++- .../console/components/routing-policy/sheet.js | 5 ++++- .../containers/collaborators-table/index.js | 5 ++++- .../containers/device-title-section/index.js | 16 ++++++++++++++-- .../console/containers/devices-table/index.js | 8 +++++++- pkg/webui/lib/hooks/use-request.js | 4 ++-- pkg/webui/styles/variables/colors.styl | 4 ++-- 9 files changed, 42 insertions(+), 12 deletions(-) diff --git a/config/storybook/preview.js b/config/storybook/preview.js index cc9ccea1ae4..4978a5b16f5 100644 --- a/config/storybook/preview.js +++ b/config/storybook/preview.js @@ -24,7 +24,6 @@ import messages from '@ttn-lw/locales/en.json' import backendMessages from '@ttn-lw/locales/.backend/en.json' import '../../pkg/webui/styles/main.styl' -import '../../pkg/webui/styles/utilities/color.styl' import '../../pkg/webui/styles/utilities/general.styl' import '../../pkg/webui/styles/utilities/spacing.styl' import 'focus-visible/dist/focus-visible' diff --git a/pkg/webui/account/containers/collaborators-table/index.js b/pkg/webui/account/containers/collaborators-table/index.js index 1ebf5d40223..fbf290792ee 100644 --- a/pkg/webui/account/containers/collaborators-table/index.js +++ b/pkg/webui/account/containers/collaborators-table/index.js @@ -92,7 +92,10 @@ const CollaboratorsTable = props => { return ( {collaboratorId}{' '} - + ) } diff --git a/pkg/webui/console/components/application-general-settings-form/index.js b/pkg/webui/console/components/application-general-settings-form/index.js index fb9dfd74758..579bea99cd3 100644 --- a/pkg/webui/console/components/application-general-settings-form/index.js +++ b/pkg/webui/console/components/application-general-settings-form/index.js @@ -197,7 +197,11 @@ const ApplicationGeneralSettingsForm = ({ isResctrictedUser={isResctrictedUser} userId={userId} /> - + diff --git a/pkg/webui/console/components/routing-policy/sheet.js b/pkg/webui/console/components/routing-policy/sheet.js index 1dcbe34479b..35c57922f1d 100644 --- a/pkg/webui/console/components/routing-policy/sheet.js +++ b/pkg/webui/console/components/routing-policy/sheet.js @@ -32,7 +32,10 @@ const RoutingPolicy = ({ enabled, message, positiveMessage, negativeMessage }) = diff --git a/pkg/webui/console/containers/collaborators-table/index.js b/pkg/webui/console/containers/collaborators-table/index.js index e85b9f9be5f..c26e021dba7 100644 --- a/pkg/webui/console/containers/collaborators-table/index.js +++ b/pkg/webui/console/containers/collaborators-table/index.js @@ -64,7 +64,10 @@ const CollaboratorsTable = props => { userLabel = ( {collaboratorId}{' '} - + ) } diff --git a/pkg/webui/console/containers/device-title-section/index.js b/pkg/webui/console/containers/device-title-section/index.js index 088faa739d5..0eddc1432c3 100644 --- a/pkg/webui/console/containers/device-title-section/index.js +++ b/pkg/webui/console/containers/device-title-section/index.js @@ -93,7 +93,13 @@ const DeviceTitleSection = props => { } > - + ) : ( @@ -103,7 +109,13 @@ const DeviceTitleSection = props => { content={} > - + )} diff --git a/pkg/webui/console/containers/devices-table/index.js b/pkg/webui/console/containers/devices-table/index.js index 184663cf48f..e939a0705b0 100644 --- a/pkg/webui/console/containers/devices-table/index.js +++ b/pkg/webui/console/containers/devices-table/index.js @@ -110,7 +110,13 @@ const headers = [ placement="top-end" > - + ) diff --git a/pkg/webui/lib/hooks/use-request.js b/pkg/webui/lib/hooks/use-request.js index b169da25964..7f6a95f3d12 100644 --- a/pkg/webui/lib/hooks/use-request.js +++ b/pkg/webui/lib/hooks/use-request.js @@ -30,8 +30,8 @@ const useRequest = (requestAction, requestOnChange) => { requestAction instanceof Array ? Promise.all(requestAction.map(req => dispatch(attachPromise(req)))) : typeof requestAction === 'function' - ? requestAction(dispatch) - : dispatch(attachPromise(requestAction)) + ? requestAction(dispatch) + : dispatch(attachPromise(requestAction)) promise .then(result => { diff --git a/pkg/webui/styles/variables/colors.styl b/pkg/webui/styles/variables/colors.styl index 54753fcf94c..a46166e7109 100644 --- a/pkg/webui/styles/variables/colors.styl +++ b/pkg/webui/styles/variables/colors.styl @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// CONSOLE COLOR PALLETE +// CONSOLE COLOR PALETTE // ===================== -// This file contains the color pallete for the console. It is meant to +// This file contains the color palette for the console. It is meant to // be used only by the tokens.styl file to define design tokens with it. // Do not use these values directly but only through the tokens.styl file.