RIFT-15726 - optimize download size -> lodash usage in UI
[osm/UI.git] / skyquake / plugins / composer / src / src / libraries / model / DescriptorModelMetaProperty.js
index 8ba295a..4318c5b 100644 (file)
@@ -23,7 +23,8 @@
 
 'use strict';
 
-import _ from 'lodash'
+import _includes from 'lodash/includes'
+import _isArray from 'lodash/isArray'
 import guid from './../guid'
 import changeCase from 'change-case'
 import InstanceCounter from './../InstanceCounter'
@@ -32,6 +33,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 +70,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 +156,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();
                                        }