Merge pull request #7974 from artoscinote/ma_SCI_11188

Improve behaviour for private team sharing [SCI-11188]
This commit is contained in:
Martin Artnik 2024-10-15 23:39:42 +02:00 committed by GitHub
commit b7e1596e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -57,7 +57,7 @@ class TeamSharedObjectsController < ApplicationController
end
def shareable_teams
teams = Team.order(:name).all - [@model.team]
teams = (Team.order(:name).all - [@model.team]).filter { |t| can_read_team?(t) || @model.private_shared_with?(t) }
render json: teams, each_serializer: ShareableTeamSerializer, model: @model
end

View file

@ -35,7 +35,7 @@
</span>
</div>
<template v-for="team in shareableTeams">
<div class="col-span-2 flex items-center h-9 gap-1" :class="{ 'hidden': !team.attributes.readable && !team.attributes.private_shared_with }">
<div class="col-span-2 flex items-center h-9 gap-1">
<span class="sci-checkbox-container" :class="{'opacity-0 pointer-events-none': sharedWithAllRead}">
<input :disabled="!team.attributes.readable" type="checkbox" class="sci-checkbox" v-model="team.attributes.private_shared_with" />
<span class="sci-checkbox-label"></span>