From 2b620b07718592bb392b82db5f278a18f1c1d454 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 13 Sep 2023 21:48:16 +0200 Subject: [PATCH] fix(design): correct show share icon (#555) - only show if hasShares and you are the owner - don't show hasShares if shared with you Signed-off-by: Florian Steffens --- lib/Service/TableService.php | 6 +++++- .../navigation/partials/NavigationTableItem.vue | 8 ++------ .../navigation/partials/NavigationViewItem.vue | 13 +++++++------ src/modules/navigation/sections/Navigation.vue | 11 ++++------- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/lib/Service/TableService.php b/lib/Service/TableService.php index 599cdd3ef..01cbbbf60 100644 --- a/lib/Service/TableService.php +++ b/lib/Service/TableService.php @@ -5,7 +5,6 @@ use DateTime; use Exception; -use OCA\Tables\Db\Share; use OCA\Tables\Db\Table; use OCA\Tables\Db\TableMapper; use OCA\Tables\Errors\InternalError; @@ -118,6 +117,11 @@ public function findAll(?string $userId = null, bool $skipTableEnhancement = fal foreach ($allTables as $table) { /** @var string $userId */ $this->enhanceTable($table, $userId); + // if the table is shared with me, there are no other shares + // will avoid showing the shared icon in the FE nav + if($table->getIsShared()) { + $table->setHasShares(false); + } } } diff --git a/src/modules/navigation/partials/NavigationTableItem.vue b/src/modules/navigation/partials/NavigationTableItem.vue index 0e18c7984..799fe0f85 100644 --- a/src/modules/navigation/partials/NavigationTableItem.vue +++ b/src/modules/navigation/partials/NavigationTableItem.vue @@ -19,7 +19,7 @@ {{ n('tables', '%n row', '%n rows', table.rowsCount, {}) }} - +
@@ -74,7 +74,7 @@ + :show-share-sender="false" />