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

[stable4] fix public shares #1243

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix(FilePicker): Do not show private views on public shares
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 21, 2024
commit 640f2ccceb0bd4a9e87b2057cfe15fbdbf1d76c9
57 changes: 31 additions & 26 deletions lib/components/FilePicker/FilePickerNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,33 @@
<IconClose :size="16" />
</template>
</NcTextField>
<!-- On non collapsed dialogs show the tablist, otherwise a dropdown is shown -->
<ul v-if="!isCollapsed"
class="file-picker__side"
role="tablist"
:aria-label="t('Filepicker sections')">
<li v-for="view in allViews" :key="view.id">
<NcButton :aria-selected="currentView === view.id"
:type="currentView === view.id ? 'primary' : 'tertiary'"
:wide="true"
role="tab"
@click="$emit('update:currentView', view.id)">
<template #icon>
<component :is="view.icon" :size="20" />
</template>
{{ view.label }}
</NcButton>
</li>
</ul>
<NcSelect v-else
:aria-label="t('Current view selector')"
:clearable="false"
:searchable="false"
:options="allViews"
:value="currentViewObject"
@input="v => emit('update:currentView', v.id)" />
<template v-if="!isPublic">
<!-- On non collapsed dialogs show the tablist, otherwise a dropdown is shown -->
<ul v-if="!isCollapsed"
class="file-picker__side"
role="tablist"
:aria-label="t('Filepicker sections')">
<li v-for="view in allViews" :key="view.id">
<NcButton :aria-selected="currentView === view.id"
:type="currentView === view.id ? 'primary' : 'tertiary'"
:wide="true"
role="tab"
@click="$emit('update:currentView', view.id)">
<template #icon>
<component :is="view.icon" :size="20" />
</template>
{{ view.label }}
</NcButton>
</li>
</ul>
<NcSelect v-else
:aria-label="t('Current view selector')"
:clearable="false"
:searchable="false"
:options="allViews"
:value="currentViewObject"
@input="v => emit('update:currentView', v.id)" />
</template>
</Fragment>
</template>

Expand All @@ -48,9 +50,12 @@ import IconMagnify from 'vue-material-design-icons/Magnify.vue'
import IconStar from 'vue-material-design-icons/Star.vue'

import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'
import { t } from '../../utils/l10n'
import { computed } from 'vue'
import { Fragment } from 'vue-frag'
import { t } from '../../utils/l10n'
import { useIsPublic } from '../../usables/isPublic'

const { isPublic } = useIsPublic()

const allViews = [{
id: 'files',
Expand Down