Skip to content

Commit

Permalink
DSL Property filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mgubaidullin committed Nov 8, 2024
1 parent 149739d commit f909f1c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 18 deletions.
24 changes: 18 additions & 6 deletions karavan-app/src/main/webui/src/designer/property/DslProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
TextVariants,
ExpandableSection,
Button,
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
} from '@patternfly/react-core';
import '../karavan.css';
import './DslProperties.css';
Expand All @@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
import {PropertiesHeader} from "./PropertiesHeader";
import {PropertyUtil} from "./property/PropertyUtil";
import {usePropertiesStore} from "./PropertyStore";
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";

interface Props {
designerType: 'routes' | 'rest' | 'beans'
Expand Down Expand Up @@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
onChange={(_, selected) => setChangedOnly(selected)}
/>
</ToggleGroup>
<TextInput
placeholder="filter by name"
value={propertyFilter}
onChange={(_, value) => setPropertyFilter(value)}
/>
<TextInputGroup>
<TextInputGroupMain
value={propertyFilter}
placeholder="filter by name"
type="text"
autoComplete={"off"}
autoFocus={true}
onChange={(_event, value) => setPropertyFilter(value)}
aria-label="filter by name"
/>
<TextInputGroupUtilities>
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
<TimesIcon aria-hidden={true}/>
</Button>
</TextInputGroupUtilities>
</TextInputGroup>
</div>
)
}
Expand Down
24 changes: 18 additions & 6 deletions karavan-designer/src/designer/property/DslProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
TextVariants,
ExpandableSection,
Button,
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
} from '@patternfly/react-core';
import '../karavan.css';
import './DslProperties.css';
Expand All @@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
import {PropertiesHeader} from "./PropertiesHeader";
import {PropertyUtil} from "./property/PropertyUtil";
import {usePropertiesStore} from "./PropertyStore";
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";

interface Props {
designerType: 'routes' | 'rest' | 'beans'
Expand Down Expand Up @@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
onChange={(_, selected) => setChangedOnly(selected)}
/>
</ToggleGroup>
<TextInput
placeholder="filter by name"
value={propertyFilter}
onChange={(_, value) => setPropertyFilter(value)}
/>
<TextInputGroup>
<TextInputGroupMain
value={propertyFilter}
placeholder="filter by name"
type="text"
autoComplete={"off"}
autoFocus={true}
onChange={(_event, value) => setPropertyFilter(value)}
aria-label="filter by name"
/>
<TextInputGroupUtilities>
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
<TimesIcon aria-hidden={true}/>
</Button>
</TextInputGroupUtilities>
</TextInputGroup>
</div>
)
}
Expand Down
24 changes: 18 additions & 6 deletions karavan-space/src/designer/property/DslProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
TextVariants,
ExpandableSection,
Button,
Tooltip, ToggleGroupItem, ToggleGroup, TextInput,
Tooltip, ToggleGroupItem, ToggleGroup, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities,
} from '@patternfly/react-core';
import '../karavan.css';
import './DslProperties.css';
Expand All @@ -41,6 +41,7 @@ import {CamelDisplayUtil} from "karavan-core/lib/api/CamelDisplayUtil";
import {PropertiesHeader} from "./PropertiesHeader";
import {PropertyUtil} from "./property/PropertyUtil";
import {usePropertiesStore} from "./PropertyStore";
import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";

interface Props {
designerType: 'routes' | 'rest' | 'beans'
Expand Down Expand Up @@ -156,11 +157,22 @@ export function DslProperties(props: Props) {
onChange={(_, selected) => setChangedOnly(selected)}
/>
</ToggleGroup>
<TextInput
placeholder="filter by name"
value={propertyFilter}
onChange={(_, value) => setPropertyFilter(value)}
/>
<TextInputGroup>
<TextInputGroupMain
value={propertyFilter}
placeholder="filter by name"
type="text"
autoComplete={"off"}
autoFocus={true}
onChange={(_event, value) => setPropertyFilter(value)}
aria-label="filter by name"
/>
<TextInputGroupUtilities>
<Button variant="plain" onClick={_ => setPropertyFilter('')}>
<TimesIcon aria-hidden={true}/>
</Button>
</TextInputGroupUtilities>
</TextInputGroup>
</div>
)
}
Expand Down

0 comments on commit f909f1c

Please sign in to comment.