mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Automatically disable guest-track-changes when project made private
This commit is contained in:
parent
6e8e4e6453
commit
5f6e191c5f
2 changed files with 10 additions and 4 deletions
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue