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

IBX-6343: ezdate and ezdatetime validation is styled properly #912

Merged
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
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/js/scripts/fieldType/ezdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const SELECTOR_INPUT = '.ibexa-data-source__input:not(.flatpickr-input)';
const SELECTOR_FLATPICKR_INPUT = '.flatpickr-input';
const EVENT_VALUE_CHANGED = 'change';
const SELECTOR_ERROR_NODE = '.ibexa-data-source';
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzDateValidator extends ibexa.BaseFieldValidator {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const SELECTOR_INPUT = '.ibexa-data-source__input[data-seconds]';
const SELECTOR_FLATPICKR_INPUT = '.flatpickr-input';
const EVENT_VALUE_CHANGED = 'change';
const SELECTOR_ERROR_NODE = '.ibexa-data-source';
const SELECTOR_ERROR_NODE = '.ibexa-form-error';
const { convertDateToTimezone } = ibexa.helpers.timezone;

class EzDateTimeValidator extends ibexa.BaseFieldValidator {
Expand Down
19 changes: 18 additions & 1 deletion src/bundle/Resources/public/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@
@import 'mixins/drag-and-drop';

@mixin datetime-field() {
&.is-invalid {
.ibexa-label {
color: $ibexa-color-danger;
}

.ibexa-input-text-wrapper__action-btn {
.ibexa-icon {
fill: $ibexa-color-danger;
}
}

.ibexa-data-source__input {
border: calculateRem(1px) solid $ibexa-color-danger;
background: $ibexa-color-danger-100;
}
}

.ibexa-data-source__input-wrapper {
max-width: 30ch;
position: relative;
Expand Down Expand Up @@ -98,7 +115,7 @@

.ibexa-data-source__input {
border: calculateRem(1px) solid $ibexa-color-danger;
background: $ibexa-color-warning-pale;
background: $ibexa-color-danger-100;
}
}
}
Expand Down
Loading