Skip to content

Commit 640f2cc

Browse files
committed
fix(FilePicker): Do not show private views on public shares
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent ead859b commit 640f2cc

1 file changed

Lines changed: 31 additions & 26 deletions

File tree

lib/components/FilePicker/FilePickerNavigation.vue

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,33 @@
1212
<IconClose :size="16" />
1313
</template>
1414
</NcTextField>
15-
<!-- On non collapsed dialogs show the tablist, otherwise a dropdown is shown -->
16-
<ul v-if="!isCollapsed"
17-
class="file-picker__side"
18-
role="tablist"
19-
:aria-label="t('Filepicker sections')">
20-
<li v-for="view in allViews" :key="view.id">
21-
<NcButton :aria-selected="currentView === view.id"
22-
:type="currentView === view.id ? 'primary' : 'tertiary'"
23-
:wide="true"
24-
role="tab"
25-
@click="$emit('update:currentView', view.id)">
26-
<template #icon>
27-
<component :is="view.icon" :size="20" />
28-
</template>
29-
{{ view.label }}
30-
</NcButton>
31-
</li>
32-
</ul>
33-
<NcSelect v-else
34-
:aria-label="t('Current view selector')"
35-
:clearable="false"
36-
:searchable="false"
37-
:options="allViews"
38-
:value="currentViewObject"
39-
@input="v => emit('update:currentView', v.id)" />
15+
<template v-if="!isPublic">
16+
<!-- On non collapsed dialogs show the tablist, otherwise a dropdown is shown -->
17+
<ul v-if="!isCollapsed"
18+
class="file-picker__side"
19+
role="tablist"
20+
:aria-label="t('Filepicker sections')">
21+
<li v-for="view in allViews" :key="view.id">
22+
<NcButton :aria-selected="currentView === view.id"
23+
:type="currentView === view.id ? 'primary' : 'tertiary'"
24+
:wide="true"
25+
role="tab"
26+
@click="$emit('update:currentView', view.id)">
27+
<template #icon>
28+
<component :is="view.icon" :size="20" />
29+
</template>
30+
{{ view.label }}
31+
</NcButton>
32+
</li>
33+
</ul>
34+
<NcSelect v-else
35+
:aria-label="t('Current view selector')"
36+
:clearable="false"
37+
:searchable="false"
38+
:options="allViews"
39+
:value="currentViewObject"
40+
@input="v => emit('update:currentView', v.id)" />
41+
</template>
4042
</Fragment>
4143
</template>
4244

@@ -48,9 +50,12 @@ import IconMagnify from 'vue-material-design-icons/Magnify.vue'
4850
import IconStar from 'vue-material-design-icons/Star.vue'
4951
5052
import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'
51-
import { t } from '../../utils/l10n'
5253
import { computed } from 'vue'
5354
import { Fragment } from 'vue-frag'
55+
import { t } from '../../utils/l10n'
56+
import { useIsPublic } from '../../usables/isPublic'
57+
58+
const { isPublic } = useIsPublic()
5459
5560
const allViews = [{
5661
id: 'files',

0 commit comments

Comments
 (0)