Bug 177 - Export of nsd/vnfd should not prompt for format and grammar 37/1337/1
authorBob Gallagher <bob.gallagher@riftio.com>
Tue, 21 Mar 2017 15:25:27 +0000 (11:25 -0400)
committerBob Gallagher <bob.gallagher@riftio.com>
Tue, 21 Mar 2017 15:25:27 +0000 (11:25 -0400)
Export will be done using MANO and OSM.

Change-Id: Ia118bbf8cab80fb1715d629797dcac0f7ab61721
Signed-off-by: Bob Gallagher <bob.gallagher@riftio.com>
skyquake/plugins/composer/src/src/stores/CatalogDataStore.js

index afc5009..9345bc3 100644 (file)
@@ -36,7 +36,6 @@ import ComposerAppActions from '../actions/ComposerAppActions'
 import CatalogDataSource from '../sources/CatalogDataSource'
 import ComposerAppStore from '../stores/ComposerAppStore'
 import SelectionManager from '../libraries/SelectionManager'
-import ExportSelectorDialog from '../components/ExportSelectorDialog'
 
 const defaults = {
        catalogs: [],
@@ -581,61 +580,17 @@ class CatalogDataStore {
        }
 
        exportSelectedCatalogItems(draggedItem) {
-               const onSelectFormat = (selectedFormat, event) => {
-                       this.setState({
-                               selectedFormat: selectedFormat
-                       });
-               };
-
-               const onSelectGrammar = (selectedGrammar, event) => {
-                       this.setState({
-                               selectedGrammar: selectedGrammar
-                       });
-               }
-
-
-               const onCancel = () => {
-                       this.resetSelectionState();
-                       ModalOverlayActions.hideModalOverlay();
-               };
-
-               const onDownload = (event) => {
+               // collect the selected items and delegate to the catalog package manager action creator
+               const selectedItems = this.getAllSelectedCatalogItems();
+               if (selectedItems.length) {
                        CatalogPackageManagerActions.downloadCatalogPackage.defer({
                                selectedItems: selectedItems,
-                               selectedFormat: this.selectedFormat,
-                               selectedGrammar: this.selectedGrammar
+                               selectedFormat: 'mano',
+                               selectedGrammar: 'osm'
                        });
                        this.resetSelectionState();
-                       ModalOverlayActions.hideModalOverlay();
-                       return;
-               }
-
-               if (draggedItem) {
-                       // if item is given make sure it is also selected
-                       //draggedItem.uiState.selected = true;
-                       SelectionManager.addSelection(draggedItem);
-                       this.updateCatalogItem(draggedItem);
-               }
-               // collect the selected items and delegate to the catalog package manager action creator
-               const selectedItems = this.getAllSelectedCatalogItems();
-               if (selectedItems.length) {
-                       CatalogDataStore.chooseExportFormat(onSelectFormat, onSelectGrammar, onDownload, onCancel);
                }
        }
-
-       static chooseExportFormat(onSelectFormat, onSelectGrammar, onDownload, onCancel) {
-               ModalOverlayActions.showModalOverlay.defer(
-                       <ExportSelectorDialog
-                               onSelectFormat={onSelectFormat}
-                               onSelectGrammar={onSelectGrammar}
-                               onCancel={onCancel}
-                               onDownload={onDownload}
-                               currentlySelectedFormat='mano'
-                               currentlySelectedGrammar='osm'
-                       />
-               );
-       }
-
 }
 
 export default alt.createStore(CatalogDataStore, 'CatalogDataStore');