ui: rename unsafeOptionsSelected() -> isUnsafeOptionSelected()

This commit is contained in:
Mike Salvatore 2021-01-29 11:04:46 -05:00
parent 57554ca435
commit 1440121aef
2 changed files with 9 additions and 9 deletions

View File

@ -44,7 +44,7 @@ class AdvancedMultiSelect extends React.Component {
infoPaneParams: getDefaultPaneParams( infoPaneParams: getDefaultPaneParams(
this.infoPaneRefString, this.infoPaneRefString,
this.registry, this.registry,
this.unsafeOptionsSelected(this.props.value) this.isUnsafeOptionSelected(this.props.value)
) )
}; };
} }
@ -71,7 +71,7 @@ class AdvancedMultiSelect extends React.Component {
this.props.onChange(newValues); this.props.onChange(newValues);
this.setMasterCheckboxState(newValues); this.setMasterCheckboxState(newValues);
this.setHideResetState(newValues); this.setHideResetState(newValues);
this.setPaneInfoToDefault(this.unsafeOptionsSelected(newValues)); this.setPaneInfoToDefault(this.isUnsafeOptionSelected(newValues));
} }
onChildCheckboxClick = (value) => { onChildCheckboxClick = (value) => {
@ -115,7 +115,7 @@ class AdvancedMultiSelect extends React.Component {
this.props.onChange(this.defaultValues); this.props.onChange(this.defaultValues);
this.setHideResetState(this.defaultValues); this.setHideResetState(this.defaultValues);
this.setMasterCheckboxState(this.defaultValues); this.setMasterCheckboxState(this.defaultValues);
this.setPaneInfoToDefault(this.unsafeOptionsSelected(this.defaultValues)); this.setPaneInfoToDefault(this.isUnsafeOptionSelected(this.defaultValues));
} }
setHideResetState(selectValues) { setHideResetState(selectValues) {
@ -125,10 +125,10 @@ class AdvancedMultiSelect extends React.Component {
} }
getHideResetState(selectValues) { getHideResetState(selectValues) {
return !(this.unsafeOptionsSelected(selectValues)) return !(this.isUnsafeOptionSelected(selectValues))
} }
unsafeOptionsSelected(selectValues) { isUnsafeOptionSelected(selectValues) {
return !(selectValues.every((value) => this.isSafe(value))); return !(selectValues.every((value) => this.isSafe(value)));
} }
@ -150,12 +150,12 @@ class AdvancedMultiSelect extends React.Component {
); );
} }
setPaneInfoToDefault(unsafeOptionsSelected) { setPaneInfoToDefault(isUnsafeOptionSelected) {
this.setState(() => ({ this.setState(() => ({
infoPaneParams: getDefaultPaneParams( infoPaneParams: getDefaultPaneParams(
this.props.schema.items.$ref, this.props.schema.items.$ref,
this.props.registry, this.props.registry,
unsafeOptionsSelected isUnsafeOptionSelected
) )
})); }));
} }

View File

@ -12,13 +12,13 @@ const WarningType = {
MULTIPLE: 2 MULTIPLE: 2
} }
function getDefaultPaneParams(refString, registry, unsafeOptionsSelected) { function getDefaultPaneParams(refString, registry, isUnsafeOptionSelected) {
let configSection = getObjectFromRegistryByRef(refString, registry); let configSection = getObjectFromRegistryByRef(refString, registry);
return ( return (
{ {
title: configSection.title, title: configSection.title,
content: configSection.description, content: configSection.description,
warningType: unsafeOptionsSelected ? WarningType.Multiple : WarningType.NONE warningType: isUnsafeOptionSelected ? WarningType.Multiple : WarningType.NONE
}); });
} }