You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/03/03 20:37:25 UTC

[airavata-django-portal] branch master updated: Fix group delete error handling

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git


The following commit(s) were added to refs/heads/master by this push:
     new 43b32cc  Fix group delete error handling
43b32cc is described below

commit 43b32cc8001cef1b3dbf7b25293098e61c215f4d
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Sat Mar 3 15:37:18 2018 -0500

    Fix group delete error handling
---
 .../js/group_components/GroupListItem.vue          | 28 ++++++++++++----------
 django_airavata/settings.py                        |  5 +++-
 django_airavata/settings_local.py.sample           |  2 +-
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupListItem.vue b/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupListItem.vue
index e3528f9..04155f0 100644
--- a/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupListItem.vue
+++ b/django_airavata/apps/groups/static/django_airavata_groups/js/group_components/GroupListItem.vue
@@ -14,8 +14,8 @@
             <b-modal :header-bg-variant="headerBgVariant" :header-text-variant="headerTextVariant" :body-bg-variant="bodyBgVariant" v-model="show" :id="'modal'+group.id" title="Are you sure?">
               <p class="my-4">You cannot go back! Do you really want to delete the group '<strong>{{ group.name }}</strong>'?</p>
               <div slot="modal-footer" class="w-100">
-                <b-button class="float-right ml-1" :variant="yesButtonVariant" @click="deleteGroup(group.id)">Yes</b-button>
-                <b-button class="float-right ml-1" :variant="noButtonVariant" @click="show=false">No</b-button>
+                <b-button class="float-right ml-1" :variant="yesButtonVariant" :disabled="deleting" @click="deleteGroup(group.id)">Yes</b-button>
+                <b-button class="float-right ml-1" :variant="noButtonVariant" :disabled="deleting" @click="show=false">No</b-button>
               </div>
             </b-modal>
         </td>
@@ -37,21 +37,25 @@ export default {
         headerBgVariant: 'danger',
         bodyBgVariant: 'light',
         headerTextVariant: 'light',
+        deleting: false,
       }
     },
     props: ['group'],
     methods: {
       deleteGroup(id) {
-        try {
-          let ret_msg = services.GroupService.delete(id);
-          this.$emit('deleteSuccess','Group Deleted Successfully!');
-          this.show = false;
-        }
-        catch(error) {
-            console.log(error);
-            this.$emit('deleteFailed', 'Group Delete Failed!');
-            this.show = false;
-        }
+          this.deleting = true;
+          services.GroupService.delete(id)
+              .then(result => {
+                  this.$emit('deleteSuccess','Group Deleted Successfully!');
+                  this.show = false;
+                  this.deleting = false;
+              })
+              .catch(error => {
+                  console.log(error);
+                  this.$emit('deleteFailed', 'Group Delete Failed!');
+                  this.show = false;
+                  this.deleting = false;
+              });
       }
     }
 }
diff --git a/django_airavata/settings.py b/django_airavata/settings.py
index 7b0f221..e857e8e 100644
--- a/django_airavata/settings.py
+++ b/django_airavata/settings.py
@@ -1,8 +1,11 @@
 """
 Django settings for django_airavata_gateway project.
+
 Generated by 'django-admin startproject' using Django 1.10.5.
+
 For more information on this file, see
 https://docs.djangoproject.com/en/1.10/topics/settings/
+
 For the full list of settings and their values, see
 https://docs.djangoproject.com/en/1.10/ref/settings/
 """
@@ -164,7 +167,7 @@ LOGGING = {
         },
     },
 }
-GATEWAY_DATA_STORE_DIR = '/tmp'
+
 # Allow all settings to be overridden by settings_local.py file
 try:
     from django_airavata.settings_local import *
diff --git a/django_airavata/settings_local.py.sample b/django_airavata/settings_local.py.sample
index fcea7b2..d7b8814 100644
--- a/django_airavata/settings_local.py.sample
+++ b/django_airavata/settings_local.py.sample
@@ -33,7 +33,7 @@ AIRAVATA_API_HOST = 'localhost'
 AIRAVATA_API_PORT = 8930
 AIRAVATA_API_SECURE = False
 GATEWAY_DATA_STORE_RESOURCE_ID = '...'
-GATEWAY_DATA_STORE_DIR = '...'
+GATEWAY_DATA_STORE_DIR = '/tmp'
 GATEWAY_DATA_STORE_HOSTNAME = 'localhost'
 
 # Profile Service Configuration

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.