ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [02/34] ambari git commit: AMBARI-20815. Need a confirmation dialog for table / database delete (pallavkul)
Date Wed, 26 Apr 2017 18:01:08 GMT
AMBARI-20815. Need a confirmation dialog for table / database delete (pallavkul)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7f4f421a
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7f4f421a
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7f4f421a

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: 7f4f421ae8ef06c5d0100ee3f2fea15c45094454
Parents: 150ab25
Author: pallavkul <pallav.kul@gmail.com>
Authored: Mon Apr 24 11:57:32 2017 +0530
Committer: pallavkul <pallav.kul@gmail.com>
Committed: Mon Apr 24 11:57:32 2017 +0530

----------------------------------------------------------------------
 .../routes/databases/database/tables/table.js   | 22 ++++++++++++++++++--
 .../databases/database/tables/table.hbs         | 19 ++++++++++++++++-
 2 files changed, 38 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7f4f421a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
index 53055cf..42a9a33 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table.js
@@ -45,8 +45,16 @@ export default Ember.Route.extend(UILoggerMixin, {
   },
 
   actions: {
-    deleteTable(table) {
-      this.deleteTable(table);
+    deleteTable() {
+      this.deleteTable(this.currentModel);
+    },
+
+    deleteTableWarning(){
+      this.deleteTableWarning();
+    },
+
+    cancelDeleteTableWarning(){
+      this.cancelDeleteTableWarning();
     },
 
     editTable(table) {
@@ -58,7 +66,16 @@ export default Ember.Route.extend(UILoggerMixin, {
     }
   },
 
+  deleteTableWarning(){
+    this.controller.set('showDeleteTableWarningModal', true);
+  },
+
+  cancelDeleteTableWarning(){
+    this.controller.set('showDeleteTableWarningModal', false);
+  },
+
   deleteTable(tableInfo) {
+    this.controller.set('showDeleteTableWarningModal', false);
     this.controller.set('showDeleteTableModal', true);
     this.controller.set('deleteTableMessage', 'Submitting request to delete table');
     let databaseModel = this.controllerFor('databases.database').get('model');
@@ -88,6 +105,7 @@ export default Ember.Route.extend(UILoggerMixin, {
         this.get('logger').danger(`Failed to delete table '${tableInfo.get('table')}'`, this.extractError(error));
         this.controller.set('showDeleteTableModal', true);
       });
+
   },
 
   _removeTableLocally(database, table) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/7f4f421a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
index 2fe3cfb..d461a95 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
@@ -27,7 +27,7 @@
         <ul class="dropdown-menu dropdown-menu-right">
           <li>{{#link-to "databases.database.tables.table.edit" class="text-uppercase"}}{{fa-icon
"edit"}} Edit{{/link-to}}</li>
           <li>{{#link-to "databases.database.tables.table.rename" class="text-uppercase"}}{{fa-icon
"edit"}} Rename{{/link-to}}</li>
-          <li><a href="#" class="text-uppercase" {{action "deleteTable" model}}>{{fa-icon
"trash"}} Delete</a></li>
+          <li><a href="#" class="text-uppercase" {{action "deleteTableWarning" }}>{{fa-icon
"trash"}} Delete</a></li>
         </ul>
       </div>
     </div>
@@ -46,6 +46,23 @@
       </div><!-- /.modal-content -->
     {{/modal-dialog}}
   {{/if}}
+
+  {{#if showDeleteTableWarningModal}}
+    {{confirm-dialog
+    title="Confirm"
+    label="Do You want to delete the Table?"
+    titleIcon="minus"
+    labelIcon="save"
+    rejectIcon="times"
+    confirmIcon="check"
+    closable=false
+    confirmClass="success"
+    confirm="deleteTable"
+    reject="cancelDeleteTableWarning"
+    }}
+  {{/if}}
+
+
   <div class="table-body">
     {{#tabs-pane tabs=tabs inverse= true as |tab|}}
       {{tabs-item tab=tab tabs=tabs}}


Mime
View raw message