diff --git a/services/web/app/views/project/editor/review-panel.pug b/services/web/app/views/project/editor/review-panel.pug index 7d241c8eab..889784d479 100644 --- a/services/web/app/views/project/editor/review-panel.pug +++ b/services/web/app/views/project/editor/review-panel.pug @@ -83,12 +83,11 @@ li.rp-tc-state-separator li.rp-tc-state-item.rp-tc-state-item-guests - // span.rp-tc-state-item-name !{translate("tc_guests")} - span.rp-tc-state-item-name Guests + span.rp-tc-state-item-name !{translate("tc_guests")} review-panel-toggle( ng-model="reviewPanel.trackChangesOnForGuests" on-toggle="toggleTrackChangesForGuests(isOn);" - disabled="!project.features.trackChanges || !permissions.write" + disabled="!project.features.trackChanges || !permissions.write || !trackChangesForGuestsAvailable" ) .rp-entry-list( diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index cf26c79c8f..4696d1c332 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -22,6 +22,7 @@ define [ trackChangesOnForEveryone: false trackChangesOnForGuests: false trackChangesOnForThisGuestClient: false + trackChangesForGuestsAvailable: false entries: {} resolvedComments: {} hasEntries: false @@ -81,6 +82,13 @@ define [ if member.privileges == "readAndWrite" $scope.reviewPanel.formattedProjectMembers[member._id] = formatUser(member) + $scope.$watch 'project.publicAccesLevel', (level) -> + if level? + available = $scope.trackChangesForGuestsAvailable = level == 'tokenBased' + if !available + $scope.trackChangesOnForThisGuestClient = false + $scope.toggleTrackChangesForGuests false + $scope.commentState = adding: false content: "" @@ -650,7 +658,6 @@ define [ $http.post "/project/#{$scope.project_id}/track_changes", data applyTrackChangesStateToClient = (state) -> - console.log ">> applying tc state to client", state if typeof state is "boolean" _setEveryoneTCState state _setGuestsTCState state