From 1a16d74b625ed87700be2e35390e480c10f5ab9a Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Mon, 17 Feb 2020 16:02:25 +0200 Subject: [PATCH] [ACA-2174][ACA-2173] Shared / Favorites - edit offline (#1341) * edit offline * try to fix test for viewer - password protected file * bug: Edit in Microsoft Office action is displayed in Shared Files for a locked file move Shared Files workaround down in the file to fix this * remove some workarounds, update some comments * remove other workarounds, make some tests independent, enable lock icon on Search results * forgotten change * remove another workaround Co-authored-by: Adina Parpalita --- e2e/components/data-table/data-table.ts | 13 ++ e2e/components/dialog/password-dialog.ts | 8 +- .../files-folders/shared-files.ts | 24 ++-- .../files-folders/test-data.ts | 82 +++-------- .../special-permissions/favorites.ts | 6 +- .../special-permissions/other-permissions.ts | 27 ++-- .../test-data-permissions.ts | 38 +++-- e2e/suites/actions/edit-offline.test.ts | 135 +++++++++--------- e2e/suites/actions/unshare-file.test.ts | 10 +- .../viewer/viewer-protected-file.test.ts | 16 +-- projects/aca-shared/rules/src/app.rules.ts | 7 +- .../src/lib/evaluators.ts | 26 ++-- .../favorites/favorites.component.html | 1 + .../search-results.component.html | 1 + .../shared-files/shared-files.component.html | 1 + 15 files changed, 180 insertions(+), 215 deletions(-) diff --git a/e2e/components/data-table/data-table.ts b/e2e/components/data-table/data-table.ts index d383f075d..054bb1c73 100755 --- a/e2e/components/data-table/data-table.ts +++ b/e2e/components/data-table/data-table.ts @@ -264,6 +264,19 @@ export class DataTable extends Component { } } + async unselectItem(name: string, location: string = ''): Promise { + const isSelected = await this.hasCheckMarkIcon(name, location); + if (isSelected) { + try { + const item = this.getRowFirstCell(name, location); + await item.click(); + + } catch (e) { + console.log('--- unselect item catch : ', e); + } + } + } + async clickItem(name: string, location: string = ''): Promise { const item = this.getRowFirstCell(name, location); await item.click(); diff --git a/e2e/components/dialog/password-dialog.ts b/e2e/components/dialog/password-dialog.ts index 440193b50..2ab7ce5e7 100755 --- a/e2e/components/dialog/password-dialog.ts +++ b/e2e/components/dialog/password-dialog.ts @@ -58,7 +58,13 @@ export class PasswordDialog extends Component { } async isDialogOpen() { - return browser.isElementPresent(by.css(PasswordDialog.selectors.root)); + try { + const dialog = await browser.wait(until.elementLocated(by.css(PasswordDialog.selectors.root)), BROWSER_WAIT_TIMEOUT, '------- timeout waiting for dialog') + return dialog.isDisplayed(); + } catch (error) { + return false; + } + } async getTitle() { diff --git a/e2e/suites/actions-available/files-folders/shared-files.ts b/e2e/suites/actions-available/files-folders/shared-files.ts index afcb4925e..aa94eee39 100755 --- a/e2e/suites/actions-available/files-folders/shared-files.ts +++ b/e2e/suites/actions-available/files-folders/shared-files.ts @@ -43,33 +43,33 @@ export function sharedFilesTests() { describe('single selection', () => { it('File Office, shared - [C297629]', async () => { - await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileDocxShared.name, testData.fileDocxShared.toolbarPrimary, testData.fileDocxShared.toolbarMore); + await testUtil.checkContextMenu(testData.fileDocxShared.name, testData.fileDocxShared.contextMenu); }); it('File Office, shared, favorite - [C280652]', async () => { - await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.toolbarMore); + await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.contextMenu); }); it('File shared - [C297630]', async () => { - await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileShared.name, testData.fileShared.toolbarPrimary, testData.fileShared.toolbarMore); + await testUtil.checkContextMenu(testData.fileShared.name, testData.fileShared.contextMenu); }); it('File shared, favorite - [C286273]', async () => { - await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.toolbarMore); + await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.contextMenu); }); it('File shared, locked - [C286274]', async () => { - await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileSharedLocked.name, testData.fileSharedLocked.toolbarPrimary, testData.fileSharedLocked.toolbarMore); + await testUtil.checkContextMenu(testData.fileSharedLocked.name, testData.fileSharedLocked.contextMenu); }); it('File shared, favorite, locked - [C286275]', async () => { - await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.sharedToolbarMore); - await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.sharedContextMenu); + await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.toolbarMore); + await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.contextMenu); }); }); diff --git a/e2e/suites/actions-available/files-folders/test-data.ts b/e2e/suites/actions-available/files-folders/test-data.ts index 2eb081344..10cb960af 100644 --- a/e2e/suites/actions-available/files-folders/test-data.ts +++ b/e2e/suites/actions-available/files-folders/test-data.ts @@ -64,18 +64,18 @@ const viewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favori // ---- FAVORITES workarounds ---- -// TODO: add Edit Offline when ACA-2174 is fixed -// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue -const favoritesSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; -// TODO: add Edit Offline when ACA-2174 is fixed -// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue +// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue const favoritesContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; -// TODO: add Edit Offline when ACA-2174 is fixed -// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue +// TODO: investigate why 'Permissions' is not displayed and raise issue +const favoritesLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; +// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue const favoritesToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; -// TODO: add Edit Offline when ACA-2174 is fixed -// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue +// TODO: investigate why 'Permissions' is not displayed and raise issue +const favoritesLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; +// TODO: investigate why 'Edit Offline', 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue const favoritesSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; +// TODO: investigate why 'Permissions' is not displayed and raise issue +const favoritesSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; // ---- SEARCH workarounds ---- @@ -107,26 +107,6 @@ const searchViewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version' const searchViewerDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; const searchViewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; -// ---- SHARED workarounds ---- - -// TODO: add Edit Offline to expectedContextMenu when ACA-2173 is fixed -const sharedFilesDocxContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed -const sharedFilesDocxToolbarMore = ['Edit in Microsoft Office™', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Edit Offline to expectedContextMenu when ACA-2173 is fixed -const sharedFilesDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed -const sharedFilesDocxSharedFavToolbarMore = ['Edit in Microsoft Office™', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Cancel Editing to expectedContextMenu when ACA-2173 is fixed -const sharedFilesSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Cancel Editing to expectedToolbarMore when ACA-2173 is fixed -const sharedFilesSharedToolbarMore = ['Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Edit Offline to expectedToolbarMore when ACA-2173 is fixed -const sharedFilesFavSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; -// TODO: add Cancel Editing to expectedToolbarMore when ACA-2173 is fixed -const sharedFilesSharedFavToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; - - export const fileDocx = { name: `file-docx-${Utils.random()}.docx`, @@ -211,10 +191,7 @@ export const fileDocxShared = { searchContextMenu: searchDocxSharedContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore: searchDocxToolbarMore, - searchViewerToolbarMore: searchViewerDocxToolbarMore, - - sharedContextMenu: sharedFilesDocxContextMenu, - sharedToolbarMore: sharedFilesDocxToolbarMore + searchViewerToolbarMore: searchViewerDocxToolbarMore }; export const fileDocxSharedFav = { @@ -228,16 +205,13 @@ export const fileDocxSharedFav = { viewerToolbarMore: viewerDocxFavToolbarMore, favoritesContextMenu: favoritesSharedContextMenu, - favoritesToolbarPrimary: favoritesSharedToolbarPrimary, + favoritesToolbarPrimary: fileSharedToolbarPrimary, favoritesToolbarMore, searchContextMenu: searchDocxSharedFavContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore: searchDocxFavToolbarMore, - searchViewerToolbarMore: searchViewerDocxFavToolbarMore, - - sharedContextMenu: sharedFilesDocxSharedFavContextMenu, - sharedToolbarMore: sharedFilesDocxSharedFavToolbarMore + searchViewerToolbarMore: searchViewerDocxFavToolbarMore }; export const fileShared = { @@ -253,10 +227,7 @@ export const fileShared = { searchContextMenu: searchSharedContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore, - searchViewerToolbarMore, - - sharedContextMenu: sharedFilesSharedContextMenu, - sharedToolbarMore: sharedFilesSharedToolbarMore + searchViewerToolbarMore }; export const fileSharedFav = { @@ -270,16 +241,13 @@ export const fileSharedFav = { viewerToolbarMore: viewerFavToolbarMore, favoritesContextMenu: favoritesSharedContextMenu, - favoritesToolbarPrimary: favoritesSharedToolbarPrimary, + favoritesToolbarPrimary: fileSharedToolbarPrimary, favoritesToolbarMore, searchContextMenu: searchSharedFavContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore: searchFavToolbarMore, - searchViewerToolbarMore: searchViewerFavToolbarMore, - - sharedContextMenu: sharedFilesFavSharedContextMenu, - sharedToolbarMore: sharedFilesSharedFavToolbarMore + searchViewerToolbarMore: searchViewerFavToolbarMore }; export const fileLocked = { @@ -308,8 +276,8 @@ export const fileFavLocked = { viewerToolbarPrimary, viewerToolbarMore: viewerFavLockedToolbarMore, - favoritesContextMenu, - favoritesToolbarMore, + favoritesContextMenu: favoritesLockedContextMenu, + favoritesToolbarMore: favoritesLockedToolbarMore, searchContextMenu: searchFavLockedContextMenu, searchToolbarPrimary, @@ -330,10 +298,7 @@ export const fileSharedLocked = { searchContextMenu: searchSharedLockedContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore: searchLockedToolbarMore, - searchViewerToolbarMore: searchViewerLockedToolbarMore, - - sharedContextMenu: sharedFilesSharedContextMenu, - sharedToolbarMore: sharedFilesSharedToolbarMore + searchViewerToolbarMore: searchViewerLockedToolbarMore }; export const fileSharedFavLocked = { @@ -346,17 +311,14 @@ export const fileSharedFavLocked = { viewerToolbarPrimary: viewerSharedToolbarPrimary, viewerToolbarMore: viewerFavLockedToolbarMore, - favoritesContextMenu: favoritesSharedContextMenu, - favoritesToolbarPrimary: favoritesSharedToolbarPrimary, - favoritesToolbarMore, + favoritesToolbarMore: favoritesLockedToolbarMore, + favoritesContextMenu: favoritesSharedLockedContextMenu, + favoritesToolbarPrimary: fileSharedToolbarPrimary, searchContextMenu: searchSharedFavLockedContextMenu, searchToolbarPrimary: searchSharedToolbarPrimary, searchToolbarMore: searchFavLockedToolbarMore, - searchViewerToolbarMore: searchViewerFavLockedToolbarMore, - - sharedContextMenu: sharedFilesFavSharedContextMenu, - sharedToolbarMore: sharedFilesSharedFavToolbarMore + searchViewerToolbarMore: searchViewerFavLockedToolbarMore }; export const fileInTrash = { diff --git a/e2e/suites/actions-available/special-permissions/favorites.ts b/e2e/suites/actions-available/special-permissions/favorites.ts index f0ca7949c..1e39fc052 100755 --- a/e2e/suites/actions-available/special-permissions/favorites.ts +++ b/e2e/suites/actions-available/special-permissions/favorites.ts @@ -58,12 +58,12 @@ export function favoritesTests() { }); it('File Office, shared, favorite - [C279187]', async () => { - await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesToolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore); + await testUtil.checkToolbarActions(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.toolbarPrimary, testData.fileDocxSharedFav.favoritesToolbarMore); await testUtil.checkContextMenu(testData.fileDocxSharedFav.name, testData.fileDocxSharedFav.favoritesContextMenu); }); it('File shared, favorite - [C280053]', async () => { - await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.favoritesToolbarPrimary, testData.fileSharedFav.favoritesToolbarMore); + await testUtil.checkToolbarActions(testData.fileSharedFav.name, testData.fileSharedFav.toolbarPrimary, testData.fileSharedFav.favoritesToolbarMore); await testUtil.checkContextMenu(testData.fileSharedFav.name, testData.fileSharedFav.favoritesContextMenu); }); @@ -73,7 +73,7 @@ export function favoritesTests() { }); it('File shared, favorite, locked - [C325011]', async () => { - await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesToolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore); + await testUtil.checkToolbarActions(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.toolbarPrimary, testData.fileSharedFavLocked.favoritesToolbarMore); await testUtil.checkContextMenu(testData.fileSharedFavLocked.name, testData.fileSharedFavLocked.favoritesContextMenu); }); diff --git a/e2e/suites/actions-available/special-permissions/other-permissions.ts b/e2e/suites/actions-available/special-permissions/other-permissions.ts index 55dce7b30..9f8ae1f76 100755 --- a/e2e/suites/actions-available/special-permissions/other-permissions.ts +++ b/e2e/suites/actions-available/special-permissions/other-permissions.ts @@ -59,8 +59,7 @@ export function collaboratorTests(siteName?: string) { await page.clickSharedFilesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Edit Offline' when ACA-2173 is done - const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; + const expectedToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore); }); @@ -69,9 +68,8 @@ export function collaboratorTests(siteName?: string) { await page.clickFavoritesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Edit Offline' when ACA-2174 is done - // TODO: remove 'Delete' when ACA-1737 is done - // TODO: remove 'Move' when ACA-1737 is done + // TODO: investigate why 'Edit Offline' is not displayed and raise issue + // TODO: remove 'Move' and 'Delete' when ACA-1737 is done const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; await testUtil.checkToolbarActions(testData.fileSharedFav.name, expectedToolbarPrimary, expectedToolbarMore); @@ -156,8 +154,7 @@ export function filesLockedByCurrentUser(siteName?: string) { await page.clickSharedFilesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Cancel Editing' when ACA-2173 is done - const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; + const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore); }); @@ -166,10 +163,8 @@ export function filesLockedByCurrentUser(siteName?: string) { await page.clickFavoritesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Cancel Editing' when ACA-2174 is fixed - // TODO: remove 'Move' when ACA-1737 is fixed - // TODO: remove 'Delete' when ACA-1737 is fixed - const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; + // TODO: remove 'Move' and 'Delete' when ACA-1737 is fixed + const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore); }); @@ -255,9 +250,8 @@ export function filesLockedByOtherUser(siteName?: string) { await page.clickSharedFilesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Cancel Editing' when ACA-2173 is done - // TODO: remove 'Upload New Version' when ACA-2173 is done - const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; + // TODO: investigate why 'Upload New Version' appears and raise issue + const expectedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; await testUtil.checkToolbarActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore); }); @@ -266,7 +260,7 @@ export function filesLockedByOtherUser(siteName?: string) { await page.clickFavoritesAndWait(); const expectedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; - // TODO: add 'Cancel Editing' when ACA-2174 is fixed + // TODO: investigate why 'Cancel Editing' doesn't appear and raise issue // TODO: remove 'Upload New Version' when ACA-1737 is done const expectedToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; @@ -320,8 +314,7 @@ export function filesLockedByOtherUser(siteName?: string) { await searchResultsPage.waitForResults(); const expectedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions']; - // TODO: add 'Move' when ACA-2319 is fixed - // TODO: add 'Delete' when ACA-2319 is fixed + // TODO: add 'Move' and 'Delete' when ACA-2319 is fixed const expectedToolbarMore = ['Cancel Editing', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; await testUtil.checkViewerActions(testData.fileLockedByUser, expectedToolbarPrimary, expectedToolbarMore); diff --git a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts index 6aec85a2d..3df083069 100644 --- a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts +++ b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts @@ -52,27 +52,38 @@ const consumerViewerToolbarMore = ['Favorite', 'Copy', 'Manage Versions']; // ---- FAVORITES workarounds ---- // TODO: remove 'Move' and 'Delete' when ACA-1737 is done -// TODO: remove 'Upload New Version' when ACA-2175 is done +// TODO: investigate why 'Upload New Version' appears and raise issue const favoritesConsumerToolbarMore = ['Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; // TODO: remove 'Move' and 'Delete' when ACA-1737 is done -// TODO: remove 'Upload New Version' when ACA-2175 is done +// TODO: investigate why 'Upload New Version' appears and raise issue const favoritesConsumerContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; // TODO: remove 'Move' and 'Delete' when ACA-1737 is done -// TODO: remove 'Upload New Version' when ACA-2175 is done +// TODO: investigate why 'Upload New Version' appears and raise issue const favoritesConsumerSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; -const favoritesConsumerSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; // ---- SHARED FILES workaround ---- -// TODO: remove 'Upload New Version' when ACA-2173 is done +// TODO: investigate why 'Upload New Version' appears and raise issue const sharedConsumerToolbarMore = ['Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; -// TODO: remove 'Upload New Version' when ACA-2173 is done +// TODO: investigate why 'Cancel Editing' appears and raise issue +// TODO: investigate why 'Upload New Version' appears and raise issue +const sharedConsumerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; +// TODO: investigate why 'Upload New Version' appears and raise issue const sharedConsumerFavToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; -// TODO: remove 'Upload New Version' when ACA-2173 is done +// TODO: investigate why 'Cancel Editing' appears and raise issue +// TODO: investigate why 'Upload New Version' appears and raise issue +const sharedConsumerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; +// TODO: investigate why 'Upload New Version' appears and raise issue const sharedConsumerContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; -// TODO: remove 'Upload New Version' when ACA-2173 is done +// TODO: investigate why 'Cancel Editing' appears and raise issue +// TODO: investigate why 'Upload New Version' appears and raise issue +const sharedConsumerLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; +// TODO: investigate why 'Upload New Version' appears and raise issue const sharedConsumerFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; +// TODO: investigate why 'Cancel Editing' appears and raise issue +// TODO: investigate why 'Upload New Version' appears and raise issue +const sharedConsumerFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; export const fileDocx = { @@ -161,7 +172,6 @@ export const fileDocxSharedFav = { favoritesToolbarMore: favoritesConsumerToolbarMore, favoritesContextMenu: favoritesConsumerSharedContextMenu, - favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, sharedToolbarMore: sharedConsumerFavToolbarMore, sharedContextMenu: sharedConsumerFavContextMenu, @@ -197,7 +207,6 @@ export const fileSharedFav = { favoritesToolbarMore: favoritesConsumerToolbarMore, favoritesContextMenu: favoritesConsumerSharedContextMenu, - favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, sharedToolbarMore: sharedConsumerFavToolbarMore, sharedContextMenu: sharedConsumerFavContextMenu, @@ -244,8 +253,8 @@ export const fileSharedLocked = { viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, viewerToolbarMore: consumerViewerToolbarMore, - sharedToolbarMore: sharedConsumerToolbarMore, - sharedContextMenu: sharedConsumerContextMenu, + sharedToolbarMore: sharedConsumerLockedToolbarMore, + sharedContextMenu: sharedConsumerLockedContextMenu, searchToolbarPrimary: searchConsumerSharedToolbarPrimary }; @@ -262,10 +271,9 @@ export const fileSharedFavLocked = { favoritesToolbarMore: favoritesConsumerToolbarMore, favoritesContextMenu: favoritesConsumerSharedContextMenu, - favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, - sharedToolbarMore: sharedConsumerFavToolbarMore, - sharedContextMenu: sharedConsumerFavContextMenu, + sharedToolbarMore: sharedConsumerFavLockedToolbarMore, + sharedContextMenu: sharedConsumerFavLockedContextMenu, searchToolbarPrimary: searchConsumerSharedToolbarPrimary }; diff --git a/e2e/suites/actions/edit-offline.test.ts b/e2e/suites/actions/edit-offline.test.ts index 0ef7f2cfd..80f3dd45e 100755 --- a/e2e/suites/actions/edit-offline.test.ts +++ b/e2e/suites/actions/edit-offline.test.ts @@ -55,29 +55,14 @@ describe('Edit offline', () => { const { dataTable, toolbar } = page; const { searchInput } = page.header; - beforeAll(async (done) => { + beforeAll(async () => { await apis.admin.people.createUser({ username }); - - parentPFId = (await apis.user.nodes.createFolder(parentPF)).entry.id; - parentSFId = (await apis.user.nodes.createFolder(parentSF)).entry.id; - parentRFId = (await apis.user.nodes.createFolder(parentRF)).entry.id; - parentFavId = (await apis.user.nodes.createFolder(parentFav)).entry.id; - parentSearchId = (await apis.user.nodes.createFolder(parentSearch)).entry.id; - - done(); - }); - - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(parentPFId); - await apis.user.nodes.deleteNodeById(parentSFId); - await apis.user.nodes.deleteNodeById(parentRFId); - await apis.user.nodes.deleteNodeById(parentFavId); - await apis.user.nodes.deleteNodeById(parentSearchId); - done(); }); describe('on Personal Files', () => { - beforeAll(async (done) => { + beforeAll(async () => { + parentPFId = (await apis.user.nodes.createFolder(parentPF)).entry.id; + file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, file1)).entry.id; fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, fileLocked)).entry.id; fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentPFId, fileLocked2)).entry.id; @@ -86,18 +71,19 @@ describe('Edit offline', () => { await apis.user.nodes.lockFile(fileLocked2Id); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + beforeEach(async () => { await page.clickPersonalFilesAndWait(); await dataTable.doubleClickOnRowByName(parentPF); - done(); }); - afterEach(async (done) => { + afterEach(async () => { await Utils.pressEscape(); - done(); + }); + + afterAll(async () => { + await apis.user.nodes.deleteNodeById(parentPFId); }); it('File is locked and downloaded when clicking Edit Offline - [C297538]', async () => { @@ -117,16 +103,17 @@ describe('Edit offline', () => { it('Cancel Editing unlocks the file - [C297540]', async () => { await dataTable.selectItem(fileLocked); await toolbar.clickMoreActionsCancelEditing(); - await dataTable.clearSelection(); + await dataTable.unselectItem(fileLocked); expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`); }); }); - // TODO: enable tests when ACA-2173 is done - xdescribe('on Shared Files', () => { - beforeAll(async (done) => { + describe('on Shared Files', () => { + beforeAll(async () => { + parentSFId = (await apis.user.nodes.createFolder(parentSF)).entry.id; + file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, file1)).entry.id; fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked)).entry.id; fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSFId, fileLocked2)).entry.id; @@ -138,20 +125,21 @@ describe('Edit offline', () => { await apis.user.shared.waitForApi({ expect: 3 }); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + afterAll(async () => { + await apis.user.nodes.deleteNodeById(parentSFId); + }); + + beforeEach(async () => { await page.clickSharedFilesAndWait(); - done(); }); - afterEach(async (done) => { + afterEach(async () => { await Utils.pressEscape(); - done(); }); - xit('File is locked and downloaded when clicking Edit Offline - [C306950]', async () => { + it('File is locked and downloaded when clicking Edit Offline - [C306950]', async () => { await dataTable.selectItem(file1, parentSF); await toolbar.clickMoreActionsEditOffline(); @@ -159,16 +147,16 @@ describe('Edit offline', () => { expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); }); - xit('Lock information is displayed - [C306951]', async () => { + it('Lock information is displayed - [C306951]', async () => { expect(await dataTable.isItemPresent(fileLocked2, parentSF)).toBe(true, `${fileLocked2} is not displayed`); expect(await dataTable.hasLockIcon(fileLocked2, parentSF)).toBe(true, `${fileLocked2} does not have a lock icon`); expect(await dataTable.getLockOwner(fileLocked2, parentSF)).toContain(username, `${fileLocked2} does not have correct lock owner info`); }); - xit('Cancel Editing unlocks the file - [C306952]', async () => { + it('Cancel Editing unlocks the file - [C306952]', async () => { await dataTable.selectItem(fileLocked); await toolbar.clickMoreActionsCancelEditing(); - await dataTable.clearSelection(); + await dataTable.unselectItem(fileLocked); expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); expect(await dataTable.hasLockIcon(fileLocked, parentSF)).toBe(false, `${fileLocked} has a lock icon`); @@ -176,7 +164,11 @@ describe('Edit offline', () => { }); describe('on Recent Files', () => { - beforeAll(async (done) => { + beforeAll(async () => { + parentRFId = (await apis.user.nodes.createFolder(parentRF)).entry.id; + + await apis.user.search.waitForApi(username, { expect: 0 }); + file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, file1)).entry.id; fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked)).entry.id; fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentRFId, fileLocked2)).entry.id; @@ -184,20 +176,21 @@ describe('Edit offline', () => { await apis.user.nodes.lockFile(fileLockedId); await apis.user.nodes.lockFile(fileLocked2Id); - await apis.user.search.waitForApi(username, { expect: 6 }); + await apis.user.search.waitForApi(username, { expect: 3 }); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + afterAll(async () => { + await apis.user.nodes.deleteNodeById(parentRFId); + }); + + beforeEach(async () => { await page.clickRecentFilesAndWait(); - done(); }); - afterEach(async (done) => { + afterEach(async () => { await Utils.pressEscape(); - done(); }); it('File is locked and downloaded when clicking Edit Offline - [C297541]', async () => { @@ -217,16 +210,17 @@ describe('Edit offline', () => { it('Cancel Editing unlocks the file - [C297543]', async () => { await dataTable.selectItem(fileLocked, parentRF); await toolbar.clickMoreActionsCancelEditing(); - await dataTable.clearSelection(); + await dataTable.unselectItem(fileLocked, parentRF); expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); expect(await dataTable.hasLockIcon(fileLocked, parentRF)).toBe(false, `${fileLocked} has a lock icon`); }); }); - // TODO: enable tests when ACA-2174 is done - xdescribe('on Favorite Files', () => { - beforeAll(async (done) => { + describe('on Favorite Files', () => { + beforeAll(async () => { + parentFavId = (await apis.user.nodes.createFolder(parentFav)).entry.id; + file1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, file1)).entry.id; fileLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked)).entry.id; fileLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentFavId, fileLocked2)).entry.id; @@ -238,19 +232,21 @@ describe('Edit offline', () => { await apis.user.favorites.waitForApi({ expect: 3 }); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + afterAll(async () => { + await apis.user.nodes.deleteNodeById(parentFavId); + }); + + beforeEach(async () => { await page.clickFavoritesAndWait(); - done(); }); - afterEach(async (done) => { + afterEach(async () => { await Utils.pressEscape(); - done(); }); + // TODO: raise REPO issue: permissions not returned in /people/${personId}/favorites api xit('File is locked and downloaded when clicking Edit Offline - [C306956]', async () => { await dataTable.selectItem(file1); await toolbar.clickMoreActionsEditOffline(); @@ -259,16 +255,16 @@ describe('Edit offline', () => { expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); }); - xit('Lock information is displayed - [C306957]', async () => { + it('Lock information is displayed - [C306957]', async () => { expect(await dataTable.isItemPresent(fileLocked2)).toBe(true, `${fileLocked2} is not displayed`); expect(await dataTable.hasLockIcon(fileLocked2)).toBe(true, `${fileLocked2} does not have a lock icon`); expect(await dataTable.getLockOwner(fileLocked2)).toContain(username, `${fileLocked2} does not have correct lock owner info`); }); - xit('Cancel Editing unlocks the file - [C306958]', async () => { + it('Cancel Editing unlocks the file - [C306958]', async () => { await dataTable.selectItem(fileLocked); await toolbar.clickMoreActionsCancelEditing(); - await dataTable.clearSelection(); + await dataTable.unselectItem(fileLocked); expect(await apis.user.nodes.isFileLockedWrite(fileLockedId)).toBe(false, `${fileLocked} is still locked`); expect(await dataTable.hasLockIcon(fileLocked)).toBe(false, `${fileLocked} has a lock icon`); @@ -276,7 +272,9 @@ describe('Edit offline', () => { }); describe('on Search Results', () => { - beforeAll(async (done) => { + beforeAll(async () => { + parentSearchId = (await apis.user.nodes.createFolder(parentSearch)).entry.id; + fileSearch1Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearch1)).entry.id; fileSearchLockedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked)).entry.id; fileSearchLocked2Id = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentSearchId, fileSearchLocked2)).entry.id; @@ -287,21 +285,21 @@ describe('Edit offline', () => { await apis.user.search.waitForNodes('file-search', { expect: 3 }); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + afterAll(async () => { + await apis.user.nodes.deleteNodeById(parentSearchId); + }); + + beforeEach(async () => { await page.clickPersonalFilesAndWait(); await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); await searchInput.searchFor('file-search'); await dataTable.waitForBody(); - done(); }); - afterEach(async (done) => { + afterEach(async () => { await Utils.pressEscape(); - done(); }); it('File is locked and downloaded when clicking Edit Offline - [C306953]', async () => { @@ -312,21 +310,20 @@ describe('Edit offline', () => { expect(await apis.user.nodes.isFileLockedWrite(fileSearch1Id)).toBe(true, `${fileSearch1} is not locked`); }); - // TODO: enable when ACA-2314 is fixed - xit('Lock information is displayed - [C306954]', async () => { + it('Lock information is displayed - [C306954]', async () => { expect(await dataTable.isItemPresent(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} is not displayed`); expect(await dataTable.hasLockIcon(fileSearchLocked2, parentSearch)).toBe(true, `${fileSearchLocked2} does not have a lock icon`); - expect(await dataTable.getLockOwner(fileSearchLocked2, parentSearch)).toContain(username, `${fileSearchLocked2} does not have correct lock owner info`); + // TODO: enable when ACA-2314 is fixed + // expect(await dataTable.getLockOwner(fileSearchLocked2, parentSearch)).toContain(username, `${fileSearchLocked2} does not have correct lock owner info`); }); it('Cancel Editing unlocks the file - [C306955]', async () => { await dataTable.selectItem(fileSearchLocked); await toolbar.clickMoreActionsCancelEditing(); - await dataTable.clearSelection(); + await dataTable.unselectItem(fileSearchLocked); expect(await apis.user.nodes.isFileLockedWrite(fileSearchLockedId)).toBe(false, `${fileSearchLocked} is still locked`); - // TODO: enable when ACA-2314 is fixed - // expect(await dataTable.hasLockIcon(fileSearchLocked, parentSearch)).toBe(false, `${fileSearchLocked} has a lock icon`); + expect(await dataTable.hasLockIcon(fileSearchLocked, parentSearch)).toBe(false, `${fileSearchLocked} has a lock icon`); }); }); }); diff --git a/e2e/suites/actions/unshare-file.test.ts b/e2e/suites/actions/unshare-file.test.ts index 6ea5be057..aee35f584 100755 --- a/e2e/suites/actions/unshare-file.test.ts +++ b/e2e/suites/actions/unshare-file.test.ts @@ -479,9 +479,6 @@ describe('Unshare a file', () => { expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`); - // TODO: disable check cause api is slow to update - // expect(await dataTable.isItemPresent(file2)).toBe(false, `${file2} is in the Shared files list`); - await browser.get(url); expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); expect(await viewer.getFileTitle()).not.toEqual(file2); @@ -519,9 +516,6 @@ describe('Unshare a file', () => { expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`); - // TODO: disable check cause api is slow to update - // expect(await dataTable.isItemPresent(file4)).toBe(false, `${file4} is in the Shared files list`); - await browser.get(url); expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); expect(await viewer.getFileTitle()).not.toEqual(file4); @@ -631,9 +625,7 @@ describe('Unshare a file', () => { it('Unshare a file from the context menu - [C286698]', async () => { await dataTable.rightClickOnItem(file4); - // TODO: remove workaround for favorites - // await toolbar.clickSharedLinkSettings(); - await contextMenu.clickShare(); + await contextMenu.clickSharedLinkSettings(); await shareDialog.waitForDialogToOpen(); const url = await shareDialog.getLinkUrl(); await shareDialog.clickShareToggle(); diff --git a/e2e/suites/viewer/viewer-protected-file.test.ts b/e2e/suites/viewer/viewer-protected-file.test.ts index 28d3a32aa..a7e1863ac 100755 --- a/e2e/suites/viewer/viewer-protected-file.test.ts +++ b/e2e/suites/viewer/viewer-protected-file.test.ts @@ -48,16 +48,15 @@ describe('Viewer - password protected file', () => { const viewer = new Viewer(); const passwordDialog = new PasswordDialog(); - beforeAll(async (done) => { + beforeAll(async () => { await apis.admin.people.createUser({ username }); parentId = (await apis.user.nodes.createFolder(parent)).entry.id; await apis.user.upload.uploadFile(protectedFile.name, parentId); await loginPage.loginWith(username); - done(); }); - beforeEach(async (done) => { + beforeEach(async () => { await page.header.expandSideNav(); await page.clickPersonalFilesAndWait(); await dataTable.doubleClickOnRowByName(parent); @@ -65,20 +64,15 @@ describe('Viewer - password protected file', () => { await dataTable.doubleClickOnRowByName(protectedFile.name); await viewer.waitForViewerToOpen(); await page.waitForDialog(); - done(); }); - afterEach(async (done) => { - if (await passwordDialog.isDialogOpen()) { - await passwordDialog.clickClose(); - } + afterEach(async () => { + await page.closeOpenDialogs(); await Utils.pressEscape(); - done(); }); - afterAll(async (done) => { + afterAll(async () => { await apis.user.nodes.deleteNodeById(parentId); - done(); }); it('Password dialog appears when opening a protected file - [C268958]', async () => { diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts index 027e0cd90..11381309e 100644 --- a/projects/aca-shared/rules/src/app.rules.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -152,7 +152,7 @@ export function canDeleteSelection(context: RuleContext): boolean { return false; } - // temp workaround for Search api + // temp workaround for Favorites api if (navigation.isFavorites(context)) { return true; } @@ -391,7 +391,7 @@ export function canLockFile(context: RuleContext): boolean { /** * Checks if user can unlock selected file. - * JSON ref: `app.selection.file.canLock` + * JSON ref: `app.selection.file.canUnlock` */ export function canUnlockFile(context: RuleContext): boolean { const { file } = context.selection; @@ -508,9 +508,6 @@ export function canToggleEditOffline(context: RuleContext): boolean { return [ hasFileSelected(context), navigation.isNotTrashcan(context), - navigation.isNotFavorites(context) || - navigation.isFavoritesPreview(context), - navigation.isNotSharedFiles(context) || navigation.isSharedPreview(context), canLockFile(context) || canUnlockFile(context) ].every(Boolean); } diff --git a/projects/adf-office-services-ext/src/lib/evaluators.ts b/projects/adf-office-services-ext/src/lib/evaluators.ts index 535a26dd7..18c626143 100644 --- a/projects/adf-office-services-ext/src/lib/evaluators.ts +++ b/projects/adf-office-services-ext/src/lib/evaluators.ts @@ -53,19 +53,6 @@ export function canOpenWithOffice( return false; } - // workaround for Shared files - if ( - context.navigation && - context.navigation.url && - context.navigation.url.startsWith('/shared') - ) { - if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) { - return context.permissions.check(file, ['update'], { - target: 'allowableOperationsOnTarget' - }); - } - } - if (!file.entry.properties) { return false; } @@ -107,5 +94,18 @@ export function canOpenWithOffice( return false; } + // workaround for Shared files + if ( + context.navigation && + context.navigation.url && + context.navigation.url.startsWith('/shared') + ) { + if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) { + return context.permissions.check(file, ['update'], { + target: 'allowableOperationsOnTarget' + }); + } + } + return context.permissions.check(file, ['update']); } diff --git a/src/app/components/favorites/favorites.component.html b/src/app/components/favorites/favorites.component.html index 27148c698..009cb074f 100644 --- a/src/app/components/favorites/favorites.component.html +++ b/src/app/components/favorites/favorites.component.html @@ -20,6 +20,7 @@ selectionMode="multiple" [navigate]="false" [sorting]="['modifiedAt', 'desc']" + [imageResolver]="imageResolver" (node-dblclick)="onNodeDoubleClick($event.detail?.node)" (name-click)="onNodeDoubleClick($event.detail?.node)" > diff --git a/src/app/components/search/search-results/search-results.component.html b/src/app/components/search/search-results/search-results.component.html index 01befdeb4..af905470b 100644 --- a/src/app/components/search/search-results/search-results.component.html +++ b/src/app/components/search/search-results/search-results.component.html @@ -69,6 +69,7 @@ [selectionMode]="'multiple'" [sortingMode]="'server'" [sorting]="sorting" + [imageResolver]="imageResolver" [node]="data" (node-dblclick)="onNodeDoubleClick($event.detail?.node)" > diff --git a/src/app/components/shared-files/shared-files.component.html b/src/app/components/shared-files/shared-files.component.html index 3ee06f402..d70a9e4b1 100644 --- a/src/app/components/shared-files/shared-files.component.html +++ b/src/app/components/shared-files/shared-files.component.html @@ -19,6 +19,7 @@ currentFolderId="-sharedlinks-" selectionMode="multiple" [sorting]="['modifiedAt', 'desc']" + [imageResolver]="imageResolver" (node-dblclick)="preview($event.detail?.node)" (name-click)="preview($event.detail?.node)" >