ソースを参照

AMBARI-20411. Export workflow will create a workflow with workflow name (Venkata Sairam via pallavkul)

pallavkul 8 年 前
コミット
b099a2c323

+ 7 - 3
contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js

@@ -222,10 +222,14 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     });
   },
   workflowXmlDownload(workflowXml){
-      var link = document.createElement("a");
+    let link = document.createElement("a"), val = this.get('workflow.name');
+    if(Ember.isBlank(val)) {
       link.download = "workflow.xml";
-      link.href = "data:text/xml,"+encodeURIComponent(vkbeautify.xml(workflowXml));
-      link.click();
+    } else {
+      link.download = val.replace(/\s/g, '_');
+    }
+    link.href = "data:text/xml,"+encodeURIComponent(vkbeautify.xml(workflowXml));
+    link.click();
   },
   nodeRendered: function(){
     if (this.get("isNew")){

+ 9 - 0
contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less

@@ -1765,4 +1765,13 @@ input:invalid {
 #projectsDeleteConfirmation .modal-body {
    max-height: 70vh;
    overflow: auto;
+ }
+.tab-name {
+  display: inline-block;
+  max-width: 100px;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  overflow: hidden;
+  top: 5px;
+  position: relative;
 }

+ 1 - 1
contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs

@@ -125,7 +125,7 @@
           {{else}}
           <i class="fa fa-th marginright5"></i>
           {{/if}}
-          {{tab.name}}
+          <div class="tab-name">{{tab.name}}</div>
           <span class="closeTab" {{action "showWarning" index bubbles=false }}>x</span>
         </a>
       </li>