NOTICKET: Adding checks to code where necessary
[osm/UI.git] / skyquake / plugins / composer / src / src / libraries / model / DescriptorModelMetaProperty.js
index 8ba295a..8fe51d9 100644 (file)
@@ -32,6 +32,9 @@ import DescriptorTemplateFactory from './DescriptorTemplateFactory'
 import utils from '../utils'
 
 export default {
+       isBoolean(property = {}) {
+               return (typeof(property['data-type']) == 'string') && (property['data-type'].toLowerCase() == 'boolean')
+       },
        isLeaf(property = {}) {
                return /leaf|choice/.test(property.type);
        },
@@ -66,7 +69,7 @@ export default {
         return !/^(leaf|leaf_list)$/.test(property.type);
        },
        isSimpleList(property = {}) {
-               return _.contains(DescriptorModelFields.simpleList, property.name);
+               return _.includes(DescriptorModelFields.simpleList, property.name);
        },
        isPrimativeDataType(property = {}) {
                const Property = this;
@@ -152,7 +155,7 @@ export default {
                                if (uiState.name === 'name') {
                                        return changeCase.param(parentMeta.name) + '-' + InstanceCounter.count(parentMeta[':qualified-type']);
                                }
-                               if (_.isArray(parentMeta.key) && _.contains(parentMeta.key, uiState.name)) {
+                               if (_.isArray(parentMeta.key) && _.includes(parentMeta.key, uiState.name)) {
                                        if (/uuid/.test(uiState['data-type'])) {
                                                return guid();
                                        }