diff --git a/packages/web-app-files/src/composables/actions/files/useFileActionsMove.ts b/packages/web-app-files/src/composables/actions/files/useFileActionsMove.ts index 547ddfdd4ae..e02da7536ed 100644 --- a/packages/web-app-files/src/composables/actions/files/useFileActionsMove.ts +++ b/packages/web-app-files/src/composables/actions/files/useFileActionsMove.ts @@ -43,16 +43,13 @@ export const useFileActionsMove = ({ store }: { store?: Store } = {}) => { !isLocationPublicActive(router, 'files-public-link') && !isLocationCommonActive(router, 'files-common-favorites') ) { - console.log('A') return false } if (resources.length === 0) { - console.log('B') return false } if (!store.getters['Files/currentFolder']) { - console.log('C') return false } diff --git a/packages/web-app-search/src/portals/SearchBar.vue b/packages/web-app-search/src/portals/SearchBar.vue index e37ae0e807c..fea12c46b96 100644 --- a/packages/web-app-search/src/portals/SearchBar.vue +++ b/packages/web-app-search/src/portals/SearchBar.vue @@ -128,7 +128,7 @@ export default defineComponent({ const isMobileWidth = inject>('isMobileWidth') const scopeQueryValue = useRouteQuery('scope') const shareId = useRouteQuery('shareId') - const locationFilterId = ref(SearchLocationFilterConstants.currentFolder) + const locationFilterId = ref(SearchLocationFilterConstants.inHere) const optionsDropRef = ref(null) const activePreviewIndex = ref(null) const term = ref('') @@ -184,7 +184,7 @@ export default defineComponent({ let searchTerm = unref(term) if ( unref(currentFolderAvailable) && - unref(locationFilterId) === SearchLocationFilterConstants.currentFolder + unref(locationFilterId) === SearchLocationFilterConstants.inHere ) { const currentFolder = store.getters['Files/currentFolder'] let scope @@ -224,7 +224,7 @@ export default defineComponent({ const useScope = unref(term) && unref(currentFolderAvailable) && - unref(locationFilterId) === SearchLocationFilterConstants.currentFolder + unref(locationFilterId) === SearchLocationFilterConstants.inHere router.push( createLocationCommon('files-common-search', { query: { diff --git a/packages/web-pkg/src/components/SearchBarFilter.vue b/packages/web-pkg/src/components/SearchBarFilter.vue index eea6f4401f3..add927e56f2 100644 --- a/packages/web-pkg/src/components/SearchBarFilter.vue +++ b/packages/web-pkg/src/components/SearchBarFilter.vue @@ -62,13 +62,13 @@ export default defineComponent({ const currentSelectionTitle = computed(() => $gettext(currentSelection.value?.title)) const locationOptions = computed(() => [ { - id: SearchLocationFilterConstants.currentFolder, - title: $gettext('Current Folder'), + id: SearchLocationFilterConstants.inHere, + title: $gettext('In here'), enabled: props.currentFolderAvailable }, { - id: SearchLocationFilterConstants.allFiles, - title: $gettext('All Files'), + id: SearchLocationFilterConstants.everywhere, + title: $gettext('Everywhere'), enabled: true } ]) @@ -84,19 +84,19 @@ export default defineComponent({ const useScope = unref(useSopeQueryValue).toString() === 'true' if (useScope) { currentSelection.value = unref(locationOptions).find( - ({ id }) => id === SearchLocationFilterConstants.currentFolder + ({ id }) => id === SearchLocationFilterConstants.inHere ) return } currentSelection.value = unref(locationOptions).find( - ({ id }) => id === SearchLocationFilterConstants.allFiles + ({ id }) => id === SearchLocationFilterConstants.everywhere ) return } if (!props.currentFolderAvailable) { currentSelection.value = unref(locationOptions).find( - ({ id }) => id === SearchLocationFilterConstants.allFiles + ({ id }) => id === SearchLocationFilterConstants.everywhere ) return } @@ -109,7 +109,7 @@ export default defineComponent({ } currentSelection.value = unref(locationOptions).find( - ({ id }) => id === SearchLocationFilterConstants.currentFolder + ({ id }) => id === SearchLocationFilterConstants.everywhere ) }, { immediate: true } diff --git a/packages/web-pkg/src/composables/search/constants.ts b/packages/web-pkg/src/composables/search/constants.ts index 543d94ef36c..9b6ee3f5fb6 100644 --- a/packages/web-pkg/src/composables/search/constants.ts +++ b/packages/web-pkg/src/composables/search/constants.ts @@ -1,5 +1,5 @@ export abstract class SearchLocationFilterConstants { - static readonly defaultModeName: string = 'current-folder' - static readonly allFiles: string = 'all-files' - static readonly currentFolder: string = 'current-folder' + static readonly defaultModeName: string = 'everywhere' + static readonly everywhere: string = 'everywhere' + static readonly inHere: string = 'in-here' } diff --git a/packages/web-pkg/tests/unit/components/SearchBarFilter.spec.ts b/packages/web-pkg/tests/unit/components/SearchBarFilter.spec.ts index 63c023f5f77..c4b81df0f59 100644 --- a/packages/web-pkg/tests/unit/components/SearchBarFilter.spec.ts +++ b/packages/web-pkg/tests/unit/components/SearchBarFilter.spec.ts @@ -9,20 +9,20 @@ const selectors = { } describe('SearchBarFilter', () => { - it('shows "All Files" as current option if no current folder available', () => { - const { wrapper } = getWrapper() + it('shows "Everywhere" as default option', () => { + const { wrapper } = getWrapper({ currentFolderAvailable: true }) const filterLabel = wrapper.findComponent(selectors.filterChipStub).props('filterLabel') - expect(filterLabel).toBe('All Files') + expect(filterLabel).toBe('Everywhere') }) - it('shows "Current Folder" as current option if current folder available', () => { - const { wrapper } = getWrapper({ currentFolderAvailable: true }) + it('shows "Everywhere" as current option if no In here available', () => { + const { wrapper } = getWrapper() const filterLabel = wrapper.findComponent(selectors.filterChipStub).props('filterLabel') - expect(filterLabel).toBe('Current Folder') + expect(filterLabel).toBe('Everywhere') }) - it('shows "Current Folder" as current option if given via scipe', () => { + it('shows "In here" as current option if given via scope', () => { const { wrapper } = getWrapper({ useScope: 'true' }) const filterLabel = wrapper.findComponent(selectors.filterChipStub).props('filterLabel') - expect(filterLabel).toBe('Current Folder') + expect(filterLabel).toBe('In here') }) }) diff --git a/tests/e2e/cucumber/features/smoke/fullTextSearch.feature b/tests/e2e/cucumber/features/smoke/fullTextSearch.feature index d51b1d930d2..0ff3c757e32 100644 --- a/tests/e2e/cucumber/features/smoke/fullTextSearch.feature +++ b/tests/e2e/cucumber/features/smoke/fullTextSearch.feature @@ -51,7 +51,7 @@ Feature: Search | fileWithTag.txt | tag 1 | | withTag.txt | tag 1 | - When "Brian" searches "" using the global search and the "all files" filter and presses enter + When "Brian" searches "" using the global search and the "everywhere" filter and presses enter Then "Brian" should see the message "Search for files" on the webUI When "Brian" selects tag "alice tag" from the search result filter chip @@ -66,7 +66,7 @@ Feature: Search | fileWithTag.txt | | withTag.txt | - When "Brian" searches "file" using the global search and the "all files" filter and presses enter + When "Brian" searches "file" using the global search and the "everywhere" filter and presses enter Then following resources should be displayed in the files list for user "Brian" | resource | | fileWithTag.txt | @@ -81,7 +81,7 @@ Feature: Search | spaceFolder/spaceTextfile.txt | When "Brian" enables the option to search in file content - And "Brian" searches "Cheers" using the global search and the "all files" filter and presses enter + And "Brian" searches "Cheers" using the global search and the "everywhere" filter and presses enter Then following resources should be displayed in the files list for user "Brian" | resource | | textfile.txt | diff --git a/tests/e2e/cucumber/features/smoke/search.feature b/tests/e2e/cucumber/features/smoke/search.feature index 3fd20487012..72176527266 100644 --- a/tests/e2e/cucumber/features/smoke/search.feature +++ b/tests/e2e/cucumber/features/smoke/search.feature @@ -40,7 +40,7 @@ Feature: Search | .hidden-file.txt | # search for objects of personal space - When "Alice" searches "foldeR" using the global search and the "all files" filter + When "Alice" searches "foldeR" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | folder | @@ -52,7 +52,7 @@ Feature: Search | .hidden-file.txt | # search for hidden file - When "Alice" searches "hidden" using the global search and the "all files" filter + When "Alice" searches "hidden" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | .hidden-file.txt | @@ -64,7 +64,7 @@ Feature: Search | new-lorem-big.txt | # subfolder search - And "Alice" searches "child" using the global search and the "all files" filter + And "Alice" searches "child" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | child-one | @@ -78,7 +78,7 @@ Feature: Search | new-lorem-big.txt | # received shares search - And "Alice" searches "NEW" using the global search and the "all files" filter + And "Alice" searches "NEW" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | new_share_from_brian | @@ -95,7 +95,7 @@ Feature: Search | resource | as | | folder | renamedFolder | | FolDer | renamedFolDer | - And "Alice" searches "rena" using the global search and the "all files" filter + And "Alice" searches "rena" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | renamedFolder | @@ -123,7 +123,7 @@ Feature: Search And "Carol" creates the following resources | resource | type | | folder | folder | - And "Carol" searches "NEW" using the global search and the "all files" filter + And "Carol" searches "NEW" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Carol" | resource | | new_share_from_brian | @@ -149,14 +149,14 @@ Feature: Search | mainFolder/subFolder/exampleInsideTheSubFolder.txt | I'm in the sub folder | And "Alice" opens the "files" app When "Alice" opens folder "mainFolder" - And "Alice" searches "example" using the global search and the "all files" filter + And "Alice" searches "example" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | exampleInsideThePersonalSpace.txt | | exampleInsideTheMainFolder.txt | | exampleInsideTheSubFolder.txt | - When "Alice" searches "example" using the global search and the "current folder" filter + When "Alice" searches "example" using the global search and the "in here" filter Then following resources should be displayed in the search list for user "Alice" | resource | | exampleInsideTheMainFolder.txt | diff --git a/tests/e2e/cucumber/features/smoke/searchProjectSpace.feature b/tests/e2e/cucumber/features/smoke/searchProjectSpace.feature index 952b7b08bfd..37ba0848274 100644 --- a/tests/e2e/cucumber/features/smoke/searchProjectSpace.feature +++ b/tests/e2e/cucumber/features/smoke/searchProjectSpace.feature @@ -23,14 +23,14 @@ Feature: Search in the project space And "Alice" navigates to the personal space page # search for project space objects - When "Alice" searches "-'s" using the global search and the "all files" filter + When "Alice" searches "-'s" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | new-'single'quotes.txt | But following resources should not be displayed in the search list for user "Alice" | resource | | folder(WithSymbols:!;_+-&) | - When "Alice" searches "!;_+-&)" using the global search and the "all files" filter + When "Alice" searches "!;_+-&)" using the global search and the "everywhere" filter Then following resources should be displayed in the search list for user "Alice" | resource | | folder(WithSymbols:!;_+-&) | diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 7bc0884aef1..5dea68b3132 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -57,8 +57,8 @@ const globalSearchInput = '.oc-search-input' const globalSearchBarFilter = '.oc-search-bar-filter' const globalSearchDirFilterDropdown = '//div[@id="files-global-search"]//button[contains(@id, "oc-filter")]' -const globalSearchBarFilterAllFiles = '//*[@data-test-id="all-files"]' -const globalSearchBarFilterCurrentFolder = '//*[@data-test-id="current-folder"]' +const globalSearchBarFilterAllFiles = '//*[@data-test-id="everywhere"]' +const globalSearchBarFilterCurrentFolder = '//*[@data-test-id="in-here"]' const searchList = '//div[@id="files-global-search-options"]//li[contains(@class,"preview")]//span[@class="oc-resource-name"]' const globalSearchOptions = '#files-global-search-options' @@ -1075,7 +1075,7 @@ export const getTagsForResourceVisibilityInDetailsPanel = async ( return true } -export type searchFilter = 'all files' | 'current folder' +export type searchFilter = 'everywhere' | 'in here' export interface searchResourceGlobalSearchArgs { keyword: string @@ -1097,7 +1097,7 @@ export const searchResourceGlobalSearch = async ( await page.locator(globalSearchDirFilterDropdown).click() await page .locator( - filter === 'all files' ? globalSearchBarFilterAllFiles : globalSearchBarFilterCurrentFolder + filter === 'everywhere' ? globalSearchBarFilterAllFiles : globalSearchBarFilterCurrentFolder ) .click() }