Skip to content

Commit

Permalink
fix(design): remove share icon if listed in share-list (#537)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
  • Loading branch information
Florian authored Sep 12, 2023
1 parent 3f63c14 commit 43bea1d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
10 changes: 7 additions & 3 deletions src/modules/navigation/partials/NavigationTableItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
<Table :size="20" />
</template>
</template>
<template #extra />
<template #counter>
<NcCounterBubble v-if="canReadData(table)">
{{ n('tables', '%n row', '%n rows', table.rowsCount, {}) }}
</NcCounterBubble>
<NcActionButton v-if="table.hasShares" icon="icon-share" :class="{'margin-right': !(activeTable && table.id === activeTable.id)}" @click="actionShowShare" />
<NcActionButton v-if="!isSharedItem" icon="icon-share" :class="{'margin-right': !(activeTable && table.id === activeTable.id)}" @click="actionShowShare" />
<div v-if="table.isShared && table.ownership !== userId" class="margin-left">
<NcAvatar :user="table.ownership" />
</div>
Expand Down Expand Up @@ -74,7 +73,8 @@
</template>
<NavigationViewItem v-for="view in getViews"
:key="'view'+view.id"
:view="view" />
:view="view"
:is-shared-item="true" />
</NcAppNavigationItem>
</template>
<script>
Expand Down Expand Up @@ -128,6 +128,10 @@ export default {
type: String,
default: '',
},
isSharedItem: {
type: Boolean,
default: false,
},
},
data() {
Expand Down
7 changes: 5 additions & 2 deletions src/modules/navigation/partials/NavigationViewItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
<Table :size="20" />
</template>
</template>
<template #extra />
<template #counter>
<NcCounterBubble v-if="canReadData(view)">
{{ n('tables', '%n row', '%n rows', view.rowsCount, {}) }}
</NcCounterBubble>
<NcActionButton v-if="view.hasShares" icon="icon-share" :class="{'margin-right': !(activeView && view.id === activeView.id)}" @click="actionShowShare" />
<NcActionButton v-if="!isSharedItem" icon="icon-share" :class="{'margin-right': !(activeView && view.id === activeView.id)}" @click="actionShowShare" />
<div v-if="view.isShared && view.ownership !== userId && !canManageTable(view)" class="margin-left">
<NcAvatar :user="view.ownership" />
</div>
Expand Down Expand Up @@ -117,6 +116,10 @@ export default {
type: Object,
default: null,
},
isSharedItem: {
type: Boolean,
default: false,
},
},
data() {
Expand Down
21 changes: 9 additions & 12 deletions src/modules/navigation/sections/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,23 @@
<NcActionButton :aria-label="t('tables', 'Create table')" icon="icon-add" @click.prevent="createTable" />
</template>
</NcAppNavigationCaption>
<NavigationDashboardItem v-for="table in getOwnTables"
<NavigationTableItem v-for="table in getOwnTables"
:key="table.id"
:filter-string="filterString"
:table="table" />

<NcAppNavigationCaption v-if="getSharedTables.length > 0"
:title="t('tables', 'Shared tables')" />

<NavigationDashboardItem v-for="table in getSharedTables"
:title="t('tables', 'Shared')" />
<NavigationTableItem v-for="table in getSharedTables"
:key="table.id"
:filter-string="filterString"
:table="table" />

<NcAppNavigationCaption v-if="getSharedViews.length > 0"
:title="t('tables', 'Shared views')" />

:table="table"
:is-shared-item="true" />
<NavigationViewItem
v-for="view in getSharedViews"
:key="'view'+view.id"
:view="view" />
:view="view"
:is-shared-item="true" />
</ul>

<div v-if="filterString !== ''" class="search-info">
Expand All @@ -60,7 +57,7 @@
<script>
import { NcAppNavigation, NcAppNavigationCaption, NcActionButton, NcTextField, NcButton, NcEmptyContent } from '@nextcloud/vue'
import NavigationViewItem from '../partials/NavigationViewItem.vue'
import NavigationDashboardItem from '../partials/NavigationTableItem.vue'
import NavigationTableItem from '../partials/NavigationTableItem.vue'
import { mapState } from 'vuex'
import { emit } from '@nextcloud/event-bus'
import Magnify from 'vue-material-design-icons/Magnify.vue'
Expand All @@ -69,7 +66,7 @@ import { getCurrentUser } from '@nextcloud/auth'
export default {
name: 'Navigation',
components: {
NavigationDashboardItem,
NavigationTableItem,
NavigationViewItem,
NcAppNavigation,
NcAppNavigationCaption,
Expand Down

0 comments on commit 43bea1d

Please sign in to comment.