You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airavata.apache.org by GitBox <gi...@apache.org> on 2021/02/24 20:15:27 UTC

[GitHub] [airavata-django-portal] akbranam opened a new pull request #55: Airavata 3321: adding read only view for Group Resource Profiles

akbranam opened a new pull request #55:
URL: https://github.com/apache/airavata-django-portal/pull/55


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airavata-django-portal] machristie commented on a change in pull request #55: Airavata 3321: adding read only view for Group Resource Profiles

Posted by GitBox <gi...@apache.org>.
machristie commented on a change in pull request #55:
URL: https://github.com/apache/airavata-django-portal/pull/55#discussion_r599977135



##########
File path: django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
##########
@@ -141,8 +174,18 @@ export default {
     id: {
       type: String,
     },
+    readonly: {
+      type: Boolean,

Review comment:
       If the type can also be string, then you can have `type: [Boolean, String]` so both are accepted.

##########
File path: django_airavata/apps/admin/static/django_airavata_admin/src/components/admin/group_resource_preferences/GroupComputeResourcePreference.vue
##########
@@ -81,7 +86,31 @@
               Edit
               <i class="fa fa-edit" aria-hidden="true"></i>
             </router-link>
+            <router-link
+              class="action-link"
+              v-if="readonly"
+              :to="{
+                name: 'compute_preference',
+                params: {
+                  value: row.item,
+                  id: id,
+                  host_id: row.item.computeResourceId,
+                  readonly: false,

Review comment:
       Instead of 'false', this should be 'true' or just 'readonly'




-- 
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:
users@infra.apache.org



[GitHub] [airavata-django-portal] machristie merged pull request #55: Airavata 3321: adding read only view for Group Resource Profiles

Posted by GitBox <gi...@apache.org>.
machristie merged pull request #55:
URL: https://github.com/apache/airavata-django-portal/pull/55


   


-- 
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:
users@infra.apache.org



[GitHub] [airavata-django-portal] machristie commented on a change in pull request #55: Airavata 3321: adding read only view for Group Resource Profiles

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org