diff --git a/changelog/unreleased/bugfix-nav-icon-flickering-lightmode b/changelog/unreleased/bugfix-nav-icon-flickering-lightmode new file mode 100644 index 00000000000..ceff8518b0a --- /dev/null +++ b/changelog/unreleased/bugfix-nav-icon-flickering-lightmode @@ -0,0 +1,6 @@ +Bugfix: SidebarNavItem icon flickering + +We've fixed a bug which caused the icons on the SidebarNav +to flicker when transitioning in lightmode + +https://github.com/owncloud/web/pull/7309 \ No newline at end of file diff --git a/changelog/unreleased/enhancement-keyboard-shortcut-indicators b/changelog/unreleased/enhancement-keyboard-shortcut-indicators new file mode 100644 index 00000000000..68ee3415ef0 --- /dev/null +++ b/changelog/unreleased/enhancement-keyboard-shortcut-indicators @@ -0,0 +1,6 @@ +Enhancement: Keyboard shortcut indicators in ContextMenu + +We've added the option to display relevant keyboard shortcuts in the contextmenu to give notice to the user which shortcuts are available + +https://github.com/owncloud/web/pull/7309 +https://github.com/owncloud/web/issues/6892 \ No newline at end of file diff --git a/changelog/unreleased/enhancement-lowlight-cut-resources b/changelog/unreleased/enhancement-lowlight-cut-resources new file mode 100644 index 00000000000..a54603b50c4 --- /dev/null +++ b/changelog/unreleased/enhancement-lowlight-cut-resources @@ -0,0 +1,5 @@ +Enhancement: Lowlight cut resources + +We've added a visual indication to show which resources are being cut + +https://github.com/owncloud/web/pull/7309 \ No newline at end of file diff --git a/changelog/unreleased/enhancement-replace-locationpicker-clipboard b/changelog/unreleased/enhancement-replace-locationpicker-clipboard new file mode 100644 index 00000000000..df299088d01 --- /dev/null +++ b/changelog/unreleased/enhancement-replace-locationpicker-clipboard @@ -0,0 +1,7 @@ +Enhancement: Replace locationpicker with clipboard actions + +We've replaced the locationpicker in batchactions and contextmenu with +the new cut/copy/paste clipboard actions. + +https://github.com/owncloud/web/pull/7309 +https://github.com/owncloud/web/issues/6892 diff --git a/packages/web-app-files/src/components/ActionMenuItem.vue b/packages/web-app-files/src/components/ActionMenuItem.vue index c968de70a89..397655e71be 100644 --- a/packages/web-app-files/src/components/ActionMenuItem.vue +++ b/packages/web-app-files/src/components/ActionMenuItem.vue @@ -32,6 +32,11 @@ {{ action.label(filterParams) }} + diff --git a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue index 1792b702ec0..dbd3de60d15 100644 --- a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue +++ b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue @@ -110,6 +110,15 @@ +
+ + + Paste here + + + + +
@@ -130,7 +139,8 @@ import { useCapabilitySpacesEnabled, useStore, usePublicLinkPassword, - useUserContext + useUserContext, + usePublicLinkContext } from 'web-pkg/src/composables' import { DavProperties, DavProperty } from 'web-pkg/src/constants' @@ -184,7 +194,8 @@ export default defineComponent({ hasShareJail: useCapabilityShareJailEnabled(), hasSpaces: useCapabilitySpacesEnabled(), publicLinkPassword: usePublicLinkPassword({ store }), - isUserContext: useUserContext({ store }) + isUserContext: useUserContext({ store }), + isPublicLinkContext: usePublicLinkContext({ store }) } }, data: () => ({ @@ -194,10 +205,13 @@ export default defineComponent({ }), computed: { ...mapGetters(['capabilities', 'configuration', 'newFileHandlers', 'user']), - ...mapGetters('Files', ['files', 'currentFolder', 'selectedFiles']), + ...mapGetters('Files', ['files', 'currentFolder', 'selectedFiles', 'clipboardResources']), ...mapGetters('runtime/spaces', ['spaces']), ...mapState('Files', ['areFileExtensionsShown']), + showPasteHereButton() { + return this.clipboardResources && this.clipboardResources.length !== 0 + }, mimetypesAllowedForCreation() { // we can't use `mapGetters` here because the External app doesn't exist in all deployments const mimeTypes = this.$store.getters['External/mimeTypes'] @@ -275,7 +289,12 @@ export default defineComponent({ } }, methods: { - ...mapActions('Files', ['loadPreview', 'loadIndicators']), + ...mapActions('Files', [ + 'loadPreview', + 'loadIndicators', + 'clearClipboardFiles', + 'pasteSelectedFiles' + ]), ...mapActions([ 'openFile', 'showMessage', @@ -287,6 +306,23 @@ export default defineComponent({ ...mapMutations('runtime/spaces', ['UPDATE_SPACE_FIELD']), ...mapMutations(['SET_QUOTA']), + pasteFilesHere() { + this.pasteSelectedFiles({ + client: this.$client, + createModal: this.createModal, + hideModal: this.hideModal, + showMessage: this.showMessage, + $gettext: this.$gettext, + $gettextInterpolate: this.$gettextInterpolate, + $ngettext: this.$ngettext, + isPublicLinkContext: this.isPublicLinkContext, + publicLinkPassword: this.publicLinkPassword, + upsertResource: this.UPSERT_RESOURCE + }).then(() => { + ;(document.activeElement as HTMLElement).blur() + }) + }, + async onUploadComplete(result) { if (result.successful) { const file = result.successful[0] @@ -810,7 +846,7 @@ export default defineComponent({ } }) - diff --git a/packages/web-app-files/src/components/AppBar/SelectedResources/BatchActions.vue b/packages/web-app-files/src/components/AppBar/SelectedResources/BatchActions.vue index 72fd9adcf27..c8a3c4730a9 100644 --- a/packages/web-app-files/src/components/AppBar/SelectedResources/BatchActions.vue +++ b/packages/web-app-files/src/components/AppBar/SelectedResources/BatchActions.vue @@ -7,6 +7,7 @@ :items="selectedFiles" appearance="outline" class="oc-mr-s" + :shortcut-hint="false" /> diff --git a/packages/web-app-files/src/components/FilesList/ContextActions.vue b/packages/web-app-files/src/components/FilesList/ContextActions.vue index eb9806a085d..0fd0b2f09ea 100644 --- a/packages/web-app-files/src/components/FilesList/ContextActions.vue +++ b/packages/web-app-files/src/components/FilesList/ContextActions.vue @@ -16,6 +16,7 @@ import DownloadFile from '../../mixins/actions/downloadFile' import EmptyTrashBin from '../../mixins/actions/emptyTrashBin' import Favorite from '../../mixins/actions/favorite' import Move from '../../mixins/actions/move' +import Paste from '../../mixins/actions/paste' import Navigate from '../../mixins/actions/navigate' import Rename from '../../mixins/actions/rename' import Restore from '../../mixins/actions/restore' @@ -43,6 +44,7 @@ export default { EmptyTrashBin, Favorite, Move, + Paste, Navigate, Rename, Restore, @@ -148,6 +150,7 @@ export default { ...this.$_delete_items, ...this.$_move_items, ...this.$_copy_items, + ...this.$_paste_items, ...this.$_rename_items, ...this.$_restore_items, ...this.$_acceptShare_items, diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index 8d8d7245a11..db8cd4924fa 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -7,6 +7,7 @@ import { bus } from 'web-pkg/src/instance' import { mapActions, mapState, mapMutations } from 'vuex' import { defineComponent } from '@vue/composition-api' import MixinFilesListScrolling from '../../mixins/filesListScrolling' +import { usePublicLinkContext, usePublicLinkPassword, useStore } from 'web-pkg/src/composables' export default defineComponent({ mixins: [MixinFilesListScrolling], @@ -21,6 +22,13 @@ export default defineComponent({ default: 'files-view' } }, + setup() { + const store = useStore() + return { + publicLinkPassword: usePublicLinkPassword({ store }), + isPublicLinkContext: usePublicLinkContext({ store }) + } + }, data: () => { return { selectionCursor: 0 @@ -202,6 +210,8 @@ export default defineComponent({ $gettext: this.$gettext, $gettextInterpolate: this.$gettextInterpolate, $ngettext: this.$ngettext, + isPublicLinkContext: this.isPublicLinkContext, + publicLinkPassword: this.publicLinkPassword, upsertResource: this.upsertResource }) }, diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index 7c236510925..0c4ed4672c1 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -61,6 +61,7 @@ :is-resource-clickable="isResourceClickable(item.id)" :folder-link="folderLink(item)" :parent-folder-link="parentFolderLink(item)" + :class="{ 'resource-table-resource-cut': isResourceCut(item) }" @click="emitFileClick(item)" /> r.id === resource.id) + }, isLatestSelectedItem(item) { return item.id === this.latestSelectedId }, @@ -801,6 +812,9 @@ export default defineComponent({ diff --git a/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature b/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature index f9fe0ae5894..07fab67b621 100644 --- a/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature +++ b/tests/acceptance/features/webUIDeleteFilesFolders/deleteFilesFolders.feature @@ -249,10 +249,10 @@ Feature: deleting files and folders | lorem.txt | | simple-folder | When the user deletes file "lorem.txt" using the webUI - Then the error message with header 'Failed to delete "lorem.txt"' should be displayed on the webUI + Then the "error" message with header 'Failed to delete "lorem.txt"' should be displayed on the webUI When the user clears all error message from the webUI And the user deletes folder "simple-folder" using the webUI - Then the error message with header 'Failed to delete "simple-folder"' should be displayed on the webUI + Then the "error" message with header 'Failed to delete "simple-folder"' should be displayed on the webUI When the user reloads the current page of the webUI Then file "lorem.txt" should not be listed on the webUI And folder "simple-folder" should not be listed on the webUI diff --git a/tests/acceptance/features/webUIFavorites/favoritesFile.feature b/tests/acceptance/features/webUIFavorites/favoritesFile.feature index f2eca1baa80..ad742681404 100644 --- a/tests/acceptance/features/webUIFavorites/favoritesFile.feature +++ b/tests/acceptance/features/webUIFavorites/favoritesFile.feature @@ -111,11 +111,11 @@ Feature: Mark file as favorite | lorem.txt | | simple-folder | When the user marks file "lorem.txt" as favorite using the webUI - Then the error message with header 'Failed to change favorite state of "lorem.txt"' should be displayed on the webUI + Then the "error" message with header 'Failed to change favorite state of "lorem.txt"' should be displayed on the webUI And file "lorem.txt" should not be marked as favorite on the webUI When the user clears all error message from the webUI And the user marks folder "simple-folder" as favorite using the webUI - Then the error message with header 'Failed to change favorite state of "simple-folder"' should be displayed on the webUI + Then the "error" message with header 'Failed to change favorite state of "simple-folder"' should be displayed on the webUI And folder "simple-folder" should not be marked as favorite on the webUI And as "Alice" file "lorem.txt" should not exist in the server And as "Alice" folder "simple-folder" should not exist in the server diff --git a/tests/acceptance/features/webUIFavorites/unfavoriteFile.feature b/tests/acceptance/features/webUIFavorites/unfavoriteFile.feature index 9b81b584475..6d16e302bd5 100644 --- a/tests/acceptance/features/webUIFavorites/unfavoriteFile.feature +++ b/tests/acceptance/features/webUIFavorites/unfavoriteFile.feature @@ -110,11 +110,11 @@ Feature: Unmark file/folder as favorite | lorem.txt | | simple-folder | When the user unmarks the favorited file "lorem.txt" using the webUI - Then the error message with header 'Failed to change favorite state of "lorem.txt"' should be displayed on the webUI + Then the "error" message with header 'Failed to change favorite state of "lorem.txt"' should be displayed on the webUI And file "lorem.txt" should be marked as favorite on the webUI When the user clears all error message from the webUI And the user unmarks the favorited folder "simple-folder" using the webUI - Then the error message with header 'Failed to change favorite state of "simple-folder"' should be displayed on the webUI + Then the "error" message with header 'Failed to change favorite state of "simple-folder"' should be displayed on the webUI And folder "simple-folder" should be marked as favorite on the webUI And as "Alice" file "lorem.txt" should not exist in the server And as "Alice" folder "simple-folder" should not exist in the server diff --git a/tests/acceptance/features/webUIFiles/batchAction.feature b/tests/acceptance/features/webUIFiles/batchAction.feature index a3f26178168..9188d39fea0 100644 --- a/tests/acceptance/features/webUIFiles/batchAction.feature +++ b/tests/acceptance/features/webUIFiles/batchAction.feature @@ -16,7 +16,7 @@ Feature: Visibility of the batch actions menu When the user marks the folder "simple-folder" using the webUI Then the following batch action buttons should be visible | buttonName | - | Move | + | Cut | | Copy | | Delete | @@ -29,7 +29,7 @@ Feature: Visibility of the batch actions menu | buttonName | | Download | | Delete | - | Move | + | Cut | | Copy | @@ -43,7 +43,7 @@ Feature: Visibility of the batch actions menu Then the following batch action buttons should be visible | buttonName | | Delete | - | Move | + | Cut | | Copy | @skipOnOCIS @@ -93,7 +93,7 @@ Feature: Visibility of the batch actions menu Then the following batch action buttons should not be visible | buttonName | | Delete | - | Move | + | Cut | | Copy | @@ -106,7 +106,7 @@ Feature: Visibility of the batch actions menu Then the following batch action buttons should not be visible | buttonName | | Delete | - | Move | + | Cut | | Copy | diff --git a/tests/acceptance/features/webUIFiles/download.feature b/tests/acceptance/features/webUIFiles/download.feature index 4b23ccb97eb..0482cbd9d92 100644 --- a/tests/acceptance/features/webUIFiles/download.feature +++ b/tests/acceptance/features/webUIFiles/download.feature @@ -14,7 +14,7 @@ Feature: download files | name | | lorem.txt | When the user downloads file "lorem.txt" using the webUI - Then the error message with header 'Download failed' should be displayed on the webUI + Then the "error" message with header 'Download failed' should be displayed on the webUI When the user reloads the current page of the webUI Then file "lorem.txt" should not be listed on the webUI And as "Alice" file "lorem.txt" should not exist in the server diff --git a/tests/acceptance/features/webUIFilesActionMenu/fileFolderActionMenu.feature b/tests/acceptance/features/webUIFilesActionMenu/fileFolderActionMenu.feature index dca6cb35a00..a99efc04848 100644 --- a/tests/acceptance/features/webUIFilesActionMenu/fileFolderActionMenu.feature +++ b/tests/acceptance/features/webUIFilesActionMenu/fileFolderActionMenu.feature @@ -17,9 +17,9 @@ Feature: User can see the file or folder actions menu options When the user opens the actions sidebar panel of file "lorem.txt" on the webUI Then the app-sidebar for file "lorem.txt" should be visible on the webUI And only the following items with default items should be visible in the actions menu on the webUI - | items | + | items | | open in text editor | - | download | + | download | When the user opens the actions sidebar panel of file "lorem.pdf" on the webUI Then the app-sidebar for file "lorem.pdf" should be visible on the webUI And only the following items with default items should be visible in the actions menu on the webUI @@ -29,9 +29,9 @@ Feature: User can see the file or folder actions menu options When the user opens the actions sidebar panel of file "testavatar.png" on the webUI Then the app-sidebar for file "testavatar.png" should be visible on the webUI And only the following items with default items should be visible in the actions menu on the webUI - | items | - | preview | - | download | + | items | + | preview | + | download | Scenario: observe different actions menu options on selecting a folder diff --git a/tests/acceptance/features/webUIFilesCopy/copy.feature b/tests/acceptance/features/webUIFilesCopy/copy.feature index fb335234dfb..a25a180e9a5 100644 --- a/tests/acceptance/features/webUIFilesCopy/copy.feature +++ b/tests/acceptance/features/webUIFilesCopy/copy.feature @@ -32,7 +32,7 @@ Feature: copy files and folders And user "Alice" has logged in using the webUI And the user has browsed to the personal page When the user tries to copy file "strängé filename (duplicate #2 &).txt" into folder "strängé नेपाली folder" using the webUI - Then the error message with header 'Failed to copy "strängé filename (duplicate #2 &).txt"' should be displayed on the webUI + Then the "modal error" message with header 'File with name strängé filename (duplicate #2 &).txt already exists.' should be displayed on the webUI @smokeTest @ocisSmokeTest Scenario: Copy multiple files at once @@ -78,7 +78,7 @@ Feature: copy files and folders And user "Alice" has created folder "simple-folder/simple-empty-folder" in the server And user "Alice" has uploaded file "data.zip" to "simple-folder/data.zip" in the server And user "Alice" has shared folder "simple-folder" with link with "read, update, create, delete" permissions in the server - And the public uses the webUI to access the last public link created by user "Alice" in a new session + When the public uses the webUI to access the last public link created by user "Alice" in a new session And the user copies file "data.zip" into folder "simple-empty-folder" using the webUI Then breadcrumb for folder "simple-empty-folder" should be displayed on the webUI And file "data.zip" should be listed on the webUI @@ -113,7 +113,7 @@ Feature: copy files and folders Given user "Alice" has created folder "simple-empty-folder" in the server And user "Alice" has logged in using the webUI When the user tries to copy folder "simple-empty-folder" into folder "simple-empty-folder" using the webUI - Then the error message with header 'Failed to copy "simple-empty-folder"' should be displayed on the webUI + Then the "error" message with header "You can't paste the selected file at this location because you can't paste an item into itself." should be displayed on the webUI And as "Alice" file "simple-empty-folder/simple-empty-folder" should not exist in the server @@ -127,40 +127,3 @@ Feature: copy files and folders And folder "simple-empty-folder" should be listed on the webUI And as "Alice" folder "folder with space/simple-empty-folder/simple-empty-folder" should exist in the server And as "Alice" folder "simple-empty-folder" should exist in the server - - Scenario: cancel copying a file - Given user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user selects copy action for folder "data.zip" using the webUI - And the user selects the folder "simple-empty-folder" as a place to copy the file using the webUI - And the user cancels the attempt to copy resources using the webUI - Then file "data.zip" should be listed on the webUI - But file "data.zip" should not be listed in the folder "simple-empty-folder" on the webUI - - Scenario: cancel copying of multiple files at once - Given user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "new-data.zip" to "testapp.zip" in the server - And user "Alice" has created file "lorem.txt" in the server - And user "Alice" has created folder "simple-empty-folder" in the server - And user "Alice" has logged in using the webUI - And the user has browsed to the personal page - When the user marks these files for batch action using the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | - And the user selects the copy button to copy files using the webUI - And the user selects the folder "simple-empty-folder" as a place to copy the files using the webUI - And the user cancels the attempt to copy resources using the webUI - Then the following files should be listed on the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | - But these resources should not be listed in the folder "simple-empty-folder" on the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | diff --git a/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature b/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature index 89b2439faa1..3c3337fbef4 100644 --- a/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature +++ b/tests/acceptance/features/webUIMoveFilesFolders/moveFiles.feature @@ -45,7 +45,7 @@ Feature: move files And user "Alice" has uploaded file "lorem.txt" to "simple-folder/lorem.txt" in the server And the user has browsed to the personal page When the user tries to move file "lorem.txt" into folder "simple-folder" using the webUI - Then the error message with header 'Failed to move "lorem.txt"' should be displayed on the webUI + Then the "modal error" message with header 'File with name lorem.txt already exists.' should be displayed on the webUI @smokeTest @ocisSmokeTest @disablePreviews Scenario: Move multiple files at once @@ -102,38 +102,38 @@ Feature: move files When the user tries to move file "lorem.txt" into folder "simple-folder (2)" using the webUI Then as "Alice" file "simple-folder (2)/lorem.txt" should not exist in the server - Scenario: cancel moving a file - Given user "Alice" has logged in using the webUI - And the user has browsed to the personal page - And the user selects move action for file "lorem.txt" using the webUI - And the user selects the folder "simple-folder" as a place to move the file using the webUI - And the user cancels the attempt to move resources using the webUI - Then file "lorem.txt" should be listed on the webUI - But file "lorem.txt" should not be listed in the folder "simple-folder" on the webUI - Scenario: cancel moving of multiple files at once - Given user "Alice" has logged in using the webUI - And user "Alice" has uploaded file "data.zip" to "data.zip" in the server - And user "Alice" has uploaded file "data.zip" to "testapp.zip" in the server - And the user has browsed to the personal page - When the user marks these files for batch action using the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | - And the user selects the move button to move files using the webUI - And the user selects the folder "simple-folder" as a place to move the files using the webUI - And the user cancels the attempt to move resources using the webUI - Then the following files should be listed on the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | - But these resources should not be listed in the folder "simple-folder" on the webUI - | file_name | - | data.zip | - | lorem.txt | - | testapp.zip | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @issue-ocis-873 Scenario: sharee moves a file shared by sharer into another folder diff --git a/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature b/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature index 0fbaffb6eb0..bad48860f0e 100644 --- a/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature +++ b/tests/acceptance/features/webUIMoveFilesFolders/moveFolders.feature @@ -35,7 +35,7 @@ Feature: move folders And user "Alice" has logged in using the webUI And the user has browsed to the personal page When the user tries to move folder "simple-empty-folder" into folder "simple-folder" using the webUI - Then the error message with header 'Failed to move "simple-empty-folder"' should be displayed on the webUI + Then the "modal error" message with header 'Folder with name simple-empty-folder already exists.' should be displayed on the webUI @smokeTest Scenario: Move multiple folders at once @@ -81,7 +81,7 @@ Feature: move folders Scenario: move a folder into the same folder Given user "Alice" has logged in using the webUI When the user tries to move folder "simple-empty-folder" into folder "simple-empty-folder" using the webUI - Then the error message with header 'Failed to move "simple-empty-folder"' should be displayed on the webUI + Then the "error" message with header "You can't paste the selected file at this location because you can't paste an item into itself." should be displayed on the webUI And as "Alice" folder "simple-empty-folder/simple-empty-folder" should not exist in the server diff --git a/tests/acceptance/features/webUIRenameFiles/renameFiles.feature b/tests/acceptance/features/webUIRenameFiles/renameFiles.feature index a78d7400d8f..972d16d34df 100644 --- a/tests/acceptance/features/webUIRenameFiles/renameFiles.feature +++ b/tests/acceptance/features/webUIRenameFiles/renameFiles.feature @@ -113,7 +113,7 @@ Feature: rename files Scenario Outline: Try to rename a file using forbidden characters Given user "Alice" has logged in using the webUI When the user tries to rename file "data.zip" to "" using the webUI - Then the error message with header 'Failed to rename "data.zip" to ""' should be displayed on the webUI + Then the "error" message with header 'Failed to rename "data.zip" to ""' should be displayed on the webUI And file "data.zip" should be listed on the webUI And file "" should not be listed on the webUI Examples: @@ -182,7 +182,7 @@ Feature: rename files Scenario: Rename a file to .part (on oc10) Given user "Alice" has logged in using the webUI When the user tries to rename file "data.zip" to "data.part" using the webUI - Then the error message with header 'Failed to rename "data.zip" to "data.part"' should be displayed on the webUI + Then the "error" message with header 'Failed to rename "data.zip" to "data.part"' should be displayed on the webUI @skipOnOC10 Scenario: Rename a file to .part @@ -272,7 +272,7 @@ Feature: rename files | name | | lorem.txt | When the user tries to rename file "lorem.txt" to "new-lorem.txt" using the webUI - Then the error message with header 'Failed to rename "lorem.txt" to "new-lorem.txt"' should be displayed on the webUI + Then the "error" message with header 'Failed to rename "lorem.txt" to "new-lorem.txt"' should be displayed on the webUI When the user reloads the current page of the webUI Then file "lorem.txt" should not be listed on the webUI And file "new-lorem.txt" should not be listed on the webUI diff --git a/tests/acceptance/features/webUIRenameFolders/renameFolders.feature b/tests/acceptance/features/webUIRenameFolders/renameFolders.feature index 4eeae6d5eeb..5c3b8ac6857 100644 --- a/tests/acceptance/features/webUIRenameFolders/renameFolders.feature +++ b/tests/acceptance/features/webUIRenameFolders/renameFolders.feature @@ -104,7 +104,7 @@ Feature: rename folders Scenario Outline: Rename a folder using forbidden characters Given user "Alice" has logged in using the webUI When the user tries to rename folder to using the webUI - Then the error message with header '' should be displayed on the webUI + Then the "error" message with header '' should be displayed on the webUI And folder "simple-folder" should be listed on the webUI Examples: | from_name | to_name | alert_message | @@ -140,7 +140,7 @@ Feature: rename folders Scenario: Rename a folder to .part (on oc10) Given user "Alice" has logged in using the webUI When the user tries to rename folder "simple-folder" to "simple.part" using the webUI - Then the error message with header 'Failed to rename "simple-folder" to "simple.part"' should be displayed on the webUI + Then the "error" message with header 'Failed to rename "simple-folder" to "simple.part"' should be displayed on the webUI @skipOnOC10 Scenario: Rename a folder to .part (on ocis) @@ -154,7 +154,7 @@ Feature: rename folders | name | | simple-folder | When the user tries to rename folder "simple-folder" to "new-simple-folder" using the webUI - Then the error message with header 'Failed to rename "simple-folder" to "new-simple-folder"' should be displayed on the webUI + Then the "error" message with header 'Failed to rename "simple-folder" to "new-simple-folder"' should be displayed on the webUI When the user reloads the current page of the webUI Then folder "simple-folder" should not be listed on the webUI And folder "new-simple-folder" should not be listed on the webUI diff --git a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature index 4450b51cc1a..64e1e4050da 100644 --- a/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature +++ b/tests/acceptance/features/webUISharingInternalUsers/shareWithUsers.feature @@ -166,11 +166,11 @@ Feature: Sharing files and folders with internal users | lorem.txt | | simple-folder | When the user shares file "lorem.txt" with user "Brian Murphy" as "Editor" using the webUI - Then the error message with header 'Error while sharing.' should be displayed on the webUI + Then the "error" message with header 'Error while sharing.' should be displayed on the webUI And user "Brian Murphy" should not be listed in the collaborators list on the webUI When the user clears all error message from the webUI And the user shares folder "simple-folder" with user "Brian Murphy" as "Editor" using the webUI - Then the error message with header 'Error while sharing.' should be displayed on the webUI + Then the "error" message with header 'Error while sharing.' should be displayed on the webUI And user "Brian Murphy" should not be listed in the collaborators list on the webUI When the user reloads the current page of the webUI Then file "lorem.txt" should not be listed on the webUI diff --git a/tests/acceptance/features/webUISharingInternalUsersToRoot/shareWithUsers.feature b/tests/acceptance/features/webUISharingInternalUsersToRoot/shareWithUsers.feature index d3473718ea9..66cf4233bd6 100644 --- a/tests/acceptance/features/webUISharingInternalUsersToRoot/shareWithUsers.feature +++ b/tests/acceptance/features/webUISharingInternalUsersToRoot/shareWithUsers.feature @@ -163,11 +163,11 @@ Feature: Sharing files and folders with internal users | lorem.txt | | simple-folder | When the user shares file "lorem.txt" with user "Brian Murphy" as "Editor" using the webUI - Then the error message with header 'Error while sharing.' should be displayed on the webUI + Then the "error" message with header 'Error while sharing.' should be displayed on the webUI And user "UserTwo" should not be listed in the collaborators list on the webUI When the user clears all error message from the webUI And the user shares folder "simple-folder" with user "Brian Murphy" as "Editor" using the webUI - Then the error message with header 'Error while sharing.' should be displayed on the webUI + Then the "error" message with header 'Error while sharing.' should be displayed on the webUI And user "UserTwo" should not be listed in the collaborators list on the webUI When the user reloads the current page of the webUI Then file "lorem.txt" should not be listed on the webUI diff --git a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature b/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature index adab3b43432..70085782ac6 100644 --- a/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature +++ b/tests/acceptance/features/webUITrashbinDelete/trashbinDelete.feature @@ -47,7 +47,7 @@ Feature: files and folders can be deleted from the trashbin # after the issue is fixed delete this scenario and use the one above Scenario: Delete folders and check that they are gone (ocis bug demonstration) When the user deletes folder "simple-folder" using the webUI - Then the error message with header 'Failed to delete "simple-folder"' should be displayed on the webUI + Then the "error" message with header 'Failed to delete "simple-folder"' should be displayed on the webUI And folder "simple-folder" should be listed on the webUI When the user deletes folder "Folder,With,Comma" using the webUI Then folder "Folder,With,Comma" should not be listed on the webUI @@ -98,7 +98,7 @@ Feature: files and folders can be deleted from the trashbin @issue-product-139 Scenario: Clear trashbin When the user clears the trashbin - Then the success message with header "All deleted files were removed" should be displayed on the webUI + Then the "success" message with header "All deleted files were removed" should be displayed on the webUI And there should be no resources listed on the webUI diff --git a/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature b/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature index dbf20a55009..0ef7b168453 100644 --- a/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature +++ b/tests/acceptance/features/webUITrashbinRestore/trashbinRestore.feature @@ -230,7 +230,7 @@ Feature: Restore deleted files/folders | lorem.txt | When the user browses to the trashbin page And the user restores file "lorem.txt" from the trashbin using the webUI - Then the success message with header "lorem.txt was restored successfully" should be displayed on the webUI + Then the "success" message with header "lorem.txt was restored successfully" should be displayed on the webUI And file "lorem.txt" should not be listed on the webUI And folder "lorem.txt" should be listed on the webUI When the user browses to the files page using the webUI @@ -249,7 +249,7 @@ Feature: Restore deleted files/folders | lorem.txt | When the user browses to the trashbin page And the user restores folder "lorem.txt" from the trashbin using the webUI - Then the success message with header "lorem.txt was restored successfully" should be displayed on the webUI + Then the "success" message with header "lorem.txt was restored successfully" should be displayed on the webUI And folder "lorem.txt" should not be listed on the webUI And file "lorem.txt" should be listed on the webUI When the user browses to the files page using the webUI @@ -272,7 +272,7 @@ Feature: Restore deleted files/folders And the user browses to the trashbin page Then as "Alice" file "fileToShare.txt" should exist in the trashbin in the server When the user restores file "…/folder-to-share/fileToShare.txt" from the trashbin using the webUI - Then the success message with header "fileToShare.txt was restored successfully" should be displayed on the webUI + Then the "success" message with header "fileToShare.txt was restored successfully" should be displayed on the webUI And as "Alice" file "/Shares/folder-to-share/fileToShare.txt" should exist in the server @issue-1502 diff --git a/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js b/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js index 13b1e08dd01..0821e056fc4 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js +++ b/tests/acceptance/pageObjects/FilesPageElement/appSideBar.js @@ -132,7 +132,7 @@ module.exports = { return items }, getActionsMenuItemsExceptDefaults: async function () { - const defaultItems = ['add to favorites', 'copy', 'move', 'rename', 'delete'] + const defaultItems = ['add to favorites', 'copy', 'cut', 'rename', 'delete'] const items = [] let elements await this.api.elements('@panelActionsItems', function (result) { diff --git a/tests/acceptance/pageObjects/FilesPageElement/filesList.js b/tests/acceptance/pageObjects/FilesPageElement/filesList.js index fbf57a64dd7..0a8ea383121 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/filesList.js +++ b/tests/acceptance/pageObjects/FilesPageElement/filesList.js @@ -610,19 +610,17 @@ module.exports = { await fileActionsMenu.move() // Execute move - await client.page.locationPicker().selectFolderAndConfirm(target) + await this.selectFolderAndPasteFiles(target) return this }, - cancelResourceMoveOrCopyProgress: async function () { - // cancel copy or move - await this.waitForElementVisible(this.elements.cancelMoveCopyBtn.selector).click( - this.elements.cancelMoveCopyBtn.selector - ) - await this.waitForLoadingFinished() + moveMultipleResources: async function (target) { + // Trigger move + await this.click('@moveSelectedBtn') - return this + // Execute move + return await this.selectFolderAndPasteFiles(target) }, copyResource: async function (resource, target) { @@ -631,11 +629,45 @@ module.exports = { await fileActionsMenu.copy() // Execute copy - await client.page.locationPicker().selectFolderAndConfirm(target) + await this.selectFolderAndPasteFiles(target) return this }, + copyMultipleResources: async function (target) { + // Trigger copy + await this.click('@copySelectedBtn') + + // Execute copy + return await this.selectFolderAndPasteFiles(target) + }, + + selectFolderAndPasteFiles: async function (target) { + if (target.startsWith('/')) { + // if the target is absolute, we need to go to the root element first + await this.waitForElementVisible('@firstBreadcrumbLink').click('@firstBreadcrumbLink') + } + const targetSplitted = target.replace(/^(\/|\\)+/, '').split('/') + for (let i = 0; i < targetSplitted.length; i++) { + await client.page.FilesPageElement.filesList().navigateToFolder(targetSplitted[i]) + } + + await this.initAjaxCounters() + .waitForElementVisible('@pasteSelectedBtn') + .click('@pasteSelectedBtn') + .waitForAjaxCallsToStartAndFinish() + try { + await this.waitForElementNotPresent({ + selector: '@pasteSelectedBtn', + timeout: 200 + }) + } catch (e) { + console.error(e) + throw new Error('ElementPresentError') + } + return this + }, + clickOnFileName: function (fileName) { const file = this.getFileLinkSelectorByFileName(fileName, 'file') return this.useXpath().waitForElementVisible(file).click(file).useCss() @@ -767,15 +799,25 @@ module.exports = { selector: '//img[contains(@class, "oc-resource-thumbnail")]', locateStrategy: 'xpath' }, - cancelMoveCopyBtn: { - selector: '#location-picker-btn-cancel' - }, btnToggleSideBar: { selector: '#files-toggle-sidebar' }, sharedWithToggleButton: { selector: '//*[contains(@class, "sharee-avatars")]/ancestor::button', locateStrategy: 'xpath' + }, + firstBreadcrumbLink: { + selector: '//nav[contains(@class, "oc-breadcrumb")]/ol/li[1]/a', + locateStrategy: 'xpath' + }, + moveSelectedBtn: { + selector: '.oc-files-actions-move-trigger' + }, + copySelectedBtn: { + selector: '.oc-files-actions-copy-trigger' + }, + pasteSelectedBtn: { + selector: '#clipboard-btns button:first-child' } } } diff --git a/tests/acceptance/pageObjects/locationPicker.js b/tests/acceptance/pageObjects/locationPicker.js deleted file mode 100644 index 7e36cd50600..00000000000 --- a/tests/acceptance/pageObjects/locationPicker.js +++ /dev/null @@ -1,43 +0,0 @@ -const { client } = require('nightwatch-api') - -module.exports = { - commands: { - selectFolderAndConfirm: async function (target) { - await this.selectFolder(target) - await this.initAjaxCounters() - .waitForElementVisible('@confirmBtn') - .click('@confirmBtn') - .waitForAjaxCallsToStartAndFinish() - try { - await this.waitForElementNotPresent({ - selector: '@confirmBtn', - timeout: 200 - }) - } catch (e) { - console.error(e) - throw new Error('ElementPresentError') - } - return this - }, - selectFolder: async function (target) { - if (target.startsWith('/')) { - // if the target is absolute, we need to go to the root element first - await this.waitForElementVisible('@firstBreadcrumbLink').click('@firstBreadcrumbLink') - } - const targetSplitted = target.replace(/^(\/|\\)+/, '').split('/') - for (let i = 0; i < targetSplitted.length; i++) { - await client.page.FilesPageElement.filesList().navigateToFolder(targetSplitted[i]) - } - return this - } - }, - elements: { - firstBreadcrumbLink: { - selector: '//nav[contains(@class, "oc-breadcrumb")]/ol/li[1]/a', - locateStrategy: 'xpath' - }, - confirmBtn: { - selector: 'button#location-picker-btn-confirm' - } - } -} diff --git a/tests/acceptance/pageObjects/personalPage.js b/tests/acceptance/pageObjects/personalPage.js index 73f937b321b..45d29b77766 100644 --- a/tests/acceptance/pageObjects/personalPage.js +++ b/tests/acceptance/pageObjects/personalPage.js @@ -250,22 +250,6 @@ module.exports = { return this.waitForElementVisible('@dialogConfirmBtnDisabled') }, - moveMultipleResources: async function (target) { - // Trigger move - await this.click('@moveSelectedBtn') - - // Execute move - return await client.page.locationPicker().selectFolderAndConfirm(target) - }, - - copyMultipleResources: async function (target) { - // Trigger copy - await this.click('@copySelectedBtn') - - // Execute copy - return await client.page.locationPicker().selectFolderAndConfirm(target) - }, - /** * Create a md file with the given name * @@ -313,15 +297,6 @@ module.exports = { }) return searchBar.length > 0 }, - clearSelection: async function () { - await this.useXpath() - .waitForElementVisible('@clearSelectionBtn') - .click('@clearSelectionBtn') - .waitForElementNotPresent('@clearSelectionBtn') - }, - checkForButtonMoveHereDisabled: function () { - return this.waitForElementVisible('@moveHereConfirmBtn') - }, clearFileSelectionIfAny: async function () { let activeFileSelection = false await this.isVisible( @@ -430,20 +405,11 @@ module.exports = { dialogInput: { selector: '.oc-modal-body-input .oc-text-input' }, - moveSelectedBtn: { - selector: '.oc-files-actions-move-trigger' - }, - copySelectedBtn: { - selector: '.oc-files-actions-copy-trigger' - }, clearSelectionBtn: { selector: '#files-clear-selection' }, dialogBoxInputTextInRed: { selector: '.oc-text-input-danger' - }, - moveHereConfirmBtn: { - selector: '#location-picker-btn-confirm:disabled' } } } diff --git a/tests/acceptance/pageObjects/webPage.js b/tests/acceptance/pageObjects/webPage.js index 500cf11ede0..5d64483bc4b 100644 --- a/tests/acceptance/pageObjects/webPage.js +++ b/tests/acceptance/pageObjects/webPage.js @@ -216,6 +216,8 @@ module.exports = { let selector = titleOnly ? '@message' : '@messages' if (type === 'error') { selector = titleOnly ? '@errorMessage' : '@errorMessages' + } else if (type === 'modal error') { + selector = '@modalErrorMessage' } await this.waitForElementVisible(selector) await this.api.element(selector, (result) => { @@ -281,6 +283,10 @@ module.exports = { '//*[contains(@class, "oc-notification-message-danger")]//div[contains(@class, "oc-notification-message-title")]', locateStrategy: 'xpath' }, + modalErrorMessage: { + selector: '//div[@class=\'oc-modal-body\']/p[contains(@class, "oc-modal-body-message")]', + locateStrategy: 'xpath' + }, errorMessages: { selector: '//*[contains(@class, "oc-notification-message-danger")]', locateStrategy: 'xpath' diff --git a/tests/acceptance/stepDefinitions/filesContext.js b/tests/acceptance/stepDefinitions/filesContext.js index ca866d80a27..38743369b6c 100644 --- a/tests/acceptance/stepDefinitions/filesContext.js +++ b/tests/acceptance/stepDefinitions/filesContext.js @@ -1234,22 +1234,6 @@ When( } ) -Then('the move here file/folder button should be disabled', function () { - return client.page.personalPage().checkForButtonMoveHereDisabled() -}) - -When( - 'the user selects move action for folder/file {string} using the webUI', - async function (resource) { - await client.page.FilesPageElement.filesList().openFileActionsMenu(resource) - return await client.page.FilesPageElement.fileActionsMenu().move() - } -) - -When('the user cancels the attempt to move/copy resources using the webUI', function () { - return client.page.FilesPageElement.filesList().cancelResourceMoveOrCopyProgress() -}) - When( 'the user batch moves these files/folders into folder {string} using the webUI', async function (target, resources) { @@ -1257,25 +1241,10 @@ When( await client.page.FilesPageElement.filesList().toggleFileOrFolderCheckbox('enable', item[0]) } - return client.page.personalPage().moveMultipleResources(target) - } -) - -When( - 'the user tries to batch move these files/folders into folder {string} using the webUI', - async function (target, resources) { - for (const item of resources.rows()) { - await client.page.FilesPageElement.filesList().toggleFileOrFolderCheckbox('enable', item[0]) - } - - return client.page.personalPage().attemptToMoveMultipleResources(target) + return client.page.FilesPageElement.filesList().moveMultipleResources(target) } ) -When('the user selects the move button to move files using the webUI', function () { - return client.page.personalPage().click('@moveSelectedBtn') -}) - When( 'the user copies file/folder {string} into folder {string} using the webUI', function (resource, target) { @@ -1296,21 +1265,6 @@ When( } ) -When( - 'the user selects copy action for file/folder {string} using the webUI', - async function (resource) { - await client.page.FilesPageElement.filesList().openFileActionsMenu(resource) - return await client.page.FilesPageElement.fileActionsMenu().copy() - } -) - -When( - 'the user selects the folder {string} as a place to copy/move the file/files/folder/folders using the webUI', - async function (target) { - await client.page.locationPicker().selectFolder(target) - } -) - When( 'the user batch copies these files/folders into folder {string} using the webUI', async function (target, resources) { @@ -1318,14 +1272,10 @@ When( await client.page.FilesPageElement.filesList().toggleFileOrFolderCheckbox('enable', item[0]) } - return await client.page.personalPage().copyMultipleResources(target) + return await client.page.FilesPageElement.filesList().copyMultipleResources(target) } ) -When('the user selects the copy button to copy files using the webUI', function () { - return client.page.personalPage().click('@copySelectedBtn') -}) - When( 'the user creates a markdown file with the name {string} using the webUI', function (fileName) { @@ -1365,7 +1315,6 @@ Then( async function (table) { const visibleItems = await client.page.FilesPageElement.appSideBar().getActionsMenuItemsExceptDefaults() - const tableItems = table.rows() const expectedVisibleItems = [] tableItems.forEach((element) => { diff --git a/tests/acceptance/stepDefinitions/generalContext.js b/tests/acceptance/stepDefinitions/generalContext.js index 0edbc1cf9aa..2b3f34c789f 100644 --- a/tests/acceptance/stepDefinitions/generalContext.js +++ b/tests/acceptance/stepDefinitions/generalContext.js @@ -73,13 +73,20 @@ Given('the property {string} has been deleted in web config file', function (key }) Then( - 'the {word} message with header {string} should be displayed on the webUI', + 'the {string} message with header {string} should be displayed on the webUI', async function (type, message) { const text = await client.page.webPage().getDisplayedMessage(type, true) assert.strictEqual(text, message) - const element = type === 'error' ? '@errorMessage' : '@message' - return await client.page.webPage().waitForElementNotPresent(element) + const element = + type === 'error' + ? '@errorMessage' + : type === 'modal error' + ? '@modalErrorMessage' + : '@message' + if (type === 'error') { + return await client.page.webPage().waitForElementNotPresent(element) + } } ) diff --git a/tests/e2e/support/objects/app-files/resource/actions.ts b/tests/e2e/support/objects/app-files/resource/actions.ts index 65fc49a124c..b9d565ec386 100644 --- a/tests/e2e/support/objects/app-files/resource/actions.ts +++ b/tests/e2e/support/objects/app-files/resource/actions.ts @@ -19,7 +19,7 @@ const resourceUploadButton = '#upload-menu-btn' const fileUploadInput = '#files-file-upload-input' const uploadInfoCloseButton = '#close-upload-info-btn' const filesAction = `.oc-files-actions-%s-trigger` -const locationConfirmButton = '#location-picker-btn-confirm' +const clipboardBtns = '#clipboard-btns' const breadcrumbRoot = '//nav[contains(@class, "oc-breadcrumb")]/ol/li[1]/a' const fileRenameInput = '.oc-text-input' const deleteButton = 'button.oc-files-actions-delete-trigger' @@ -229,15 +229,7 @@ export const moveOrCopyResource = async (args: moveOrCopyResourceArgs): Promise< await clickResource({ page: page, path: newLocation }) } - await Promise.all([ - page.waitForResponse( - (resp) => - resp.url().endsWith(resourceBase) && - resp.status() === 201 && - resp.request().method() === action.toUpperCase() - ), - page.locator(locationConfirmButton).click() - ]) + await page.locator(clipboardBtns).first().click() await waitForResources({ page,