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 2022/12/05 20:17:56 UTC

[airavata-django-portal] branch develop updated: AIRAVATA-3675 Display the Allocation (GRP) on the Exp Summary page

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 64764374 AIRAVATA-3675 Display the Allocation (GRP) on the Exp Summary page
64764374 is described below

commit 64764374e9e1de0f3f6773d8d385f6bdb9dfb02f
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Dec 5 15:17:43 2022 -0500

    AIRAVATA-3675 Display the Allocation (GRP) on the Exp Summary page
---
 .../js/components/experiment/ExperimentSummary.vue         | 14 ++++++++++++++
 .../js/store/modules/view-experiment.js                    | 14 ++++++++++++++
 .../static/django_airavata_workspace/js/utils/urls.js      |  5 +++++
 3 files changed, 33 insertions(+)

diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
index 903baa93..04ae7a34 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/ExperimentSummary.vue
@@ -173,6 +173,14 @@
                     >
                   </td>
                 </tr>
+                <tr v-if="groupResourceProfile">
+                  <th scope="row">Allocation</th>
+                  <td>
+                    <b-link :href="viewGroupResourceProfileLink">
+                      {{ groupResourceProfile.groupResourceProfileName }}
+                    </b-link>
+                  </td>
+                </tr>
                 <tr v-if="showQueueSettings">
                   <th scope="row">Wall Time Limit</th>
                   <td>
@@ -313,6 +321,7 @@ export default {
       "fullExperiment",
       "launching",
       "clonedExperiment",
+      "groupResourceProfile",
     ]),
     ...mapGetters("viewExperiment", [
       "finishedOrExecuting",
@@ -403,6 +412,11 @@ export default {
         return [];
       }
     },
+    viewGroupResourceProfileLink() {
+      return this.groupResourceProfile
+        ? urls.viewGroupResourceProfile(this.groupResourceProfile)
+        : null;
+    },
   },
   methods: {
     ...mapActions("viewExperiment", ["clone", "launch", "cancel"]),
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/store/modules/view-experiment.js b/django_airavata/apps/workspace/static/django_airavata_workspace/js/store/modules/view-experiment.js
index 02d7af1d..83e983aa 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/store/modules/view-experiment.js
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/store/modules/view-experiment.js
@@ -30,6 +30,9 @@ export const mutations = {
   setApplicationInterface(state, { applicationInterface }) {
     state.applicationInterface = applicationInterface;
   },
+  setGroupResourceProfile(state, { groupResourceProfile }) {
+    state.groupResourceProfile = groupResourceProfile;
+  },
 };
 export const actions = {
   async setInitialFullExperimentData({ dispatch }, { fullExperimentData }) {
@@ -55,6 +58,7 @@ export const actions = {
         errors.UnhandledErrorDispatcher.reportUnhandledError(error);
       }
     }
+    dispatch("loadGroupResourceProfile");
     dispatch("initPollingExperiment");
   },
   setLaunching({ dispatch, commit }, { launching }) {
@@ -145,6 +149,12 @@ export const actions = {
       });
     }
   },
+  async loadGroupResourceProfile({ getters, commit }) {
+    const groupResourceProfile = await services.GroupResourceProfileService.retrieve(
+      { lookup: getters.groupResourceProfileId }
+    );
+    commit("setGroupResourceProfile", { groupResourceProfile });
+  },
 };
 
 function getDataProducts(io, collection) {
@@ -241,6 +251,9 @@ export const getters = {
       ? state.applicationInterface.showQueueSettings
       : false;
   },
+  groupResourceProfileId(state, getters) {
+    return getters.experiment?.userConfigurationData?.groupResourceProfileId;
+  },
 };
 
 const state = {
@@ -250,6 +263,7 @@ const state = {
   clonedExperiment: null,
   runningIntermediateOutputFetches: {},
   applicationInterface: null,
+  groupResourceProfile: null,
 };
 export default {
   namespaced: true,
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/utils/urls.js b/django_airavata/apps/workspace/static/django_airavata_workspace/js/utils/urls.js
index 9f8cbd27..0bb92992 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/utils/urls.js
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/utils/urls.js
@@ -47,4 +47,9 @@ export default {
   navigateToProjectsList() {
     window.location.assign(this.projectsList());
   },
+  viewGroupResourceProfile(groupResourceProfile) {
+    return `/admin/group-resource-profiles/${encodeURIComponent(
+      groupResourceProfile.groupResourceProfileId
+    )}`;
+  },
 };