From 46eadfada44515650c008666d78885fe929d1d8d Mon Sep 17 00:00:00 2001 From: Chrystal Griffiths Date: Fri, 7 Sep 2018 17:23:03 +0100 Subject: [PATCH 1/5] Conditionally show sharing bits --- services/web/app/views/project/editor/share.pug | 14 +++++++------- .../ide/share/controllers/ShareController.coffee | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/services/web/app/views/project/editor/share.pug b/services/web/app/views/project/editor/share.pug index d2aa1cc173..cb46cb9a5f 100644 --- a/services/web/app/views/project/editor/share.pug +++ b/services/web/app/views/project/editor/share.pug @@ -8,9 +8,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate') h3 #{translate("share_project")} .modal-body.modal-body-share .container-fluid - //- Private (with token-access available) - .row.public-access-level(ng-show="project.publicAccesLevel == 'private'") + .row.public-access-level(ng-show="isAdmin && project.publicAccesLevel == 'private'") .col-xs-12.text-center | #{translate('link_sharing_is_off')} |    @@ -28,7 +27,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') ) //- Token-based access - .row.public-access-level(ng-show="project.publicAccesLevel == 'tokenBased'") + .row.public-access-level(ng-show="isAdmin && project.publicAccesLevel == 'tokenBased'") .col-xs-12.text-center strong | #{translate('link_sharing_is_on')}. @@ -57,7 +56,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') pre.access-token(ng-hide="readOnlyTokenLink") #{translate('loading')}... //- legacy public-access - .row.public-access-level(ng-show="project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly'") + .row.public-access-level(ng-show="isAdmin && (project.publicAccesLevel == 'readAndWrite' || project.publicAccesLevel == 'readOnly')") .col-xs-12.text-center strong(ng-if="project.publicAccesLevel == 'readAndWrite'") #{translate("this_project_is_public")} strong(ng-if="project.publicAccesLevel == 'readOnly'") #{translate("this_project_is_public_read_only")} @@ -102,7 +101,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') ng-click="revokeInvite(invite)" ) i.fa.fa-times - .row.invite-controls + .row.invite-controls(ng-show="isAdmin") form(ng-show="canAddCollaborators") .small #{translate("share_with_your_collabs")} .form-group @@ -177,8 +176,9 @@ script(type='text/ng-template', id='shareProjectModalTemplate') ) #{translate("start_free_trial")} p.small(ng-show="startedFreeTrial") - | #{translate("refresh_page_after_starting_free_trial")}. - + | #{translate("refresh_page_after_starting_free_trial")} + .row.public-access-level(ng-show="!isAdmin") + .col-xs-12.text-center To add more collaborators, please ask the project owner .modal-footer.modal-footer-share .modal-footer-left i.fa.fa-refresh.fa-spin(ng-show="state.inflight") diff --git a/services/web/public/coffee/ide/share/controllers/ShareController.coffee b/services/web/public/coffee/ide/share/controllers/ShareController.coffee index e729b92f08..3f71a63fdc 100644 --- a/services/web/public/coffee/ide/share/controllers/ShareController.coffee +++ b/services/web/public/coffee/ide/share/controllers/ShareController.coffee @@ -4,9 +4,7 @@ define [ App.controller "ShareController", ["$scope", "$modal", "ide", "projectInvites", "projectMembers", "event_tracking", ($scope, $modal, ide, projectInvites, projectMembers, event_tracking) -> $scope.openShareProjectModal = (isAdmin) -> - if !isAdmin - return - + $scope.isAdmin = isAdmin; event_tracking.sendMBOnce "ide-open-share-modal-once" $modal.open( From 57ac858004583ecff5534aefd21cc8f9e36e7d9d Mon Sep 17 00:00:00 2001 From: Chrystal Griffiths Date: Thu, 13 Sep 2018 12:19:44 +0100 Subject: [PATCH 2/5] Style the notice --- services/web/app/views/project/editor/share.pug | 2 +- services/web/public/stylesheets/app/editor/share.less | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/project/editor/share.pug b/services/web/app/views/project/editor/share.pug index cb46cb9a5f..0b45e0d17f 100644 --- a/services/web/app/views/project/editor/share.pug +++ b/services/web/app/views/project/editor/share.pug @@ -177,7 +177,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') p.small(ng-show="startedFreeTrial") | #{translate("refresh_page_after_starting_free_trial")} - .row.public-access-level(ng-show="!isAdmin") + .row.public-access-level.public-access-level--notice(ng-show="!isAdmin") .col-xs-12.text-center To add more collaborators, please ask the project owner .modal-footer.modal-footer-share .modal-footer-left diff --git a/services/web/public/stylesheets/app/editor/share.less b/services/web/public/stylesheets/app/editor/share.less index 13613af561..c4a92e6a53 100644 --- a/services/web/public/stylesheets/app/editor/share.less +++ b/services/web/public/stylesheets/app/editor/share.less @@ -30,6 +30,13 @@ } } + .public-access-level.public-access-level--notice { + background-color: @gray-lightest; + border-bottom: none; + margin-top: @margin-md; + padding-top: @margin-md; + } + .project-member, .project-invite { &:hover { background-color: @gray-lightest; From b51fc01bde57836c1a54e45837a2291ab7658983 Mon Sep 17 00:00:00 2001 From: Chrystal Griffiths Date: Thu, 13 Sep 2018 17:17:18 +0100 Subject: [PATCH 3/5] Remove temporary solution --- services/web/app/views/project/editor/header.pug | 4 ---- .../web/public/stylesheets/app/editor/toolbar.less | 11 ----------- 2 files changed, 15 deletions(-) diff --git a/services/web/app/views/project/editor/header.pug b/services/web/app/views/project/editor/header.pug index 835192f298..a7f03f2e3c 100644 --- a/services/web/app/views/project/editor/header.pug +++ b/services/web/app/views/project/editor/header.pug @@ -103,12 +103,8 @@ header.toolbar.toolbar-header.toolbar-with-labels( a.btn.btn-full-height( href - ng-class="{ 'btn-full-height-disabled' : !permissions.admin }" ng-click="openShareProjectModal(permissions.admin);" ng-controller="ShareController" - tooltip-enable="!permissions.admin" - tooltip="Only the project owner can use the Share menu at the moment, but we're working on making it accessible to collaborators, too." - tooltip-placement="bottom" ) i.fa.fa-fw.fa-group p.toolbar-label #{translate("share")} diff --git a/services/web/public/stylesheets/app/editor/toolbar.less b/services/web/public/stylesheets/app/editor/toolbar.less index aeea9da50a..dcc0344c73 100644 --- a/services/web/public/stylesheets/app/editor/toolbar.less +++ b/services/web/public/stylesheets/app/editor/toolbar.less @@ -72,17 +72,6 @@ background-color: @toolbar-btn-active-bg-color; box-shadow: @toolbar-btn-active-shadow; } - &.btn-full-height-disabled { - opacity: 0.65; - &:hover, - &.active, - &:active { - text-shadow: none; - background-color: transparent; - color: @toolbar-btn-color; - box-shadow: none; - } - } .label { top: 4px; right: 4px; From 3b43cf9075f7af71e75f14a8777540a8ff45e717 Mon Sep 17 00:00:00 2001 From: Chrystal Griffiths Date: Thu, 13 Sep 2018 17:57:11 +0100 Subject: [PATCH 4/5] Slight copy change --- services/web/app/views/project/editor/share.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/editor/share.pug b/services/web/app/views/project/editor/share.pug index 0b45e0d17f..737cedf5cc 100644 --- a/services/web/app/views/project/editor/share.pug +++ b/services/web/app/views/project/editor/share.pug @@ -178,7 +178,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') p.small(ng-show="startedFreeTrial") | #{translate("refresh_page_after_starting_free_trial")} .row.public-access-level.public-access-level--notice(ng-show="!isAdmin") - .col-xs-12.text-center To add more collaborators, please ask the project owner + .col-xs-12.text-center To add more collaborators or turn on link sharing, please ask the project owner .modal-footer.modal-footer-share .modal-footer-left i.fa.fa-refresh.fa-spin(ng-show="state.inflight") From 915bd18058d0bd3367aa41dbd77796b0de5e8485 Mon Sep 17 00:00:00 2001 From: Chrystal Griffiths Date: Fri, 14 Sep 2018 11:47:18 +0100 Subject: [PATCH 5/5] Read-only collaborators table --- services/web/app/views/project/editor/share.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/project/editor/share.pug b/services/web/app/views/project/editor/share.pug index 737cedf5cc..17da2df67a 100644 --- a/services/web/app/views/project/editor/share.pug +++ b/services/web/app/views/project/editor/share.pug @@ -76,7 +76,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') .col-xs-3.text-left span(ng-show="member.privileges == 'readAndWrite'") #{translate("can_edit")} span(ng-show="member.privileges == 'readOnly'") #{translate("read_only")} - .col-xs-1 + .col-xs-1(ng-show="isAdmin") a( href tooltip=translate('remove_collaborator') @@ -178,7 +178,7 @@ script(type='text/ng-template', id='shareProjectModalTemplate') p.small(ng-show="startedFreeTrial") | #{translate("refresh_page_after_starting_free_trial")} .row.public-access-level.public-access-level--notice(ng-show="!isAdmin") - .col-xs-12.text-center To add more collaborators or turn on link sharing, please ask the project owner + .col-xs-12.text-center #{translate("to_add_more_collaborators")} .modal-footer.modal-footer-share .modal-footer-left i.fa.fa-refresh.fa-spin(ng-show="state.inflight")