Skip to content

Commit f909f1c

Browse files
committed
DSL Property filter
1 parent 149739d commit f909f1c

File tree

3 files changed

+54
-18
lines changed

3 files changed

+54
-18
lines changed

karavan-app/src/main/webui/src/designer/property/DslProperties.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
TextVariants,
2323
ExpandableSection,
2424
Button,
25-
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
25+
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
2626
} from '@patternfly/react-core';
2727
import '../karavan.css';
2828
import './DslProperties.css';
@@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
4141
import {PropertiesHeader} from "./PropertiesHeader";
4242
import {PropertyUtil} from "./property/PropertyUtil";
4343
import {usePropertiesStore} from "./PropertyStore";
44+
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";
4445

4546
interface Props {
4647
designerType: 'routes' | 'rest' | 'beans'
@@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
156157
onChange={(_, selected) => setChangedOnly(selected)}
157158
/>
158159
</ToggleGroup>
159-
<TextInput
160-
placeholder="filter by name"
161-
value={propertyFilter}
162-
onChange={(_, value) => setPropertyFilter(value)}
163-
/>
160+
<TextInputGroup>
161+
<TextInputGroupMain
162+
value={propertyFilter}
163+
placeholder="filter by name"
164+
type="text"
165+
autoComplete={"off"}
166+
autoFocus={true}
167+
onChange={(_event, value) => setPropertyFilter(value)}
168+
aria-label="filter by name"
169+
/>
170+
<TextInputGroupUtilities>
171+
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
172+
<TimesIcon aria-hidden={true}/>
173+
</Button>
174+
</TextInputGroupUtilities>
175+
</TextInputGroup>
164176
</div>
165177
)
166178
}

karavan-designer/src/designer/property/DslProperties.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
TextVariants,
2323
ExpandableSection,
2424
Button,
25-
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
25+
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
2626
} from '@patternfly/react-core';
2727
import '../karavan.css';
2828
import './DslProperties.css';
@@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
4141
import {PropertiesHeader} from "./PropertiesHeader";
4242
import {PropertyUtil} from "./property/PropertyUtil";
4343
import {usePropertiesStore} from "./PropertyStore";
44+
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";
4445

4546
interface Props {
4647
designerType: 'routes' | 'rest' | 'beans'
@@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
156157
onChange={(_, selected) => setChangedOnly(selected)}
157158
/>
158159
</ToggleGroup>
159-
<TextInput
160-
placeholder="filter by name"
161-
value={propertyFilter}
162-
onChange={(_, value) => setPropertyFilter(value)}
163-
/>
160+
<TextInputGroup>
161+
<TextInputGroupMain
162+
value={propertyFilter}
163+
placeholder="filter by name"
164+
type="text"
165+
autoComplete={"off"}
166+
autoFocus={true}
167+
onChange={(_event, value) => setPropertyFilter(value)}
168+
aria-label="filter by name"
169+
/>
170+
<TextInputGroupUtilities>
171+
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
172+
<TimesIcon aria-hidden={true}/>
173+
</Button>
174+
</TextInputGroupUtilities>
175+
</TextInputGroup>
164176
</div>
165177
)
166178
}

karavan-space/src/designer/property/DslProperties.tsx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
TextVariants,
2323
ExpandableSection,
2424
Button,
25-
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
25+
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
2626
} from '@patternfly/react-core';
2727
import '../karavan.css';
2828
import './DslProperties.css';
@@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
4141
import {PropertiesHeader} from "./PropertiesHeader";
4242
import {PropertyUtil} from "./property/PropertyUtil";
4343
import {usePropertiesStore} from "./PropertyStore";
44+
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";
4445

4546
interface Props {
4647
designerType: 'routes' | 'rest' | 'beans'
@@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
156157
onChange={(_, selected) => setChangedOnly(selected)}
157158
/>
158159
</ToggleGroup>
159-
<TextInput
160-
placeholder="filter by name"
161-
value={propertyFilter}
162-
onChange={(_, value) => setPropertyFilter(value)}
163-
/>
160+
<TextInputGroup>
161+
<TextInputGroupMain
162+
value={propertyFilter}
163+
placeholder="filter by name"
164+
type="text"
165+
autoComplete={"off"}
166+
autoFocus={true}
167+
onChange={(_event, value) => setPropertyFilter(value)}
168+
aria-label="filter by name"
169+
/>
170+
<TextInputGroupUtilities>
171+
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
172+
<TimesIcon aria-hidden={true}/>
173+
</Button>
174+
</TextInputGroupUtilities>
175+
</TextInputGroup>
164176
</div>
165177
)
166178
}

0 commit comments

Comments
 (0)