Skip to content

Commit

Permalink
Disabled parameter - None values are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Andre Azevedo Quirino committed Sep 19, 2024
1 parent d02b303 commit 5c3d3f5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/editors/_shared/hooks/DataTypes/AbstractDataType.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ class AbstractDataType {
* @returns
*/
validate(value) {
if (value === "None")
return Promise.resolve({ success: true });

try {
const parsed = this.getParsed(value);
return Promise.resolve({
Expand Down
6 changes: 0 additions & 6 deletions src/editors/_shared/hooks/DataTypes/types/AnyType.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ import { DATA_TYPES } from "../../../../../utils/Constants";
import DataType from "../AbstractDataType";

class AnyType extends DataType {
// Any type properties definition
key = DATA_TYPES.ANY;
label = "Any";

/**
* Validate value
* @param {*} value
* @returns
*/
_validate(value) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class ConfigurationType extends DataType {
* @returns
*/
validate(value, options) {
if (value === "None")
return Promise.resolve({ success: true });

const validationMethod = options?.isConfigFromParameter
? "validateConfiguration"
: "validateConfigurationRaw";
Expand Down
1 change: 0 additions & 1 deletion src/editors/_shared/hooks/DataTypes/types/NumberType.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import DataType from "../AbstractDataType";
import { checkIfDefaultOrDisabled } from "./utils";

class NumberType extends DataType {
// Number type properties definition
key = DATA_TYPES.NUMBER;
inputType = DATA_TYPES.NUMBER;
label = "Number";
Expand Down
1 change: 0 additions & 1 deletion src/editors/_shared/hooks/DataTypes/types/StringType.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DATA_TYPES } from "../../../../../utils/Constants";
import DataType from "../AbstractDataType";

class StringType extends DataType {
// String type properties definition
key = DATA_TYPES.STRING;
label = "String";
default = '';
Expand Down

0 comments on commit 5c3d3f5

Please sign in to comment.