From 9528a05329219e582a75772c8d8cb68e8bf62bdd Mon Sep 17 00:00:00 2001 From: jmfrancois Date: Thu, 12 Oct 2023 14:10:47 +0200 Subject: [PATCH] chore: lint forms --- .../src/UIForm/Widget/Widget.component.js | 1 + .../fields/Datalist/Datalist.component.js | 1 + .../src/UIForm/fields/Date/Date.component.js | 1 + .../UIForm/fields/Date/DateTime.component.js | 1 + .../src/UIForm/fields/Date/Time.component.js | 1 + .../MultiSelectTag.component.js | 1 + .../ResourcePicker.component.test.js | 102 ++++++++---------- .../UIForm/fields/Toggle/Toggle.component.js | 1 + packages/forms/src/UIForm/utils/properties.js | 1 + 9 files changed, 54 insertions(+), 56 deletions(-) diff --git a/packages/forms/src/UIForm/Widget/Widget.component.js b/packages/forms/src/UIForm/Widget/Widget.component.js index 5022be3bcf..b4a84fb29c 100644 --- a/packages/forms/src/UIForm/Widget/Widget.component.js +++ b/packages/forms/src/UIForm/Widget/Widget.component.js @@ -9,6 +9,7 @@ import shouldRender from '../utils/condition'; import theme from './Widget.component.module.scss'; import { useWidget } from '../context'; +// eslint-disable-next-line @typescript-eslint/default-param-last function isUpdating(updatingKeys = [], key) { if (updatingKeys.length === 0 || !key) { return false; diff --git a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js index 9cd71f127e..de27de0dff 100644 --- a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js +++ b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js @@ -218,6 +218,7 @@ class Datalist extends Component { {...this.state} dataFeature={this.props.schema.dataFeature} className="form-control-container" + // eslint-disable-next-line jsx-a11y/no-autofocus autoFocus={this.props.schema.autoFocus} disabled={this.props.schema.disabled || this.props.valueIsUpdating} multiSection={get(this.props, 'schema.options.isMultiSection', false)} diff --git a/packages/forms/src/UIForm/fields/Date/Date.component.js b/packages/forms/src/UIForm/fields/Date/Date.component.js index 37c7eef45d..a3c9ef6ca4 100644 --- a/packages/forms/src/UIForm/fields/Date/Date.component.js +++ b/packages/forms/src/UIForm/fields/Date/Date.component.js @@ -55,6 +55,7 @@ function DateWidget(props) { valueIsUpdating={valueIsUpdating} > - ({ toolbar, onRowClick, isSelected, collection, ...props }) => - ( -
-
-
- - toolbar.name.onChange(e)} - value={toolbar.name.value} - /> -
-
- - - -
-
- - - - - -
-
- - + - - {collection && ( - - )} - ResourcePicker
- ), -); +
+ + + + + +
+ + + + + {collection && ( + + )} + ResourcePicker + + ); + +jest.mock('ally.js'); +jest.unmock('@talend/design-system'); +jest.mock('@talend/react-components/lib/ResourcePicker', ResourcePickerMock); describe('ResourcePicker field', () => { const collection = [ diff --git a/packages/forms/src/UIForm/fields/Toggle/Toggle.component.js b/packages/forms/src/UIForm/fields/Toggle/Toggle.component.js index 61e9e57683..515167bbc9 100644 --- a/packages/forms/src/UIForm/fields/Toggle/Toggle.component.js +++ b/packages/forms/src/UIForm/fields/Toggle/Toggle.component.js @@ -21,6 +21,7 @@ function ToggleWidget(props) { valueIsUpdating={valueIsUpdating} >