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/07/17 22:30:18 UTC

[airavata-django-portal] branch master updated (70e68de -> 240c7d3)

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

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


    from 70e68de  Fix null dereference error
     new a9407ea  Autocomplete: fix handling of null value
     new 240c7d3  AIRAVATA-2805 Add ShareButton to App Deployments

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../components/admin/ApplicationDeployments.vue    | 23 ++++++++++++++++------
 django_airavata/apps/api/serializers.py            |  2 +-
 django_airavata/apps/api/views.py                  |  1 +
 .../static/common/js/components/Autocomplete.vue   |  7 ++-----
 4 files changed, 21 insertions(+), 12 deletions(-)


[airavata-django-portal] 02/02: AIRAVATA-2805 Add ShareButton to App Deployments

Posted by ma...@apache.org.
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

commit 240c7d31750a60e8ffc04b2334d5f7f68ce5e17e
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Tue Jul 17 18:30:09 2018 -0400

    AIRAVATA-2805 Add ShareButton to App Deployments
---
 .../components/admin/ApplicationDeployments.vue    | 23 ++++++++++++++++------
 django_airavata/apps/api/views.py                  |  1 +
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/ApplicationDeployments.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/ApplicationDeployments.vue
index 41b7d7f..54317b0 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/ApplicationDeployments.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/ApplicationDeployments.vue
@@ -2,12 +2,15 @@
   <div class="main_section">
     <div class="new-application-tab-main">
       <h4>Application Deployments</h4>
-      <div class="entry" v-if="appDeployments.appDeployments.length!=0">
+      <div class="entry" v-if="appDeployments.appDeployments && appDeployments.appDeployments.length!=0">
         <div class="heading">Select an Application Deployment to Edit</div>
         <select v-model="appDeploymentIndex">
           <option v-for="(appDeployment,index) in appDeployments.appDeployments" v-bind:value="index">{{appDeployment.appDeploymentId}}</option>
         </select>
       </div>
+      <div class="entry" v-if="appDeployments.appDeploymentId">
+          <share-button v-model="sharedEntity"/>
+      </div>
       <div class="entry">
         <div class="heading">Application module</div>
         <input type="text" v-model="appDeployments.appModuleId"/>
@@ -131,12 +134,16 @@
   import Loading from '../Loading.vue'
 
   import Utils from '../../utils'
+  import {components as comps} from 'django-airavata-common-ui'
+  import DjangoAiravataAPI from 'django-airavata-api'
 
   const {mapGetters, mapActions} = createNamespacedHelpers('newApplication/appDeploymentsTab')
 
   export default {
     components: {
-      NewApplicationButtons,Loading
+      NewApplicationButtons,
+      Loading,
+      "share-button": comps.ShareButton,
     },
     mounted: function () {
       this.initializeAppDeployment(()=>{
@@ -145,13 +152,12 @@
       })
     },
     data: function () {
-      var appDeployments = this.getCompleteData
-      console.log("Application Deployment Data", appDeployments)
       return {
-        "appDeployments": appDeployments,
+        "appDeployments": this.getCompleteData ? this.getCompleteData : {},
         "computeHosts":[],
         "queues":[],
-        "appDeploymentIndex":null
+        "appDeploymentIndex":null,
+        sharedEntity: null,
       }
     },
     computed: {
@@ -214,6 +220,11 @@
         var temp=this.appDeployments.appDeployments[value]
         temp.appDeployments=this.appDeployments.appDeployments
         this.appDeployments=temp
+      },
+      "appDeployments.appDeploymentId": function (value) {
+        DjangoAiravataAPI.services.ServiceFactory.service("SharedEntities")
+          .retrieve({lookup: value})
+          .then(sharedEntity => this.sharedEntity = sharedEntity);
       }
     }
   }
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index 791e972..c40bf7f 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -739,6 +739,7 @@ class SharedEntityViewSet(mixins.RetrieveModelMixin,
                           GenericAPIBackedViewSet):
     serializer_class = serializers.SharedEntitySerializer
     lookup_field = 'entity_id'
+    lookup_value_regex = '[^/]+'
 
     def get_instance(self, lookup_value):
         users = {}


[airavata-django-portal] 01/02: Autocomplete: fix handling of null value

Posted by ma...@apache.org.
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

commit a9407ead8ed7fdb4145547439c710a8217c8d078
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Tue Jul 17 17:08:16 2018 -0400

    Autocomplete: fix handling of null value
---
 django_airavata/apps/api/serializers.py                      | 2 +-
 django_airavata/static/common/js/components/Autocomplete.vue | 7 ++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index c9d37e5..88de8a8 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -135,7 +135,7 @@ class StoredJSONField(serializers.JSONField):
 
 class GroupSerializer(serializers.Serializer):
     url = FullyEncodedHyperlinkedIdentityField(view_name='django_airavata_api:group-detail', lookup_field='id', lookup_url_kwarg='group_id')
-    id = serializers.CharField(default=GroupModel.thrift_spec[1][4])
+    id = serializers.CharField(default=GroupModel.thrift_spec[1][4], allow_null=True)
     name = serializers.CharField(required=True)
     description = serializers.CharField(allow_null=True, allow_blank=True)
     ownerId = serializers.CharField(read_only=True)
diff --git a/django_airavata/static/common/js/components/Autocomplete.vue b/django_airavata/static/common/js/components/Autocomplete.vue
index b5e74e0..8497ac7 100644
--- a/django_airavata/static/common/js/components/Autocomplete.vue
+++ b/django_airavata/static/common/js/components/Autocomplete.vue
@@ -19,8 +19,7 @@ export default {
   props: {
     value: {
       type: Array,
-      required: false
-        , default:[]
+      required: false,
     },
 
     suggestions: {
@@ -29,9 +28,8 @@ export default {
     }
   },
   data () {
-      console.log("Value",this.value.length);
     return {
-      localValue: this.value,
+      localValue: this.value ? this.value.slice() : [],
     }
   },
   components: {
@@ -39,7 +37,6 @@ export default {
   },
   computed: {
     selected () {
-        console.log("local Value",this.localValue.length);
         return this.suggestions.filter((suggestion) => {
             return this.localValue.indexOf(suggestion.id) >= 0;
         });