airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] 01/02: Autocomplete: fix handling of null value
Date Tue, 17 Jul 2018 22:30:19 GMT
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 <machrist@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;
         });


Mime
View raw message