Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiDatePicker] Add alert icon when isInvalid #6677

Merged
merged 6 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
487 changes: 235 additions & 252 deletions src/components/date_picker/__snapshots__/date_picker.test.tsx.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ exports[`EuiDatePickerRange isInvalid is rendered 1`] = `
>
<input
aria-label="Press the down key to open a popover containing a calendar."
class="euiDatePicker euiFieldText euiFieldText--withIcon euiFieldText-isInvalid euiDatePickerRange__start"
class="euiDatePicker euiFieldText euiFormControlLayout--1icons euiFieldText--withIcon euiDatePickerRange__start"
type="text"
value=""
/>
Expand All @@ -224,6 +224,14 @@ exports[`EuiDatePickerRange isInvalid is rendered 1`] = `
/>
</span>
</div>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
color="danger"
data-euiicon-type="warning"
/>
</div>
</div>
</div>
</span>
Expand All @@ -232,7 +240,7 @@ exports[`EuiDatePickerRange isInvalid is rendered 1`] = `
>
<span
color="danger"
data-euiicon-type="warning"
data-euiicon-type="sortRight"
/>
</span>
<span
Expand All @@ -255,13 +263,21 @@ exports[`EuiDatePickerRange isInvalid is rendered 1`] = `
>
<input
aria-label="Press the down key to open a popover containing a calendar."
class="euiDatePicker euiFieldText euiFieldText-isInvalid euiDatePickerRange__end"
class="euiDatePicker euiFieldText euiFormControlLayout--1icons euiDatePickerRange__end"
type="text"
value=""
/>
</div>
</div>
</div>
<div
class="euiFormControlLayoutIcons euiFormControlLayoutIcons--right"
>
<span
color="danger"
data-euiicon-type="warning"
/>
</div>
</div>
</div>
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/date_picker/_date_picker_range.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
align-items: center;
}

.euiDatePickerRange--isInvalid .euiDatePickerRange__delimeter {
.euiDatePickerRange--isInvalid:not(.euiDatePickerRange--isDisabled):not(.euiDatePickerRange--readOnly) .euiDatePickerRange__delimeter {
@include euiFormControlInvalidStyle;
}
4 changes: 1 addition & 3 deletions src/components/date_picker/date_picker.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ import { EuiContext } from '../context';

describe('EuiDatePicker', () => {
test('is rendered', () => {
const component = shallow<EuiDatePicker>(
<EuiDatePicker {...requiredProps} />
);
const component = shallow(<EuiDatePicker {...requiredProps} />);

expect(component).toMatchSnapshot(); // snapshot of wrapping dom
expect(component.find('ContextConsumer').shallow()).toMatchSnapshot(); // snapshot of DatePicker usage
Expand Down
Loading