Use date picker for events filtering (#3243)

This commit is contained in:
Jon Koops 2022-09-05 23:30:50 +02:00 committed by GitHub
parent a8ab21096b
commit fe1b602f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 28 deletions

View file

@ -3,6 +3,7 @@ import {
Button,
Chip,
ChipGroup,
DatePicker,
Dropdown,
DropdownToggle,
Flex,
@ -416,14 +417,17 @@ export const AdminEvents = () => {
fieldId="kc-dateFrom"
className="keycloak__events_search__form_label"
>
<KeycloakTextInput
ref={register()}
type="text"
id="kc-dateFrom"
<Controller
name="dateFrom"
className="pf-c-form-control pf-m-icon pf-m-calendar"
placeholder="yyyy-MM-dd"
data-testid="dateFrom-searchField"
control={control}
render={({ onChange, value }) => (
<DatePicker
className="pf-u-w-100"
value={value}
onChange={(value) => onChange(value)}
inputProps={{ id: "kc-dateFrom" }}
/>
)}
/>
</FormGroup>
<FormGroup
@ -431,14 +435,17 @@ export const AdminEvents = () => {
fieldId="kc-dateTo"
className="keycloak__events_search__form_label"
>
<KeycloakTextInput
ref={register()}
type="text"
id="kc-dateTo"
<Controller
name="dateTo"
className="pf-c-form-control pf-m-icon pf-m-calendar"
placeholder="yyyy-MM-dd"
data-testid="dateTo-searchField"
control={control}
render={({ onChange, value }) => (
<DatePicker
className="pf-u-w-100"
value={value}
onChange={(value) => onChange(value)}
inputProps={{ id: "kc-dateTo" }}
/>
)}
/>
</FormGroup>
<ActionGroup>

View file

@ -3,6 +3,7 @@ import {
Button,
Chip,
ChipGroup,
DatePicker,
DescriptionList,
DescriptionListDescription,
DescriptionListGroup,
@ -327,14 +328,17 @@ export default function EventsSection() {
fieldId="kc-dateFrom"
className="keycloak__events_search__form_label"
>
<KeycloakTextInput
ref={register()}
type="text"
id="kc-dateFrom"
<Controller
name="dateFrom"
className="pf-c-form-control pf-m-icon pf-m-calendar"
placeholder="yyyy-MM-dd"
data-testid="dateFrom-searchField"
control={control}
render={({ onChange, value }) => (
<DatePicker
className="pf-u-w-100"
value={value}
onChange={(value) => onChange(value)}
inputProps={{ id: "kc-dateFrom" }}
/>
)}
/>
</FormGroup>
<FormGroup
@ -342,14 +346,17 @@ export default function EventsSection() {
fieldId="kc-dateTo"
className="keycloak__events_search__form_label"
>
<KeycloakTextInput
ref={register()}
type="text"
id="kc-dateTo"
<Controller
name="dateTo"
className="pf-c-form-control pf-m-icon pf-m-calendar"
placeholder="yyyy-MM-dd"
data-testid="dateTo-searchField"
control={control}
render={({ onChange, value }) => (
<DatePicker
className="pf-u-w-100"
value={value}
onChange={(value) => onChange(value)}
inputProps={{ id: "kc-dateTo" }}
/>
)}
/>
</FormGroup>
<ActionGroup>