X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FCanvasPanel.js;h=160db5fc8afc6bdb148e0e745815f830a7346479;hb=304568236de1a22486738399b075e909d37c2686;hp=6b04bd918dea34520e9bf9dfbfc5f3982d03a67c;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/plugins/composer/src/src/components/CanvasPanel.js b/skyquake/plugins/composer/src/src/components/CanvasPanel.js index 6b04bd918..160db5fc8 100644 --- a/skyquake/plugins/composer/src/src/components/CanvasPanel.js +++ b/skyquake/plugins/composer/src/src/components/CanvasPanel.js @@ -1,6 +1,6 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ */ 'use strict'; -import _ from 'lodash' +import _includes from 'lodash/includes' import cc from 'change-case' import React from 'react' import PureRenderMixin from 'react-addons-pure-render-mixin' @@ -35,6 +35,8 @@ import EditForwardingGraphPaths from './EditorForwardingGraph/EditForwardingGrap import SelectionManager from '../libraries/SelectionManager' import DescriptorModelIconFactory from '../libraries/model/IconFactory' +import FileManager from './filemanager/FileManager.jsx'; + import '../styles/CanvasPanel.scss' const CanvasPanel = React.createClass({ @@ -69,8 +71,26 @@ const CanvasPanel = React.createClass({ var req = require.context("../", true, /^\.\/.*\.svg$/); const hasItem = this.props.containers.length !== 0; const isEditingNSD = DescriptorModelFactory.isNetworkService(this.props.containers[0]); + const isDescriptorView = (this.props.panelTabShown == 'descriptor'); const hasNoCatalogs = this.props.hasNoCatalogs; const bodyComponent = hasItem ? : messages.canvasWelcome(); + const viewFiles = this.props.panelTabShown == 'assets'; + const viewButtonTabs = !hasItem ? null : ( +
+
+ + { + this.props.files ? + + : null + } +
+
+ ) return (
@@ -79,18 +99,23 @@ const CanvasPanel = React.createClass({ {this.props.title}
+ {viewButtonTabs}
- {hasNoCatalogs ? null : bodyComponent} + {hasNoCatalogs ? null : viewFiles ? : bodyComponent}
- - + { + isDescriptorView ? + + : null + } +
); }, onDragOver(event) { - const isDraggingFiles = _.contains(event.dataTransfer.types, 'Files'); + const isDraggingFiles = _includes(event.dataTransfer.types, 'Files'); if (!isDraggingFiles) { event.preventDefault(); event.dataTransfer.dropEffect = 'copy';