machristie commented on a change in pull request #55:
URL: 
https://github.com/apache/airavata-django-portal/pull/55#discussion_r612769582



##########
File path: 
django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
##########
@@ -202,6 +214,7 @@ export default {
       services.GroupResourceProfileService.retrieve({ lookup: this.id }).then(
         (groupResourceProfile) => {
           this.localGroupResourceProfile = groupResourceProfile;
+          this.userHasWriteAccess = 
this.localGroupResourceProfile.userHasWriteAccess;

Review comment:
       This line essentially only gets called when reloading the page in the 
browser, as far as I can tell. You should also handle the case where the 
groupResourceProfile is passed as a prop and just get the userHasWriteAccess 
from that.

##########
File path: 
django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/ComputePreference.vue
##########
@@ -249,6 +263,7 @@ export default {
       validationErrors: null,
       reservationsInvalid: false,
       computeResourcePolicyInvalid: false,
+      userHasWriteAccess: true,

Review comment:
       Maybe for safety, default this to false?

##########
File path: 
django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
##########
@@ -97,12 +126,16 @@
       </template>
     </list-layout>
     <div class="fixed-footer">
-      <b-button variant="primary" @click="saveGroupResourceProfile"
+      <b-button 
+      variant="primary" 
+      disabled="!data.userHasWriteAccess"

Review comment:
       this should be a binding, like `:disabled="!data.userHasWriteAccess"`. 
As it is, the expression isn't being evaluated and is taken as a literal string.

##########
File path: 
django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
##########
@@ -97,12 +126,16 @@
       </template>
     </list-layout>
     <div class="fixed-footer">
-      <b-button variant="primary" @click="saveGroupResourceProfile"
+      <b-button 
+      variant="primary" 
+      disabled="!data.userHasWriteAccess"
+      @click="saveGroupResourceProfile"
         >Save</b-button
       >
       <delete-button
         v-if="id"
         class="ml-2"
+        disabled="!data.userHasWriteAccess"

Review comment:
       Likewise, should be `:disabled=...`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to