Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 428A1200B54 for ; Wed, 13 Jul 2016 21:38:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 41236160A62; Wed, 13 Jul 2016 19:38:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 46BDE160A6E for ; Wed, 13 Jul 2016 21:38:31 +0200 (CEST) Received: (qmail 71227 invoked by uid 500); 13 Jul 2016 19:38:30 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 71132 invoked by uid 99); 13 Jul 2016 19:38:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2016 19:38:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 487CAE04EE; Wed, 13 Jul 2016 19:38:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Wed, 13 Jul 2016 19:38:33 -0000 Message-Id: <79cdebc2a9fe437eb140dbd863232772@git.apache.org> In-Reply-To: <96ecb15724c7472aa277dd1c96201b13@git.apache.org> References: <96ecb15724c7472aa277dd1c96201b13@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/4] airavata-php-gateway git commit: experiment sharing and permissions revocation enabled archived-at: Wed, 13 Jul 2016 19:38:32 -0000 experiment sharing and permissions revocation enabled Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/91bc869b Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/91bc869b Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/91bc869b Branch: refs/heads/grouper-integration Commit: 91bc869bff0d7e1a7317b552557b1608953c207b Parents: f53bcb7 Author: Jeff Kinnison Authored: Wed Jul 13 15:25:06 2016 -0400 Committer: Jeff Kinnison Committed: Wed Jul 13 15:25:06 2016 -0400 ---------------------------------------------------------------------- app/controllers/ExperimentController.php | 8 ++++++-- app/libraries/ExperimentUtilities.php | 5 ++++- app/views/experiment/create-complete.blade.php | 4 ---- app/views/experiment/edit.blade.php | 3 --- app/views/experiment/summary.blade.php | 4 +--- app/views/partials/experiment-info.blade.php | 14 ++++++++++++-- app/views/partials/experiment-inputs.blade.php | 4 ++++ app/views/partials/sharing-form-body.blade.php | 4 ++-- public/js/sharing/share.js | 7 +++++-- public/js/sharing/sharing_utils.js | 1 + 10 files changed, 35 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/app/controllers/ExperimentController.php ---------------------------------------------------------------------- diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php index 06026a0..5f1edb2 100755 --- a/app/controllers/ExperimentController.php +++ b/app/controllers/ExperimentController.php @@ -1,6 +1,7 @@ Input::get("expId"), "experiment" => $experiment, "project" => $project, "jobDetails" => $jobDetails, "expVal" => $expVal, - "autoRefresh"=> $autoRefresh + "autoRefresh"=> $autoRefresh, + "users" => json_encode($users) ); if( Input::has("dashboard")) { @@ -233,7 +237,7 @@ class ExperimentController extends BaseController $users = SharingUtilities::getAllUserProfiles($_GET['expId'], ResourceType::EXPERIMENT); - return View::make("experiment/edit", array("expInputs" => $experimentInputs, "users" => $users)); + return View::make("experiment/edit", array("expInputs" => $experimentInputs, "users" => json_encode($users))); } public function cloneExperiment() http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/app/libraries/ExperimentUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php index 4f63480..cc59b68 100644 --- a/app/libraries/ExperimentUtilities.php +++ b/app/libraries/ExperimentUtilities.php @@ -551,6 +551,7 @@ class ExperimentUtilities */ public static function update_experiment($expId, $updatedExperiment) { + $share = $_POST['share-settings']; try { Airavata::updateExperiment(Session::get('authz-token'), $expId, $updatedExperiment); } catch (InvalidRequestException $ire) { @@ -570,6 +571,8 @@ class ExperimentUtilities Please try again later or submit a bug report using the link in the Help menu.

' . '

AiravataSystemException: ' . $ase->getMessage() . '

'); } + + ExperimentUtilities::share_experiment($expId, json_decode($share)); } @@ -1339,7 +1342,7 @@ class ExperimentUtilities GrouperUtilities::shareResourceWithUsers($expId, ResourceType::EXPERIMENT, $wadd); GrouperUtilities::revokeSharingOfResourceFromUsers($expId, ResourceType::EXPERIMENT, $wrevoke); - GrouperUtilities::shareResourceWithUsers($expId, ResourceType::Experiment, $radd); + GrouperUtilities::shareResourceWithUsers($expId, ResourceType::EXPERIMENT, $radd); GrouperUtilities::revokeSharingOfResourceFromUsers($expId, ResourceType::EXPERIMENT, $rrevoke); } } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/app/views/experiment/create-complete.blade.php ---------------------------------------------------------------------- diff --git a/app/views/experiment/create-complete.blade.php b/app/views/experiment/create-complete.blade.php index 0308ee3..c3976bb 100644 --- a/app/views/experiment/create-complete.blade.php +++ b/app/views/experiment/create-complete.blade.php @@ -20,10 +20,6 @@ @include('partials/experiment-inputs', array("expInputs" => $expInputs, "queueDefaults" => $expInputs['queueDefaults']) ) -
- @include('partials/sharing-display-body', array("form" => true)) -
-
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/app/views/experiment/edit.blade.php ---------------------------------------------------------------------- diff --git a/app/views/experiment/edit.blade.php b/app/views/experiment/edit.blade.php index 0708e41..a991bd1 100755 --- a/app/views/experiment/edit.blade.php +++ b/app/views/experiment/edit.blade.php @@ -26,9 +26,6 @@ @include('partials/experiment-inputs', array( "expInputs", $expInputs)) @if( count( $expInputs['computeResources']) > 0) -
- @include('partials/sharing-display-body', array("form" => true)) -
-@include('partials/sharing-display-body') -
+{{ HTML::image("assets/Profile_avatar_placeholder_large.png", 'placeholder image', array('class' => 'baseimage')) }} @stop http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/app/views/partials/experiment-info.blade.php ---------------------------------------------------------------------- diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php index 2d1969d..63c4e06 100644 --- a/app/views/partials/experiment-info.blade.php +++ b/app/views/partials/experiment-info.blade.php @@ -1,3 +1,4 @@ +{{ HTML::style('css/sharing.css') }}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/public/js/sharing/share.js ---------------------------------------------------------------------- diff --git a/public/js/sharing/share.js b/public/js/sharing/share.js index fdd7c9f..bf9e62c 100755 --- a/public/js/sharing/share.js +++ b/public/js/sharing/share.js @@ -171,11 +171,12 @@ $(function() { // Save the sharing permissions of each selected user $('body').on('click', '#share-box-button', function(e) { - var data, resource_id, $share_list, share_settings, access; + var data, resource_id, $share_list, $update_list, share_settings, access; e.stopPropagation(); e.preventDefault(); data = $("#share-box").data() $share_list = $("#share-box-share").children(); + $update_list = $('.sharing-updated'); share_settings = {}; if (data.hasOwnProperty('resource_id')) { resource_id = data.resource_id; @@ -185,7 +186,7 @@ $(function() { $('#shared-users').empty(); if ($share_list.filter('.sharing-thumbnail').length > 0) { $share_list.sort(comparator_map.username); - $share_list.each(function(index, element) { + $update_list.each(function(index, element) { var $e, data, settings; $e = $(element); data = $e.data(); @@ -236,6 +237,7 @@ $(function() { $('#shared-users').addClass('text-align-center'); $('#shared-users').prepend('

This project has not been shared

'); } + $('.sharing-updated').removeClass('sharing-updated'); $('#share-box').animate({top: "100%"}); return false; }); @@ -275,6 +277,7 @@ $(function() { } $parent.find('.sharing-thumbnail-access-text').val(access_text[access]); $parent.data(data); + $parent.addClass('sharing-updated'); }); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/91bc869b/public/js/sharing/sharing_utils.js ---------------------------------------------------------------------- diff --git a/public/js/sharing/sharing_utils.js b/public/js/sharing/sharing_utils.js index fcd120b..6b31acd 100644 --- a/public/js/sharing/sharing_utils.js +++ b/public/js/sharing/sharing_utils.js @@ -80,6 +80,7 @@ var createThumbnail = function(username, firstname, lastname, email, access = ac var changeShareState = function($target) { var data; data = $target.data(); + $target.addClass('sharing-updated'); if ($target.hasClass('share-box-users-item')) { $target.find('.sharing-thumbnail-access').val('1').prop("disabled", false).show(); $target.find('.sharing-thumbnail-access-text').text(access_text[access_enum.READ]).hide();