Skip to content

Commit d5b2691

Browse files
bbovenziSneha Prabhu
authored andcommitted
Resolve all eslint warnings (apache#48197)
1 parent dc5e100 commit d5b2691

File tree

20 files changed

+161
-40
lines changed

20 files changed

+161
-40
lines changed

airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldDateTime.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export const FieldDateTime = ({ name, ...rest }: FlexibleFormElementProps & Inpu
4848
onChange={(event) => handleChange(event.target.value)}
4949
size="sm"
5050
type={rest.type}
51-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
52-
value={param.value !== null && param.value !== undefined ? String(param.value).slice(0, 16) : ""}
51+
value={JSON.stringify(param.value ?? "").slice(0, 16)}
5352
/>
5453
);
5554
};

airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldMultilineText.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ export const FieldMultilineText = ({ name }: FlexibleFormElementProps) => {
4242
onChange={(event) => handleChange(event.target.value)}
4343
rows={6}
4444
size="sm"
45-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
46-
value={String(param.value ?? "")}
45+
value={JSON.stringify(param.value ?? "")}
4746
/>
4847
);
4948
};

airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldNumber.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export const FieldNumber = ({ name }: FlexibleFormElementProps) => {
5151
name={`element_${name}`}
5252
onValueChange={(event) => handleChange(event.value)}
5353
size="sm"
54-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
55-
value={String(param.value ?? "")}
54+
value={JSON.stringify(param.value ?? "")}
5655
>
5756
<NumberInputField />
5857
</NumberInputRoot>

airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldString.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ export const FieldString = ({ name }: FlexibleFormElementProps) => {
4848
}}
4949
placeholder={param.schema.examples ? "Start typing to see options." : undefined}
5050
size="sm"
51-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
52-
value={String(param.value ?? "")}
51+
value={JSON.stringify(param.value ?? "")}
5352
/>
5453
{param.schema.examples ? (
5554
<datalist id={`list_${name}`}>

airflow-core/src/airflow/ui/src/components/FlexibleForm/HiddenInput.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ export const HiddenInput = ({ name }: FlexibleFormElementProps) => {
3333
id={`element_${name}`}
3434
name={`element_${name}`}
3535
type="hidden"
36-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
37-
value={String(param.value ?? "")}
36+
value={JSON.stringify(param.value ?? "")}
3837
/>
3938
</VisuallyHidden>
4039
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*!
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import { Menu as ChakraMenu } from "@chakra-ui/react";
20+
21+
import { Content } from "./MenuContent";
22+
23+
export const Menu = {
24+
...ChakraMenu,
25+
Content,
26+
};

airflow-core/src/airflow/ui/src/components/ui/Menu.tsx renamed to airflow-core/src/airflow/ui/src/components/ui/Menu/MenuContent.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type MenuContentProps = {
2424
readonly portalRef?: React.RefObject<HTMLElement>;
2525
} & ChakraMenu.ContentProps;
2626

27-
const Content = forwardRef<HTMLDivElement, MenuContentProps>((props, ref) => {
27+
export const Content = forwardRef<HTMLDivElement, MenuContentProps>((props, ref) => {
2828
const { portalled = true, portalRef, ...rest } = props;
2929

3030
return (
@@ -35,8 +35,3 @@ const Content = forwardRef<HTMLDivElement, MenuContentProps>((props, ref) => {
3535
</Portal>
3636
);
3737
});
38-
39-
export const Menu = {
40-
...ChakraMenu,
41-
Content,
42-
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*!
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export * from "./Menu";

airflow-core/src/airflow/ui/src/components/ui/Toaster.tsx renamed to airflow-core/src/airflow/ui/src/components/ui/Toaster/Toaster.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { Toaster as ChakraToaster, Portal, Spinner, Stack, Toast, createToaster } from "@chakra-ui/react";
19+
import { Toaster as ChakraToaster, Portal, Spinner, Stack, Toast } from "@chakra-ui/react";
2020

21-
export const toaster = createToaster({
22-
pauseOnPageIdle: true,
23-
placement: "bottom-end",
24-
});
21+
import { toaster } from "./createToaster";
2522

2623
export const Toaster = () => (
2724
<Portal>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*!
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
import { createToaster } from "@chakra-ui/react";
20+
21+
export const toaster = createToaster({
22+
pauseOnPageIdle: true,
23+
placement: "bottom-end",
24+
});

0 commit comments

Comments
 (0)