Skip to content

Commit e9c49d6

Browse files
Update SearchBar in DAGImportErrorsModal and PluginImportErrorsModal (#50145)
* Add SearchBar in ImportErrorsModal * Update search bar for PluginError Co-authored-by: pierrejeambrun <[email protected]> --------- Co-authored-by: pierrejeambrun <[email protected]>
1 parent f9fb450 commit e9c49d6

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrorsModal.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { Heading, Text, HStack, Input } from "@chakra-ui/react";
19+
import { Heading, Text, HStack } from "@chakra-ui/react";
2020
import { useEffect, useState } from "react";
2121
import { LuFileWarning } from "react-icons/lu";
2222
import { PiFilePy } from "react-icons/pi";
2323

2424
import type { ImportErrorResponse } from "openapi/requests/types.gen";
25+
import { SearchBar } from "src/components/SearchBar";
2526
import Time from "src/components/Time";
2627
import { Accordion, Dialog } from "src/components/ui";
2728
import { Pagination } from "src/components/ui/Pagination";
@@ -59,17 +60,18 @@ export const DAGImportErrorsModal: React.FC<ImportDAGErrorModalProps> = ({ impor
5960

6061
return (
6162
<Dialog.Root onOpenChange={onOpenChange} open={open} scrollBehavior="inside" size="xl">
62-
<Dialog.Content backdrop>
63-
<Dialog.Header>
63+
<Dialog.Content backdrop p={4}>
64+
<Dialog.Header display="flex" justifyContent="space-between">
6465
<HStack fontSize="xl">
6566
<LuFileWarning />
6667
<Heading>Dag Import Errors</Heading>
6768
</HStack>
68-
<Input
69-
mt={4}
70-
onChange={(event) => setSearchQuery(event.target.value)}
71-
placeholder="Search by file"
72-
value={searchQuery}
69+
<SearchBar
70+
buttonProps={{ disabled: true }}
71+
defaultValue={searchQuery}
72+
hideAdvanced
73+
onChange={setSearchQuery}
74+
placeHolder="Search by file"
7375
/>
7476
</Dialog.Header>
7577

airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/PluginImportErrorsModal.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { Heading, Text, HStack, Input } from "@chakra-ui/react";
19+
import { Heading, Text, HStack } from "@chakra-ui/react";
2020
import { useEffect, useState } from "react";
2121
import { LuFileWarning } from "react-icons/lu";
2222
import { PiFilePy } from "react-icons/pi";
2323

2424
import type { PluginImportErrorResponse } from "openapi/requests/types.gen";
25+
import { SearchBar } from "src/components/SearchBar";
2526
import { Accordion, Dialog } from "src/components/ui";
2627
import { Pagination } from "src/components/ui/Pagination";
2728

@@ -62,17 +63,18 @@ export const PluginImportErrorsModal: React.FC<PluginImportErrorsModalProps> = (
6263

6364
return (
6465
<Dialog.Root onOpenChange={onOpenChange} open={open} scrollBehavior="inside" size="xl">
65-
<Dialog.Content backdrop>
66-
<Dialog.Header>
66+
<Dialog.Content backdrop p={4}>
67+
<Dialog.Header display="flex" justifyContent="space-between">
6768
<HStack fontSize="xl">
6869
<LuFileWarning />
6970
<Heading>Plugin Import Errors</Heading>
7071
</HStack>
71-
<Input
72-
mt={4}
73-
onChange={(event) => setSearchQuery(event.target.value)}
74-
placeholder="Search by file"
75-
value={searchQuery}
72+
<SearchBar
73+
buttonProps={{ disabled: true }}
74+
defaultValue={searchQuery}
75+
hideAdvanced
76+
onChange={setSearchQuery}
77+
placeHolder="Search by file"
7678
/>
7779
</Dialog.Header>
7880

0 commit comments

Comments
 (0)