Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AD277200C32 for ; Thu, 9 Mar 2017 14:59:34 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ABCF9160B67; Thu, 9 Mar 2017 13:59:34 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5E622160B64 for ; Thu, 9 Mar 2017 14:59:33 +0100 (CET) Received: (qmail 99018 invoked by uid 500); 9 Mar 2017 13:59:32 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 99009 invoked by uid 99); 9 Mar 2017 13:59:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2017 13:59:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7986ADFB7D; Thu, 9 Mar 2017 13:59:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pallavkul@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ambari git commit: AMBARI-20371. WFM: Delete option in Manage recent list. (Venkata Sairam via pallavkul) Date: Thu, 9 Mar 2017 13:59:32 +0000 (UTC) archived-at: Thu, 09 Mar 2017 13:59:34 -0000 Repository: ambari Updated Branches: refs/heads/trunk 0ff34acb3 -> 625dc70b8 AMBARI-20371. WFM: Delete option in Manage recent list. (Venkata Sairam via pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/625dc70b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/625dc70b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/625dc70b Branch: refs/heads/trunk Commit: 625dc70b8c6803536f2a5b0f87904d26f8daae2c Parents: 0ff34ac Author: pallavkul Authored: Thu Mar 9 19:28:52 2017 +0530 Committer: pallavkul Committed: Thu Mar 9 19:28:52 2017 +0530 ---------------------------------------------------------------------- .../ui/app/components/designer-workspace.js | 1 + .../resources/ui/app/components/drafts-wf.js | 84 +++++++-- .../ui/app/components/recent-projects.js | 32 +--- .../src/main/resources/ui/app/styles/app.less | 14 +- .../templates/components/designer-workspace.hbs | 2 +- .../ui/app/templates/components/drafts-wf.hbs | 175 ++++++++++++------- .../templates/components/recent-projects.hbs | 17 +- 7 files changed, 195 insertions(+), 130 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js index 0e49d70..980904f 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js @@ -213,6 +213,7 @@ export default Ember.Component.extend({ }, editWorkflow(path, type){ this.sendAction('editWorkflow', path, type); + this.send('hideProjectManagerList'); }, showProjectManagerList(){ var deferred = Ember.RSVP.defer(); http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js index 1d01e9b..ed448d9 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js @@ -24,9 +24,10 @@ export default Ember.Component.extend({ "isCoordinator": true, "isWorkflow": true, "sortProp": ['updatedAt:desc'], - "filteredModels": Ember.computed("model", "search", "isBundle", "isCoordinator", "isWorkflow", function(){ + "filteredModels": Ember.computed("recentFiles", "search", "isBundle", "isCoordinator", "isWorkflow", { + get(key) { var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle"); - return this.get("model").filter( (role) => { + return this.get("recentFiles").filter( (role) => { score = 0 if(searchTxt && searchTxt.length) { condition = role.get('name') && role.get('name').toLowerCase().indexOf(searchTxt)>-1; @@ -42,22 +43,42 @@ export default Ember.Component.extend({ } return condition && score > 0; }); + }, + set(key, value) { + this.set('recentFiles', value); + + var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle"); + return this.get("recentFiles").filter( (role) => { + score = 0 + if(searchTxt && searchTxt.length) { + condition = role.get('name') && role.get('name').toLowerCase().indexOf(searchTxt)>-1; + } + if(isWorkflow && role.get('type') === 'WORKFLOW') { + score++; + } + if(isCoordinator && role.get('type') === 'COORDINATOR') { + score++; + } + if(isBundle && role.get('type') === 'BUNDLE') { + score++; + } + return condition && score > 0; + }); + //return value; + } }), + resetDetails() { + this.set("deleteMsg", null); + this.set("deleteInProgress", false); + }, modelSorted : Ember.computed.sort("filteredModels", "sortProp"), "isDeleteDraftConformation": false, "currentDraft": undefined, "deleteInProgress": false, "deleteMsg": undefined, "currentJobService" : Ember.inject.service('current-job'), - elementsInserted: function () { - this.$('.actions').hide(); - }.on("didInsertElement"), rendered : function(){ var self = this; - this.$("#projectsList").on("hidden.bs.modal", function () { - this.sendAction("close"); - history.back(); - }.bind(this)); this.$("#projectDeleteModal").on('hidden.bs.modal', function () { self.set("isDeleteDraftConformation", true); self.set("deleteMsg", null); @@ -73,15 +94,11 @@ export default Ember.Component.extend({ this.sendAction('editWorkflow', path, type); }, confirmDelete (job ){ - this.set("showingConfirmation", true); - this.set("currentDraft", job); - }, - deleteDraft () { - this.sendAction("deleteWorkflow", this.get('currentDraft')); + this.send("showDeleteConfirmation", job); }, - closeProjects () { - //this.$('.modal-backdrop').remove(); - this.$("#projectsList").modal("hide"); + close () { + this.$("#projectsList").modal("hide"); + this.sendAction('close'); }, showActions (job) { this.$('.'+job.get("updatedAt")+'Actions').show(); @@ -90,6 +107,39 @@ export default Ember.Component.extend({ hideActions (job) { this.$('.'+job.get("updatedAt")+'Actions').hide(); this.$('.Actions'+job.get("updatedAt")).show(); + }, + showDeleteConfirmation(job) { + this.resetDetails(); + this.set('currentDraft', job); + this.set('showingDeleteConfirmation', true); + Ember.run.later(()=>{ + this.$("#projectsDeleteConfirmation").modal("show"); + }, 100); + }, + deleteWorkflow () { + let job = this.get("currentDraft"); + this.set("deleteInProgress", true); + var self= this; + var rec = this.get("store").peekRecord('wfproject', job.id); + if(rec){ + rec.destroyRecord().then(function () { + self.get('recentFiles', self.get('store').peekAll("wfproject")); + self.set("deleteInProgress", false); + self.set("deleteMsg", "Workflow successfully deleted."); + self.get('store').unloadRecord(rec); + self.set('filteredModels', self.get('store').peekAll("wfproject")); + Ember.run.later(()=>{ + self.set('showingDeleteConfirmation', false); + self.$("#projectsDeleteConfirmation").modal("hide"); + }, 1000); + }).catch(function (response) { + self.get('store').unloadRecord(rec); + self.get('filteredModels', self.get('store').peekAll("wfproject")); + self.sendAction("showProjectManagerList"); + self.set("deleteInProgress", false); + self.set("deleteMsg", "There is some problem while deletion.Please try again."); + }); + } } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js index 18a57f6..bbc51cc 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/recent-projects.js @@ -18,40 +18,12 @@ import Ember from 'ember'; export default Ember.Component.extend({ - store: Ember.inject.service(), - rendered : function(){ - var self = this; - this.$("#projectDeleteModal").on('hidden.bs.modal', function () { - self.set("isDeleteDraftConformation", true); - self.set("deleteMsg", null); - self.set("deleteInProgress", false); - }.bind(this)); - this.$("#projectsList").on("hidden.bs.modal", function () { - this.sendAction("close"); - }.bind(this)); - this.$("#projectsList").modal("show"); - }.on('didInsertElement'), actions: { close(){ - this.sendAction("close"); + this.sendAction('close'); }, - deleteWorkflow (job) { - this.set("deleteInProgress", true); - var self= this; - var rec = this.get("store").peekRecord('wfproject', job.id); - if(rec){ - rec.destroyRecord().then(function () { - self.set("deleteInProgress", false); - self.set("deleteMsg", "Workflow successfully deleted."); - }).catch(function (response) { - self.set("deleteInProgress", false); - self.set("deleteMsg", "There is some problem while deletion.Please try again."); - }); - } - }, editWorkflow ( path, type ) { this.sendAction('editWorkflow', path, type); - this.$("#projectsList").modal("hide"); - }, + } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less index a30833c..5577239 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less +++ b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less @@ -1597,7 +1597,7 @@ input:invalid { .inlineBlock{ display:inline-block; } -.asset-list .fa-trash-o { +.asset-list .fa-trash-o, #projectsList .fa-trash-o{ color: @defaultRed; cursor: pointer; } @@ -1713,9 +1713,6 @@ input:invalid { .displayBlock { display : block; } -.tab-pane #draftsTable, #projectsList #dashboard, .tab-pane .searchWorkflows { - display : none; - } .projects-list { white-space: nowrap; width: 100%; @@ -1760,3 +1757,12 @@ input:invalid { .processing-message { padding-left: 48%; } +#projectsList .modal-body { + max-height: 70vh; + overflow-y: scroll; + overflow-x: auto; + } +#projectsDeleteConfirmation .modal-body { + max-height: 70vh; + overflow: auto; +} http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs index c8d8dc3..c190511 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs @@ -160,7 +160,7 @@ {{#asset-manager showAssetManager="showAssetManager"}}{{/asset-manager}} {{/if}} {{#if isProjManagerVisible}} - {{recent-projects recentFiles=recentFiles routeToDesigner="routeToDesigner" editWorkflow="editWorkflow" deleteWorkflow="deleteWorkflow" close="hideProjectManagerList" deleteWorkflowJob="deleteWorkflowJob" currentDraft=currentDraft}} + {{recent-projects recentFiles=recentFiles routeToDesigner="routeToDesigner" editWorkflow="editWorkflow" deleteWorkflow="deleteWorkflow" close="hideProjectManagerList" deleteWorkflowJob="deleteWorkflowJob" currentDraft=currentDraft showProjectManagerList="showProjectManagerList"}} {{/if}} {{#if showingWarning}} {{#confirmation-dialog title="Confirm workflow reset" http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs index 632d6bd..ac28de3 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs @@ -15,68 +15,119 @@ * See the License for the specific language governing permissions and * limitations under the License. }} -
- {{spin-spinner lines=13 length=20 width=10}} -
-
- {{input type="checkbox" class="marginright5" name="isWorkflow" checked=isWorkflow}}Workflow   - {{input type="checkbox" class="marginright5" name="isCoordinator" checked=isCoordinator}}Coordinator   - {{input type="checkbox" class="marginright5" name="isBundle" checked=isBundle}}Bundle   - {{input type="text" class="l-input" value=search placeholder="Type Workflow name or path"}} -
-{{#if modelSorted}} -
- - - - - - - - - - - - {{#if modelSorted}} - {{#each modelSorted as |job idx|}} - {{#if true}} - - - - - - - + + +
NamePathUpdated at
- {{#if (eq job.type "WORKFLOW")}} - - {{else if (eq job.type "COORDINATOR")}} - - {{else}} - - {{/if}} - -
- {{job.workflowDefinitionPath}} -
-
-
- {{format-unicode-date job.updatedAt}} -
-
+ + + + + + + + + + + {{#if modelSorted}} + {{#each modelSorted as |job idx|}} + + + + + + + + + {{/each}} {{/if}} - {{/each}} - {{/if}} - -
NamePathUpdated at
+ {{#if (eq job.type "WORKFLOW")}} + + {{else if (eq job.type "COORDINATOR")}} + + {{else}} + + {{/if}} + +
+ {{job.workflowDefinitionPath}} +
+
+
+ {{format-unicode-date job.updatedAt}} +
+
+
+ +
+
+ + +
+
Displaying {{modelSorted.length}} workflows
+ {{else}} +
+ +
+ {{/if}} + + + + -
Displaying {{modelSorted.length}} workflows
-{{else}} -
- +
+ + + +{{#if showingDeleteConfirmation}} + +{{/if}} http://git-wip-us.apache.org/repos/asf/ambari/blob/625dc70b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/recent-projects.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/recent-projects.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/recent-projects.hbs index cd8f6af..c616586 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/recent-projects.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/recent-projects.hbs @@ -15,19 +15,4 @@ * See the License for the specific language governing permissions and * limitations under the License. }} - +{{drafts-wf recentFiles=recentFiles routeToDesigner="routeToDesigner" editWorkflow="editWorkflow" deleteWorkflow="deleteWorkflow" showDeleteConfirmation="showDeleteConfirmation" showProjectManagerList="showProjectManagerList" close="close"}}