Compare commits

...

2 Commits

Author SHA1 Message Date
Sebastien Marinier ab314393e9 fix: bug with name of shared groups
Shared groups were listed with their ID and not their display name
2024-08-19 11:23:25 +02:00
Sebastien Marinier a8591150de fix: don't use backticks
Use concatenated strings
2024-08-19 11:18:56 +02:00
5 changed files with 22 additions and 4 deletions

View File

@ -11,6 +11,7 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IGroupManager;
use OCP\IRequest;
use OCP\IUserManager;
@ -24,6 +25,9 @@ class RoomShareController extends Controller {
/** @var IUserManager */
private $userManager;
/** @var IGroupManager */
private $groupManager;
/** @var RoomService */
private $roomService;
@ -37,6 +41,7 @@ class RoomShareController extends Controller {
IRequest $request,
RoomShareService $service,
IUserManager $userManager,
IGroupManager $groupManager,
RoomService $roomService,
CircleHelper $circleHelper,
$userId
@ -44,6 +49,7 @@ class RoomShareController extends Controller {
parent::__construct($appName, $request);
$this->service = $service;
$this->userManager = $userManager;
$this->groupManager = $groupManager;
$this->roomService = $roomService;
$this->circleHelper = $circleHelper;
$this->userId = $userId;
@ -90,6 +96,14 @@ class RoomShareController extends Controller {
}
$roomShare->setShareWithDisplayName($circle->getName());
} elseif ($roomShare->getShareType() === RoomShare::SHARE_TYPE_GROUP) {
$shareWithGroup = $this->groupManager->get($roomShare->getShareWith());
if ($shareWithGroup === null) {
continue;
}
$roomShare->setShareWithDisplayName($shareWithGroup->getDisplayName());
}
$shares[] = $roomShare;

View File

@ -9,6 +9,7 @@ use OCA\BigBlueButton\Db\RoomShare;
use OCA\BigBlueButton\Service\RoomService;
use OCA\BigBlueButton\Service\RoomShareService;
use OCP\AppFramework\Http;
use OCP\IGroupManager;
use OCP\IRequest;
use OCP\IUserManager;
use PHPUnit\Framework\TestCase;
@ -19,6 +20,7 @@ class RoomShareControllerTest extends TestCase {
private $roomService;
private $circleHelper;
private $userManager;
private $groupManager;
private $controller;
private $userId = 'user_foo';
@ -29,6 +31,7 @@ class RoomShareControllerTest extends TestCase {
$this->request = $this->createMock(IRequest::class);
$this->service = $this->createMock(RoomShareService::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->groupManager = $this->createMock(IGroupManager::class);
$this->roomService = $this->createMock(RoomService::class);
$this->circleHelper = $this->createMock(CircleHelper::class);
@ -37,6 +40,7 @@ class RoomShareControllerTest extends TestCase {
$this->request,
$this->service,
$this->userManager,
$this->groupManager,
$this->roomService,
$this->circleHelper,
$this->userId

View File

@ -132,7 +132,7 @@ const EditRoomDialog: React.FC<Props> = ({ room, restriction, updateProperty, op
{room.access === Access.InternalRestricted &&
<div className="bbb-form-element bbb-form-shareWith">
<span className="icon icon-details icon-visible"></span><em>{`${t('bbb', 'Access')} : ${descriptions.internalRestrictedShareWith}`}</em>
<span className="icon icon-details icon-visible"></span><em>{t('bbb', 'Access') + ' : ' + descriptions.internalRestrictedShareWith}</em>
</div>
}

View File

@ -16,12 +16,12 @@ const RecordingRow: React.FC<Props> = ({recording, isAdmin, deleteRecording, sto
function checkPublished(recording: Recording, onChange: (value: boolean) => void) {
return (
<div>
<input id={`bbb-record-state-${recording.id}`}
<input id={'bbb-record-state-' + recording.id}
type="checkbox"
className="checkbox"
checked={recording.state === 'published'}
onChange={(event) => onChange(event.target.checked)} />
<label htmlFor={`bbb-record-state-${recording.id}`}>{t('bbb', 'Published')}</label>
<label htmlFor={'bbb-record-state-' + recording.id}>{t('bbb', 'Published')}</label>
</div>
);
}

View File

@ -107,7 +107,7 @@ const ShareWith: React.FC<Props> = ({ room, permission, shares: allShares, setSh
</div>
<div className="bbb-shareWith__item__label">
<h5>{displayName}
{(share.id === ROOM_OWNER_ID || !isOwner) && ` (${permissionLabel(share.permission)})`}
{(share.id === ROOM_OWNER_ID || !isOwner) && (' (' + permissionLabel(share.permission) + ')')}
</h5>
</div>
{(share.id > ROOM_OWNER_ID && isOwner) && selectPermission(share.permission, (value) => {