Skip to content

Commit

Permalink
Merge pull request #834 from complexdatacollective/release/6.5.3
Browse files Browse the repository at this point in the history
Release branch for 6.5.3
  • Loading branch information
jthrilly authored May 30, 2024
2 parents 06fbc91 + 5322330 commit a66f85f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "network-canvas-architect",
"version": "6.5.2",
"version": "6.5.3",
"productName": "Network Canvas Architect",
"description": "A tool for building Network Canvas interviews.",
"author": "Complex Data Collective <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion public/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "network-canvas-architect",
"version": "6.5.2",
"version": "6.5.3",
"productName": "Network Canvas Architect",
"description": "A tool for building Network Canvas interviews.",
"author": "Complex Data Collective",
Expand Down
8 changes: 8 additions & 0 deletions src/components/Validations/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ const VALIDATIONS_WITH_LIST_VALUES = [
// 'greaterThanVariable',
];

const VALIDATIONS_WITHOUT_VALUES = [
'required',
'unique',
];

const isValidationWithoutValue = (validation) => VALIDATIONS_WITHOUT_VALUES.includes(validation);

const isValidationWithNumberValue = (validation) => (
VALIDATIONS_WITH_NUMBER_VALUES.includes(validation));
const isValidationWithListValue = (validation) => VALIDATIONS_WITH_LIST_VALUES.includes(validation);
Expand All @@ -97,6 +104,7 @@ export {
getValidationOptionsForVariableType,
isValidationWithNumberValue,
isValidationWithListValue,
isValidationWithoutValue,
VALIDATIONS,
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/Validations/withUpdateHandlers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { omit } from 'lodash';
import { withHandlers } from 'recompose';
import { isValidationWithListValue, isValidationWithNumberValue } from './options';
import { isValidationWithListValue, isValidationWithNumberValue, isValidationWithoutValue } from './options';

/**
* Function called when a validation is added or updated. Returns a value
Expand All @@ -12,8 +12,8 @@ import { isValidationWithListValue, isValidationWithNumberValue } from './option
* @returns {string} The new value.
*/
const getAutoValue = (type, oldType, value) => {
// Required is special - always return true.
if (type === 'required') {
// If the validation type doesn't require a value, return true.
if (isValidationWithoutValue(type)) {
return true;
}

Expand Down

0 comments on commit a66f85f

Please sign in to comment.