Skip to content
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

fix(design): remove share icon if listed in share-list #537

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
datenangebot marked this conversation as resolved.
Show resolved Hide resolved
},

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
Loading