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

Don't show file extensions in AppTopBar and Search if turned off via setting #10176

Merged
merged 8 commits into from
Dec 15, 2023
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Turned off file extensions had no effect
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved

We've fixed a bug where file extensions where shown in different views,
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
like Search and AppTopBar even if the user turned them off via setting.
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved

https://github.com/owncloud/web/pull/10176
9 changes: 6 additions & 3 deletions packages/web-pkg/src/components/AppTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
v-if="resource"
id="app-top-bar-resource"
:is-thumbnail-displayed="false"
:is-extension-displayed="areFileExtensionsShown"
:path-prefix="pathPrefix"
:resource="resource"
:parent-folder-name="parentFolderName"
Expand Down Expand Up @@ -81,7 +82,7 @@
import { computed, defineComponent, PropType, unref } from 'vue'
import ContextActionMenu from './ContextActions/ContextActionMenu.vue'
import { useGettext } from 'vue3-gettext'
import { Action, useEventBus, useFolderLink, useGetMatchingSpace } from '../composables'
import { Action, useFolderLink, useGetMatchingSpace, useStore } from '../composables'
import {
Resource,
isPublicSpaceResource,
Expand Down Expand Up @@ -110,9 +111,10 @@ export default defineComponent({
emits: ['close'],
setup(props) {
const { $gettext } = useGettext()
const eventBus = useEventBus()
const { getMatchingSpace } = useGetMatchingSpace()
const store = useStore()

const areFileExtensionsShown = computed(() => unref(store.state.Files.areFileExtensionsShown))
const contextMenuLabel = computed(() => $gettext('Show context menu'))
const closeButtonLabel = computed(() => $gettext('Close'))

Expand Down Expand Up @@ -144,7 +146,8 @@ export default defineComponent({
contextMenuLabel,
closeButtonLabel,
parentFolderName,
parentFolderLinkIconAdditionalAttributes
parentFolderLinkIconAdditionalAttributes,
areFileExtensionsShown
}
}
})
Expand Down
9 changes: 7 additions & 2 deletions packages/web-pkg/src/components/Search/ResourcePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:path-prefix="pathPrefix"
:is-path-displayed="true"
:folder-link="folderLink"
:is-extension-displayed="areFileExtensionsShown"
:parent-folder-link-icon-additional-attributes="parentFolderLinkIconAdditionalAttributes"
:parent-folder-name="parentFolderName"
:is-thumbnail-displayed="displayThumbnails"
Expand All @@ -17,7 +18,7 @@ import { VisibilityObserver } from '../../observer'
import { debounce } from 'lodash-es'
import { computed, defineComponent, PropType, ref, unref } from 'vue'
import { mapGetters } from 'vuex'
import { useGetMatchingSpace, useFileActions, useFolderLink } from '../../composables'
import { useGetMatchingSpace, useFileActions, useFolderLink, useStore } from '../../composables'
import { Resource } from '@ownclouders/web-client/src/helpers'
import { isResourceTxtFileAlmostEmpty } from '../../helpers'
import { SearchResultValue } from './types'
Expand Down Expand Up @@ -47,8 +48,11 @@ export default defineComponent({
getParentFolderLinkIconAdditionalAttributes,
getFolderLink
} = useFolderLink()
const store = useStore()
const previewData = ref()

const areFileExtensionsShown = computed(() => unref(store.state.Files.areFileExtensionsShown))

const resource = computed((): Resource => {
return {
...(props.searchResult.data as Resource),
Expand Down Expand Up @@ -98,7 +102,8 @@ export default defineComponent({
parentFolderLinkIconAdditionalAttributes: getParentFolderLinkIconAdditionalAttributes(
unref(resource)
),
additionalAttrs
additionalAttrs,
areFileExtensionsShown
}
},
computed: {
Expand Down