From: Laurence Maultsby Date: Wed, 25 Jan 2017 13:24:29 +0000 (-0500) Subject: Removed EditConfigParameterMap.js X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=commitdiff_plain;h=7a485f58714f7271c9e06782aea598fb4545025f Removed EditConfigParameterMap.js Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/composer/src/src/components/EditConfigParameterMap.js b/skyquake/plugins/composer/src/src/components/EditConfigParameterMap.js deleted file mode 100644 index f89b14a1b..000000000 --- a/skyquake/plugins/composer/src/src/components/EditConfigParameterMap.js +++ /dev/null @@ -1,480 +0,0 @@ -/* - * - * Copyright 2016 RIFT.IO Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -/** - * Created by onvelocity on 1/18/16. - * - * This class generates the form fields used to edit the CONFD JSON model. - */ -'use strict'; - -import _ from 'lodash' -import utils from '../libraries/utils' -import React from 'react' -import ClassNames from 'classnames' -import changeCase from 'change-case' -import toggle from '../libraries/ToggleElementHandler' -import Button from './Button' -import Property from '../libraries/model/DescriptorModelMetaProperty' -import ComposerAppActions from '../actions/ComposerAppActions' -import CatalogItemsActions from '../actions/CatalogItemsActions' -import DESCRIPTOR_MODEL_FIELDS from '../libraries/model/DescriptorModelFields' -import DescriptorModelFactory from '../libraries/model/DescriptorModelFactory' -import DescriptorModelMetaFactory from '../libraries/model/DescriptorModelMetaFactory' -import SelectionManager from '../libraries/SelectionManager' -import DeletionManager from '../libraries/DeletionManager' -import DescriptorModelIconFactory from '../libraries/model/IconFactory' -import getEventPath from '../libraries/getEventPath' -import CatalogDataStore from '../stores/CatalogDataStore' - -import imgAdd from '../../../node_modules/open-iconic/svg/plus.svg' -import imgRemove from '../../../node_modules/open-iconic/svg/trash.svg' - -import '../styles/EditDescriptorModelProperties.scss' -import '../styles/EditConfigParameterMap.scss'; - - -function getDescriptorMetaBasicForType(type) { - const basicPropertiesFilter = d => _.includes(DESCRIPTOR_MODEL_FIELDS[type], d.name); - return DescriptorModelMetaFactory.getModelMetaForType(type, basicPropertiesFilter) || {properties: []}; -} - -function getDescriptorMetaAdvancedForType(type) { - const advPropertiesFilter = d => !_.includes(DESCRIPTOR_MODEL_FIELDS[type], d.name); - return DescriptorModelMetaFactory.getModelMetaForType(type, advPropertiesFilter) || {properties: []}; -} - -function getTitle(model = {}) { - if (typeof model['short-name'] === 'string' && model['short-name']) { - return model['short-name']; - } - if (typeof model.name === 'string' && model.name) { - return model.name; - } - if (model.uiState && typeof model.uiState.displayName === 'string' && model.uiState.displayName) { - return model.uiState.displayName - } - if (typeof model.id === 'string') { - return model.id; - } -} -function startEditing() { - DeletionManager.removeEventListeners(); - } - - function endEditing() { - DeletionManager.addEventListeners(); - } - - function onClickSelectItem(property, path, value, event) { - event.preventDefault(); - const root = this.getRoot(); - if (SelectionManager.select(value)) { - CatalogItemsActions.catalogItemMetaDataChanged(root.model); - } - } - - function onFocusPropertyFormInputElement(property, path, value, event) { - - event.preventDefault(); - startEditing(); - - function removeIsFocusedClass(event) { - event.target.removeEventListener('blur', removeIsFocusedClass); - Array.from(document.querySelectorAll('.-is-focused')).forEach(d => d.classList.remove('-is-focused')); - } - - removeIsFocusedClass(event); - - const propertyWrapper = getEventPath(event).reduce((parent, element) => { - if (parent) { - return parent; - } - if (!element.classList) { - return false; - } - if (element.classList.contains('property')) { - return element; - } - }, false); - - if (propertyWrapper) { - propertyWrapper.classList.add('-is-focused'); - event.target.addEventListener('blur', removeIsFocusedClass); - } - - } - - function buildAddPropertyAction(container, property, path) { - function onClickAddProperty(property, path, event) { - event.preventDefault(); - //SelectionManager.resume(); - const create = Property.getContainerCreateMethod(property, this); - if (create) { - const model = null; - create(model, path, property); - } else { - const name = path.join('.'); - const value = Property.createModelInstance(property); - utils.assignPathValue(this.model, name, value); - } - CatalogItemsActions.catalogItemDescriptorChanged(this.getRoot()); - } - return ( -