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 2019/05/13 13:53:18 UTC

[airavata-django-portal] branch master updated (3b9742d -> 609b068)

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 3b9742d  Validate and create passed in experimentDataDir
     new e4ff4e3  AIRAVATA-3038 Remove old GroupResourceProfileService class
     new 609b068  AIRAVATA-3038 Fetch creationTime and update new group resource profile

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:
 .../ComputePreference.vue                          | 12 +++-------
 .../GroupComputeResourcePreference.vue             |  4 ++--
 .../js/services/GroupResourceProfileService.js     | 27 ----------------------
 django_airavata/apps/api/views.py                  |  4 ++++
 4 files changed, 9 insertions(+), 38 deletions(-)
 delete mode 100644 django_airavata/apps/api/static/django_airavata_api/js/services/GroupResourceProfileService.js


[airavata-django-portal] 01/02: AIRAVATA-3038 Remove old GroupResourceProfileService class

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 e4ff4e3edf69ae1b71aa879be16f81664394a84f
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon May 13 09:47:30 2019 -0400

    AIRAVATA-3038 Remove old GroupResourceProfileService class
---
 .../ComputePreference.vue                          | 12 +++-------
 .../GroupComputeResourcePreference.vue             |  4 ++--
 .../js/services/GroupResourceProfileService.js     | 27 ----------------------
 3 files changed, 5 insertions(+), 38 deletions(-)

diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
index 459b404..090e835 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
@@ -224,9 +224,7 @@ export default {
       );
       // TODO: success and error handling are the same so we can just combine those
       if (this.id) {
-        DjangoAiravataAPI.services.ServiceFactory.service(
-          "GroupResourceProfiles"
-        )
+        DjangoAiravataAPI.services.GroupResourceProfileService
           .update({ data: groupResourceProfile, lookup: this.id })
           .then(groupResourceProfile => {
             // Navigate back to GroupResourceProfile with success message
@@ -239,9 +237,7 @@ export default {
             });
           });
       } else {
-        DjangoAiravataAPI.services.ServiceFactory.service(
-          "GroupResourceProfiles"
-        )
+        DjangoAiravataAPI.services.GroupResourceProfileService
           .create({ data: groupResourceProfile })
           .then(groupResourceProfile => {
             // Navigate back to GroupResourceProfile with success message
@@ -261,9 +257,7 @@ export default {
         this.host_id
       );
       if (removedChildren) {
-        DjangoAiravataAPI.services.ServiceFactory.service(
-          "GroupResourceProfiles"
-        )
+        DjangoAiravataAPI.services.GroupResourceProfileService
           .update({ data: groupResourceProfile, lookup: this.id })
           .then(groupResourceProfile => {
             // Navigate back to GroupResourceProfile with success message
diff --git a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
index 6c1eec8..7bca11c 100644
--- a/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
+++ b/django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
@@ -88,7 +88,7 @@ export default {
   mounted: function() {
     if (this.id) {
       if (!this.value.groupResourceProfileId) {
-        services.ServiceFactory.service("GroupResourceProfiles")
+        services.GroupResourceProfileService
           .retrieve({ lookup: this.id })
           .then(grp => (this.data = grp));
       }
@@ -98,7 +98,7 @@ export default {
     let data = this.value.clone();
     return {
       data: data,
-      service: services.ServiceFactory.service("GroupResourceProfiles"),
+      service: services.GroupResourceProfileService,
       computePreferencesFields: [
         {
           label: "Name",
diff --git a/django_airavata/apps/api/static/django_airavata_api/js/services/GroupResourceProfileService.js b/django_airavata/apps/api/static/django_airavata_api/js/services/GroupResourceProfileService.js
deleted file mode 100644
index 29e05c5..0000000
--- a/django_airavata/apps/api/static/django_airavata_api/js/services/GroupResourceProfileService.js
+++ /dev/null
@@ -1,27 +0,0 @@
-
-import FetchUtils from '../utils/FetchUtils'
-import GroupResourceProfile from '../models/GroupResourceProfile'
-
-class GroupResourceProfileService {
-    list(data = null) {
-        if (data) {
-            return Promise.resolve(data.map(result => new GroupResourceProfile(result)));
-        } else {
-            return FetchUtils.get('/api/group-resource-profiles/')
-                .then(results => results.map(result => new GroupResourceProfile(result)));
-        }
-    }
-
-    get(groupResourceProfileId, data = null) {
-        if (data) {
-            return Promise.resolve(new GroupResourceProfile(data));
-        } else {
-            return FetchUtils.get('/api/group-resource-profiles/'
-                    + encodeURIComponent(groupResourceProfileId) + '/')
-                .then(result => new GroupResourceProfile(result));
-        }
-    }
-}
-
-// Export as a singleton
-export default new GroupResourceProfileService();
\ No newline at end of file


[airavata-django-portal] 02/02: AIRAVATA-3038 Fetch creationTime and update new group resource profile

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 609b06838b14dc0a4deeba6dcaa6153170b27c6e
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon May 13 09:48:18 2019 -0400

    AIRAVATA-3038 Fetch creationTime and update new group resource profile
---
 django_airavata/apps/api/views.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index b6c926b..75151a9 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -935,6 +935,10 @@ class GroupResourceProfileViewSet(APIBackedViewSet):
         group_resource_profile_id = self.request.airavata_client.createGroupResourceProfile(
             authzToken=self.authz_token, groupResourceProfile=group_resource_profile)
         group_resource_profile.groupResourceProfileId = group_resource_profile_id
+        # Update the creationTime field on the group resource profile
+        new_group_resource_profile = self.request.airavata_client.getGroupResourceProfile(
+            self.authz_token, group_resource_profile_id)
+        group_resource_profile.creationTime = new_group_resource_profile.creationTime
 
     def perform_update(self, serializer):
         grp = serializer.save()