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 2021/05/28 21:08:36 UTC
[airavata-django-portal] branch develop updated: fixing create new
grp
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 2b61e15 fixing create new grp
new 911a0f7 Merge pull request #61 from akbranam/AIRAVATA-3321-GRP-Readonly-View
2b61e15 is described below
commit 2b61e15bd92eb8db876796e4e80dd7c0d5ff6b46
Author: akbranam <ak...@gmail.com>
AuthorDate: Fri May 14 13:53:02 2021 -0400
fixing create new grp
---
.../ComputePreference.vue | 3 +++
.../GroupComputeResourcePreference.vue | 25 ++++++++++++++--------
2 files changed, 19 insertions(+), 9 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 149c871..4c4b41d 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
@@ -240,6 +240,9 @@ export default {
} else if (!this.computeResourcePolicy) {
this.createDefaultComputeResourcePolicy(computeResourcePromise);
}
+ if (!this.id){
+ this.userHasWriteAccess=true;
+ }
this.$on("input", this.validate);
},
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 9d5bb1c..86475ba 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
@@ -17,7 +17,7 @@
id="profile-name"
type="text"
v-model="data.groupResourceProfileName"
- :disabled="!data.userHasWriteAccess"
+ :disabled="!userHasWriteAccess"
required
placeholder="Name of this Group Resource Profile"
>
@@ -30,7 +30,7 @@
<ssh-credential-selector
id="default-credential-store-token"
v-model="data.defaultCredentialStoreToken"
- :readonly="!data.userHasWriteAccess"
+ :readonly="!userHasWriteAccess"
>
</ssh-credential-selector>
</b-form-group>
@@ -41,7 +41,7 @@
</div>
<list-layout
:items="data.computePreferences"
- :newButtonDisabled="!data.userHasWriteAccess"
+ :newButtonDisabled="!userHasWriteAccess"
title="Compute Preferences"
new-item-button-text="New Compute Preference"
@add-new-item="createComputePreference"
@@ -65,7 +65,7 @@
<template slot="action" slot-scope="row">
<router-link
class="action-link"
- v-if="data.userHasWriteAccess"
+ v-if="userHasWriteAccess"
:to="{
name: 'compute_preference',
params: {
@@ -88,7 +88,7 @@
<router-link
class="action-link"
- v-if="!data.userHasWriteAccess"
+ v-if="!userHasWriteAccess"
:to="{
name: 'compute_preference',
params: {
@@ -111,7 +111,7 @@
<delete-link
class="action-link"
- v-if="data.userHasWriteAccess"
+ v-if="userHasWriteAccess"
@delete="removeComputePreference(row.item.computeResourceId)"
>
Are you sure you want to remove the preferences for compute
@@ -128,14 +128,14 @@
<div class="fixed-footer">
<b-button
variant="primary"
- :disabled="!data.userHasWriteAccess"
+ :disabled="!userHasWriteAccess"
@click="saveGroupResourceProfile"
>Save</b-button
>
<delete-button
v-if="id"
class="ml-2"
- :disabled="!data.userHasWriteAccess"
+ :disabled="!userHasWriteAccess"
@delete="removeGroupResourceProfile"
>
Are you sure you want to remove Group Resource Profile
@@ -179,7 +179,10 @@ export default {
if (this.id) {
if (!this.value.groupResourceProfileId) {
services.GroupResourceProfileService.retrieve({ lookup: this.id }).then(
- (grp) => (this.data = grp)
+ (grp) => {
+ this.data = grp;
+ this.userHasWriteAccess = this.data.userHasWriteAccess;
+ }
);
}
// Load information about the owner of this GroupResourceProfile
@@ -189,6 +192,9 @@ export default {
this.sharedEntity = sharedEntity;
});
}
+ else{
+ this.userHasWriteAccess = true;
+ }
},
data: function () {
let data = this.value.clone();
@@ -196,6 +202,7 @@ export default {
data: data,
service: services.GroupResourceProfileService,
sharedEntity: null,
+ userHasWriteAccess: false,
computePreferencesFields: [
{
label: "Name",