Skip to content

Commit

Permalink
IBX-6343: ezdate and ezdatetime validation is styled properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Sep 19, 2023
1 parent 91d572f commit 272920f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
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

0 comments on commit 272920f

Please sign in to comment.