From a9691f5fe78af32c474754f841a71a68e2d2a484 Mon Sep 17 00:00:00 2001 From: Koren Lev Date: Mon, 2 Oct 2017 11:37:03 +0300 Subject: ui move to docker Change-Id: Iff31ebb3fff782e848704801b7800fdf480264a1 Signed-off-by: Koren Lev --- .../inventory-properties-display.js | 90 ---------------------- 1 file changed, 90 deletions(-) delete mode 100644 ui/imports/ui/components/inventory-properties-display/inventory-properties-display.js (limited to 'ui/imports/ui/components/inventory-properties-display/inventory-properties-display.js') diff --git a/ui/imports/ui/components/inventory-properties-display/inventory-properties-display.js b/ui/imports/ui/components/inventory-properties-display/inventory-properties-display.js deleted file mode 100644 index 34eb4c5..0000000 --- a/ui/imports/ui/components/inventory-properties-display/inventory-properties-display.js +++ /dev/null @@ -1,90 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others / -// / -// All rights reserved. This program and the accompanying materials / -// are made available under the terms of the Apache License, Version 2.0 / -// which accompanies this distribution, and is available at / -// http://www.apache.org/licenses/LICENSE-2.0 / -///////////////////////////////////////////////////////////////////////////////////////// -/* - * Template Component: InventoryPropertiesDisplay - */ - -//import { Meteor } from 'meteor/meteor'; -import { Template } from 'meteor/templating'; -import { SimpleSchema } from 'meteor/aldeed:simple-schema'; -import { ReactiveDict } from 'meteor/reactive-dict'; -import * as R from 'ramda'; -import { Inventory } from '/imports/api/inventories/inventories'; - -import './inventory-properties-display.html'; - -/* - * Lifecycles - */ - -Template.InventoryPropertiesDisplay.onCreated(function() { - let instance = this; - instance.state = new ReactiveDict(); - instance.state.setDefault({ - data: null, - env: null, - nodeId: null, - }); - - instance.autorun(function () { - let data = Template.currentData(); - - try { - new SimpleSchema({ - env: { type: String }, - nodeId: { type: String }, - displayFn: { type: Function }, - }).validate(data); - } catch (e) { - // meteor sometimes does not show the validation error and throws unclear view error. - console.error(`error in validate ${e}`); - throw e; - } - - instance.state.set('env', data.env); - instance.state.set('nodeId', data.nodeId); - }); - - instance.autorun(function () { - let env = instance.state.get('env'); - let nodeId = instance.state.get('nodeId'); - if (R.any(R.isNil)([env, nodeId])) { return; } - - instance.subscribe('inventory?env&id', env, nodeId); - - Inventory.find({ environment: env, id: nodeId }).forEach((node) => { - instance.state.set('node', node); - }); - }); -}); - -/* -Template.InventoryPropertiesDisplay.rendered = function() { -}; -*/ - -/* - * Events - */ - -Template.InventoryPropertiesDisplay.events({ -}); - -/* - * Helpers - */ - -Template.InventoryPropertiesDisplay.helpers({ - getNode: function () { - let instance = Template.instance(); - return instance.state.get('node'); - } -}); - - -- cgit 1.2.3-korg