You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by is...@apache.org on 2021/06/21 15:16:05 UTC

[airavata-custos-portal] branch reference-portal updated: Minor fixes

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

isjarana pushed a commit to branch reference-portal
in repository https://gitbox.apache.org/repos/asf/airavata-custos-portal.git


The following commit(s) were added to refs/heads/reference-portal by this push:
     new f0d9dde  Minor fixes
     new 6e84529  Merge pull request #81 from dinukadesilva/reference-portal
f0d9dde is described below

commit f0d9ddea4575cf86f0cdfc094c354973510eae95
Author: Dinuka De Silva <l....@gmail.com>
AuthorDate: Mon Jun 21 11:12:03 2021 -0400

    Minor fixes
---
 .../src/components/admin-portal/TenantEntities.vue | 24 +++++++++-------------
 .../components/admin-portal/TenantNewEntity.vue    | 17 ++++++++-------
 2 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/custos-demo-gateway/src/components/admin-portal/TenantEntities.vue b/custos-demo-gateway/src/components/admin-portal/TenantEntities.vue
index c106aa1..00c8206 100644
--- a/custos-demo-gateway/src/components/admin-portal/TenantEntities.vue
+++ b/custos-demo-gateway/src/components/admin-portal/TenantEntities.vue
@@ -42,7 +42,7 @@
                   </router-link>
                 </small>
                 <div>
-                  <b-button v-if="hasPermission(appointment, permissionTypeShare)" variant="link" size="sm"
+                  <b-button v-if="hasPermission(appointment, permissionTypeEditor)" variant="link" size="sm"
                             v-b-modal="`modal-appointment-share-${appointment.entityId}`">
                     <b-icon icon="share"/>
                   </b-button>
@@ -80,7 +80,7 @@
                         </router-link>
                       </small>
                       <div>
-                        <b-button variant="link" size="sm" v-if="hasPermission(history, permissionTypeShare)"
+                        <b-button variant="link" size="sm" v-if="hasPermission(history, permissionTypeEditor)"
                                   v-b-modal="`modal-history-share-${history.entityId}`">
                           <b-icon icon="share"/>
                         </b-button>
@@ -156,7 +156,7 @@
                         </router-link>
                       </small>
                       <div>
-                        <b-button variant="link" size="sm" v-if="hasPermission(prescription, permissionTypeShare)"
+                        <b-button variant="link" size="sm" v-if="hasPermission(prescription, permissionTypeEditor)"
                                   v-b-modal="`modal-prescription-share-${prescription.entityId}`">
                           <b-icon icon="share"/>
                         </b-button>
@@ -233,7 +233,7 @@ const clientRoleNurse = config.value('clientRoleNurse');
 const clientRolePatient = config.value('clientRolePatient');
 const groupIdDoctor = config.value('groupIdDoctor');
 // const groupIdNurse = config.value('groupIdNurse');
-// const permissionTypeViewer = config.value('permissionTypeViewer');
+const permissionTypeViewer = config.value('permissionTypeViewer');
 const permissionTypeEditor = config.value('permissionTypeEditor');
 const permissionTypeShare = config.value('permissionTypeShare');
 
@@ -428,7 +428,7 @@ export default {
           name: `custos-health-history-${window.performance.now()}`,
           fullText: JSON.stringify(entity.fullTextJson),
           type: entity.type,
-          ownerId: this.$store.getters["auth/currentUsername"]
+          ownerId: appointment.ownerId
         });
 
         this.entitiesMap = {
@@ -438,6 +438,9 @@ export default {
             saved: true
           }
         }
+
+        this.refreshData();
+
       } catch (error) {
         this.errors.push({
           title: "Unknown error when creating the entity.",
@@ -471,14 +474,14 @@ export default {
           await this.$store.dispatch("sharing/shareEntity", {
             entityId: subEntity.entityId,
             clientId: this.clientId,
-            permissionTypeId: "READ",
+            permissionTypeId: permissionTypeViewer,
             groupIds: [groupIdDoctor]
           });
         } else if (entity.type === entityTypeIdPrescription) {
           await this.$store.dispatch("sharing/shareEntity", {
             entityId: subEntity.entityId,
             clientId: this.clientId,
-            permissionTypeId: "READ",
+            permissionTypeId: permissionTypeViewer,
             usernames: [appointment.ownerId]
           });
         }
@@ -544,13 +547,6 @@ export default {
             username: this.currentUsername
           });
 
-          this.$store.dispatch("sharing/userHasAccess", {
-            clientId: this.clientId,
-            entityId: entity.entityId,
-            permissionTypeId: permissionTypeShare,
-            username: this.currentUsername
-          });
-
           entity.saved = true;
 
           try {
diff --git a/custos-demo-gateway/src/components/admin-portal/TenantNewEntity.vue b/custos-demo-gateway/src/components/admin-portal/TenantNewEntity.vue
index 277b093..9dbcebc 100644
--- a/custos-demo-gateway/src/components/admin-portal/TenantNewEntity.vue
+++ b/custos-demo-gateway/src/components/admin-portal/TenantNewEntity.vue
@@ -76,9 +76,9 @@ import config from "@/config";
 const groupIdDoctor = config.value('groupIdDoctor');
 const groupIdNurse = config.value('groupIdNurse');
 
-const permissionTypeViewer = config.value('permissionTypeViewer');
+// const permissionTypeViewer = config.value('permissionTypeViewer');
 const permissionTypeEditor = config.value('permissionTypeEditor');
-const permissionTypeShare = config.value('permissionTypeShare');
+// const permissionTypeShare = config.value('permissionTypeShare');
 
 export default {
   name: "TenantEntities",
@@ -172,13 +172,12 @@ export default {
             ownerId: this.$store.getters["auth/currentUsername"]
           });
 
-          await Promise.all([permissionTypeViewer, permissionTypeEditor, permissionTypeShare].map(permissionTypeId =>
-              this.$store.dispatch("sharing/shareEntity", {
-                entityId: entityId,
-                clientId: this.clientId,
-                permissionTypeId,
-                groupIds: [groupIdDoctor, groupIdNurse]
-              })));
+          await this.$store.dispatch("sharing/shareEntity", {
+            entityId: entityId,
+            clientId: this.clientId,
+            permissionTypeId: permissionTypeEditor,
+            groupIds: [groupIdDoctor, groupIdNurse]
+          });
 
           await this.$router.push(`/tenants/${this.clientId}/entities`);
         } catch (error) {