aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src')
-rw-r--r--apps/files/src/components/FileEntry/FileEntryName.vue11
-rw-r--r--apps/files/src/composables/useNavigation.spec.ts7
-rw-r--r--apps/files/src/plugins/search/folderSearch.ts5
-rw-r--r--apps/files/src/store/userconfig.ts1
-rw-r--r--apps/files/src/types.ts1
-rw-r--r--apps/files/src/views/Settings.vue18
-rw-r--r--apps/files/src/views/favorites.spec.ts1
-rw-r--r--apps/files/src/views/folderTree.ts2
8 files changed, 35 insertions, 11 deletions
diff --git a/apps/files/src/components/FileEntry/FileEntryName.vue b/apps/files/src/components/FileEntry/FileEntryName.vue
index 2fec9e5d556..418f9581eb6 100644
--- a/apps/files/src/components/FileEntry/FileEntryName.vue
+++ b/apps/files/src/components/FileEntry/FileEntryName.vue
@@ -30,7 +30,7 @@
<span class="files-list__row-name-text" dir="auto">
<!-- Keep the filename stuck to the extension to avoid whitespace rendering issues-->
<span class="files-list__row-name-" v-text="basename" />
- <span class="files-list__row-name-ext" v-text="extension" />
+ <span v-if="userConfigStore.userConfig.show_files_extensions" class="files-list__row-name-ext" v-text="extension" />
</span>
</component>
</template>
@@ -46,11 +46,12 @@ import { defineComponent, inject } from 'vue'
import NcTextField from '@nextcloud/vue/components/NcTextField'
-import { useNavigation } from '../../composables/useNavigation'
+import { getFilenameValidity } from '../../utils/filenameValidity.ts'
import { useFileListWidth } from '../../composables/useFileListWidth.ts'
-import { useRouteParameters } from '../../composables/useRouteParameters.ts'
+import { useNavigation } from '../../composables/useNavigation.ts'
import { useRenamingStore } from '../../store/renaming.ts'
-import { getFilenameValidity } from '../../utils/filenameValidity.ts'
+import { useRouteParameters } from '../../composables/useRouteParameters.ts'
+import { useUserConfigStore } from '../../store/userconfig.ts'
import logger from '../../logger.ts'
export default defineComponent({
@@ -95,6 +96,7 @@ export default defineComponent({
const { directory } = useRouteParameters()
const filesListWidth = useFileListWidth()
const renamingStore = useRenamingStore()
+ const userConfigStore = useUserConfigStore()
const defaultFileAction = inject<FileAction | undefined>('defaultFileAction')
@@ -105,6 +107,7 @@ export default defineComponent({
filesListWidth,
renamingStore,
+ userConfigStore,
}
},
diff --git a/apps/files/src/composables/useNavigation.spec.ts b/apps/files/src/composables/useNavigation.spec.ts
index 569e61825e1..b9eb671a181 100644
--- a/apps/files/src/composables/useNavigation.spec.ts
+++ b/apps/files/src/composables/useNavigation.spec.ts
@@ -29,6 +29,7 @@ describe('Composables: useNavigation', () => {
describe('currentView', () => {
beforeEach(() => {
+ // eslint-disable-next-line import/namespace
navigation = new nextcloudFiles.Navigation()
spy.mockImplementation(() => navigation)
})
@@ -39,6 +40,7 @@ describe('Composables: useNavigation', () => {
})
it('should return already active navigation', async () => {
+ // eslint-disable-next-line import/namespace
const view = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-1', name: 'My View 1', order: 0 })
navigation.register(view)
navigation.setActive(view)
@@ -48,6 +50,7 @@ describe('Composables: useNavigation', () => {
})
it('should be reactive on updating active navigation', async () => {
+ // eslint-disable-next-line import/namespace
const view = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-1', name: 'My View 1', order: 0 })
navigation.register(view)
const wrapper = mount(TestComponent)
@@ -63,6 +66,7 @@ describe('Composables: useNavigation', () => {
describe('views', () => {
beforeEach(() => {
+ // eslint-disable-next-line import/namespace
navigation = new nextcloudFiles.Navigation()
spy.mockImplementation(() => navigation)
})
@@ -73,6 +77,7 @@ describe('Composables: useNavigation', () => {
})
it('should return already registered views', () => {
+ // eslint-disable-next-line import/namespace
const view = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-1', name: 'My View 1', order: 0 })
// register before mount
navigation.register(view)
@@ -82,7 +87,9 @@ describe('Composables: useNavigation', () => {
})
it('should be reactive on registering new views', () => {
+ // eslint-disable-next-line import/namespace
const view = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-1', name: 'My View 1', order: 0 })
+ // eslint-disable-next-line import/namespace
const view2 = new nextcloudFiles.View({ getContents: () => Promise.reject(new Error()), icon: '<svg></svg>', id: 'view-2', name: 'My View 2', order: 1 })
// register before mount
diff --git a/apps/files/src/plugins/search/folderSearch.ts b/apps/files/src/plugins/search/folderSearch.ts
index 626b1daa72b..6aabefbfc9d 100644
--- a/apps/files/src/plugins/search/folderSearch.ts
+++ b/apps/files/src/plugins/search/folderSearch.ts
@@ -36,12 +36,15 @@ function init() {
callback: (nodes: Node[]) => {
logger.info('Folder picked', { folder: nodes[0] })
const folder = nodes[0]
+ const filterUpdateText = (folder.root === '/files/' + folder.basename)
+ ? t('files', 'Search in all files')
+ : t('files', 'Search in folder: {folder}', { folder: folder.basename })
emit('nextcloud:unified-search:add-filter', {
id: 'in-folder',
appId: 'files',
searchFrom: 'files',
payload: folder,
- filterUpdateText: t('files', 'Search in folder: {folder}', { folder: folder.basename }),
+ filterUpdateText,
filterParams: { path: folder.path },
})
},
diff --git a/apps/files/src/store/userconfig.ts b/apps/files/src/store/userconfig.ts
index 54e9a75eb8b..48fe01d5134 100644
--- a/apps/files/src/store/userconfig.ts
+++ b/apps/files/src/store/userconfig.ts
@@ -15,6 +15,7 @@ const initialUserConfig = loadState<UserConfig>('files', 'config', {
crop_image_previews: true,
default_view: 'files',
grid_view: false,
+ show_files_extensions: true,
show_hidden: false,
show_mime_column: true,
sort_favorites_first: true,
diff --git a/apps/files/src/types.ts b/apps/files/src/types.ts
index 6757b7f1f45..0096ecc0fdb 100644
--- a/apps/files/src/types.ts
+++ b/apps/files/src/types.ts
@@ -55,6 +55,7 @@ export interface UserConfig {
crop_image_previews: boolean
default_view: 'files' | 'personal'
grid_view: boolean
+ show_files_extensions: boolean
show_hidden: boolean
show_mime_column: boolean
sort_favorites_first: boolean
diff --git a/apps/files/src/views/Settings.vue b/apps/files/src/views/Settings.vue
index f347f842c22..0838d308af9 100644
--- a/apps/files/src/views/Settings.vue
+++ b/apps/files/src/views/Settings.vue
@@ -29,7 +29,6 @@
{{ t('files', 'Personal files') }}
</NcCheckboxRadioSwitch>
</fieldset>
-
<NcCheckboxRadioSwitch data-cy-files-settings-setting="sort_favorites_first"
:checked="userConfig.sort_favorites_first"
@update:checked="setConfig('sort_favorites_first', $event)">
@@ -40,6 +39,15 @@
@update:checked="setConfig('sort_folders_first', $event)">
{{ t('files', 'Sort folders before files') }}
</NcCheckboxRadioSwitch>
+ <NcCheckboxRadioSwitch data-cy-files-settings-setting="folder_tree"
+ :checked="userConfig.folder_tree"
+ @update:checked="setConfig('folder_tree', $event)">
+ {{ t('files', 'Enable folder tree') }}
+ </NcCheckboxRadioSwitch>
+ </NcAppSettingsSection>
+
+ <!-- Visual settings -->
+ <NcAppSettingsSection id="settings" :name="t('files', 'Visual settings')">
<NcCheckboxRadioSwitch data-cy-files-settings-setting="show_hidden"
:checked="userConfig.show_hidden"
@update:checked="setConfig('show_hidden', $event)">
@@ -55,10 +63,10 @@
@update:checked="setConfig('crop_image_previews', $event)">
{{ t('files', 'Crop image previews') }}
</NcCheckboxRadioSwitch>
- <NcCheckboxRadioSwitch data-cy-files-settings-setting="folder_tree"
- :checked="userConfig.folder_tree"
- @update:checked="setConfig('folder_tree', $event)">
- {{ t('files', 'Enable folder tree') }}
+ <NcCheckboxRadioSwitch data-cy-files-settings-setting="show_files_extensions"
+ :checked="userConfig.show_files_extensions"
+ @update:checked="setConfig('show_files_extensions', $event)">
+ {{ t('files', 'Show files extensions') }}
</NcCheckboxRadioSwitch>
</NcAppSettingsSection>
diff --git a/apps/files/src/views/favorites.spec.ts b/apps/files/src/views/favorites.spec.ts
index e73279f2b31..f793eb9f54c 100644
--- a/apps/files/src/views/favorites.spec.ts
+++ b/apps/files/src/views/favorites.spec.ts
@@ -17,6 +17,7 @@ import { action } from '../actions/favoriteAction'
import * as favoritesService from '../services/Favorites'
import { registerFavoritesView } from './favorites'
+// eslint-disable-next-line import/namespace
const { Folder, getNavigation } = filesUtils
vi.mock('@nextcloud/axios')
diff --git a/apps/files/src/views/folderTree.ts b/apps/files/src/views/folderTree.ts
index bdff1659080..2ce4e501e6f 100644
--- a/apps/files/src/views/folderTree.ts
+++ b/apps/files/src/views/folderTree.ts
@@ -151,7 +151,7 @@ const registerTreeRoot = () => {
Navigation.register(new View({
id: folderTreeId,
- name: t('files', 'All folders'),
+ name: t('files', 'Folder tree'),
caption: t('files', 'List of your files and folders.'),
icon: FolderMultipleSvg,