Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const fields = doc.querySelectorAll('.ibexa-field-edit');
const getValidationResults = (validator) => {
const isValid = validator.isValid();
const validatorName = validator.constructor.name;
const validatorName = validator.getValidatorName();
const result = { isValid, validatorName };

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
return this.fieldContainer ? this.fieldContainer : fallback;
}

getValidatorName() {
return 'BaseFieldValidator';
}

/**
* Attaches event to elements found with a selector provided by field config
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
this.containerSelectors = containerSelectors;
}

getValidatorName() {
return 'MultiInputFieldValidator';
}

toggleInvalidState(isError, config, input) {
super.toggleInvalidState(isError, config, input);

Expand Down
4 changes: 4 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezboolean.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzBooleanValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzBooleanValidator';
}

/**
* Validates the input field value
*
Expand Down
4 changes: 4 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezcountry.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzCountryValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzCountryValidator';
}

/**
* Validates the country field value
*
Expand Down
4 changes: 4 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzDateValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzDateValidator';
}

/**
* Validates the input
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
const { convertDateToTimezone } = ibexa.helpers.timezone;

class EzDateTimeValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzDateTimeValidator';
}

/**
* Validates the input
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezemail.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzEmailValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzEmailValidator';
}
/**
* Validates the input
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezfloat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const SELECTOR_ERROR_NODE = `${SELECTOR_FIELD} .ibexa-form-error`;

class EzFloatValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzFloatValidator';
}
/**
* Validates the input
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
const maps = [];

class EzGMapLocationValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzGMapLocationValidator';
}
/**
* Validates latitude/longitude input value
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezinteger.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const SELECTOR_ERROR_NODE = `${SELECTOR_FIELD} .ibexa-form-error`;

class EzIntegerValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzIntegerValidator';
}
/**
* Validates the input
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezkeyword.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
const SELECTOR_ERROR_NODE = '.ibexa-form-error';

class EzKeywordValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzKeywordValidator';
}
/**
* Validates the keywords input
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
const EVENT_CUSTOM = 'validateInput';

class EzObjectRelationListValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzObjectRelationListValidator';
}
/**
* Validates the input
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
const EVENT_VALUE_CHANGED = 'change';

class EzSelectionValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzSelectionValidator';
}
/**
* Validates the textarea field value
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezstring.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
const SELECTOR_SOURCE_INPUT = '.ibexa-data-source__input';

class EzStringValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzStringValidator';
}
/**
* Validates the input
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/eztext.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
const SELECTOR_FIELD = '.ibexa-field-edit--eztext';

class EzTextValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzTextValidator';
}
/**
* Validates the textarea field value
*
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/eztime.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const EVENT_VALUE_CHANGED = 'change';

class EzTimeValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzTimeValidator';
}
/**
* Validates the input
*
Expand Down
4 changes: 4 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezurl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
const SELECTOR_ERROR_NODE = '.ibexa-data-source__field--link .ibexa-form-error';

class EzUrlValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzUrlValidator';
}

validateUrl(event) {
const result = {
isError: false,
Expand Down
3 changes: 3 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezuser.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
const SELECTOR_ERROR_WRAPPER = '.ibexa-form-error';

class EzUserValidator extends ibexa.BaseFieldValidator {
getValidatorName() {
return 'EzUserValidator';
}
/**
* Validates the input field value
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class RichTextValidator extends ibexa.BaseFieldValidator {
this.labelSelector = labelSelector;
}

getValidatorName() {
return 'RichTextValidator';
}

/**
* Validates the input
*
Expand Down
Loading