-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
share with teams #1465
base: main
Are you sure you want to change the base?
share with teams #1465
Conversation
8a288e5
to
a6da886
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the backend bits only so far.
Thanks Arthur @blizzz 🙏 - those are really helpful! |
93927cb
to
a36c56e
Compare
7803db6
to
34d53d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just testing this out, and it looks pretty good!
Just want to confirm one thing. Is it okay that when if I share with a team, and later disable the Teams app, the team display name can not be shown (just the circle ID)? I assume this is expected since we can't access the display name if the app is disabled, but would like to confirm?
Thank you @enjeck! That's a really good points, I didn't think about that actually. I think we can hide those shares when circles disabled, that would be better and more appropriate for this case. Let me know if we expect it different like completely remove those shares @juliusknorr @blizzz , thank you! |
Yes, would agree with that. I think we do it the same way in the files app 👍 |
34d53d6
to
0c456a5
Compare
0c456a5
to
1f12051
Compare
To confirm, in addition to hiding the shares from the sidebar, the tables are not shared with the users in a team? |
Signed-off-by: Hoang Pham <[email protected]>
Yes @enjeck, we check from BE so when getting all tables of a user will exclude those circle's shares |
1f12051
to
68c2920
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backendwise looks OK (only nitpicks, not blocking), did not do functional tests so far.
private LoggerInterface $logger; | ||
private bool $circlesEnabled; | ||
private ?CirclesManager $circlesManager; | ||
|
||
/** | ||
* @psalm-suppress UndefinedClass | ||
*/ | ||
public function __construct( | ||
LoggerInterface $logger, | ||
IAppManager $appManager | ||
) { | ||
$this->logger = $logger; | ||
$this->circlesEnabled = $appManager->isEnabledForUser('circles'); | ||
$this->circlesManager = null; | ||
|
||
if ($this->circlesEnabled) { | ||
try { | ||
$this->circlesManager = Server::get(CirclesManager::class); | ||
} catch (Throwable $e) { | ||
$this->logger->warning('Failed to get CirclesManager: ' . $e->getMessage()); | ||
$this->circlesEnabled = false; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private LoggerInterface $logger; | |
private bool $circlesEnabled; | |
private ?CirclesManager $circlesManager; | |
/** | |
* @psalm-suppress UndefinedClass | |
*/ | |
public function __construct( | |
LoggerInterface $logger, | |
IAppManager $appManager | |
) { | |
$this->logger = $logger; | |
$this->circlesEnabled = $appManager->isEnabledForUser('circles'); | |
$this->circlesManager = null; | |
if ($this->circlesEnabled) { | |
try { | |
$this->circlesManager = Server::get(CirclesManager::class); | |
} catch (Throwable $e) { | |
$this->logger->warning('Failed to get CirclesManager: ' . $e->getMessage()); | |
$this->circlesEnabled = false; | |
} | |
} | |
} | |
private bool $circlesEnabled; | |
private ?CirclesManager $circlesManager; | |
/** | |
* @psalm-suppress UndefinedClass | |
*/ | |
public function __construct( | |
private LoggerInterface $logger, | |
IAppManager $appManager | |
) { | |
$this->circlesEnabled = $appManager->isEnabledForUser('circles'); | |
$this->circlesManager = null; | |
if ($this->circlesEnabled) { | |
try { | |
$this->circlesManager = Server::get(CirclesManager::class); | |
} catch (Throwable $e) { | |
$this->logger->warning('Failed to get CirclesManager: ' . $e->getMessage()); | |
$this->circlesEnabled = false; | |
} | |
} | |
} |
nitpick: use property promotion
* @psalm-suppress UndefinedClass | ||
* @psalm-suppress UndefinedDocblockClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are they about? There should be nothing extra ordinary here?
/** | ||
* @psalm-suppress UndefinedClass | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question
/** | ||
* @psalm-suppress UndefinedDocblockClass | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is psalm complaining about here?
|
||
/** | ||
* @psalm-import-type TablesShare from ResponseDefinitions | ||
* @psalm-suppress UndefinedDocblockClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also wondering here
@@ -85,7 +93,9 @@ public function findAll(string $nodeType, int $nodeId, ?string $userId = null, b | |||
$userId = $this->permissionsService->preCheckUserId($userId); | |||
|
|||
try { | |||
$shares = $this->mapper->findAllSharesForNode($nodeType, $nodeId, $userId); | |||
$excluded = !$this->circleHelper->isCirclesEnabled() ? ['circle'] : []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another nitpick: ideal turn 'cirlce'
into a constant (and adapt follow up usages).
(Yes, existing group
string suffers from the same)
Fixes #142