diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..dc0e090d57 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,38 @@ +# This is a comment. +# Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# these users will be requested for +# review when someone opens a pull request. +* @DenysVuika @pionnegru + +# Order is important; the last matching pattern takes the most +# precedence. When someone opens a pull request that only +# modifies JS files, only @js-owner and not the global +# owner(s) will be requested for a review. +e2e/* @adinapitul @pionnegru @DenysVuika +protractor.conf.js @adinapitul + +# You can also use email addresses if you prefer. They'll be +# used to look up users just like we do for commit author +# emails. +#*.go docs@example.com + +# In this example, @doctocat owns any files in the build/logs +# directory at the root of the repository and any of its +# subdirectories. +#/build/logs/ @doctocat + +# The `docs/*` pattern will match files like +# `docs/getting-started.md` but not further nested files like +# `docs/build-app/troubleshooting.md`. +#docs/* docs@example.com + +# In this example, @octocat owns any file in an apps directory +# anywhere in your repository. +#apps/ @octocat + +# In this example, @doctocat owns any file in the `/docs` +# directory in the root of your repository. +#/docs/ @doctocat diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5ccd541087..946326776e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,44 +1,12 @@ -## PR Checklist -Please check if your PR fulfills the following requirements: +## Definition of Done -``` -- [ ] The commit message follows our guidelines: https://github.com/Alfresco/alfresco-content-app/blob/master/CONTRIBUTING.md#commit -- [ ] Tests for the changes have been added (for bug fixes / features) -- [ ] Docs have been added / updated (for bug fixes / features) -``` +- Technical Documentation +- Code compliant with Clean Coding rules and tslint +- Unit tests +- Automation tests -## PR Type -What kind of change does this PR introduce? - - -``` -[ ] Bugfix -[ ] Feature -[ ] Code style update (formatting, local variables) -[ ] Refactoring (no functional changes, no api changes) -[ ] Build related changes -[ ] CI related changes -[ ] Documentation content changes -[ ] Application / Infrastructure changes -[ ] Other... Please describe: -``` - -## What is the current behavior? - +## Current behavior Issue Number: N/A - -## What is the new behavior? - - -## Does this PR introduce a breaking change? -``` -[ ] Yes -[ ] No -``` - - - - -## Other information +## New behavior diff --git a/.github/plint.yml b/.github/plint.yml index 1a9de3c5c0..15cb0cb6ff 100644 --- a/.github/plint.yml +++ b/.github/plint.yml @@ -1,2 +1,25 @@ modules: - pr.prettier + - pr.spellcheck + +prettier: + options: + singleQuote: true + exclude: + - '*.json' + +spellcheck: + dictionaries: + - softwareTerms + - html + - en-gb + - en_US + words: + - plint + - ngrx + - qshare + - snackbar + - exif + - docx + exclude: + - src/assets/app.extensions.json diff --git a/.travis.yml b/.travis.yml index 76225ff54b..a768059ad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,27 +7,41 @@ addons: language: node_js node_js: - '10' -before_script: - - sudo /etc/init.d/postgresql stop + +cache: + directories: + - node_modules + before_install: + - sudo /etc/init.d/postgresql stop - npm install -g npm@latest - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 + +stages: + - name: Quality and Unit tests + - name: e2e + jobs: include: - - stage: test + - stage: Quality and Unit tests name: 'Code quality checks' - script: - - npm run lint - - stage: test - name: 'Unit tests' + script: npm run lint + - name: 'Unit tests' script: - npm run test:ci - bash <(curl -s https://codecov.io/bash) -X gcov - stage: e2e - name: 'Nginx' - script: npm run build.e2e && npm run e2e:docker - - stage: e2e - name: 'Tomcat' - script: npm run build.tomcat.e2e && npm run docker.tomcat.e2e + name: Test Suite appNavigation&search + script: npm run build.e2e && SUITE="--suite authentication,listViews,navigation,application,pagination,search" npm run e2e:docker + - name: Test Suite actionsAvailable + script: npm run build.e2e && SUITE="--suite actionsAvailable" npm run e2e:docker + - name: Test Suite addRemoveContent + script: npm run build.e2e && SUITE="--suite addRemoveContent" npm run e2e:docker + - name: Test Suite manageContent + script: npm run build.e2e && SUITE="--suite manageContent" npm run e2e:docker + - name: Test Suite sharingContent&markFavorite + script: npm run build.e2e && SUITE="--suite sharingContent" npm run e2e:docker + - name: Test Suite viewContent&metadata&extensions + script: npm run build.e2e && SUITE="--suite viewer,infoDrawer,extensions" npm run e2e:docker diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a398c3a8a4..3a7af4412e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,9 @@ { "recommendations": [ - "eg2.tslint", + "ms-vscode.vscode-typescript-tslint-plugin", "angular.ng-template", "streetsidesoftware.code-spell-checker", - "peterjausovec.vscode-docker", + "ms-azuretools.vscode-docker", "editorconfig.editorconfig", "davidanson.vscode-markdownlint", "esbenp.prettier-vscode", diff --git a/README.md b/README.md index 30425e4158..095b75fdad 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Alfresco - make business flow

+

Alfresco - Simply a better way to create amazing digital experiences

# Alfresco Content Application @@ -32,25 +32,23 @@ Please include a clear description, steps to reproduce and screenshots where app #### Features added in the latest release -- Edit Offline - lock and download files whilst editing -- Edit Online - edit files directly in Microsoft Office -- [Alfresco Full Text Search (FTS) syntax](https://alfresco-content-app.netlify.com/#/features/search-results?id=alfresco-full-text-search) - enhanced search input to support the Alfresco Search Query Language -- [Single Sign-On](https://alfresco-content-app.netlify.com/#/getting-started/sso) (SSO) support with Alfresco Identity Service and ADF 3.0.0, basic Kerberos support +- New language translations (Arabic, Czech, Danish, Finnish, Polish and Swedish) +- Automatic display of metadata aspects and properties +- Search result facet improvements +- Various extensibility improvements and enhancements Please refer to the [release notes] for details of all changes. #### High level feature themes planned for 2019 + - Extensibility - Building on the existing framework to further enhance the developer experience - Collaboration & File Management - Folder rule creation - File/Folder linking via secondary association - File Library Management - - For managers: manage Library users and requests to join - Enhanced UI and user experience - - New language translations (Arabic, Czech, Danish, Finnish, Polish and Swedish). - Accessibility WCAG AA compliance - - Search result facet improvements - Search query input assistance - Metadata information drawer enhancements @@ -63,6 +61,7 @@ Read up on our guidelines for [contributing] and then check out one of our issue | ACA Version | Built with | Tested on | | ----------- | ---------- | --------- | +| ACA 1.8 | ADF 3.3.0 | ACS 6.1 | | ACA 1.7 | ADF 3.0.0 | ACS 6.1 | | ACA 1.6 | ADF 2.6.1 | ACS 6.1 | | ACA 1.5 | ADF 2.6.0 | ACS 6.0 | @@ -95,7 +94,11 @@ Read up on our guidelines for [contributing] and then check out one of our issue | 1.7 | Edit Offline | Lock and unlock for editing, download current version, upload new version. | | 1.7 | Edit with Microsoft Office | Extension to edit online with Alfresco Office Services (AOS) | | 1.7 | Single Sign-On (SSO) | Support for Alfresco Identity Service, with ADF 3.0.0 | -| 1.7 | Search Query Language | Enhanced search input using the Alfresco Search Query Language | +| 1.7 | Search Query Language | Enhanced search input using the Alfresco Search Query Language | +| 1.8 | Localizations . | Arabic, Czech, Danish, Finnish, Polish and Swedish | +| 1.8 | Metadata improvements | Automatic display of aspects and properties | +| 1.8 | Search facet improvements | Facet intervals and grouped facet queries | +| 1.8 | Extensibility improvements | Various - see [release notes](https://github.com/Alfresco/alfresco-content-app/releases) for details | [contributing]: https://github.com/Alfresco/alfresco-content-app/blob/master/CONTRIBUTING.md [github]: https://github.com/Alfresco/alfresco-content-app/issues diff --git a/alfresco.png b/alfresco.png index fc2bcdeccb..ad238ea357 100644 Binary files a/alfresco.png and b/alfresco.png differ diff --git a/angular.json b/angular.json index a2dafd68db..2528404c91 100644 --- a/angular.json +++ b/angular.json @@ -22,6 +22,11 @@ ] }, "assets": [ + { + "glob": "LICENSE", + "input": ".", + "output": "/" + }, "src/assets", "src/favicon-96x96.png", "src/app.config.json", @@ -273,6 +278,41 @@ } } } + }, + "aca-shared": { + "root": "projects/aca-shared", + "sourceRoot": "projects/aca-shared/src", + "projectType": "library", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-ng-packagr:build", + "options": { + "tsConfig": "projects/aca-shared/tsconfig.lib.json", + "project": "projects/aca-shared/ng-package.json" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "projects/aca-shared/test.ts", + "tsConfig": "projects/aca-shared/tsconfig.spec.json", + "karmaConfig": "projects/aca-shared/karma.conf.js" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "projects/aca-shared/tsconfig.lib.json", + "projects/aca-shared/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } } }, "defaultProject": "app", diff --git a/cspell.json b/cspell.json index 615efac647..1ca728ea28 100644 --- a/cspell.json +++ b/cspell.json @@ -42,6 +42,7 @@ "docx", "SOLR", "simpletask", + "titlecase", "unshare", "qshare", @@ -62,7 +63,8 @@ "keycodes", "denysvuika", "submenu", - "submenus" + "submenus", + "dateitem" ], "dictionaries": ["html", "en-gb", "en_US"] } diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ce49ba3a72..1d75d9c187 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -60,17 +60,23 @@ if [ -n "${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}" ];then fi if [[ $ACSURL ]]; then - sed -i s%{protocol}//{hostname}{:port}%"$ACSURL"%g /tmp/app.config.json && \ + replace="\/" + encoded=${ACSURL//\//$replace} + sed -i s%{protocol}//{hostname}{:port}%"$encoded"%g /tmp/app.config.json && \ cat /tmp/app.config.json > ./app.config.json fi if [[ $BASEPATH ]]; then - sed -i s%href=\"/\"%href=\""$BASEPATH"\"%g /tmp/index.html && \ + replace="\/" + encoded=${BASEPATH//\//$replace} + sed -i s%href=\"/\"%href=\""$encoded"\"%g /tmp/index.html && \ cat /tmp/index.html > ./index.html fi if [ -n "${APP_BASE_SHARE_URL}" ];then - sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${APP_BASE_SHARE_URL}\"/g" \ + replace="\/" + encoded=${APP_BASE_SHARE_URL//\//$replace} + sed -e "s/\"baseShareUrl\": \".*\"/\"baseShareUrl\": \"${encoded}\"/g" \ -i /tmp/app.config.json && \ cat /tmp/app.config.json > ./app.config.json fi diff --git a/docs/README.md b/docs/README.md index 82495c962d..51b3ed9169 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,6 +24,7 @@ The documentation is divided into the following sections: | ACA Version | Built with | Tested on | | ----------- | ---------- | --------- | +| ACA 1.8 | ADF 3.3.0 | ACS 6.1 | | ACA 1.7 | ADF 3.0.0 | ACS 6.1 | | ACA 1.6 | ADF 2.6.1 | ACS 6.1 | | ACA 1.5 | ADF 2.6.0 | ACS 6.0 | diff --git a/docs/extending/application-actions.md b/docs/extending/application-actions.md index 368e09826b..f1bbb5da99 100644 --- a/docs/extending/application-actions.md +++ b/docs/extending/application-actions.md @@ -76,48 +76,50 @@ and perform document list reload if needed. Below is the list of public actions types you can use in the plugin definitions as a reference to the action: -| Name | Payload | Description | -| ---------------------- | ------------------- | ----------------------------------------------------------------------------------------------- | -| SET_CURRENT_FOLDER | Node | Notify components about currently opened folder. | -| SET_CURRENT_URL | string | Notify components about current browser URL. | -| SET_USER_PROFILE | Person | Assign current user profile. | -| TOGGLE_INFO_DRAWER | n/a | Toggle info drawer for the selected node. | -| ADD_FAVORITE | MinimalNodeEntity[] | Add nodes (or selection) to favorites. | -| REMOVE_FAVORITE | MinimalNodeEntity[] | Removes nodes (or selection) from favorites. | -| DELETE_LIBRARY | string | Delete a Library by id. Takes selected node if payload not provided. | -| CREATE_LIBRARY | n/a | Invoke a "Create Library" dialog. | -| SET_SELECTED_NODES | MinimalNodeEntity[] | Notify components about selected nodes. | -| DELETE_NODES | MinimalNodeEntity[] | Delete the nodes (or selection). Supports undo actions. | -| UNDO_DELETE_NODES | any[] | Reverts deletion of nodes (or selection). | -| RESTORE_DELETED_NODES | MinimalNodeEntity[] | Restores deleted nodes (or selection). Typically used with Trashcan. | -| PURGE_DELETED_NODES | MinimalNodeEntity[] | Permanently delete nodes (or selection). Typically used with Trashcan. | -| DOWNLOAD_NODES | MinimalNodeEntity[] | Download nodes (or selections). Creates a ZIP archive for folders or multiple items. | -| CREATE_FOLDER | string | Invoke a "Create Folder" dialog for the opened folder (or the parent folder id in the payload). | -| EDIT_FOLDER | MinimalNodeEntity | Invoke an "Edit Folder" dialog for the node (or selection). | -| SHARE_NODE | MinimalNodeEntity | Invoke a "Share" dialog for the node (or selection). | -| UNSHARE_NODES | MinimalNodeEntity[] | Remove nodes (or selection) from the shared nodes (does not remove content). | -| COPY_NODES | MinimalNodeEntity[] | Invoke a "Copy" dialog for the nodes (or selection). Supports undo actions. | -| MOVE_NODES | MinimalNodeEntity[] | Invoke a "Move" dialog for the nodes (or selection). Supports undo actions. | -| MANAGE_PERMISSIONS | MinimalNodeEntity | Invoke a "Manage Permissions" dialog for the node (or selection). | -| MANAGE_VERSIONS | MinimalNodeEntity | Invoke a "Manage Versions" dialog for the node (or selection). | -| NAVIGATE_URL | string | Navigate to a given route URL within the application. | -| NAVIGATE_ROUTE | any[] | Navigate to a particular Route (supports parameters). | -| NAVIGATE_FOLDER | MinimalNodeEntity | Navigate to a folder based on the Node properties. | -| NAVIGATE_PARENT_FOLDER | MinimalNodeEntity | Navigate to a containing folder based on the Node properties. | -| NAVIGATE_LIBRARY | string | Navigate to library. | -| SEARCH_BY_TERM | string | Perform a simple search by the term and navigate to Search results. | -| SNACKBAR_INFO | string | Show information snackbar with the message provided. | -| SNACKBAR_WARNING | string | Show warning snackbar with the message provided. | -| SNACKBAR_ERROR | string | Show error snackbar with the message provided. | -| UPLOAD_FILES | n/a | Invoke "Upload Files" dialog and upload files to the currently opened folder. | -| UPLOAD_FOLDER | n/a | Invoke "Upload Folder" dialog and upload selected folder to the currently opened one. | -| UPLOAD_FILE_VERSION | n/a | Invoke "New File Version" dialog. | -| VIEW_FILE | MinimalNodeEntity | Preview the file (or selection) in the Viewer. | -| UNLOCK_WRITE | NodeEntry | Unlock file from read only mode | -| PRINT_FILE | MinimalNodeEntity | Print the file opened in the Viewer (or selected). | -| FULLSCREEN_VIEWER | n/a | Enters fullscreen mode to view the file opened in the Viewer. | -| LOGOUT | n/a | Log out and redirect to Login screen. | -| RELOAD_DOCUMENT_LIST | n/a | Reload active document list | -| TOGGLE_SEARCH_FILTER | n/a | Toggle Filter component visibility in Search Results. | -| SHOW_SEARCH_FILTER | n/a | Show Filter component in Search Results. | -| HIDE_SEARCH_FILTER | n/a | Hide Filter component in Search Results | +| Version | Name | Payload | Description | +| ------- | ---------------------- | ------------------- | ----------------------------------------------------------------------------------------------- | +| 1.7.0 | SET_CURRENT_FOLDER | Node | Notify components about currently opened folder. | +| 1.7.0 | SET_CURRENT_URL | string | Notify components about current browser URL. | +| 1.7.0 | SET_USER_PROFILE | Person | Assign current user profile. | +| 1.7.0 | TOGGLE_INFO_DRAWER | n/a | Toggle info drawer for the selected node. | +| 1.7.0 | ADD_FAVORITE | MinimalNodeEntity[] | Add nodes (or selection) to favorites. | +| 1.7.0 | REMOVE_FAVORITE | MinimalNodeEntity[] | Removes nodes (or selection) from favorites. | +| 1.7.0 | DELETE_LIBRARY | string | Delete a Library by id. Takes selected node if payload not provided. | +| 1.7.0 | CREATE_LIBRARY | n/a | Invoke a "Create Library" dialog. | +| 1.7.0 | SET_SELECTED_NODES | MinimalNodeEntity[] | Notify components about selected nodes. | +| 1.7.0 | DELETE_NODES | MinimalNodeEntity[] | Delete the nodes (or selection). Supports undo actions. | +| 1.7.0 | UNDO_DELETE_NODES | any[] | Reverts deletion of nodes (or selection). | +| 1.7.0 | RESTORE_DELETED_NODES | MinimalNodeEntity[] | Restores deleted nodes (or selection). Typically used with Trashcan. | +| 1.7.0 | PURGE_DELETED_NODES | MinimalNodeEntity[] | Permanently delete nodes (or selection). Typically used with Trashcan. | +| 1.7.0 | DOWNLOAD_NODES | MinimalNodeEntity[] | Download nodes (or selections). Creates a ZIP archive for folders or multiple items. | +| 1.7.0 | CREATE_FOLDER | string | Invoke a "Create Folder" dialog for the opened folder (or the parent folder id in the payload). | +| 1.7.0 | EDIT_FOLDER | MinimalNodeEntity | Invoke an "Edit Folder" dialog for the node (or selection). | +| 1.7.0 | SHARE_NODE | MinimalNodeEntity | Invoke a "Share" dialog for the node (or selection). | +| 1.7.0 | UNSHARE_NODES | MinimalNodeEntity[] | Remove nodes (or selection) from the shared nodes (does not remove content). | +| 1.7.0 | COPY_NODES | MinimalNodeEntity[] | Invoke a "Copy" dialog for the nodes (or selection). Supports undo actions. | +| 1.7.0 | MOVE_NODES | MinimalNodeEntity[] | Invoke a "Move" dialog for the nodes (or selection). Supports undo actions. | +| 1.7.0 | MANAGE_PERMISSIONS | MinimalNodeEntity | Invoke a "Manage Permissions" dialog for the node (or selection). | +| 1.7.0 | MANAGE_VERSIONS | MinimalNodeEntity | Invoke a "Manage Versions" dialog for the node (or selection). | +| 1.7.0 | NAVIGATE_URL | string | Navigate to a given route URL within the application. | +| 1.7.0 | NAVIGATE_ROUTE | any[] | Navigate to a particular Route (supports parameters). | +| 1.7.0 | NAVIGATE_FOLDER | MinimalNodeEntity | Navigate to a folder based on the Node properties. | +| 1.7.0 | NAVIGATE_PARENT_FOLDER | MinimalNodeEntity | Navigate to a containing folder based on the Node properties. | +| 1.7.0 | NAVIGATE_LIBRARY | string | Navigate to library. | +| 1.7.0 | SEARCH_BY_TERM | string | Perform a simple search by the term and navigate to Search results. | +| 1.7.0 | SNACKBAR_INFO | string | Show information snackbar with the message provided. | +| 1.7.0 | SNACKBAR_WARNING | string | Show warning snackbar with the message provided. | +| 1.7.0 | SNACKBAR_ERROR | string | Show error snackbar with the message provided. | +| 1.7.0 | UPLOAD_FILES | n/a | Invoke "Upload Files" dialog and upload files to the currently opened folder. | +| 1.7.0 | UPLOAD_FOLDER | n/a | Invoke "Upload Folder" dialog and upload selected folder to the currently opened one. | +| 1.7.0 | UPLOAD_FILE_VERSION | n/a | Invoke "New File Version" dialog. | +| 1.7.0 | VIEW_FILE | MinimalNodeEntity | Preview the file (or selection) in the Viewer. | +| 1.7.0 | UNLOCK_WRITE | NodeEntry | Unlock file from read only mode | +| 1.7.0 | PRINT_FILE | MinimalNodeEntity | Print the file opened in the Viewer (or selected). | +| 1.7.0 | FULLSCREEN_VIEWER | n/a | Enters fullscreen mode to view the file opened in the Viewer. | +| 1.7.0 | LOGOUT | n/a | Log out and redirect to Login screen. | +| 1.7.0 | RELOAD_DOCUMENT_LIST | n/a | Reload active document list | +| 1.7.0 | TOGGLE_SEARCH_FILTER | n/a | Toggle Filter component visibility in Search Results. | +| 1.7.0 | SHOW_SEARCH_FILTER | n/a | Show Filter component in Search Results. | +| 1.7.0 | HIDE_SEARCH_FILTER | n/a | Hide Filter component in Search Results | +| 1.8.0 | VIEW_NODE | string | Lightweight preview of a node by id. Can be invoked from extensions. | +| 1.8.0 | CLOSE_PREVIEW | n/a | Closes the viewer ( preview of the item ) | diff --git a/docs/extending/application-features.md b/docs/extending/application-features.md index 6b318815db..2bca3efa0e 100644 --- a/docs/extending/application-features.md +++ b/docs/extending/application-features.md @@ -363,6 +363,7 @@ Viewer component in ACA supports the following extension points: - Toolbar actions - `More` toolbar actions - `Open With` actions +- Rules ```json { @@ -547,6 +548,35 @@ and invoke it from the custom `Open With` menu entry called `Snackbar`. As with other content actions, custom plugins can disable, update or extend `Open With` actions. +### Rules + +You can provide global rules for the Viewer by utilizing the `features.viewer.rules` object: + +```ts +export interface ViewerRules { + /** + * Checks if user can preview the node. + */ + canPreview?: string; +} +``` + +For example: + +```json +{ + "features": { + "viewer": { + "rules": { + "canPreview": "customRule" + } + } + } +} +``` + +The rule should return `true` if node preview is allowed, otherwise `false`. + ## Content metadata presets The content metadata presets are needed by the [Content Metadata Component](https://www.alfresco.com/abn/adf/docs/content-services/content-metadata-card.component/) to render the properties of metadata aspects for a given node. diff --git a/docs/extending/rules.md b/docs/extending/rules.md index b8ce11fcac..7096c6c3d2 100644 --- a/docs/extending/rules.md +++ b/docs/extending/rules.md @@ -56,11 +56,11 @@ in case you do not need providing extra parameters, or chaining multiple rules t You can create new rules by chaining other rules and evaluators. -| Key | Description | -| ---------- | ----------------------------------------------------------------------------- | -| core.every | Evaluates to `true` if all chained rules evaluate to `true`. | -| core.some | Evaluates to `true` if at least one of the chained rules evaluates to `true`. | -| core.not | Evaluates to `true` if all chained rules evaluate to `false`. | +| Version | Key | Description | +| ------- | ---------- | ----------------------------------------------------------------------------- | +| 1.7.0 | core.every | Evaluates to `true` if all chained rules evaluate to `true`. | +| 1.7.0 | core.some | Evaluates to `true` if at least one of the chained rules evaluates to `true`. | +| 1.7.0 | core.not | Evaluates to `true` if all chained rules evaluate to `false`. | Below is an example of the composite rule definition that combines the following conditions: @@ -129,31 +129,43 @@ The button will be visible only when the linked rule evaluates to `true`. ## Application Evaluators -| Key | Description | -| ----------------------------------- | ------------------------------------------------------------ | -| app.selection.canDelete | User has permission to delete selected node(s). | -| app.selection.canDownload | User can download selected node(s). | -| app.selection.notEmpty | At least one node is selected. | -| app.selection.canUnshare | User is able to remove selected node(s) from public sharing. | -| app.selection.canAddFavorite | User can add selected node(s) to favorites. | -| app.selection.canRemoveFavorite | User can remove selected node(s) from favorites. | -| app.selection.first.canUpdate | User has permission to update selected node(s). | -| app.selection.file | A single File node is selected. | -| app.selection.file.canShare | User is able to share the selected file. | -| app.selection.file.isShared | A shared node is selected. | -| app.selection.file.isLocked | File is locked for editing. | -| app.selection.file.isLockOwner | File is locked and current user is the lock owner. | -| app.selection.file.canUploadVersion | User can update file version. | -| app.selection.library | A single Library node is selected. | -| app.selection.isPrivateLibrary | A private Library node is selected. | -| app.selection.hasLibraryRole | The selected Library node has a role property. | -| app.selection.hasNoLibraryRole | The selected Library node has no role property. | -| app.selection.folder | A single Folder node is selected. | -| app.selection.folder.canUpdate | User has permissions to update the selected folder. | -| app.selection.folder.canUpdate | User has permissions to update the selected folder. | -| app.selection.file.canLock | User has permissions to lock file. | -| app.selection.file.canUnlock | User has permissions to unlock file. | -| repository.isQuickShareEnabled | Whether the quick share repository option is enabled or not. | +| Ver. | Key | Description | +| ----- | ----------------------------------- | ------------------------------------------------------------------------ | +| 1.7.0 | app.selection.canDelete | User has permission to delete selected node(s). | +| 1.7.0 | app.selection.canDownload | User can download selected node(s). | +| 1.7.0 | app.selection.notEmpty | At least one node is selected. | +| 1.7.0 | app.selection.canUnshare | User is able to remove selected node(s) from public sharing. | +| 1.7.0 | app.selection.canAddFavorite | User can add selected node(s) to favorites. | +| 1.7.0 | app.selection.canRemoveFavorite | User can remove selected node(s) from favorites. | +| 1.7.0 | app.selection.first.canUpdate | User has permission to update selected node(s). | +| 1.7.0 | app.selection.file | A single File node is selected. | +| 1.7.0 | app.selection.file.canShare | User is able to share the selected file. | +| 1.7.0 | app.selection.file.isShared | A shared node is selected. | +| 1.7.0 | app.selection.file.isLocked | File is locked for editing. | +| 1.7.0 | app.selection.file.isLockOwner | File is locked and current user is the lock owner. | +| 1.7.0 | app.selection.file.canUploadVersion | User can update file version. | +| 1.7.0 | app.selection.library | A single Library node is selected. | +| 1.7.0 | app.selection.isPrivateLibrary | A private Library node is selected. | +| 1.7.0 | app.selection.hasLibraryRole | The selected Library node has a role property. | +| 1.7.0 | app.selection.hasNoLibraryRole | The selected Library node has no role property. | +| 1.7.0 | app.selection.folder | A single Folder node is selected. | +| 1.7.0 | app.selection.folder.canUpdate | User has permissions to update the selected folder. | +| 1.7.0 | app.selection.folder.canUpdate | User has permissions to update the selected folder. | +| 1.7.0 | app.selection.file.canLock | User has permissions to lock file. | +| 1.7.0 | app.selection.file.canUnlock | User has permissions to unlock file. | +| 1.7.0 | repository.isQuickShareEnabled | Whether the quick share repository option is enabled or not. | +| 1.8.0 | canCopyNode | Checks if user can copy selected node. | +| 1.8.0 | canToggleJoinLibrary | Checks if user can perform "Join" or "Cancel Join Request" on a library. | +| 1.8.0 | canEditFolder | Checks if user can edit the selected folder. | +| 1.8.0 | isTrashcanItemSelected | Checks if user has trashcan item selected. | +| 1.8.0 | canViewFile | Checks if user can view the file. | +| 1.8.0 | canLeaveLibrary | Checks if user can **Leave** selected library. | +| 1.8.0 | canToggleSharedLink | Checks if user can toggle shared link mode. | +| 1.8.0 | canShowInfoDrawer | Checks if user can show **Info Drawer** for the selected node. | +| 1.8.0 | canManageFileVersions | Checks if user can manage file versions for the selected node. | +| 1.8.0 | canManagePermissions | Checks if user can manage permissions for the selected node. | +| 1.8.0 | canToggleEditOffline | Checks if user can toggle **Edit Offline** mode for selected node. | +| 1.8.0 | user.isAdmin | Checks if user is admin. | ## Navigation Evaluators @@ -165,28 +177,28 @@ for example mixing `core.every` and `core.not`. **Tip:** You can also negate any rule by utilizing a `!` prefix: `!app.navigation.isTrashcan` is the opposite of the `app.navigation.isTrashcan`. -| Key | Description | -| --------------------------------- | ---------------------------------------------------------------- | -| app.navigation.folder.canCreate | User can create content in the currently opened folder. | -| app.navigation.folder.canUpload | User can upload content to the currently opened folder. | -| app.navigation.isTrashcan | User is using the **Trashcan** page. | -| app.navigation.isNotTrashcan | Current page is not a **Trashcan**. | -| app.navigation.isLibraries | User is using a **Libraries** or **Library Search Result** page. | -| app.navigation.isNotLibraries | Current page is not a **Libraries** page. | -| app.navigation.isSharedFiles | User is using the **Shared Files** page. | -| app.navigation.isNotSharedFiles | Current page is not **Shared Files**. | -| app.navigation.isFavorites | User is using the **Favorites** page. | -| app.navigation.isNotFavorites | Current page is not **Favorites**. | -| app.navigation.isRecentFiles | User is using the **Recent Files** page. | -| app.navigation.isNotRecentFiles | Current page is not **Recent Files**. | -| app.navigation.isSearchResults | User is using the **Search Results** page. | -| app.navigation.isNotSearchResults | Current page is not the **Search Results**. | -| app.navigation.isSharedPreview | Current page is preview **Shared Files**. | -| app.navigation.isFavoritesPreview | Current page is preview **Favorites**. | -| app.navigation.isSharedFileViewer | Current page is shared file preview page. | -| app.navigation.isPreview | Current page is **Preview**. | -| app.navigation.isPersonalFiles | Current page is **Personal Files**. | -| app.navigation.isLibraryFiles | Current page is **Library Files**. | +| Version | Key | Description | +| ------- | --------------------------------- | ---------------------------------------------------------------- | +| 1.7.0 | app.navigation.folder.canCreate | User can create content in the currently opened folder. | +| 1.7.0 | app.navigation.folder.canUpload | User can upload content to the currently opened folder. | +| 1.7.0 | app.navigation.isTrashcan | User is using the **Trashcan** page. | +| 1.7.0 | app.navigation.isNotTrashcan | Current page is not a **Trashcan**. | +| 1.7.0 | app.navigation.isLibraries | User is using a **Libraries** or **Library Search Result** page. | +| 1.7.0 | app.navigation.isNotLibraries | Current page is not a **Libraries** page. | +| 1.7.0 | app.navigation.isSharedFiles | User is using the **Shared Files** page. | +| 1.7.0 | app.navigation.isNotSharedFiles | Current page is not **Shared Files**. | +| 1.7.0 | app.navigation.isFavorites | User is using the **Favorites** page. | +| 1.7.0 | app.navigation.isNotFavorites | Current page is not **Favorites**. | +| 1.7.0 | app.navigation.isRecentFiles | User is using the **Recent Files** page. | +| 1.7.0 | app.navigation.isNotRecentFiles | Current page is not **Recent Files**. | +| 1.7.0 | app.navigation.isSearchResults | User is using the **Search Results** page. | +| 1.7.0 | app.navigation.isNotSearchResults | Current page is not the **Search Results**. | +| 1.7.0 | app.navigation.isSharedPreview | Current page is preview **Shared Files**. | +| 1.7.0 | app.navigation.isFavoritesPreview | Current page is preview **Favorites**. | +| 1.7.0 | app.navigation.isSharedFileViewer | Current page is shared file preview page. | +| 1.7.0 | app.navigation.isPreview | Current page is **Preview**. | +| 1.7.0 | app.navigation.isPersonalFiles | Current page is **Personal Files**. | +| 1.7.0 | app.navigation.isLibraryFiles | Current page is **Library Files**. | **Tip:** See the [Registration](/extending/registration) section for more details on how to register your own entries to be re-used at runtime. diff --git a/docs/extending/tutorials.md b/docs/extending/tutorials.md index 49c0d6bbca..74fa1270bd 100644 --- a/docs/extending/tutorials.md +++ b/docs/extending/tutorials.md @@ -161,7 +161,7 @@ Update `my-extension-dialog.component.ts`: ```ts import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material'; +import { MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'aca-my-extension-dialog', @@ -229,7 +229,7 @@ See also: Update to raise a dialog ```ts -import { MatDialog } from '@angular/material'; +import { MatDialog } from '@angular/material/dialog'; import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component'; @Injectable() diff --git a/docs/getting-started/internationalization.md b/docs/getting-started/internationalization.md index de9ebbaf52..7b7d91eedc 100644 --- a/docs/getting-started/internationalization.md +++ b/docs/getting-started/internationalization.md @@ -17,6 +17,12 @@ The Content Application provides support for the following languages: - Brazilian Portuguese (`pt-BR`) - Russian (`ru`) - Simplified Chinese (`zh-CN`) +- Arabic (`ar`) +- Czech (`cs`) +- Danish (`da`) +- Finnish (`fi`) +- Polish (`pl`) +- Swedish (`sv`) The default language is English, however the current browser language is taken as the default one automatically when the application starts. diff --git a/docs/getting-started/navigation.md b/docs/getting-started/navigation.md index c684b366bc..07ec281b0d 100644 --- a/docs/getting-started/navigation.md +++ b/docs/getting-started/navigation.md @@ -138,6 +138,30 @@ In the `app.config.json` define a link entry which will point to the custom page ``` +This can also be declared using ngrx store action: + +```json +{ + ..., + "navigation": [ + "main": [ ... ], + "secondary": [ ... ], + "custom": [ + { + "icon": "work", + "label": "Link", + "title": "My custom link", + "click": { + "action": "NAVIGATE_ROUTE", + "payload": "custom-route" + } + } + ] + ] +} + +``` + Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` definition. ```js @@ -162,4 +186,28 @@ Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` defin ![](../images/navigation-03.png) +### Rendering custom components + +Navigation definition also supports custom components to be dynamically render. The schema for this is as follows: + +```json +"navbar": [ + { + "id": "app.navbar.primary", + "items": [ + ... + + { + "id": "custom-component", + "component": "custom-menu-item" + } + + ... + ] + } +] +``` + +Note that components must be declared as entryComponents under the app module. + For more information about the content of a custom page see [Document List Layout](/features/document-list-layout) section. diff --git a/docs/getting-started/prerequisites.md b/docs/getting-started/prerequisites.md index 5cb03903d0..96da8251c8 100644 --- a/docs/getting-started/prerequisites.md +++ b/docs/getting-started/prerequisites.md @@ -6,11 +6,11 @@ Title: Prerequisites This application uses the latest releases from Alfresco: -- [Alfresco ADF (2.6.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started) -- [Alfresco Content Services (6.0)](https://www.alfresco.com/platform/content-services-ecm) - or [Alfresco Community Edition (6.0 - General Release: 201806)](https://www.alfresco.com/products/community/download) +- [Alfresco ADF (3.3.0)](https://community.alfresco.com/community/application-development-framework/pages/get-started) +- [Alfresco Content Services (6.1)](https://www.alfresco.com/platform/content-services-ecm) + or [Alfresco Community Edition (6.1 - General Availability 201901)](https://www.alfresco.com/products/community/download) **Note:** You also need [Node.js](https://nodejs.org/en/) (LTS) installed to build it locally from source code. The latest version of the Alfresco Content platform is required -due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments. \ No newline at end of file +due to the application using the latest [REST APIs](https://docs.alfresco.com/5.2/pra/1/topics/pra-welcome.html) developments. diff --git a/docs/tutorials/dialog-actions.md b/docs/tutorials/dialog-actions.md index 6d82285874..f762733b6f 100644 --- a/docs/tutorials/dialog-actions.md +++ b/docs/tutorials/dialog-actions.md @@ -36,7 +36,7 @@ Update `my-extension-dialog.component.ts`: ```ts import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material'; +import { MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'aca-my-extension-dialog', @@ -104,7 +104,7 @@ See also: Update to raise a dialog ```ts -import { MatDialog } from '@angular/material'; +import { MatDialog } from '@angular/material/dialog'; import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my-extension-dialog.component'; @Injectable() diff --git a/e2e/components/components.ts b/e2e/components/components.ts index a1440fa843..252410cb30 100755 --- a/e2e/components/components.ts +++ b/e2e/components/components.ts @@ -29,6 +29,7 @@ export * from './header/user-info'; export * from './data-table/data-table'; export * from './dialog/confirm-dialog'; export * from './dialog/create-edit-folder-dialog'; +export * from './dialog/password-dialog'; export * from './pagination/pagination'; export * from './sidenav/sidenav'; export * from './toolbar/toolbar'; diff --git a/e2e/components/data-table/data-table.ts b/e2e/components/data-table/data-table.ts index 5f0b9093db..7917cf83bc 100755 --- a/e2e/components/data-table/data-table.ts +++ b/e2e/components/data-table/data-table.ts @@ -34,16 +34,16 @@ export class DataTable extends Component { root: 'adf-datatable', head: '.adf-datatable-header', - columnHeader: '.adf-datatable-row .adf-datatable-table-cell-header', + columnHeader: '.adf-datatable-row .adf-datatable-cell-header', sortedColumnHeader: ` - .adf-data-table__header--sorted-asc, - .adf-data-table__header--sorted-desc + .adf-datatable__header--sorted-asc, + .adf-datatable__header--sorted-desc `, body: '.adf-datatable-body', row: '.adf-datatable-row[role]', selectedRow: '.adf-datatable-row.adf-is-selected', - cell: '.adf-data-table-cell', + cell: '.adf-datatable-cell-container', locationLink: '.aca-location-link', nameLink: '.adf-datatable-link', libraryRole: 'adf-library-role-column', @@ -57,7 +57,13 @@ export class DataTable extends Component { emptyListTitle: '.adf-empty-content__title', emptyListSubtitle: '.adf-empty-content__subtitle', - emptyListText: '.adf-empty-content__text' + emptyListText: '.adf-empty-content__text', + + emptySearchText: '.empty-search__text', + + searchResultsRow: 'aca-search-results-row', + searchResultsRowLine: '.line', + searchResultsNameLink: '.link' }; head: ElementFinder = this.component.element(by.css(DataTable.selectors.head)); @@ -69,6 +75,8 @@ export class DataTable extends Component { emptyListSubtitle: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListSubtitle)); emptyListText: ElementArrayFinder = this.component.all(by.css(DataTable.selectors.emptyListText)); + emptySearchText: ElementFinder = this.component.element(by.css(DataTable.selectors.emptySearchText)); + menu: Menu = new Menu(); constructor(ancestor?: ElementFinder) { @@ -76,12 +84,12 @@ export class DataTable extends Component { } // Wait methods (waits for elements) - waitForHeader() { - return browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT, '--- timeout waitForHeader ---'); + async waitForHeader() { + return await browser.wait(EC.presenceOf(this.head), BROWSER_WAIT_TIMEOUT, '--- timeout waitForHeader ---'); } - waitForBody() { - return browser.wait(EC.presenceOf(this.body), BROWSER_WAIT_TIMEOUT, '--- timeout waitForBody ---'); + async waitForBody() { + return await browser.wait(EC.presenceOf(this.body), BROWSER_WAIT_TIMEOUT, '--- timeout waitForBody ---'); } async waitForEmptyState() { @@ -166,20 +174,28 @@ export class DataTable extends Component { return this.body.element(by.cssContainingText(DataTable.selectors.row, name)); } + getRowCells(name: string, location: string = '') { + return this.getRowByName(name, location).all(by.css(DataTable.selectors.cell)); + } + + async getRowCellsCount(itemName: string) { + return await this.getRowCells(itemName).count(); + } + getRowFirstCell(name: string, location: string = '') { - return this.getRowByName(name, location).all(by.css(DataTable.selectors.cell)).get(0); + return this.getRowCells(name, location).get(0); } - getRowNameCell(name: string) { - return this.getRowByName(name).all(by.css(DataTable.selectors.cell)).get(1); + getRowNameCell(name: string, location: string = '') { + return this.getRowCells(name, location).get(1); } - getRowNameCellText(name: string) { - return this.getRowNameCell(name).$('span'); + getRowNameCellSpan(name: string, location: string = '') { + return this.getRowNameCell(name, location).$('span'); } - async getItemNameTooltip(name: string) { - return await this.getRowNameCellText(name).getAttribute('title'); + async getItemNameTooltip(name: string, location: string = '') { + return await this.getRowNameCellSpan(name, location).getAttribute('title'); } async hasCheckMarkIcon(itemName: string, location: string = '') { @@ -214,25 +230,34 @@ export class DataTable extends Component { } // Navigation/selection methods - async doubleClickOnRowByName(name: string) { + async doubleClickOnRowByName(name: string, location: string = '') { try { - const item = this.getRowFirstCell(name); + const item = this.getRowFirstCell(name, location); await Utils.waitUntilElementClickable(item); await browser.actions().mouseMove(item).perform(); - await browser.actions().click().click().perform(); + await browser.actions().doubleClick().perform(); } catch (error) { console.log('--- catch: doubleClickOnRowByName', error); } } async selectItem(name: string, location: string = '') { - try{ - const item = this.getRowFirstCell(name, location); - await item.click(); - - } catch (e) { - console.log('--- select item catch : ', e); + const isSelected = await this.hasCheckMarkIcon(name, location); + if (!isSelected) { + try { + const item = this.getRowFirstCell(name, location); + await item.click(); + + } catch (e) { + console.log('--- select item catch : ', e); + } } + + } + + async clickItem(name: string, location: string = '') { + const item = this.getRowFirstCell(name, location); + await item.click(); } async clickNameLink(itemName: string) { @@ -262,13 +287,14 @@ export class DataTable extends Component { async rightClickOnItem(itemName: string) { const item = this.getRowFirstCell(itemName); - await browser.actions().click(item, protractor.Button.RIGHT).perform(); + await browser.actions().mouseMove(item).perform(); + await browser.actions().click(protractor.Button.RIGHT).perform(); } async rightClickOnMultipleSelection() { - await this.wait(); const itemFromSelection = this.getSelectedRows().get(0); - await browser.actions().click(itemFromSelection, protractor.Button.RIGHT).perform(); + await browser.actions().mouseMove(itemFromSelection).perform(); + await browser.actions().click(protractor.Button.RIGHT).perform(); } getItemLocationEl(name: string) { @@ -330,6 +356,10 @@ export class DataTable extends Component { } } + async getEmptySearchResultsText() { + return await this.emptySearchText.getText(); + } + async getCellsContainingName(name: string) { const rows = this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name)); return rows.map(async cell => await cell.getText()); @@ -370,4 +400,53 @@ export class DataTable extends Component { }, {}); } + getSearchResultsRowByName(name: string, location: string = '') { + if (location) { + return this.body.all(by.cssContainingText(DataTable.selectors.searchResultsRow, name)) + .filter(async (elem) => await browser.isElementPresent(elem.element(by.cssContainingText(DataTable.selectors.searchResultsRowLine, location)))) + .first(); + } + return this.body.element(by.cssContainingText(DataTable.selectors.searchResultsRow, name)); + } + + getSearchResultRowLines(name: string, location: string = '') { + return this.getSearchResultsRowByName(name, location).all(by.css(DataTable.selectors.searchResultsRowLine)); + } + + async getSearchResultLinesCount(name: string, location: string = '') { + return await this.getSearchResultRowLines(name, location).count(); + } + + getSearchResultNthLine(name: string, location: string = '', index: number) { + return this.getSearchResultRowLines(name, location).get(index); + } + + async getSearchResultNameAndTitle(name: string, location: string = '') { + return await this.getSearchResultNthLine(name, location, 0).getText(); + } + + async getSearchResultDescription(name: string, location: string = '') { + return await this.getSearchResultNthLine(name, location, 1).getText(); + } + + async getSearchResultModified(name: string, location: string = '') { + return await this.getSearchResultNthLine(name, location, 2).getText(); + } + + async getSearchResultLocation(name: string, location: string = '') { + return await this.getSearchResultNthLine(name, location, 3).getText(); + } + + getSearchResultNameLink(itemName: string, location: string = '') { + return this.getSearchResultsRowByName(itemName, location).$(DataTable.selectors.searchResultsNameLink); + } + + async hasLinkOnSearchResultName(itemName: string, location: string = '') { + return await this.getSearchResultNameLink(itemName, location).isPresent(); + } + + async clickSearchResultNameLink(itemName: string, location: string = '') { + await this.getSearchResultNameLink(itemName, location).click(); + } + } diff --git a/e2e/components/dialog/confirm-dialog.ts b/e2e/components/dialog/confirm-dialog.ts index f262658906..e536dff60e 100755 --- a/e2e/components/dialog/confirm-dialog.ts +++ b/e2e/components/dialog/confirm-dialog.ts @@ -109,7 +109,7 @@ export class ConfirmDialog extends Component { } async clickCancel() { - return await this.clickButton('Cancel'); + return await this.cancelButton.click(); } async clickKeep() { diff --git a/e2e/components/dialog/password-dialog.ts b/e2e/components/dialog/password-dialog.ts new file mode 100755 index 0000000000..c5bdc8a063 --- /dev/null +++ b/e2e/components/dialog/password-dialog.ts @@ -0,0 +1,109 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { ElementFinder, by, browser, ExpectedConditions as EC, until } from 'protractor'; +import { BROWSER_WAIT_TIMEOUT } from '../../configs'; +import { Component } from '../component'; + +export class PasswordDialog extends Component { + private static selectors = { + root: 'adf-pdf-viewer-password-dialog', + + title: '.mat-dialog-title', + content: '.mat-dialog-content', + passwordInput: 'input[type="Password"]', + actionButtons: '.mat-dialog-actions', + errorMessage: '.mat-error' + }; + + title: ElementFinder = this.component.element(by.css(PasswordDialog.selectors.title)); + content: ElementFinder = this.component.element(by.css(PasswordDialog.selectors.content)); + passwordInput: ElementFinder = this.component.element(by.css(PasswordDialog.selectors.passwordInput)); + errorMessage: ElementFinder = this.component.element(by.css(PasswordDialog.selectors.errorMessage)); + closeButton: ElementFinder = this.component.element(by.buttonText('Close')); + submitButton: ElementFinder = this.component.element(by.buttonText('Submit')); + + constructor(ancestor?: ElementFinder) { + super(PasswordDialog.selectors.root, ancestor); + } + + async waitForDialogToClose() { + await browser.wait(EC.stalenessOf(this.title), BROWSER_WAIT_TIMEOUT); + } + + async waitForDialogToOpen() { + await browser.wait(EC.presenceOf(this.title), BROWSER_WAIT_TIMEOUT); + } + + async isDialogOpen() { + return await browser.isElementPresent(by.css(PasswordDialog.selectors.root)); + } + + async getTitle() { + return await this.title.getText(); + } + + async isCloseEnabled() { + return await this.closeButton.isEnabled(); + } + + async isSubmitEnabled() { + return await this.submitButton.isEnabled(); + } + + async clickClose() { + return await this.closeButton.click(); + } + + async clickSubmit() { + return await this.submitButton.click(); + } + + async isPasswordInputDisplayed() { + const present = await browser.isElementPresent(this.passwordInput); + if (present) { + return await this.passwordInput.isDisplayed(); + } else { + return false; + } + } + + async isErrorDisplayed() { + const elem = await browser.wait(until.elementLocated(by.css(PasswordDialog.selectors.errorMessage)), BROWSER_WAIT_TIMEOUT, '------- timeout waiting for error message to appear') + return await browser.isElementPresent(elem); + } + + async getErrorMessage() { + if (await this.isErrorDisplayed()) { + return await this.errorMessage.getText(); + } + return ''; + } + + async enterPassword(password: string) { + await this.passwordInput.clear(); + await this.passwordInput.sendKeys(password); + } +} diff --git a/e2e/components/info-drawer/info-drawer-comments-tab.ts b/e2e/components/info-drawer/info-drawer-comments-tab.ts new file mode 100755 index 0000000000..70dbb3688f --- /dev/null +++ b/e2e/components/info-drawer/info-drawer-comments-tab.ts @@ -0,0 +1,140 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, until } from 'protractor'; +import { Component } from '../component'; +import { BROWSER_WAIT_TIMEOUT } from '../../configs'; + +export class CommentsTab extends Component { + private static selectors = { + root: 'adf-comments', + + commentsContainer: '.adf-comments-container', + commentsHeader: '.adf-comments-header', + commentsTextArea: '.adf-comments-input-container textarea', + addCommentButton: 'button.adf-comments-input-add', + commentsList: '.adf-comment-list', + commentsListItem: '.adf-comment-list-item', + commentById: `adf-comment-`, + commentUserName: 'comment-user', + commentUserAvatar: 'comment-user-icon', + commentMessage: 'comment-message', + commentTime: 'comment-time' + }; + + commentsContainer: ElementFinder = this.component.element(by.css(CommentsTab.selectors.commentsContainer)); + commentsHeader: ElementFinder = this.component.element(by.css(CommentsTab.selectors.commentsHeader)); + commentTextarea: ElementFinder = this.component.element(by.css(CommentsTab.selectors.commentsTextArea)); + addCommentButton: ElementFinder = this.component.element(by.css(CommentsTab.selectors.addCommentButton)); + commentsList: ElementArrayFinder = this.component.all(by.css(CommentsTab.selectors.commentsListItem)); + + commentListItem = by.css(CommentsTab.selectors.commentsListItem); + + commentUserAvatar = by.id(CommentsTab.selectors.commentUserAvatar); + commentUser = by.id(CommentsTab.selectors.commentUserName) + commentText = by.id(CommentsTab.selectors.commentMessage); + commentTime = by.id(CommentsTab.selectors.commentTime); + + + constructor(ancestor?: ElementFinder) { + super(CommentsTab.selectors.root, ancestor); + } + + async waitForCommentsContainer() { + await browser.wait(EC.visibilityOf(this.commentsContainer), BROWSER_WAIT_TIMEOUT); + } + + async getCommentsTabHeaderText() { + return await this.commentsHeader.getText(); + } + + async isCommentTextAreaDisplayed() { + return await browser.isElementPresent(this.commentTextarea); + } + + async isAddCommentButtonEnabled() { + const present = await browser.isElementPresent(this.addCommentButton); + if (present) { + return await this.addCommentButton.isEnabled(); + } + return false; + } + + async getCommentListItem() { + return await browser.wait(until.elementLocated(this.commentListItem), BROWSER_WAIT_TIMEOUT / 2); + } + + async getCommentById(commentId?: string) { + if (commentId) { + return await browser.wait(until.elementLocated(by.id(`${CommentsTab.selectors.commentById}${commentId}`)), BROWSER_WAIT_TIMEOUT / 2); + } + return await this.getCommentListItem(); + } + + async isCommentDisplayed(commentId?: string) { + return await browser.isElementPresent(await this.getCommentById(commentId)); + } + + async isCommentUserAvatarDisplayed(commentId?: string) { + const commentElement = await this.getCommentById(commentId); + return await browser.isElementPresent(commentElement.findElement(this.commentUserAvatar)); + } + + async getCommentText(commentId?: string) { + const commentElement = await this.getCommentById(commentId); + const message = await commentElement.findElement(this.commentText); + return await message.getText(); + } + + async getCommentUserName(commentId?: string) { + const commentElement = await this.getCommentById(commentId); + const user = await commentElement.findElement(this.commentUser); + return await user.getText(); + } + + async getCommentTime(commentId?: string) { + const commentElement = await this.getCommentById(commentId); + const time = await commentElement.findElement(this.commentTime); + return await time.getText(); + } + + async getNthCommentId(index: number) { + return await this.commentsList.get(index - 1).getAttribute('id'); + } + + async typeComment(text: string) { + return await this.commentTextarea.sendKeys(text); + } + + async clickAddButton() { + return await this.addCommentButton.click(); + } + + async getCommentTextFromTextArea() { + return await this.commentTextarea.getAttribute('value'); + } + +} + diff --git a/e2e/components/info-drawer/info-drawer-metadata-content.ts b/e2e/components/info-drawer/info-drawer-metadata-content.ts new file mode 100755 index 0000000000..6fcb52dbb7 --- /dev/null +++ b/e2e/components/info-drawer/info-drawer-metadata-content.ts @@ -0,0 +1,125 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC } from 'protractor'; +import { Component } from '../component'; +import { BROWSER_WAIT_TIMEOUT } from '../../configs'; + +export class ContentMetadata extends Component { + private static selectors = { + root: 'adf-content-metadata-card', + + expandedPanel: '.mat-expansion-panel.mat-expanded', + propertyList: '.adf-property-list', + property: '.adf-property', + propertyLabel: '.adf-property-label', + propertyValue: '.adf-property-value', + editProperties: `button[title='Edit']`, + editProperty: `.mat-icon[title='Edit']`, + editDateItem: `.adf-dateitem-editable`, + moreLessInformation: `[data-automation-id='meta-data-card-toggle-expand']` + }; + + expandedPanel: ElementFinder = this.component.element(by.css(ContentMetadata.selectors.expandedPanel)); + propertyList: ElementFinder = this.component.element(by.css(ContentMetadata.selectors.propertyList)); + propertyListElements: ElementArrayFinder = this.component.all(by.css(ContentMetadata.selectors.property)); + propertyValue: ElementFinder = this.component.element(by.css(ContentMetadata.selectors.propertyValue)); + editPropertiesButton: ElementFinder = this.component.element(by.css(ContentMetadata.selectors.editProperties)); + lessInfoButton: ElementFinder = this.component.element(by.cssContainingText(ContentMetadata.selectors.moreLessInformation, 'Less information')); + moreInfoButton: ElementFinder = this.component.element(by.cssContainingText(ContentMetadata.selectors.moreLessInformation, 'More information')); + + imagePropertiesPanel: ElementFinder = this.component.element(by.css(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE']`)); + expandedImagePropertiesPanel: ElementFinder = this.component.element(by.css(`[data-automation-id='adf-metadata-group-APP.CONTENT_METADATA.EXIF_GROUP_TITLE'].mat-expanded`)); + + constructor(ancestor?: ElementFinder) { + super(ContentMetadata.selectors.root, ancestor); + } + + async isPropertiesListExpanded() { + return await browser.isElementPresent(this.expandedPanel); + } + + async waitForImagePropertiesPanelToExpand() { + return await browser.wait(EC.visibilityOf(this.expandedImagePropertiesPanel), BROWSER_WAIT_TIMEOUT); + } + + async getVisiblePropertiesLabels() { + return await this.component.all(by.css(ContentMetadata.selectors.propertyLabel)) + .filter(async (elem) => await elem.isDisplayed()) + .map(async (elem) => await elem.getText()); + } + + async getVisiblePropertiesValues() { + return await this.component.all(by.css(ContentMetadata.selectors.propertyValue)) + .filter(async (elem) => await elem.isDisplayed()) + .map(async (elem) => { + if (await elem.isElementPresent(by.css('.mat-checkbox'))) { + if (await elem.isElementPresent(by.css('.mat-checkbox-checked'))) { + return true; + } + return false + } + return await elem.getText(); + }); + } + + async isEditPropertiesButtonEnabled() { + return (await browser.isElementPresent(this.editPropertiesButton)) && (await this.editPropertiesButton.isEnabled()); + } + + async isLessInfoButtonEnabled() { + return (await browser.isElementPresent(this.lessInfoButton)) && (await this.lessInfoButton.isEnabled()); + } + + async isMoreInfoButtonEnabled() { + return (await browser.isElementPresent(this.moreInfoButton)) && (await this.moreInfoButton.isEnabled()); + } + + async isLessInfoButtonDisplayed() { + return await browser.isElementPresent(this.lessInfoButton); + } + + async isMoreInfoButtonDisplayed() { + return await browser.isElementPresent(this.moreInfoButton); + } + + async clickLessInformationButton() { + return await this.lessInfoButton.click(); + } + + async clickMoreInformationButton() { + return await this.moreInfoButton.click(); + } + + async isImagePropertiesPanelDisplayed() { + return (await browser.isElementPresent(this.imagePropertiesPanel)) && (await this.imagePropertiesPanel.isDisplayed()); + } + + async clickImagePropertiesPanel() { + return await this.imagePropertiesPanel.click(); + } + +} + diff --git a/e2e/components/info-drawer/info-drawer-metadata-library.ts b/e2e/components/info-drawer/info-drawer-metadata-library.ts new file mode 100755 index 0000000000..f5f2e76571 --- /dev/null +++ b/e2e/components/info-drawer/info-drawer-metadata-library.ts @@ -0,0 +1,254 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor'; +import { Component } from '../component'; +import { BROWSER_WAIT_TIMEOUT } from '../../configs'; + +export class LibraryMetadata extends Component { + private static selectors = { + root: 'app-library-metadata-form', + + metadataTabContent: '.mat-card-content', + metadataTabAction: '.mat-card-actions .mat-button', + field: '.mat-form-field', + fieldLabelWrapper: '.mat-form-field-label-wrapper', + fieldInput: '.mat-input-element', + dropDown: '.mat-select', + + visibilityOption: '.mat-option .mat-option-text', + + hint: '.mat-hint', + error: '.mat-error' + }; + + metadataTabContent: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.metadataTabContent)); + metadataTabAction: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.metadataTabAction)); + fieldLabelWrapper: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.fieldLabelWrapper)); + fieldInput: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.fieldInput)); + + visibilityDropDown: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.dropDown)); + visibilityPublic: ElementFinder = browser.element(by.cssContainingText(LibraryMetadata.selectors.visibilityOption, 'Public')); + visibilityPrivate: ElementFinder = browser.element(by.cssContainingText(LibraryMetadata.selectors.visibilityOption, 'Private')); + visibilityModerated: ElementFinder = browser.element(by.cssContainingText(LibraryMetadata.selectors.visibilityOption, 'Moderated')); + + hint: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.hint)); + error: ElementFinder = this.component.element(by.css(LibraryMetadata.selectors.error)); + + + constructor(ancestor?: ElementFinder) { + super(LibraryMetadata.selectors.root, ancestor); + } + + getLabelWrapper(label: string) { + return this.component.element(by.cssContainingText(LibraryMetadata.selectors.fieldLabelWrapper, label)); + } + + getFieldByName(fieldName: string) { + const wrapper = this.getLabelWrapper(fieldName); + return wrapper.element(by.xpath('..')).element(by.css(LibraryMetadata.selectors.fieldInput)); + } + + async isFieldDisplayed(fieldName: string) { + return await browser.isElementPresent(this.getFieldByName(fieldName)); + } + + async isInputEnabled(fieldName: string) { + return this.getFieldByName(fieldName).isEnabled(); + } + + async getValueOfField(fieldName: string) { + return await this.getFieldByName(fieldName).getText(); + } + + async enterTextInInput(fieldName: string, text: string) { + const input = this.getFieldByName(fieldName); + await input.clear(); + return await input.sendKeys(text); + } + + + getButton(button: string) { + return this.component.element(by.cssContainingText(LibraryMetadata.selectors.metadataTabAction, button)); + } + + async isButtonDisplayed(button: string) { + return browser.isElementPresent(this.getButton(button)); + } + + async isButtonEnabled(button: string) { + return await this.getButton(button).isEnabled(); + } + + async clickButton(button: string) { + return await this.getButton(button).click(); + } + + async waitForVisibilityDropDownToOpen() { + await browser.wait(EC.presenceOf(this.visibilityDropDown), BROWSER_WAIT_TIMEOUT); + } + + async waitForVisibilityDropDownToClose() { + await browser.wait(EC.stalenessOf(browser.$('.mat-option .mat-option-text')), BROWSER_WAIT_TIMEOUT); + } + + async isMessageDisplayed() { + return await browser.isElementPresent(this.hint); + } + + async getMessage() { + return await this.hint.getText(); + } + + async isErrorDisplayed() { + return await browser.isElementPresent(this.error); + } + + async getError() { + return await this.error.getText(); + } + + + async isNameDisplayed() { + return await this.isFieldDisplayed('Name'); + } + + async isNameEnabled() { + return await this.isInputEnabled('Name'); + } + + async getName() { + return await this.getValueOfField('Name'); + } + + async enterName(name: string) { + return await this.enterTextInInput('Name', name); + } + + + async isDescriptionDisplayed() { + return await this.isFieldDisplayed('Description'); + } + + async isDescriptionEnabled() { + return await this.isInputEnabled('Description'); + } + + async getDescription() { + return await this.getValueOfField('Description'); + } + + async enterDescription(desc: string) { + return await this.enterTextInInput('Description', desc); + } + + + async isVisibilityEnabled() { + const wrapper = this.getLabelWrapper('Visibility'); + const field = wrapper.element(by.xpath('..')).element(by.css(LibraryMetadata.selectors.dropDown)); + return await field.isEnabled(); + } + + async isVisibilityDisplayed() { + return await this.isFieldDisplayed('Visibility'); + } + + async getVisibility() { + return await this.getValueOfField('Visibility'); + } + + async setVisibility(visibility: string) { + const val = visibility.toLowerCase(); + + await this.visibilityDropDown.click(); + await this.waitForVisibilityDropDownToOpen(); + + if (val === 'public') { + await this.visibilityPublic.click(); + } else if (val === 'private') { + await this.visibilityPrivate.click(); + } else if (val === 'moderated') { + await this.visibilityModerated.click(); + } else { + console.log('----- invalid visibility', val); + } + + await this.waitForVisibilityDropDownToClose(); + } + + + async isLibraryIdDisplayed() { + return await this.isFieldDisplayed('Library ID'); + } + + async isLibraryIdEnabled() { + return await this.isInputEnabled('Library ID'); + } + + async getLibraryId() { + return await this.getValueOfField('Library ID'); + } + + + async isEditLibraryPropertiesEnabled() { + return await this.isButtonEnabled('Edit'); + } + + async isEditLibraryPropertiesDisplayed() { + return await this.isButtonDisplayed('Edit'); + } + + async clickEditLibraryProperties() { + return await this.clickButton('Edit'); + } + + + async isUpdateEnabled() { + return await this.isButtonEnabled('Update'); + } + + async isUpdateDisplayed() { + return await this.isButtonDisplayed('Update'); + } + + async clickUpdate() { + return await this.clickButton('Update'); + } + + + async isCancelEnabled() { + return await this.isButtonEnabled('Cancel'); + } + + async isCancelDisplayed() { + return await this.isButtonDisplayed('Cancel'); + } + + async clickCancel() { + return await this.clickButton('Cancel'); + } + +} + diff --git a/e2e/components/info-drawer/info-drawer.ts b/e2e/components/info-drawer/info-drawer.ts index b366ff4359..46d8371a45 100755 --- a/e2e/components/info-drawer/info-drawer.ts +++ b/e2e/components/info-drawer/info-drawer.ts @@ -23,13 +23,16 @@ * along with Alfresco. If not, see . */ -import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, until } from 'protractor'; +import { ElementFinder, ElementArrayFinder, by, browser, ExpectedConditions as EC, $ } from 'protractor'; import { Component } from '../component'; import { BROWSER_WAIT_TIMEOUT } from '../../configs'; +import { CommentsTab } from './info-drawer-comments-tab'; +import { LibraryMetadata } from './info-drawer-metadata-library'; +import { ContentMetadata } from './info-drawer-metadata-content'; export class InfoDrawer extends Component { private static selectors = { - root: 'aca-info-drawer', + root: 'adf-info-drawer', header: '.adf-info-drawer-layout-header', content: '.adf-info-drawer-layout-content', @@ -42,34 +45,13 @@ export class InfoDrawer extends Component { next: '.mat-tab-header-pagination-after .mat-tab-header-pagination-chevron', previous: '.mat-tab-header-pagination-before .mat-tab-header-pagination-chevron', - headerTitle: '.adf-info-drawer-layout-header-title', - - // comments tab - commentsContainer: '.adf-comments-container', - commentsHeader: '.adf-comments-header', - commentsTextArea: '.adf-comments-input-container textarea', - addCommentButton: 'button.adf-comments-input-add', - commentsList: '.adf-comment-list', - commentsListItem: '.adf-comment-list-item', - commentById: `adf-comment-`, - commentUserName: 'comment-user', - commentUserAvatar: 'comment-user-icon', - commentMessage: 'comment-message', - commentTime: 'comment-time', - - // metadata card - metadataTabContent: '.app-metadata-tab .mat-card-content', - metadataTabAction: '.app-metadata-tab .mat-card-actions .mat-button', - field: '.mat-form-field', - fieldLabelWrapper: '.mat-form-field-label-wrapper', - fieldInput: '.mat-input-element', - dropDown: '.mat-select', - visibilityOption: '.mat-option .mat-option-text', - - hint: '.mat-hint', - error: '.mat-error' + headerTitle: '.adf-info-drawer-layout-header-title' }; + commentsTab = new CommentsTab($(InfoDrawer.selectors.root)); + aboutTab = new LibraryMetadata($(InfoDrawer.selectors.root)); + propertiesTab = new ContentMetadata($(InfoDrawer.selectors.root)); + header: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.header)); headerTitle: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.headerTitle)); tabLabel: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.tabLabel)); @@ -78,40 +60,14 @@ export class InfoDrawer extends Component { tabActiveContent: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.activeTabContent)); - commentsContainer: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.commentsContainer)); - commentsHeader: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.commentsHeader)); - commentTextarea: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.commentsTextArea)); - addCommentButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.addCommentButton)); - commentsList: ElementArrayFinder = this.component.all(by.css(InfoDrawer.selectors.commentsListItem)); - - commentListItem = by.css(InfoDrawer.selectors.commentsListItem); - - commentUserAvatar = by.id(InfoDrawer.selectors.commentUserAvatar); - commentUser = by.id(InfoDrawer.selectors.commentUserName) - commentText = by.id(InfoDrawer.selectors.commentMessage); - commentTime = by.id(InfoDrawer.selectors.commentTime); - nextButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.next)); previousButton: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.previous)); - metadataTabContent: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.metadataTabContent)); - metadataTabAction: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.metadataTabAction)); - fieldLabelWrapper: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.fieldLabelWrapper)); - fieldInput: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.fieldInput)); - - visibilityDropDown: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.dropDown)); - visibilityPublic: ElementFinder = browser.element(by.cssContainingText(InfoDrawer.selectors.visibilityOption, 'Public')); - visibilityPrivate: ElementFinder = browser.element(by.cssContainingText(InfoDrawer.selectors.visibilityOption, 'Private')); - visibilityModerated: ElementFinder = browser.element(by.cssContainingText(InfoDrawer.selectors.visibilityOption, 'Moderated')); - - hint: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.hint)); - error: ElementFinder = this.component.element(by.css(InfoDrawer.selectors.error)); constructor(ancestor?: ElementFinder) { super(InfoDrawer.selectors.root, ancestor); } - async waitForInfoDrawerToOpen() { return await browser.wait(EC.presenceOf(this.header), BROWSER_WAIT_TIMEOUT); } @@ -124,10 +80,6 @@ export class InfoDrawer extends Component { return !(await browser.isElementPresent(by.css(InfoDrawer.selectors.tabs))); } - async waitForCommentsTabContainer() { - await browser.wait(EC.visibilityOf(this.commentsContainer), BROWSER_WAIT_TIMEOUT); - } - getTabByTitle(title: string) { return this.component.element(by.cssContainingText(InfoDrawer.selectors.tabLabel, title)); } @@ -166,60 +118,6 @@ export class InfoDrawer extends Component { return await this.headerTitle.getText(); } - getLabelWrapper(label: string) { - return this.component.element(by.cssContainingText(InfoDrawer.selectors.fieldLabelWrapper, label)); - } - - getFieldByName(fieldName: string) { - const wrapper = this.getLabelWrapper(fieldName); - return wrapper.element(by.xpath('..')).element(by.css(InfoDrawer.selectors.fieldInput)); - } - - async isFieldDisplayed(fieldName: string) { - return await browser.isElementPresent(this.getFieldByName(fieldName)); - } - - async isInputEnabled(fieldName: string) { - return this.getFieldByName(fieldName).isEnabled(); - } - - async getValueOfField(fieldName: string) { - return await this.getFieldByName(fieldName).getText(); - } - - async enterTextInInput(fieldName: string, text: string) { - const input = this.getFieldByName(fieldName); - await input.clear(); - return await input.sendKeys(text); - } - - - getButton(button: string) { - return this.component.element(by.cssContainingText(InfoDrawer.selectors.metadataTabAction, button)); - } - - async isButtonDisplayed(button: string) { - return browser.isElementPresent(this.getButton(button)); - } - - async isButtonEnabled(button: string) { - return await this.getButton(button).isEnabled(); - } - - async clickButton(button: string) { - return await this.getButton(button).click(); - } - - async waitForVisibilityDropDownToOpen() { - await browser.wait(EC.presenceOf(this.visibilityDropDown), BROWSER_WAIT_TIMEOUT); - } - - async waitForVisibilityDropDownToClose() { - await browser.wait(EC.stalenessOf(browser.$('.mat-option .mat-option-text')), BROWSER_WAIT_TIMEOUT); - } - - // --------------- - async isAboutTabDisplayed() { return await this.isTabDisplayed('About'); } @@ -228,236 +126,27 @@ export class InfoDrawer extends Component { return await this.isTabDisplayed('Properties'); } + async isPropertiesTabActive() { + return (await this.getActiveTabTitle()) === 'PROPERTIES'; + } + async isCommentsTabDisplayed() { return await this.isTabDisplayed('Comments'); } - async clickCommentsTab() { try { await this.getTabByTitle('Comments').click(); - await this.waitForCommentsTabContainer(); - await browser.wait(EC.visibilityOf(this.addCommentButton), BROWSER_WAIT_TIMEOUT); + await this.commentsTab.waitForCommentsContainer(); + await Promise.all([ + browser.wait(EC.visibilityOf(this.commentsTab.component), BROWSER_WAIT_TIMEOUT), + browser.wait(EC.invisibilityOf(this.propertiesTab.component), BROWSER_WAIT_TIMEOUT) + ]); } catch (error) { console.error('--- catch error on clickCommentsTab ---'); throw error; } } - async clickAboutTab() { - try { - return await this.getTabByTitle('About').click(); - } catch (error) { - console.error('--- catch error on clickAboutTab ---'); - } - } - - - async isMessageDisplayed() { - return await browser.isElementPresent(this.hint); - } - - async getMessage() { - return await this.hint.getText(); - } - - async isErrorDisplayed() { - return await browser.isElementPresent(this.error); - } - - async getError() { - return await this.error.getText(); - } - - - async isNameDisplayed() { - return await this.isFieldDisplayed('Name'); - } - - async isNameEnabled() { - return await this.isInputEnabled('Name'); - } - - async getName() { - return await this.getValueOfField('Name'); - } - - async enterName(name: string) { - return await this.enterTextInInput('Name', name); - } - - - async isDescriptionDisplayed() { - return await this.isFieldDisplayed('Description'); - } - - async isDescriptionEnabled() { - return await this.isInputEnabled('Description'); - } - - async getDescription() { - return await this.getValueOfField('Description'); - } - - async enterDescription(desc: string) { - return await this.enterTextInInput('Description', desc); - } - - - async isVisibilityEnabled() { - const wrapper = this.getLabelWrapper('Visibility'); - const field = wrapper.element(by.xpath('..')).element(by.css(InfoDrawer.selectors.dropDown)); - return await field.isEnabled(); - } - - async isVisibilityDisplayed() { - return await this.isFieldDisplayed('Visibility'); - } - - async getVisibility() { - return await this.getValueOfField('Visibility'); - } - - async setVisibility(visibility: string) { - const val = visibility.toLowerCase(); - - await this.visibilityDropDown.click(); - await this.waitForVisibilityDropDownToOpen(); - - if (val === 'public') { - await this.visibilityPublic.click(); - } else if (val === 'private') { - await this.visibilityPrivate.click(); - } else if (val === 'moderated') { - await this.visibilityModerated.click(); - } else { - console.log('----- invalid visibility', val); - } - - await this.waitForVisibilityDropDownToClose(); - } - - - async isLibraryIdDisplayed() { - return await this.isFieldDisplayed('Library ID'); - } - - async isLibraryIdEnabled() { - return await this.isInputEnabled('Library ID'); - } - - async getLibraryId() { - return await this.getValueOfField('Library ID'); - } - - - async isEditEnabled() { - return await this.isButtonEnabled('Edit'); - } - - async isEditDisplayed() { - return await this.isButtonDisplayed('Edit'); - } - - async clickEdit() { - return await this.clickButton('Edit'); - } - - - async isUpdateEnabled() { - return await this.isButtonEnabled('Update'); - } - - async isUpdateDisplayed() { - return await this.isButtonDisplayed('Update'); - } - - async clickUpdate() { - return await this.clickButton('Update'); - } - - - async isCancelEnabled() { - return await this.isButtonEnabled('Cancel'); - } - - async isCancelDisplayed() { - return await this.isButtonDisplayed('Cancel'); - } - - async clickCancel() { - return await this.clickButton('Cancel'); - } - - - async getCommentsTabHeaderText() { - return await this.commentsHeader.getText(); - } - - async isCommentTextAreaDisplayed() { - return await browser.isElementPresent(this.commentTextarea); - } - - async isAddCommentButtonEnabled() { - const present = await browser.isElementPresent(this.addCommentButton); - if (present) { - return await this.addCommentButton.isEnabled(); - } - return false; - } - - async getCommentListItem() { - return await browser.wait(until.elementLocated(this.commentListItem), BROWSER_WAIT_TIMEOUT / 2); - } - - async getCommentById(commentId?: string) { - if (commentId) { - return await browser.wait(until.elementLocated(by.id(`${InfoDrawer.selectors.commentById}${commentId}`)), BROWSER_WAIT_TIMEOUT / 2); - } - return await this.getCommentListItem(); - } - - async isCommentDisplayed(commentId?: string) { - return await browser.isElementPresent(await this.getCommentById(commentId)); - } - - async isCommentUserAvatarDisplayed(commentId?: string) { - const commentElement = await this.getCommentById(commentId); - return await browser.isElementPresent(commentElement.findElement(this.commentUserAvatar)); - } - - async getCommentText(commentId?: string) { - const commentElement = await this.getCommentById(commentId); - const message = await commentElement.findElement(this.commentText); - return await message.getText(); - } - - async getCommentUserName(commentId?: string) { - const commentElement = await this.getCommentById(commentId); - const user = await commentElement.findElement(this.commentUser); - return await user.getText(); - } - - async getCommentTime(commentId?: string) { - const commentElement = await this.getCommentById(commentId); - const time = await commentElement.findElement(this.commentTime); - return await time.getText(); - } - - async getNthCommentId(index: number) { - return await this.commentsList.get(index - 1).getAttribute('id'); - } - - async typeComment(text: string) { - return await this.commentTextarea.sendKeys(text); - } - - async clickAddButton() { - return await this.addCommentButton.click(); - } - - async getCommentTextFromTextArea() { - return await this.commentTextarea.getAttribute('value'); - } } diff --git a/e2e/components/login/login.ts b/e2e/components/login/login.ts index 9d33decb2a..b4e654f441 100755 --- a/e2e/components/login/login.ts +++ b/e2e/components/login/login.ts @@ -68,8 +68,8 @@ export class LoginComponent extends Component { await this.enterPassword(password); } - submit() { - return this.submitButton.click(); + async submit() { + await this.submitButton.click(); } async clickPasswordVisibility() { diff --git a/e2e/components/menu/menu.ts b/e2e/components/menu/menu.ts index 07b9ae09c4..6dabbd736b 100755 --- a/e2e/components/menu/menu.ts +++ b/e2e/components/menu/menu.ts @@ -40,8 +40,8 @@ export class Menu extends Component { editFolder: `.mat-menu-item[id$='editFolder']`, favoriteAction: `.mat-menu-item[id$='favorite.add']`, removeFavoriteAction: `.mat-menu-item[id$='favorite.remove']`, - editOffline: `.mat-menu-item[title='Edit offline']`, - cancelEditing: `.mat-menu-item[title='Cancel editing']` + editOffline: `.mat-menu-item[title='Edit Offline']`, + cancelEditing: `.mat-menu-item[title='Cancel Editing']` }; items: ElementArrayFinder = this.component.all(by.css(Menu.selectors.item)); @@ -50,9 +50,9 @@ export class Menu extends Component { submenus: ElementArrayFinder = browser.element.all(by.css(Menu.selectors.submenu)); cancelEditingAction: ElementFinder = this.component.element(by.css(Menu.selectors.cancelEditing)); - cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel join')); + cancelJoinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Cancel Join')); copyAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Copy')); - createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create folder')); + createFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Folder')); createLibraryAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Create Library')); deleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Delete')); downloadAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Download')); @@ -61,38 +61,38 @@ export class Menu extends Component { favoriteAction: ElementFinder = this.component.element(by.css(Menu.selectors.favoriteAction)); removeFavoriteAction: ElementFinder = this.component.element(by.css(Menu.selectors.removeFavoriteAction)); toggleFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Favorite')); - toggleRemoveFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Remove favorite')); + toggleRemoveFavoriteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Remove Favorite')); joinAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Join')); leaveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Leave')); managePermissionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permissions')); manageVersionsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Manage Versions')); - uploadNewVersionAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload new version')); + uploadNewVersionAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload New Version')); moveAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Move')); - permanentDeleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permanently delete')); + permanentDeleteAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Permanently Delete')); restoreAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Restore')); shareAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Share')); - shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared link settings')); - uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload file')); - uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload folder')); + shareEditAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Shared Link Settings')); + uploadFileAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload File')); + uploadFolderAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'Upload Folder')); viewAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View')); - viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View details')); + viewDetailsAction: ElementFinder = this.component.element(by.cssContainingText(Menu.selectors.item, 'View Details')); constructor(ancestor?: ElementFinder) { super(Menu.selectors.root, ancestor); } async waitForMenuToOpen() { - await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-backdrop'))), BROWSER_WAIT_TIMEOUT); - await browser.wait(EC.presenceOf(browser.element(by.css('.mat-menu-panel'))), BROWSER_WAIT_TIMEOUT); + await browser.wait(EC.presenceOf(browser.element(by.css('.cdk-overlay-container .mat-menu-panel'))), BROWSER_WAIT_TIMEOUT); await browser.wait(EC.visibilityOf(this.items.get(0)), BROWSER_WAIT_TIMEOUT); } async waitForMenuToClose() { - await browser.wait(EC.not(EC.presenceOf(browser.element(by.css('.mat-menu-panel')))), BROWSER_WAIT_TIMEOUT); + await browser.wait(EC.not(EC.presenceOf(browser.element(by.css('.cdk-overlay-container .mat-menu-panel')))), BROWSER_WAIT_TIMEOUT); } async closeMenu() { - return Utils.pressEscape(); + await Utils.pressEscape(); + await this.waitForMenuToClose(); } getNthItem(nth: number) { @@ -127,17 +127,29 @@ export class Menu extends Component { return await this.items.count(); } + async getMenuItems(): Promise { + return this.items.map(async (elem) => { + const text = await elem.element(by.css('span')).getText(); + return text; + }); + } + async clickNthItem(nth: number) { - const elem = this.getNthItem(nth); - await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT); - await browser.actions().mouseMove(elem).click().perform(); - await this.waitForMenuToClose(); + try { + const elem = this.getNthItem(nth); + await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT, 'timeout waiting for menu item to be clickable'); + await browser.actions().mouseMove(elem).perform(); + await browser.actions().click().perform(); + await this.waitForMenuToClose(); + } catch (e) { + console.log('____ click nth menu item catch ___', e); + } } async clickMenuItem(menuItem: string) { try { const elem = this.getItemByLabel(menuItem); - await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT); + await browser.wait(EC.elementToBeClickable(elem), BROWSER_WAIT_TIMEOUT, 'timeout waiting for menu item to be clickable'); await elem.click(); } catch (e) { console.log('___click menu item catch___', e); diff --git a/e2e/components/pagination/pagination.ts b/e2e/components/pagination/pagination.ts index b5b5d5aea7..0eba151a5f 100755 --- a/e2e/components/pagination/pagination.ts +++ b/e2e/components/pagination/pagination.ts @@ -23,10 +23,11 @@ * along with Alfresco. If not, see . */ -import { ElementFinder, by } from 'protractor'; +import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor'; +import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { Menu } from '../menu/menu'; import { Component } from '../component'; -import { browser } from 'protractor'; + export class Pagination extends Component { private static selectors = { root: 'adf-pagination', @@ -59,27 +60,45 @@ export class Pagination extends Component { async openMaxItemsMenu() { const { menu, maxItemsButton } = this; - await maxItemsButton.click(); - await menu.waitForMenuToOpen(); + try { + await browser.wait(EC.elementToBeClickable(maxItemsButton), BROWSER_WAIT_TIMEOUT, 'timeout waiting for maxItemsButton to be clickable'); + await maxItemsButton.click(); + await menu.waitForMenuToOpen(); + } catch (error) { + console.log('____ open max items catch ___', error); + } } async openCurrentPageMenu() { const { menu, pagesButton } = this; - await pagesButton.click(); - await menu.waitForMenuToOpen(); + try { + await browser.wait(EC.elementToBeClickable(pagesButton), BROWSER_WAIT_TIMEOUT, 'timeout waiting for pagesButton to be clickable'); + await pagesButton.click(); + await menu.waitForMenuToOpen(); + } catch (error) { + console.log('____ open current page menu ___', error); + } } async resetToDefaultPageSize() { - await this.openMaxItemsMenu(); - await this.menu.clickMenuItem('25'); - await this.menu.waitForMenuToClose(); + try { + await this.openMaxItemsMenu(); + await this.menu.clickNthItem(1); + await this.menu.waitForMenuToClose(); + } catch (error) { + console.log('___ reset to default page size catch ___', error); + } } async resetToDefaultPageNumber() { - await this.openCurrentPageMenu(); - await this.menu.clickMenuItem('1'); - await this.menu.waitForMenuToClose(); + try { + await this.openCurrentPageMenu(); + await this.menu.clickNthItem(1); + await this.menu.waitForMenuToClose(); + } catch (error) { + console.log('____ reset to default page number catch ___', error); + } } async clickNext() { diff --git a/e2e/components/search/search-input.ts b/e2e/components/search/search-input.ts index 6246561ca3..37ebec3fca 100755 --- a/e2e/components/search/search-input.ts +++ b/e2e/components/search/search-input.ts @@ -167,9 +167,4 @@ export class SearchInput extends Component { await this.searchBar.sendKeys(text); await this.searchBar.sendKeys(protractor.Key.ENTER); } - - async searchForTextAndCloseSearchOptions(text: string) { - await this.searchFor(text); - await Utils.pressEscape(); - } } diff --git a/e2e/components/sidenav/sidenav.ts b/e2e/components/sidenav/sidenav.ts index c138c7e3d8..b6c4fecd31 100755 --- a/e2e/components/sidenav/sidenav.ts +++ b/e2e/components/sidenav/sidenav.ts @@ -32,13 +32,14 @@ import { Utils } from '../../utilities/utils'; export class Sidenav extends Component { private static selectors = { root: 'app-sidenav', - link: '.menu__item', - label: '.item--label', + link: '.item', + label: '.action-button__label', expansion_panel: ".mat-expansion-panel-header", expansion_panel_content: ".mat-expansion-panel-body", active: 'mat-accent', - activeClass: '.item--active', - activeChild: 'item--active', + activeClass: '.action-button--active', + activeClassName: 'action-button--active', + activeChild: 'action-button--active', newButton: '[data-automation-id="create-button"]', @@ -97,7 +98,7 @@ export class Sidenav extends Component { async openCreateFolderDialog() { await this.openNewMenu(); - await this.menu.clickMenuItem('Create folder'); + await this.menu.clickMenuItem('Create Folder'); } async openCreateLibraryDialog() { @@ -106,7 +107,7 @@ export class Sidenav extends Component { } async isActive(name: string) { - return await this.getLinkLabel(name).isElementPresent(by.css(Sidenav.selectors.activeClass)); + return (await this.getLinkLabel(name).getAttribute('class')).includes(Sidenav.selectors.activeClassName); } async childIsActive(name: string) { diff --git a/e2e/components/toolbar/toolbar.ts b/e2e/components/toolbar/toolbar.ts index baf0108ff4..1e52b0c767 100755 --- a/e2e/components/toolbar/toolbar.ts +++ b/e2e/components/toolbar/toolbar.ts @@ -34,17 +34,17 @@ export class Toolbar extends Component { button: 'button', share: `.mat-icon-button[title='Share']`, - shareEdit: `.mat-icon-button[title='Shared link settings']`, + shareEdit: `.mat-icon-button[title='Shared Link Settings']`, view: `.mat-icon-button[title='View']`, searchFilterToggle: `.mat-icon-button[title='Toggle search filter']`, download: `.mat-icon-button[title='Download']`, editFolder: 'app.toolbar.editFolder', - viewDetails: `.mat-icon-button[title='View details']`, + viewDetails: `.mat-icon-button[title='View Details']`, print: `.mat-icon-button[title='Print']`, fullScreen: `.mat-icon-button[title='Activate full-screen mode']`, joinLibrary: `.mat-icon-button[title='Join']`, - leaveLibrary: `.mat-icon-button[title='Leave library']`, - permanentlyDelete: `.mat-icon-button[title='Permanently delete']`, + leaveLibrary: `.mat-icon-button[title='Leave Library']`, + permanentlyDelete: `.mat-icon-button[title='Permanently Delete']`, restore: `.mat-icon-button[title='Restore']` }; @@ -77,6 +77,12 @@ export class Toolbar extends Component { return await this.buttons.count(); } + async getButtons(): Promise { + return this.buttons.map(async elem => { + return await elem.getAttribute('title'); + }); + } + async isButtonPresent(title: string) { const elem = this.component.element(by.css(`${Toolbar.selectors.button}[title="${title}"]`)); return await elem.isPresent(); @@ -95,8 +101,8 @@ export class Toolbar extends Component { } async openMoreMenu() { - await this.isButtonPresent('More actions'); - const moreMenu = this.getButtonByTitleAttribute('More actions'); + await this.isButtonPresent('More Actions'); + const moreMenu = this.getButtonByTitleAttribute('More Actions'); await moreMenu.click(); await this.menu.waitForMenuToOpen(); } @@ -209,7 +215,7 @@ export class Toolbar extends Component { async clickMoreActionsRemoveFavorite() { await this.openMoreMenu(); - return await this.menu.clickMenuItem('Remove favorite'); + return await this.menu.clickMenuItem('Remove Favorite'); } async clickMoreActionsDelete() { @@ -234,17 +240,17 @@ export class Toolbar extends Component { async clickMoreActionsEditOffline() { await this.openMoreMenu(); - return await this.menu.clickMenuItem('Edit offline'); + return await this.menu.clickMenuItem('Edit Offline'); } async clickMoreActionsCancelEditing() { await this.openMoreMenu(); - return await this.menu.clickMenuItem('Cancel editing'); + return await this.menu.clickMenuItem('Cancel Editing'); } async clickMoreActionsUploadNewVersion() { await this.openMoreMenu(); - return await this.menu.clickMenuItem('Upload new version'); + return await this.menu.clickMenuItem('Upload New Version'); } async clickFullScreen() { diff --git a/e2e/components/viewer/viewer.ts b/e2e/components/viewer/viewer.ts index 60cb6709ac..944aa928eb 100755 --- a/e2e/components/viewer/viewer.ts +++ b/e2e/components/viewer/viewer.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import { ElementFinder, by, browser, ExpectedConditions as EC } from 'protractor'; +import { ElementFinder, by, browser, ExpectedConditions as EC, ElementArrayFinder } from 'protractor'; import { Component } from '../component'; import { BROWSER_WAIT_TIMEOUT } from '../../configs'; import { Toolbar } from '../toolbar/toolbar'; @@ -37,7 +37,9 @@ export class Viewer extends Component { closeBtn: '.adf-viewer-close-button', fileTitle: '.adf-viewer__file-title', - viewerExtensionContent: 'app-preview-extension' + viewerExtensionContent: 'adf-preview-extension', + + pdfViewerContentPage: '.adf-pdf-viewer__content .page' }; root: ElementFinder = browser.$(Viewer.selectors.root); @@ -46,6 +48,7 @@ export class Viewer extends Component { closeButton: ElementFinder = this.component.element(by.css(Viewer.selectors.closeBtn)); fileTitle: ElementFinder = this.component.element(by.css(Viewer.selectors.fileTitle)); viewerExtensionContent: ElementFinder = this.component.element(by.css(Viewer.selectors.viewerExtensionContent)); + pdfViewerContentPages: ElementArrayFinder = this.component.all(by.css(Viewer.selectors.pdfViewerContentPage)); toolbar = new Toolbar(this.component); @@ -63,7 +66,6 @@ export class Viewer extends Component { async isViewerOpened() { return await browser.isElementPresent(this.viewerLayout); - // return await this.viewerLayout.isPresent(); } async isViewerContentDisplayed() { @@ -103,4 +105,9 @@ export class Viewer extends Component { return await this.viewerExtensionContent.getAttribute('data-automation-id'); } } + + async isPdfViewerContentDisplayed() { + const count = await this.pdfViewerContentPages.count(); + return count > 0; + } } diff --git a/e2e/configs.ts b/e2e/configs.ts index c663f1c017..d1504f59aa 100755 --- a/e2e/configs.ts +++ b/e2e/configs.ts @@ -42,6 +42,10 @@ export const ADMIN_FULL_NAME = 'Administrator'; export const E2E_ROOT_PATH = __dirname; +// Dates +export const DATE_FORMAT = 'MMM D, YYYY'; +export const DATE_TIME_FORMAT = 'MMM D, YYYY, H:mm'; + // Application Routes export const APP_ROUTES = { FAVORITES: '/favorites', @@ -113,7 +117,12 @@ export const FILES = { xlsxFile: 'file-xlsx.xlsx', xlsxFile2: 'file2-xlsx.xlsx', pdfFile: 'file-pdf.pdf', - unsupportedFile: 'file_unsupported.3DS' + unsupportedFile: 'file_unsupported.3DS', + protectedFile: { + name: 'protected.pdf', + password: '0000' + }, + jpgFile: 'file-jpg.jpg' }; export const EXTENSIBILITY_CONFIGS = { diff --git a/e2e/pages/page.ts b/e2e/pages/page.ts index 0d7a72cebd..64a616f22f 100755 --- a/e2e/pages/page.ts +++ b/e2e/pages/page.ts @@ -25,6 +25,7 @@ import { browser, by, ElementFinder, ExpectedConditions as EC, until } from 'protractor'; import { BROWSER_WAIT_TIMEOUT, USE_HASH_STRATEGY } from './../configs'; +import { Utils } from '../utilities/utils'; export abstract class Page { protected static locators = { @@ -55,22 +56,22 @@ export abstract class Page { constructor(public url: string = '') {} - getTitle() { - return browser.getTitle(); + async getTitle() { + return await browser.getTitle(); } - load(relativeUrl: string = '') { + async load(relativeUrl: string = '') { const hash = USE_HASH_STRATEGY ? '/#' : ''; const path = `${browser.baseUrl}${hash}${this.url}${relativeUrl}`; - return browser.get(path); + return await browser.get(path); } - waitForApp() { - return browser.wait(EC.presenceOf(this.layout), BROWSER_WAIT_TIMEOUT); + async waitForApp() { + return await browser.wait(EC.presenceOf(this.layout), BROWSER_WAIT_TIMEOUT); } - waitForSnackBarToAppear() { - return browser.wait(until.elementLocated(by.css('.mat-snack-bar-container')), BROWSER_WAIT_TIMEOUT, '------- timeout waiting for snackbar to appear'); + async waitForSnackBarToAppear() { + return await browser.wait(until.elementLocated(by.css('.mat-snack-bar-container')), BROWSER_WAIT_TIMEOUT, '------- timeout waiting for snackbar to appear'); } async waitForSnackBarToClose() { @@ -81,6 +82,16 @@ export abstract class Page { await browser.wait(EC.visibilityOf(this.dialogContainer), BROWSER_WAIT_TIMEOUT); } + async isDialogOpen() { + return await browser.isElementPresent(this.dialogContainer); + } + + async closeOpenDialogs() { + while (await this.isDialogOpen()) { + await Utils.pressEscape(); + } + } + async refresh() { await browser.refresh(); await this.waitForApp(); diff --git a/e2e/pages/search-results-page.ts b/e2e/pages/search-results-page.ts index 5ec2a4e10a..a6b7c6a57c 100755 --- a/e2e/pages/search-results-page.ts +++ b/e2e/pages/search-results-page.ts @@ -23,35 +23,37 @@ * along with Alfresco. If not, see . */ -import { browser, ElementFinder } from 'protractor'; +import { browser, by } from 'protractor'; import { BrowsingPage } from './browsing-page'; export class SearchResultsPage extends BrowsingPage { private static selectors = { - root: 'aca-search-results', - filter: 'adf-search-filter', - expansionPanel: 'mat-expansion-panel', - size: '#expansion-panel-SEARCH.CATEGORIES.SIZE', - createdDate: '#expansion-panel-SEARCH.CATEGORIES.CREATED_DATE', - modifiedDate: '#expansion-panel-SEARCH.CATEGORIES.MODIFIED_DATE', - fileType: '#expansion-panel-SEARCH.FACET_FIELDS.FILE_TYPE', - creator: '#expansion-panel-SEARCH.CATEGORIES.CREATOR', - modifier: '#expansion-panel-SEARCH.CATEGORIES.MODIFIER', - location: '#expansion-panel-SEARCH.CATEGORIES.LOCATION', - - resultsContent: 'adf-search-results__content', - resultsContentHeader: 'adf-search-results__content-header', - resultsInfoText: 'adf-search-results--info-text', - resultsFacets: 'adf-search-results__facets', - - sortingPicker: 'adf-sorting-picker' + root: 'aca-search-results', + + filter: 'adf-search-filter', + expansionPanel: 'mat-expansion-panel', + size: '#expansion-panel-SEARCH.CATEGORIES.SIZE', + createdDate: '#expansion-panel-SEARCH.CATEGORIES.CREATED_DATE', + modifiedDate: '#expansion-panel-SEARCH.CATEGORIES.MODIFIED_DATE', + fileType: '#expansion-panel-SEARCH.FACET_FIELDS.FILE_TYPE', + creator: '#expansion-panel-SEARCH.CATEGORIES.CREATOR', + modifier: '#expansion-panel-SEARCH.CATEGORIES.MODIFIER', + location: '#expansion-panel-SEARCH.CATEGORIES.LOCATION', + + resultsContent: 'adf-search-results__content', + resultsContentHeader: '.adf-search-results__content-header', + resultsInfoText: 'adf-search-results--info-text', + resultsFacets: 'adf-search-results__facets', + + sortingPicker: 'adf-sorting-picker' }; - root: ElementFinder = browser.$(SearchResultsPage.selectors.root); - - waitForResults() { - return this.dataTable.waitForBody(); + async waitForResults() { + return await this.dataTable.waitForBody(); } + async getResultsHeader() { + return await browser.element(by.css(SearchResultsPage.selectors.resultsContentHeader)).getText(); + } } diff --git a/e2e/resources/extensibility-configs/context-submenus-ext.json b/e2e/resources/extensibility-configs/context-submenus-ext.json index 51c26e0c26..afd0c4e681 100644 --- a/e2e/resources/extensibility-configs/context-submenus-ext.json +++ b/e2e/resources/extensibility-configs/context-submenus-ext.json @@ -946,7 +946,6 @@ "id": "app.files.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -955,7 +954,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -982,7 +981,7 @@ "key": "modifiedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -992,7 +991,6 @@ "id": "app.libraries.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1001,7 +999,7 @@ "key": "title", "title": "APP.DOCUMENT_LIST.COLUMNS.TITLE", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.libraryName", "desktopOnly": false @@ -1021,7 +1019,6 @@ "id": "app.shared.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1030,7 +1027,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1066,7 +1063,7 @@ "key": "modifiedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true }, @@ -1075,7 +1072,7 @@ "key": "sharedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -1085,7 +1082,6 @@ "id": "app.recent.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1094,7 +1090,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1131,7 +1127,6 @@ "id": "app.favorites.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1140,7 +1135,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1176,7 +1171,7 @@ "key": "modifiedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -1186,7 +1181,6 @@ "id": "app.trashcan.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1195,7 +1189,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.trashcanName", "desktopOnly": false diff --git a/e2e/resources/extensibility-configs/document-presets-ext.json b/e2e/resources/extensibility-configs/document-presets-ext.json index 45f006c3d9..027d1458a0 100644 --- a/e2e/resources/extensibility-configs/document-presets-ext.json +++ b/e2e/resources/extensibility-configs/document-presets-ext.json @@ -880,7 +880,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -907,7 +907,7 @@ "key": "modifiedByUser.displayName", "title": "Test header", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true }, @@ -916,7 +916,7 @@ "key": "createdByUser.displayName", "title": "New column", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -926,7 +926,6 @@ "id": "app.libraries.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -935,7 +934,7 @@ "key": "title", "title": "APP.DOCUMENT_LIST.COLUMNS.TITLE", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.libraryName", "desktopOnly": false @@ -955,7 +954,6 @@ "id": "app.shared.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -964,7 +962,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1000,7 +998,7 @@ "key": "modifiedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true }, @@ -1009,7 +1007,7 @@ "key": "sharedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -1019,7 +1017,6 @@ "id": "app.recent.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1028,7 +1025,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1065,7 +1062,6 @@ "id": "app.favorites.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1074,7 +1070,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.name", "desktopOnly": false @@ -1110,7 +1106,7 @@ "key": "modifiedByUser.displayName", "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", "type": "text", - "class": "adf-data-table-cell--ellipsis", + "class": "adf-ellipsis-cell", "sortable": true, "desktopOnly": true } @@ -1120,7 +1116,6 @@ "id": "app.trashcan.thumbnail", "key": "$thumbnail", "type": "image", - "class": "adf-image-table-cell", "sortable": false, "desktopOnly": false }, @@ -1129,7 +1124,7 @@ "key": "name", "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", "type": "text", - "class": "adf-data-table-cell--ellipsis__name", + "class": "adf-ellipsis-cell adf-expand-cell-5", "sortable": true, "template": "app.columns.trashcanName", "desktopOnly": false diff --git a/e2e/resources/extensibility-configs/info-drawer-ext.json b/e2e/resources/extensibility-configs/info-drawer-ext.json index 735c7ba126..ab2631b3ef 100644 --- a/e2e/resources/extensibility-configs/info-drawer-ext.json +++ b/e2e/resources/extensibility-configs/info-drawer-ext.json @@ -1,773 +1,1648 @@ { - "$schema": "../../extension.schema.json", - "$name": "app", - "$version": "1.0.0", - "$references": [ - "plugin1.json", - "plugin2.json", - "dev.tools.json" - ], + "$schema": "../../extension.schema.json", + "$id": "app.core", + "$name": "app.core", + "$version": "1.0.0", + "$vendor": "Alfresco Software, Ltd.", + "$license": "LGPL-3.0", + "$runtime": "1.7.0", + "$description": "Core application extensions and features", + "$references": ["aos.plugin.json"], - "rules": [ - { - "id": "app.toolbar.favorite.canToggle", - "comment": "workaround for recent files and search api issue", - "type": "core.every", - "parameters": [ - { - "type": "rule", - "value": "core.some", - "parameters": [ - { "type": "rule", "value": "app.selection.canAddFavorite" }, - { "type": "rule", "value": "app.selection.canRemoveFavorite" } - ] - }, - { - "type": "rule", - "value": "core.some", - "parameters": [ - { "type": "rule", "value": "app.navigation.isRecentFiles" }, - { "type": "rule", "value": "app.navigation.isSharedFiles" }, - { "type": "rule", "value": "app.navigation.isSearchResults" } - ] - } - ] - }, + "rules": [ + { + "id": "app.toolbar.favorite.canToggle", + "comment": "workaround for recent files and search api issue", + "type": "core.every", + "parameters": [ { - "id": "app.toolbar.favorite.canAdd", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canAddFavorite" }, - { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, - { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, - { "type": "rule", "value": "app.navigation.isNotSearchResults" } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { + "type": "rule", + "value": "app.selection.canAddFavorite" + }, + { + "type": "rule", + "value": "app.selection.canRemoveFavorite" + } + ] }, { - "id": "app.toolbar.favorite.canRemove", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canRemoveFavorite" }, - { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, - { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, - { "type": "rule", "value": "app.navigation.isNotSearchResults" } - ] - }, + "type": "rule", + "value": "core.some", + "parameters": [ + { + "type": "rule", + "value": "app.navigation.isRecentFiles" + }, + { + "type": "rule", + "value": "app.navigation.isSharedFiles" + }, + { + "type": "rule", + "value": "app.navigation.isSearchResults" + }, + { + "type": "rule", + "value": "app.navigation.isFavorites" + } + ] + } + ] + }, + { + "id": "app.context.canShare", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canShare" }, + { "type": "rule", "value": "repository.isQuickShareEnabled" } + ] + }, + { + "id": "app.toolbar.canShare", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canShare" }, + { "type": "rule", "value": "repository.isQuickShareEnabled" }, { - "id": "app.toolbar.info", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isNotLibraries" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] - }, + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.file.isShared" } + ] + } + ] + }, + { + "id": "app.toolbar.favorite.canAdd", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canAddFavorite" }, + { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, { - "id": "app.toolbar.canCopyNode", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" }, - { "type": "rule", "value": "app.navigation.isNotLibraries" } - ] + "type": "rule", + "value": "app.navigation.isNotSearchResults" }, + { "type": "rule", "value": "app.navigation.isNotFavorites" } + ] + }, + { + "id": "app.toolbar.favorite.canRemove", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canRemoveFavorite" }, + { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, { - "id": "app.toolbar.permissions", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.file" }, - { "type": "rule", "value": "app.selection.first.canUpdate" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "app.navigation.isNotSearchResults" }, - { - "id": "app.toolbar.versions", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.file" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + { "type": "rule", "value": "app.navigation.isNotFavorites" } + ] + }, + { + "id": "app.toolbar.info", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isNotLibraries" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.libraries.toolbar", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.selection.library" } + ] + }, + { + "id": "app.libraries.toolbar.canToggleJoin", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.library" }, + { "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.isPrivateLibrary" } + ] }, + { "type": "rule", "value": "app.selection.hasNoLibraryRole" } + ] + }, + { + "id": "app.libraries.toolbar.canLeaveLibrary", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.library" }, + { "type": "rule", "value": "app.selection.hasLibraryRole" } + ] + }, + { + "id": "app.toolbar.canCopyNode", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { "type": "rule", "value": "app.navigation.isNotLibraries" } + ] + }, + { + "id": "app.toolbar.permissions", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.first.canUpdate" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.versions", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, { - "id": "app.trashcan.hasSelection", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isTrashcan" } - ] + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.file.isLocked" } + ] + } + ] + }, + { + "id": "app.trashcan.hasSelection", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isTrashcan" } + ] + }, + { + "id": "app.toolbar.canEditFolder", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.folder" }, + { "type": "rule", "value": "app.selection.folder.canUpdate" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canViewFile", + "type": "core.every", + "parameters": [ + { + "type": "rule", + "value": "app.selection.file" }, { - "id": "app.toolbar.canEditFolder", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.folder" }, - { "type": "rule", "value": "app.selection.folder.canUpdate" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.navigation.isTrashcan" } + ] + } + ] + }, + { + "id": "app.toolbar.canDownload", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canDownload" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canDelete", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canDelete" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canToggleLock", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.navigation.isNotFavorites" }, + { "type": "rule", "value": "app.navigation.isFavoritesPreview" } + ] }, { - "id": "app.toolbar.canViewFile", - "type": "core.every", - "parameters": [ - { - "type": "rule", - "value": "app.selection.file" - }, - { - "type": "rule", - "value": "core.not", - "parameters": [ - { "type": "rule", "value": "app.navigation.isTrashcan" } - ] - } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, + { "type": "rule", "value": "app.navigation.isSharedPreview" } + ] }, { - "id": "app.toolbar.canDownload", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canDownload" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canUnlock" }, + { "type": "rule", "value": "app.selection.file.canLock" } + ] } - ], + ] + }, + { + "id": "app.toolbar.canUploadNewVersion", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { "type": "rule", "value": "app.selection.file.canUploadVersion" } + ] + } + ], - "features": { - "create": [ - { - "id": "app.create.folder", + "features": { + "icons": [ + { + "id": "adf:join_library", + "value": "./assets/images/join-library.svg" + }, + { + "id": "adf:move_file", + "value": "./assets/images/adf-move-file-24px.svg" + } + ], + "create": [ + { + "id": "app.create.uploadFile", + "order": 100, + "icon": "file_upload", + "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE", + "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED", + "actions": { + "click": "UPLOAD_FILES" + }, + "rules": { + "enabled": "app.navigation.folder.canUpload" + } + }, + { + "id": "app.create.uploadFolder", + "order": 200, + "icon": "file_upload", + "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER", + "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED", + "actions": { + "click": "UPLOAD_FOLDER" + }, + "rules": { + "enabled": "app.navigation.folder.canUpload" + } + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.create.folder", + "order": 400, + "icon": "create_new_folder", + "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER", + "description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED", + "actions": { + "click": "CREATE_FOLDER" + }, + "rules": { + "enabled": "app.navigation.folder.canCreate" + } + }, + { + "id": "app.create.library", + "order": 600, + "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_LIBRARY", + "description": "APP.NEW_MENU.TOOLTIPS.CREATE_LIBRARY", + "icon": "create_new_folder", + "actions": { + "click": "CREATE_LIBRARY" + } + } + ], + "navbar": [ + { + "id": "app.navbar.primary", + "items": [ + { + "id": "app.navbar.personalFiles", + "order": 100, + "icon": "folder", + "title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP", + "route": "personal-files" + }, + { + "id": "app.navbar.libraries.menu", + "order": 200, + "icon": "library_books", + "title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP", + "children": [ + { + "id": "app.navbar.libraries.files", "order": 100, - "icon": "create_new_folder", - "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER", - "description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED", - "actions": { - "click": "CREATE_FOLDER" - }, - "rules": { - "enabled": "app.navigation.folder.canCreate" - } - }, - { - "id": "app.create.uploadFile", + "title": "APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.SIDENAV_LINK.TOOLTIP", + "route": "libraries" + }, + { + "id": "app.navbar.libraries.favorite", "order": 200, - "icon": "file_upload", - "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE", - "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED", - "actions": { - "click": "UPLOAD_FILES" - }, - "rules": { - "enabled": "app.navigation.folder.canUpload" - } - }, - { - "id": "app.create.uploadFolder", - "order": 300, - "icon": "file_upload", - "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER", - "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED", - "actions": { - "click": "UPLOAD_FOLDER" - }, - "rules": { - "enabled": "app.navigation.folder.canUpload" - } + "title": "APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.SIDENAV_LINK.TOOLTIP", + "route": "favorite/libraries" + } + ] + } + ] + }, + { + "id": "app.navbar.secondary", + "items": [ + { + "id": "app.navbar.shared", + "order": 100, + "icon": "people", + "title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP", + "route": "shared", + "rules": { + "visible": "repository.isQuickShareEnabled" } - ], - "navbar": [ - { - "id": "app.navbar.primary", - "items": [ - { - "id": "app.navbar.personalFiles", - "order": 100, - "icon": "folder", - "title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP", - "route": "personal-files" - }, - { - "id": "app.navbar.libraries", - "order": 200, - "icon": "group_work", - "title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP", - "route": "libraries" - } - ] + }, + { + "id": "app.navbar.recentFiles", + "order": 200, + "icon": "schedule", + "title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP", + "route": "recent-files" + }, + { + "id": "app.navbar.favorites", + "order": 300, + "icon": "star", + "title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP", + "route": "favorites" + }, + { + "id": "app.navbar.trashcan", + "order": 400, + "icon": "delete", + "title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP", + "route": "trashcan" + } + ] + } + ], + "toolbar": [ + { + "id": "app.toolbar.searchFilter", + "order": 50, + "title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER", + "icon": "view_list", + "actions": { + "click": "TOGGLE_SEARCH_FILTER" + }, + "rules": { + "visible": "app.navigation.isSearchResults" + } + }, + { + "id": "app.toolbar.share", + "order": 100, + "title": "APP.ACTIONS.SHARE", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.toolbar.canShare" + } + }, + { + "id": "app.toolbar.share.edit", + "order": 101, + "title": "APP.ACTIONS.SHARE_EDIT", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.isShared" + } + }, + { + "id": "app.toolbar.preview", + "order": 300, + "title": "APP.ACTIONS.VIEW", + "icon": "visibility", + "actions": { + "click": "VIEW_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.toolbar.download", + "order": 200, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.toolbar.purgeDeletedNodes", + "order": 400, + "title": "APP.ACTIONS.DELETE_PERMANENT", + "icon": "delete_forever", + "actions": { + "click": "PURGE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.toolbar.restoreDeletedNodes", + "order": 500, + "title": "APP.ACTIONS.RESTORE", + "icon": "restore", + "actions": { + "click": "RESTORE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.toolbar.joinLibrary", + "type": "custom", + "order": 600, + "component": "app.toolbar.toggleJoinLibrary", + "rules": { + "visible": "app.libraries.toolbar.canToggleJoin" + } + }, + { + "id": "app.toolbar.leaveLibrary", + "order": 650, + "title": "APP.ACTIONS.LEAVE", + "icon": "exit_to_app", + "actions": { + "click": "LEAVE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar.canLeaveLibrary" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 680 + }, + { + "id": "app.toolbar.info.infoDrawer", + "type": "custom", + "order": 700, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.toolbar.info" + } + }, + { + "id": "app.libraries.toolbar.infoDrawer", + "type": "custom", + "order": 800, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.toolbar.more", + "type": "menu", + "order": 10000, + "icon": "more_vert", + "title": "APP.ACTIONS.MORE", + "children": [ + { + "id": "app.toolbar.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } + }, + { + "id": "app.toolbar.uploadNodeVersion", + "order": 200, + "title": "APP.ACTIONS.UPLOAD_VERSION", + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" }, - { - "id": "app.navbar.secondary", - "items": [ - { - "id": "app.navbar.shared", - "order": 100, - "icon": "people", - "title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP", - "route": "shared" - }, - { - "id": "app.navbar.recentFiles", - "order": 200, - "icon": "schedule", - "title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP", - "route": "recent-files" - }, - { - "id": "app.navbar.favorites", - "order": 300, - "icon": "star", - "title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP", - "route": "favorites" - }, - { - "id": "app.navbar.trashcan", - "order": 400, - "icon": "delete", - "title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP", - "route": "trashcan" - } - ] + "rules": { + "visible": "app.toolbar.canUploadNewVersion" } - ], - "toolbar": [ - { - "id": "app.toolbar.preview", - "order": 100, - "title": "APP.ACTIONS.VIEW", - "icon": "open_in_browser", - "actions": { - "click": "VIEW_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.toolbar.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 400, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } + }, + { + "id": "app.libraries.toolbar.toggleFavorite", + "type": "custom", + "order": 401, + "component": "app.toolbar.toggleFavoriteLibrary", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.toolbar.favorite.add", + "order": 402, + "title": "APP.ACTIONS.FAVORITE", + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" }, - { - "id": "app.toolbar.download", - "order": 200, - "title": "APP.ACTIONS.DOWNLOAD", - "icon": "get_app", - "actions": { - "click": "DOWNLOAD_NODES" - }, - "rules": { - "visible": "app.toolbar.canDownload" - } + "rules": { + "visible": "app.toolbar.favorite.canAdd" + } + }, + { + "id": "app.toolbar.favorite.remove", + "order": 403, + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" }, - { - "id": "app.toolbar.editFolder", - "order": 300, - "title": "APP.ACTIONS.EDIT", - "icon": "create", - "actions": { - "click": "EDIT_FOLDER" - }, - "rules": { - "visible": "app.toolbar.canEditFolder" - } + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } + }, + { + "id": "app.toolbar.editFolder", + "order": 450, + "title": "APP.ACTIONS.EDIT", + "icon": "create", + "actions": { + "click": "EDIT_FOLDER" }, - { - "id": "app.toolbar.purgeDeletedNodes", - "order": 400, - "title": "APP.ACTIONS.DELETE_PERMANENT", - "icon": "delete_forever", - "actions": { - "click": "PURGE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "rules": { + "visible": "app.toolbar.canEditFolder" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 500 + }, + { + "id": "app.toolbar.copy", + "order": 600, + "title": "APP.ACTIONS.COPY", + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" }, - { - "id": "app.toolbar.restoreDeletedNodes", - "order": 500, - "title": "APP.ACTIONS.RESTORE", - "icon": "restore", - "actions": { - "click": "RESTORE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "rules": { + "visible": "app.toolbar.canCopyNode" + } + }, + { + "id": "app.toolbar.move", + "order": 700, + "title": "APP.ACTIONS.MOVE", + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" }, - { - "id": "app.toolbar.createLibrary", - "order": 600, - "title": "Create Library", - "icon": "create_new_folder", - "actions": { - "click": "CREATE_LIBRARY" - }, - "rules": { - "visible": "app.navigation.isLibraries" - } + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.toolbar.delete", + "order": 800, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_NODES" }, - { - "id": "app.toolbar.info", - "type": "custom", - "order": 700, - "component": "app.toolbar.toggleInfoDrawer", - "rules": { - "visible": "app.toolbar.info" - } + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.create.separator.3", + "type": "separator", + "order": 900 + }, + { + "id": "app.toolbar.versions", + "order": 1100, + "title": "APP.ACTIONS.VERSIONS", + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } + }, + { + "id": "app.toolbar.permissions", + "order": 1200, + "title": "APP.ACTIONS.PERMISSIONS", + "icon": "settings_input_component", + "actions": { + "click": "MANAGE_PERMISSIONS" }, - { - "id": "app.toolbar.more", - "type": "menu", - "order": 10000, - "icon": "more_vert", - "title": "APP.ACTIONS.MORE", - "children": [ - { - "id": "app.toolbar.favorite", - "comment": "workaround for Recent Files and Search API issue", - "type": "custom", - "order": 100, - "component": "app.toolbar.toggleFavorite", - "rules": { - "visible": "app.toolbar.favorite.canToggle" - } - }, - { - "id": "app.toolbar.favorite.add", - "order": 200, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } - }, - { - "id": "app.toolbar.favorite.remove", - "order": 300, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } - }, - { - "id": "app.toolbar.copy", - "order": 400, - "title": "APP.ACTIONS.COPY", - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } - }, - { - "id": "app.toolbar.move", - "order": 500, - "title": "APP.ACTIONS.MOVE", - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.toolbar.share", - "order": 600, - "title": "APP.ACTIONS.SHARE", - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.toolbar.unshare", - "order": 700, - "title": "APP.ACTIONS.UNSHARE", - "icon": "stop_screen_share", - "actions": { - "click": "UNSHARE_NODES" - }, - "rules": { - "visible": "app.selection.canUnshare" - } - }, - { - "id": "app.toolbar.delete", - "order": 800, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.toolbar.deleteLibrary", - "order": 900, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_LIBRARY" - }, - "rules": { - "visible": "app.selection.library" - } - }, - { - "id": "app.toolbar.versions", - "order": 1000, - "title": "APP.ACTIONS.VERSIONS", - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } - }, - { - "id": "app.toolbar.permissions", - "order": 1100, - "title": "APP.ACTIONS.PERMISSIONS", - "icon": "settings_input_component", - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } - } - ] + "rules": { + "visible": "app.toolbar.permissions" } - ], - "contextMenu": [ - { - "id": "app.context.menu.download", - "order": 100, - "title": "APP.ACTIONS.DOWNLOAD", - "icon": "get_app", - "actions": { - "click": "DOWNLOAD_NODES" - }, - "rules": { - "visible": "app.toolbar.canDownload" - } + }, + { + "id": "app.toolbar.deleteLibrary", + "order": 100, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_LIBRARY" }, + "rules": { + "visible": "app.selection.library" + } + } + ] + } + ], + "contextMenu": [ + { + "id": "app.context.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } + }, + { + "id": "app.context.menu.uploadNodeVersion", + "title": "APP.ACTIONS.UPLOAD_VERSION", + "order": 200, + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" + }, + "rules": { + "visible": "app.toolbar.canUploadNewVersion" + } + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.context.menu.share", + "type": "custom", + "order": 400, + "component": "app.shared-link.toggleSharedLink", + "rules": { + "visible": "app.context.canShare" + } + }, + { + "id": "app.context.menu.download", + "order": 500, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.context.menu.preview", + "order": 600, + "title": "APP.ACTIONS.VIEW", + "icon": "visibility", + "actions": { + "click": "VIEW_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.context.menu.favorite.add", + "title": "APP.ACTIONS.FAVORITE", + "order": 700, + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canAdd" + } + }, + { + "id": "app.context.menu.favorite.remove", + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "order": 701, + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } + }, + { + "id": "app.context.menu.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 702, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } + }, + { + "id": "app.context.menu.libraries.toggleFavorite", + "type": "custom", + "order": 703, + "component": "app.toolbar.toggleFavoriteLibrary", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.context.menu.editFolder", + "order": 800, + "title": "APP.ACTIONS.EDIT", + "icon": "create", + "actions": { + "click": "EDIT_FOLDER" + }, + "rules": { + "visible": "app.toolbar.canEditFolder" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 900 + }, + { + "id": "app.context.menu.copy", + "title": "APP.ACTIONS.COPY", + "order": 1000, + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" + }, + "rules": { + "visible": "app.toolbar.canCopyNode" + } + }, + { + "id": "app.context.menu.move", + "title": "APP.ACTIONS.MOVE", + "order": 1100, + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.context.menu.delete", + "title": "APP.ACTIONS.DELETE", + "order": 1200, + "icon": "delete", + "actions": { + "click": "DELETE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.create.separator.3", + "type": "separator", + "order": 1300 + }, + { + "id": "app.context.menu.versions", + "title": "APP.ACTIONS.VERSIONS", + "order": 1400, + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } + }, + { + "id": "app.context.menu.permissions", + "title": "APP.ACTIONS.PERMISSIONS", + "icon": "settings_input_component", + "order": 1500, + "actions": { + "click": "MANAGE_PERMISSIONS" + }, + "rules": { + "visible": "app.toolbar.permissions" + } + }, + { + "id": "app.context.menu.joinLibrary", + "type": "custom", + "order": 100, + "component": "app.menu.toggleJoinLibrary", + "rules": { + "visible": "app.libraries.toolbar.canToggleJoin" + } + }, + { + "id": "app.context.menu.leaveLibrary", + "order": 200, + "title": "APP.ACTIONS.LEAVE", + "icon": "exit_to_app", + "actions": { + "click": "LEAVE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar.canLeaveLibrary" + } + }, + { + "id": "app.context.menu.deleteLibrary", + "order": 300, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.context.menu.purgeDeletedNodes", + "order": 100, + "title": "APP.ACTIONS.DELETE_PERMANENT", + "icon": "delete_forever", + "actions": { + "click": "PURGE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.context.menu.restoreDeletedNodes", + "order": 200, + "title": "APP.ACTIONS.RESTORE", + "icon": "restore", + "actions": { + "click": "RESTORE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + } + ], + "viewer": { + "toolbarActions": [ + { + "id": "app.viewer.fullscreen", + "order": 100, + "title": "APP.ACTIONS.FULLSCREEN", + "icon": "fullscreen", + "actions": { + "click": "FULLSCREEN_VIEWER" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.viewer.separator.1", + "type": "separator", + "order": 180 + }, + { + "id": "app.viewer.share", + "order": 200, + "title": "APP.ACTIONS.SHARE", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.toolbar.canShare" + } + }, + { + "id": "app.viewer.share.edit", + "order": 250, + "title": "APP.ACTIONS.SHARE_EDIT", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.isShared" + } + }, + { + "id": "app.viewer.download", + "order": 300, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.viewer.print", + "order": 400, + "title": "APP.ACTIONS.PRINT", + "icon": "print", + "actions": { + "click": "PRINT_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.viewer.separator.2", + "type": "separator", + "order": 450 + }, + { + "id": "app.viewer.infoDrawer", + "type": "custom", + "order": 500, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.toolbar.info" + } + }, + { + "id": "app.viewer.toolbar.more", + "type": "menu", + "order": 10000, + "icon": "more_vert", + "title": "APP.ACTIONS.MORE", + "children": [ { - "id": "app.context.menu.preview", - "order": 200, - "title": "APP.ACTIONS.VIEW", - "icon": "open_in_browser", - "actions": { - "click": "VIEW_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } + "id": "app.viewer.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } }, { - "id": "app.context.menu.editFolder", - "order": 300, - "title": "APP.ACTIONS.EDIT", - "icon": "create", - "actions": { - "click": "EDIT_FOLDER" - }, - "rules": { - "visible": "app.toolbar.canEditFolder" - } + "id": "app.toolbar.uploadNodeVersion", + "order": 200, + "title": "APP.ACTIONS.UPLOAD_VERSION", + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" + }, + "rules": { + "visible": "app.toolbar.canUploadNewVersion" + } }, { - "id": "app.context.menu.share", - "title": "APP.ACTIONS.SHARE", - "order": 400, - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } + "id": "app.viewer.more.separator.1", + "type": "separator", + "order": 300 }, { - "id": "app.context.menu.favorite.add", - "title": "APP.ACTIONS.FAVORITE", - "order": 500, - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } + "id": "app.viewer.favorite.add", + "order": 400, + "title": "APP.ACTIONS.FAVORITE", + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canAdd" + } }, { - "id": "app.context.menu.favorite.remove", - "title": "APP.ACTIONS.FAVORITE", - "order": 600, - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } + "id": "app.viewer.favorite.remove", + "order": 401, + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } }, { - "id": "app.context.menu.favorite", - "comment": "workaround for Recent Files and Search API issue", - "type": "custom", - "order": 501, - "component": "app.toolbar.toggleFavorite", - "rules": { - "visible": "app.toolbar.favorite.canToggle" - } + "id": "app.viewer.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 402, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } }, { - "id": "app.context.menu.copy", - "title": "APP.ACTIONS.COPY", - "order": 700, - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } + "id": "app.viewer.more.separator.2", + "type": "separator", + "order": 500 }, { - "id": "app.context.menu.move", - "title": "APP.ACTIONS.MOVE", - "order": 800, - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } + "id": "app.viewer.copy", + "order": 600, + "title": "APP.ACTIONS.COPY", + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" + }, + "rules": { + "visible": "app.toolbar.canCopyNode" + } }, { - "id": "app.context.menu.delete", - "title": "APP.ACTIONS.DELETE", - "order": 900, - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } + "id": "app.viewer.move", + "order": 700, + "title": "APP.ACTIONS.MOVE", + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } }, { - "id": "app.context.menu.versions", - "title": "APP.ACTIONS.VERSIONS", - "order": 1000, - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } + "id": "app.viewer.delete", + "order": 800, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } }, { - "id": "app.context.menu.permissions", - "title": "APP.ACTIONS.PERMISSIONS", - "icon": "settings_input_component", - "order": 1100, - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } + "id": "app.viewer.more.separator.3", + "type": "separator", + "order": 900 }, + { - "id": "app.context.menu.purgeDeletedNodes", - "order": 1200, - "title": "APP.ACTIONS.DELETE_PERMANENT", - "icon": "delete_forever", - "actions": { - "click": "PURGE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "id": "app.viewer.versions", + "order": 1000, + "title": "APP.ACTIONS.VERSIONS", + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } }, { - "id": "app.context.menu.restoreDeletedNodes", - "order": 1300, - "title": "APP.ACTIONS.RESTORE", - "icon": "restore", - "actions": { - "click": "RESTORE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "id": "app.viewer.permissions", + "order": 1100, + "title": "APP.ACTIONS.PERMISSIONS", + "icon": "settings_input_component", + "actions": { + "click": "MANAGE_PERMISSIONS" + }, + "rules": { + "visible": "app.toolbar.permissions" + } } - ], - "viewer": { - "toolbar": [ - { - "id": "app.viewer.favorite.add", - "order": 100, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } - }, - { - "id": "app.viewer.favorite.remove", - "order": 200, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } - }, - { - "id": "app.viewer.share", - "order": 300, - "title": "APP.ACTIONS.SHARE", - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.viewer.copy", - "order": 400, - "title": "APP.ACTIONS.COPY", - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } - }, - { - "id": "app.viewer.move", - "order": 500, - "title": "APP.ACTIONS.MOVE", - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.viewer.delete", - "order": 600, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.viewer.versions", - "order": 700, - "title": "APP.ACTIONS.VERSIONS", - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } - }, - { - "id": "app.viewer.permissions", - "order": 800, - "title": "APP.ACTIONS.PERMISSIONS", - "icon": "settings_input_component", - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } - } - ], - "content": [ - { - "id": "app.viewer.pdf", - "disabled": true, - "fileExtension": "pdf", - "component": "app.components.tabs.metadata" - }, - { - "id": "app.viewer.docx", - "disabled": true, - "fileExtension": "docx", - "component": "app.components.tabs.comments" - } - ] - }, - "sidebar": [ - { - "id": "app.sidebar.properties", - "order": 1, - "title": "MY PROPERTIES", - "component": "app.components.tabs.metadata" - }, - { - "id": "app.sidebar.custom", - "order": 2, - "icon": "mood", - "title": "MY CUSTOM TITLE", - "component": "app.toolbar.toggleFavorite" - }, - { - "id": "app.sidebar.no_title", - "order": 3, - "icon": "check_circle", - "component": "app.components.tabs.metadata" - }, - { - "id": "app.sidebar.comments", - "order": 4, - "disabled": true, - "title": "APP.INFO_DRAWER.TABS.COMMENTS", - "component": "app.components.tabs.comments" + ] + } + ], + "shared": { + "toolbarActions": [ + { + "id": "app.viewer.shared.fullscreen", + "order": 100, + "title": "APP.ACTIONS.FULLSCREEN", + "icon": "fullscreen", + "actions": { + "click": "FULLSCREEN_VIEWER" + } + }, + { + "id": "app.viewer.shared.download", + "order": 200, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" } + } + ] + }, + "content": [ + { + "id": "app.viewer.pdf", + "disabled": true, + "fileExtension": "pdf", + "component": "app.components.tabs.metadata" + }, + { + "id": "app.viewer.docx", + "disabled": true, + "fileExtension": "docx", + "component": "app.components.tabs.comments" + } + ] + }, + "sidebar": [ + { + "id": "app.sidebar.properties", + "order": 1, + "title": "MY PROPERTIES", + "component": "app.components.tabs.metadata" + }, + { + "id": "app.sidebar.custom", + "order": 2, + "icon": "mood", + "title": "MY CUSTOM TITLE", + "component": "app.toolbar.toggleFavorite" + }, + { + "id": "app.sidebar.no_title", + "order": 3, + "icon": "check_circle", + "component": "app.components.tabs.metadata" + }, + { + "id": "app.sidebar.comments", + "order": 4, + "disabled": true, + "title": "APP.INFO_DRAWER.TABS.COMMENTS", + "component": "app.components.tabs.comments" + } + ], + "content-metadata-presets": [ + { + "id": "app.content.metadata.custom", + "custom": [ + { + "id": "app.content.metadata.customGroup", + "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", + "items": [ + { + "id": "app.content.metadata.exifAspect", + "aspect": "exif:exif", + "properties": [ + "exif:pixelXDimension", + "exif:pixelYDimension", + "exif:dateTimeOriginal", + "exif:exposureTime", + "exif:fNumber", + "exif:flash", + "exif:focalLength", + "exif:isoSpeedRatings", + "exif:orientation", + "exif:manufacturer", + "exif:model", + "exif:software" + ] + } + ] + } ] + } + ], + "documentList": { + "files": [ + { + "id": "app.files.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.files.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-ellipsis-cell adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.files.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.files.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.files.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "libraries": [ + { + "id": "app.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ], + "favoriteLibraries": [ + { + "id": "app.favorite.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ], + "shared": [ + { + "id": "app.shared.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.shared.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.shared.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.shared.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.sharedBy", + "key": "sharedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "recent": [ + { + "id": "app.recent.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.recent.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.recent.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.recent.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.recent.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + } + ], + "favorites": [ + { + "id": "app.favorites.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.favorites.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.favorites.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.favorites.size", + "key": "sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.favorites.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.favorites.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "trashcan": [ + { + "id": "app.trashcan.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.trashcan.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.trashcanName", + "desktopOnly": false + }, + { + "id": "app.trashcan.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.trashcan.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.trashcan.deletedOn", + "key": "archivedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.DELETED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + } + ], + "search-libraries": [ + { + "id": "app.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ] } + } } diff --git a/e2e/resources/extensibility-configs/viewer-ext.json b/e2e/resources/extensibility-configs/viewer-ext.json index 352f137e21..0b3ccc2a6b 100644 --- a/e2e/resources/extensibility-configs/viewer-ext.json +++ b/e2e/resources/extensibility-configs/viewer-ext.json @@ -1,857 +1,1683 @@ { - "$schema": "../../extension.schema.json", - "$name": "app", - "$version": "1.0.0", - "$references": [ - "plugin1.json", - "plugin2.json", - "dev.tools.json" - ], + "$schema": "../../extension.schema.json", + "$id": "app.core", + "$name": "app.core", + "$version": "1.0.0", + "$vendor": "Alfresco Software, Ltd.", + "$license": "LGPL-3.0", + "$runtime": "1.7.0", + "$description": "Core application extensions and features", + "$references": ["aos.plugin.json"], - "rules": [ - { - "id": "app.toolbar.favorite.canToggle", - "comment": "workaround for recent files and search api issue", - "type": "core.every", - "parameters": [ - { - "type": "rule", - "value": "core.some", - "parameters": [ - { "type": "rule", "value": "app.selection.canAddFavorite" }, - { "type": "rule", "value": "app.selection.canRemoveFavorite" } - ] - }, - { - "type": "rule", - "value": "core.some", - "parameters": [ - { "type": "rule", "value": "app.navigation.isRecentFiles" }, - { "type": "rule", "value": "app.navigation.isSharedFiles" }, - { "type": "rule", "value": "app.navigation.isSearchResults" } - ] - } - ] - }, + "rules": [ + { + "id": "app.toolbar.favorite.canToggle", + "comment": "workaround for recent files and search api issue", + "type": "core.every", + "parameters": [ { - "id": "app.toolbar.favorite.canAdd", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canAddFavorite" }, - { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, - { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, - { "type": "rule", "value": "app.navigation.isNotSearchResults" } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { + "type": "rule", + "value": "app.selection.canAddFavorite" + }, + { + "type": "rule", + "value": "app.selection.canRemoveFavorite" + } + ] }, { - "id": "app.toolbar.favorite.canRemove", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canRemoveFavorite" }, - { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, - { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, - { "type": "rule", "value": "app.navigation.isNotSearchResults" } - ] - }, + "type": "rule", + "value": "core.some", + "parameters": [ + { + "type": "rule", + "value": "app.navigation.isRecentFiles" + }, + { + "type": "rule", + "value": "app.navigation.isSharedFiles" + }, + { + "type": "rule", + "value": "app.navigation.isSearchResults" + }, + { + "type": "rule", + "value": "app.navigation.isFavorites" + } + ] + } + ] + }, + { + "id": "app.context.canShare", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canShare" }, + { "type": "rule", "value": "repository.isQuickShareEnabled" } + ] + }, + { + "id": "app.toolbar.canShare", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canShare" }, + { "type": "rule", "value": "repository.isQuickShareEnabled" }, { - "id": "app.toolbar.info", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isNotLibraries" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] - }, + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.file.isShared" } + ] + } + ] + }, + { + "id": "app.toolbar.favorite.canAdd", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canAddFavorite" }, + { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, { - "id": "app.toolbar.canCopyNode", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" }, - { "type": "rule", "value": "app.navigation.isNotLibraries" } - ] + "type": "rule", + "value": "app.navigation.isNotSearchResults" }, + { "type": "rule", "value": "app.navigation.isNotFavorites" } + ] + }, + { + "id": "app.toolbar.favorite.canRemove", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canRemoveFavorite" }, + { "type": "rule", "value": "app.navigation.isNotRecentFiles" }, + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, { - "id": "app.toolbar.permissions", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.file" }, - { "type": "rule", "value": "app.selection.first.canUpdate" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "app.navigation.isNotSearchResults" }, - { - "id": "app.toolbar.versions", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.file" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + { "type": "rule", "value": "app.navigation.isNotFavorites" } + ] + }, + { + "id": "app.toolbar.info", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isNotLibraries" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.libraries.toolbar", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.selection.library" } + ] + }, + { + "id": "app.libraries.toolbar.canToggleJoin", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.library" }, + { "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.isPrivateLibrary" } + ] }, + { "type": "rule", "value": "app.selection.hasNoLibraryRole" } + ] + }, + { + "id": "app.libraries.toolbar.canLeaveLibrary", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.library" }, + { "type": "rule", "value": "app.selection.hasLibraryRole" } + ] + }, + { + "id": "app.toolbar.canCopyNode", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { "type": "rule", "value": "app.navigation.isNotLibraries" } + ] + }, + { + "id": "app.toolbar.permissions", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.first.canUpdate" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.versions", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, { - "id": "app.trashcan.hasSelection", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.notEmpty" }, - { "type": "rule", "value": "app.navigation.isTrashcan" } - ] + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.selection.file.isLocked" } + ] + } + ] + }, + { + "id": "app.trashcan.hasSelection", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.notEmpty" }, + { "type": "rule", "value": "app.navigation.isTrashcan" } + ] + }, + { + "id": "app.toolbar.canEditFolder", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.folder" }, + { "type": "rule", "value": "app.selection.folder.canUpdate" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canViewFile", + "type": "core.every", + "parameters": [ + { + "type": "rule", + "value": "app.selection.file" }, { - "id": "app.toolbar.canEditFolder", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.folder" }, - { "type": "rule", "value": "app.selection.folder.canUpdate" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "core.not", + "parameters": [ + { "type": "rule", "value": "app.navigation.isTrashcan" } + ] + } + ] + }, + { + "id": "app.toolbar.canDownload", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canDownload" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canDelete", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.canDelete" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" } + ] + }, + { + "id": "app.toolbar.canToggleLock", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.navigation.isNotFavorites" }, + { "type": "rule", "value": "app.navigation.isFavoritesPreview" } + ] }, { - "id": "app.toolbar.canViewFile", - "type": "core.every", - "parameters": [ - { - "type": "rule", - "value": "app.selection.file" - }, - { - "type": "rule", - "value": "core.not", - "parameters": [ - { "type": "rule", "value": "app.navigation.isTrashcan" } - ] - } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.navigation.isNotSharedFiles" }, + { "type": "rule", "value": "app.navigation.isSharedPreview" } + ] }, { - "id": "app.toolbar.canDownload", - "type": "core.every", - "parameters": [ - { "type": "rule", "value": "app.selection.canDownload" }, - { "type": "rule", "value": "app.navigation.isNotTrashcan" } - ] + "type": "rule", + "value": "core.some", + "parameters": [ + { "type": "rule", "value": "app.selection.file.canUnlock" }, + { "type": "rule", "value": "app.selection.file.canLock" } + ] } - ], + ] + }, + { + "id": "app.toolbar.canUploadNewVersion", + "type": "core.every", + "parameters": [ + { "type": "rule", "value": "app.selection.file" }, + { "type": "rule", "value": "app.navigation.isNotTrashcan" }, + { "type": "rule", "value": "app.selection.file.canUploadVersion" } + ] + } + ], - "features": { - "create": [ - { - "id": "app.create.folder", + "features": { + "icons": [ + { + "id": "adf:join_library", + "value": "./assets/images/join-library.svg" + }, + { + "id": "adf:move_file", + "value": "./assets/images/adf-move-file-24px.svg" + } + ], + "create": [ + { + "id": "app.create.uploadFile", + "order": 100, + "icon": "file_upload", + "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE", + "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED", + "actions": { + "click": "UPLOAD_FILES" + }, + "rules": { + "enabled": "app.navigation.folder.canUpload" + } + }, + { + "id": "app.create.uploadFolder", + "order": 200, + "icon": "file_upload", + "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER", + "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED", + "actions": { + "click": "UPLOAD_FOLDER" + }, + "rules": { + "enabled": "app.navigation.folder.canUpload" + } + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.create.folder", + "order": 400, + "icon": "create_new_folder", + "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER", + "description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER", + "description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED", + "actions": { + "click": "CREATE_FOLDER" + }, + "rules": { + "enabled": "app.navigation.folder.canCreate" + } + }, + { + "id": "app.create.library", + "order": 600, + "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_LIBRARY", + "description": "APP.NEW_MENU.TOOLTIPS.CREATE_LIBRARY", + "icon": "create_new_folder", + "actions": { + "click": "CREATE_LIBRARY" + } + } + ], + "navbar": [ + { + "id": "app.navbar.primary", + "items": [ + { + "id": "app.navbar.personalFiles", + "order": 100, + "icon": "folder", + "title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP", + "route": "personal-files" + }, + { + "id": "app.navbar.libraries.menu", + "order": 200, + "icon": "library_books", + "title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP", + "children": [ + { + "id": "app.navbar.libraries.files", "order": 100, - "icon": "create_new_folder", - "title": "APP.NEW_MENU.MENU_ITEMS.CREATE_FOLDER", - "description": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.CREATE_FOLDER_NOT_ALLOWED", - "actions": { - "click": "CREATE_FOLDER" - }, - "rules": { - "enabled": "app.navigation.folder.canCreate" - } - }, - { - "id": "app.create.uploadFile", + "title": "APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.SIDENAV_LINK.TOOLTIP", + "route": "libraries" + }, + { + "id": "app.navbar.libraries.favorite", "order": 200, - "icon": "file_upload", - "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FILE", - "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FILES_NOT_ALLOWED", - "actions": { - "click": "UPLOAD_FILES" - }, - "rules": { - "enabled": "app.navigation.folder.canUpload" - } + "title": "APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.LIBRARIES.MENU.FAVORITE_LIBRARIES.SIDENAV_LINK.TOOLTIP", + "route": "favorite/libraries" + } + ] + } + ] + }, + { + "id": "app.navbar.secondary", + "items": [ + { + "id": "app.navbar.shared", + "order": 100, + "icon": "people", + "title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP", + "route": "shared", + "rules": { + "visible": "repository.isQuickShareEnabled" + } + }, + { + "id": "app.navbar.recentFiles", + "order": 200, + "icon": "schedule", + "title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP", + "route": "recent-files" + }, + { + "id": "app.navbar.favorites", + "order": 300, + "icon": "star", + "title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP", + "route": "favorites" + }, + { + "id": "app.navbar.trashcan", + "order": 400, + "icon": "delete", + "title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL", + "description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP", + "route": "trashcan" + } + ] + } + ], + "toolbar": [ + { + "id": "app.toolbar.searchFilter", + "order": 50, + "title": "APP.BROWSE.SEARCH.TOGGLE_SEARCH_FILTER", + "icon": "view_list", + "actions": { + "click": "TOGGLE_SEARCH_FILTER" + }, + "rules": { + "visible": "app.navigation.isSearchResults" + } + }, + { + "id": "app.toolbar.share", + "order": 100, + "title": "APP.ACTIONS.SHARE", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.toolbar.canShare" + } + }, + { + "id": "app.toolbar.share.edit", + "order": 101, + "title": "APP.ACTIONS.SHARE_EDIT", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.isShared" + } + }, + { + "id": "app.toolbar.preview", + "order": 300, + "title": "APP.ACTIONS.VIEW", + "icon": "visibility", + "actions": { + "click": "VIEW_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.toolbar.download", + "order": 200, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.toolbar.purgeDeletedNodes", + "order": 400, + "title": "APP.ACTIONS.DELETE_PERMANENT", + "icon": "delete_forever", + "actions": { + "click": "PURGE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.toolbar.restoreDeletedNodes", + "order": 500, + "title": "APP.ACTIONS.RESTORE", + "icon": "restore", + "actions": { + "click": "RESTORE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.toolbar.joinLibrary", + "type": "custom", + "order": 600, + "component": "app.toolbar.toggleJoinLibrary", + "rules": { + "visible": "app.libraries.toolbar.canToggleJoin" + } + }, + { + "id": "app.toolbar.leaveLibrary", + "order": 650, + "title": "APP.ACTIONS.LEAVE", + "icon": "exit_to_app", + "actions": { + "click": "LEAVE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar.canLeaveLibrary" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 680 + }, + { + "id": "app.toolbar.info.infoDrawer", + "type": "custom", + "order": 700, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.toolbar.info" + } + }, + { + "id": "app.libraries.toolbar.infoDrawer", + "type": "custom", + "order": 800, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.toolbar.more", + "type": "menu", + "order": 10000, + "icon": "more_vert", + "title": "APP.ACTIONS.MORE", + "children": [ + { + "id": "app.toolbar.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } + }, + { + "id": "app.toolbar.uploadNodeVersion", + "order": 200, + "title": "APP.ACTIONS.UPLOAD_VERSION", + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" }, - { - "id": "app.create.uploadFolder", - "order": 300, - "icon": "file_upload", - "title": "APP.NEW_MENU.MENU_ITEMS.UPLOAD_FOLDER", - "description": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS", - "description-disabled": "APP.NEW_MENU.TOOLTIPS.UPLOAD_FOLDERS_NOT_ALLOWED", - "actions": { - "click": "UPLOAD_FOLDER" - }, - "rules": { - "enabled": "app.navigation.folder.canUpload" - } + "rules": { + "visible": "app.toolbar.canUploadNewVersion" } - ], - "navbar": [ - { - "id": "app.navbar.primary", - "items": [ - { - "id": "app.navbar.personalFiles", - "order": 100, - "icon": "folder", - "title": "APP.BROWSE.PERSONAL.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.PERSONAL.SIDENAV_LINK.TOOLTIP", - "route": "personal-files" - }, - { - "id": "app.navbar.libraries", - "order": 200, - "icon": "group_work", - "title": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.LIBRARIES.SIDENAV_LINK.TOOLTIP", - "route": "libraries" - } - ] + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.toolbar.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 400, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } + }, + { + "id": "app.libraries.toolbar.toggleFavorite", + "type": "custom", + "order": 401, + "component": "app.toolbar.toggleFavoriteLibrary", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.toolbar.favorite.add", + "order": 402, + "title": "APP.ACTIONS.FAVORITE", + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" }, - { - "id": "app.navbar.secondary", - "items": [ - { - "id": "app.navbar.shared", - "order": 100, - "icon": "people", - "title": "APP.BROWSE.SHARED.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.SHARED.SIDENAV_LINK.TOOLTIP", - "route": "shared" - }, - { - "id": "app.navbar.recentFiles", - "order": 200, - "icon": "schedule", - "title": "APP.BROWSE.RECENT.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.RECENT.SIDENAV_LINK.TOOLTIP", - "route": "recent-files" - }, - { - "id": "app.navbar.favorites", - "order": 300, - "icon": "star", - "title": "APP.BROWSE.FAVORITES.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.FAVORITES.SIDENAV_LINK.TOOLTIP", - "route": "favorites" - }, - { - "id": "app.navbar.trashcan", - "order": 400, - "icon": "delete", - "title": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.LABEL", - "description": "APP.BROWSE.TRASHCAN.SIDENAV_LINK.TOOLTIP", - "route": "trashcan" - } - ] + "rules": { + "visible": "app.toolbar.favorite.canAdd" } - ], - "toolbar": [ - { - "id": "app.toolbar.preview", - "order": 100, - "title": "APP.ACTIONS.VIEW", - "icon": "open_in_browser", - "actions": { - "click": "VIEW_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } + }, + { + "id": "app.toolbar.favorite.remove", + "order": 403, + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" }, - { - "id": "app.toolbar.download", - "order": 200, - "title": "APP.ACTIONS.DOWNLOAD", - "icon": "get_app", - "actions": { - "click": "DOWNLOAD_NODES" - }, - "rules": { - "visible": "app.toolbar.canDownload" - } + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } + }, + { + "id": "app.toolbar.editFolder", + "order": 450, + "title": "APP.ACTIONS.EDIT", + "icon": "create", + "actions": { + "click": "EDIT_FOLDER" }, - { - "id": "app.toolbar.editFolder", - "order": 300, - "title": "APP.ACTIONS.EDIT", - "icon": "create", - "actions": { - "click": "EDIT_FOLDER" - }, - "rules": { - "visible": "app.toolbar.canEditFolder" - } + "rules": { + "visible": "app.toolbar.canEditFolder" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 500 + }, + { + "id": "app.toolbar.copy", + "order": 600, + "title": "APP.ACTIONS.COPY", + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" }, - { - "id": "app.toolbar.purgeDeletedNodes", - "order": 400, - "title": "APP.ACTIONS.DELETE_PERMANENT", - "icon": "delete_forever", - "actions": { - "click": "PURGE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "rules": { + "visible": "app.toolbar.canCopyNode" + } + }, + { + "id": "app.toolbar.move", + "order": 700, + "title": "APP.ACTIONS.MOVE", + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" }, - { - "id": "app.toolbar.restoreDeletedNodes", - "order": 500, - "title": "APP.ACTIONS.RESTORE", - "icon": "restore", - "actions": { - "click": "RESTORE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.toolbar.delete", + "order": 800, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_NODES" }, - { - "id": "app.toolbar.createLibrary", - "order": 600, - "title": "Create Library", - "icon": "create_new_folder", - "actions": { - "click": "CREATE_LIBRARY" - }, - "rules": { - "visible": "app.navigation.isLibraries" - } + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.create.separator.3", + "type": "separator", + "order": 900 + }, + { + "id": "app.toolbar.versions", + "order": 1100, + "title": "APP.ACTIONS.VERSIONS", + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } + }, + { + "id": "app.toolbar.permissions", + "order": 1200, + "title": "APP.ACTIONS.PERMISSIONS", + "icon": "settings_input_component", + "actions": { + "click": "MANAGE_PERMISSIONS" }, - { - "id": "app.toolbar.info", - "type": "custom", - "order": 700, - "component": "app.toolbar.toggleInfoDrawer", - "rules": { - "visible": "app.toolbar.info" - } + "rules": { + "visible": "app.toolbar.permissions" + } + }, + { + "id": "app.toolbar.deleteLibrary", + "order": 100, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_LIBRARY" }, - { - "id": "app.toolbar.more", - "type": "menu", - "order": 10000, - "icon": "more_vert", - "title": "APP.ACTIONS.MORE", - "children": [ - { - "id": "app.toolbar.favorite", - "comment": "workaround for Recent Files and Search API issue", - "type": "custom", - "order": 100, - "component": "app.toolbar.toggleFavorite", - "rules": { - "visible": "app.toolbar.favorite.canToggle" - } - }, - { - "id": "app.toolbar.favorite.add", - "order": 200, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } - }, - { - "id": "app.toolbar.favorite.remove", - "order": 300, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } - }, - { - "id": "app.toolbar.copy", - "order": 400, - "title": "APP.ACTIONS.COPY", - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } - }, - { - "id": "app.toolbar.move", - "order": 500, - "title": "APP.ACTIONS.MOVE", - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.toolbar.share", - "order": 600, - "title": "APP.ACTIONS.SHARE", - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.toolbar.unshare", - "order": 700, - "title": "APP.ACTIONS.UNSHARE", - "icon": "stop_screen_share", - "actions": { - "click": "UNSHARE_NODES" - }, - "rules": { - "visible": "app.selection.canUnshare" - } - }, - { - "id": "app.toolbar.delete", - "order": 800, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.toolbar.deleteLibrary", - "order": 900, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_LIBRARY" - }, - "rules": { - "visible": "app.selection.library" - } - }, - { - "id": "app.toolbar.versions", - "order": 1000, - "title": "APP.ACTIONS.VERSIONS", - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } - }, - { - "id": "app.toolbar.permissions", - "order": 1100, - "title": "APP.ACTIONS.PERMISSIONS", - "icon": "settings_input_component", - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } - } - ] + "rules": { + "visible": "app.selection.library" } - ], - "contextMenu": [ + } + ] + } + ], + "contextMenu": [ + { + "id": "app.context.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } + }, + { + "id": "app.context.menu.uploadNodeVersion", + "title": "APP.ACTIONS.UPLOAD_VERSION", + "order": 200, + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" + }, + "rules": { + "visible": "app.toolbar.canUploadNewVersion" + } + }, + { + "id": "app.create.separator.1", + "type": "separator", + "order": 300 + }, + { + "id": "app.context.menu.share", + "type": "custom", + "order": 400, + "component": "app.shared-link.toggleSharedLink", + "rules": { + "visible": "app.context.canShare" + } + }, + { + "id": "app.context.menu.download", + "order": 500, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.context.menu.preview", + "order": 600, + "title": "APP.ACTIONS.VIEW", + "icon": "visibility", + "actions": { + "click": "VIEW_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.context.menu.favorite.add", + "title": "APP.ACTIONS.FAVORITE", + "order": 700, + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canAdd" + } + }, + { + "id": "app.context.menu.favorite.remove", + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "order": 701, + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } + }, + { + "id": "app.context.menu.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 702, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } + }, + { + "id": "app.context.menu.libraries.toggleFavorite", + "type": "custom", + "order": 703, + "component": "app.toolbar.toggleFavoriteLibrary", + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.context.menu.editFolder", + "order": 800, + "title": "APP.ACTIONS.EDIT", + "icon": "create", + "actions": { + "click": "EDIT_FOLDER" + }, + "rules": { + "visible": "app.toolbar.canEditFolder" + } + }, + { + "id": "app.create.separator.2", + "type": "separator", + "order": 900 + }, + { + "id": "app.context.menu.copy", + "title": "APP.ACTIONS.COPY", + "order": 1000, + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" + }, + "rules": { + "visible": "app.toolbar.canCopyNode" + } + }, + { + "id": "app.context.menu.move", + "title": "APP.ACTIONS.MOVE", + "order": 1100, + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.context.menu.delete", + "title": "APP.ACTIONS.DELETE", + "order": 1200, + "icon": "delete", + "actions": { + "click": "DELETE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } + }, + { + "id": "app.create.separator.3", + "type": "separator", + "order": 1300 + }, + { + "id": "app.context.menu.versions", + "title": "APP.ACTIONS.VERSIONS", + "order": 1400, + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } + }, + { + "id": "app.context.menu.permissions", + "title": "APP.ACTIONS.PERMISSIONS", + "icon": "settings_input_component", + "order": 1500, + "actions": { + "click": "MANAGE_PERMISSIONS" + }, + "rules": { + "visible": "app.toolbar.permissions" + } + }, + { + "id": "app.context.menu.joinLibrary", + "type": "custom", + "order": 100, + "component": "app.menu.toggleJoinLibrary", + "rules": { + "visible": "app.libraries.toolbar.canToggleJoin" + } + }, + { + "id": "app.context.menu.leaveLibrary", + "order": 200, + "title": "APP.ACTIONS.LEAVE", + "icon": "exit_to_app", + "actions": { + "click": "LEAVE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar.canLeaveLibrary" + } + }, + { + "id": "app.context.menu.deleteLibrary", + "order": 300, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_LIBRARY" + }, + "rules": { + "visible": "app.libraries.toolbar" + } + }, + { + "id": "app.context.menu.purgeDeletedNodes", + "order": 100, + "title": "APP.ACTIONS.DELETE_PERMANENT", + "icon": "delete_forever", + "actions": { + "click": "PURGE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + }, + { + "id": "app.context.menu.restoreDeletedNodes", + "order": 200, + "title": "APP.ACTIONS.RESTORE", + "icon": "restore", + "actions": { + "click": "RESTORE_DELETED_NODES" + }, + "rules": { + "visible": "app.trashcan.hasSelection" + } + } + ], + "viewer": { + "toolbarActions": [ + { + "id": "app.viewer.fullscreen", + "order": 100, + "title": "APP.ACTIONS.FULLSCREEN", + "icon": "fullscreen", + "actions": { + "click": "FULLSCREEN_VIEWER" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.viewer.my-action", + "order": 150, + "title": "My action", + "icon": "http", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.canShare" + } + }, + { + "id": "app.viewer.separator.1", + "type": "separator", + "order": 180 + }, + { + "id": "app.viewer.share", + "order": 200, + "title": "APP.ACTIONS.SHARE", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.toolbar.canShare" + } + }, + { + "id": "app.viewer.share.edit", + "order": 250, + "title": "APP.ACTIONS.SHARE_EDIT", + "icon": "link", + "actions": { + "click": "SHARE_NODE" + }, + "rules": { + "visible": "app.selection.file.isShared" + } + }, + { + "id": "app.viewer.download", + "order": 300, + "title": "My custom title", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + }, + "rules": { + "visible": "app.toolbar.canDownload" + } + }, + { + "id": "app.viewer.print", + "order": 400, + "title": "APP.ACTIONS.PRINT", + "icon": "print", + "disabled": true, + "actions": { + "click": "PRINT_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } + }, + { + "id": "app.viewer.separator.2", + "type": "separator", + "order": 450 + }, + { + "id": "app.viewer.infoDrawer", + "type": "custom", + "order": 500, + "component": "app.toolbar.toggleInfoDrawer", + "rules": { + "visible": "app.toolbar.info" + } + }, + { + "id": "app.viewer.toolbar.more", + "type": "menu", + "order": 10000, + "icon": "more_vert", + "title": "APP.ACTIONS.MORE", + "children": [ { - "id": "app.context.menu.download", - "order": 100, - "title": "APP.ACTIONS.DOWNLOAD", - "icon": "get_app", - "actions": { - "click": "DOWNLOAD_NODES" - }, - "rules": { - "visible": "app.toolbar.canDownload" - } + "id": "app.viewer.toggleLock", + "order": 100, + "type": "custom", + "component": "app.toolbar.toggleEditOffline", + "rules": { + "visible": "app.toolbar.canToggleLock" + } }, { - "id": "app.context.menu.preview", - "order": 200, - "title": "APP.ACTIONS.VIEW", - "icon": "open_in_browser", - "actions": { - "click": "VIEW_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } + "id": "app.viewer.my-secondary-action", + "order": 150, + "title": "My secondary action", + "icon": "alarm", + "actions": { + "click": "PRINT_FILE" + }, + "rules": { + "visible": "app.toolbar.canViewFile" + } }, { - "id": "app.context.menu.editFolder", - "order": 300, - "title": "APP.ACTIONS.EDIT", - "icon": "create", - "actions": { - "click": "EDIT_FOLDER" - }, - "rules": { - "visible": "app.toolbar.canEditFolder" - } + "id": "app.toolbar.uploadNodeVersion", + "order": 200, + "title": "APP.ACTIONS.UPLOAD_VERSION", + "icon": "playlist_add", + "actions": { + "click": "UPLOAD_FILE_VERSION" + }, + "rules": { + "visible": "app.toolbar.canUploadNewVersion" + } }, { - "id": "app.context.menu.share", - "title": "APP.ACTIONS.SHARE", - "order": 400, - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } + "id": "app.viewer.more.separator.1", + "type": "separator", + "order": 300 }, { - "id": "app.context.menu.favorite.add", - "title": "APP.ACTIONS.FAVORITE", - "order": 500, - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } + "id": "app.viewer.favorite.add", + "order": 400, + "title": "APP.ACTIONS.FAVORITE", + "icon": "star_border", + "actions": { + "click": "ADD_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canAdd" + } }, { - "id": "app.context.menu.favorite.remove", - "title": "APP.ACTIONS.FAVORITE", - "order": 600, - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } + "id": "app.viewer.favorite.remove", + "order": 401, + "title": "APP.ACTIONS.REMOVE_FAVORITE", + "icon": "star", + "actions": { + "click": "REMOVE_FAVORITE" + }, + "rules": { + "visible": "app.toolbar.favorite.canRemove" + } }, { - "id": "app.context.menu.favorite", - "comment": "workaround for Recent Files and Search API issue", - "type": "custom", - "order": 501, - "component": "app.toolbar.toggleFavorite", - "rules": { - "visible": "app.toolbar.favorite.canToggle" - } + "id": "app.viewer.favorite", + "comment": "workaround for Recent Files and Search API issue", + "type": "custom", + "order": 402, + "component": "app.toolbar.toggleFavorite", + "rules": { + "visible": "app.toolbar.favorite.canToggle" + } }, { - "id": "app.context.menu.copy", - "title": "APP.ACTIONS.COPY", - "order": 700, - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } + "id": "app.viewer.more.separator.2", + "type": "separator", + "order": 500 }, { - "id": "app.context.menu.move", - "title": "APP.ACTIONS.MOVE", - "order": 800, - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } + "id": "app.viewer.copy", + "order": 600, + "title": "APP.ACTIONS.COPY", + "icon": "content_copy", + "actions": { + "click": "COPY_NODES" + }, + "rules": { + "visible": "app.toolbar.canCopyNode" + } }, { - "id": "app.context.menu.delete", - "title": "APP.ACTIONS.DELETE", - "order": 900, - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } + "id": "app.viewer.move", + "order": 700, + "title": "My new title", + "icon": "adf:move_file", + "actions": { + "click": "MOVE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } }, { - "id": "app.context.menu.versions", - "title": "APP.ACTIONS.VERSIONS", - "order": 1000, - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } + "id": "app.viewer.delete", + "order": 800, + "title": "APP.ACTIONS.DELETE", + "icon": "delete", + "actions": { + "click": "DELETE_NODES" + }, + "rules": { + "visible": "app.toolbar.canDelete" + } }, { - "id": "app.context.menu.permissions", - "title": "APP.ACTIONS.PERMISSIONS", - "icon": "settings_input_component", - "order": 1100, - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } + "id": "app.viewer.more.separator.3", + "type": "separator", + "order": 900 }, + { - "id": "app.context.menu.purgeDeletedNodes", - "order": 1200, - "title": "APP.ACTIONS.DELETE_PERMANENT", - "icon": "delete_forever", - "actions": { - "click": "PURGE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "id": "app.viewer.versions", + "order": 1000, + "title": "APP.ACTIONS.VERSIONS", + "icon": "history", + "actions": { + "click": "MANAGE_VERSIONS" + }, + "rules": { + "visible": "app.toolbar.versions" + } }, { - "id": "app.context.menu.restoreDeletedNodes", - "order": 1300, - "title": "APP.ACTIONS.RESTORE", - "icon": "restore", - "actions": { - "click": "RESTORE_DELETED_NODES" - }, - "rules": { - "visible": "app.trashcan.hasSelection" - } + "id": "app.viewer.permissions", + "order": 1100, + "title": "APP.ACTIONS.PERMISSIONS", + "disabled": true, + "icon": "settings_input_component", + "actions": { + "click": "MANAGE_PERMISSIONS" + }, + "rules": { + "visible": "app.toolbar.permissions" + } } - ], - "viewer": { - "toolbarActions": [ - { - "id": "app.toolbar.download", - "order": 100, - "title": "My custom title", - "icon": "get_app", - "actions": { - "click": "DOWNLOAD_NODES" - }, - "rules": { - "visible": "app.toolbar.canDownload" - } - }, - { - "id": "app.toolbar.my-action", - "order": 150, - "title": "My action", - "icon": "http", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.viewer.print", - "order": 200, - "title": "APP.ACTIONS.PRINT", - "icon": "print", - "disabled": true, - "actions": { - "click": "PRINT_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } - }, - { - "id": "app.viewer.share", - "order": 300, - "title": "APP.ACTIONS.SHARE", - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.viewer.fullscreen", - "order": 400, - "title": "APP.ACTIONS.FULLSCREEN", - "icon": "fullscreen", - "actions": { - "click": "FULLSCREEN_VIEWER" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } - }, - { - "id": "app.toolbar.more", - "type": "menu", - "order": 10000, - "icon": "more_vert", - "title": "APP.ACTIONS.MORE", - "children": [ - { - "id": "app.viewer.favorite.add", - "order": 100, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star_border", - "actions": { - "click": "ADD_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canAdd" - } - }, - { - "id": "app.viewer.favorite.remove", - "order": 200, - "title": "APP.ACTIONS.FAVORITE", - "icon": "star", - "actions": { - "click": "REMOVE_FAVORITE" - }, - "rules": { - "visible": "app.toolbar.favorite.canRemove" - } - }, - { - "id": "app.viewer.favorite", - "comment": "workaround for Recent Files and Search API issue", - "type": "custom", - "order": 101, - "component": "app.toolbar.toggleFavorite", - "rules": { - "visible": "app.toolbar.favorite.canToggle" - } - }, - { - "id": "app.toolbar.my-secondary-action", - "order": 150, - "title": "My secondary action", - "icon": "alarm", - "actions": { - "click": "PRINT_FILE" - }, - "rules": { - "visible": "app.toolbar.canViewFile" - } - }, - { - "id": "app.viewer.share", - "order": 300, - "title": "APP.ACTIONS.SHARE", - "icon": "share", - "actions": { - "click": "SHARE_NODE" - }, - "rules": { - "visible": "app.selection.file.canShare" - } - }, - { - "id": "app.viewer.copy", - "order": 400, - "title": "APP.ACTIONS.COPY", - "icon": "content_copy", - "actions": { - "click": "COPY_NODES" - }, - "rules": { - "visible": "app.toolbar.canCopyNode" - } - }, - { - "id": "app.viewer.move", - "order": 500, - "title": "My new title", - "icon": "library_books", - "actions": { - "click": "MOVE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.viewer.delete", - "order": 600, - "title": "APP.ACTIONS.DELETE", - "icon": "delete", - "actions": { - "click": "DELETE_NODES" - }, - "rules": { - "visible": "app.selection.canDelete" - } - }, - { - "id": "app.viewer.versions", - "order": 700, - "title": "APP.ACTIONS.VERSIONS", - "icon": "history", - "actions": { - "click": "MANAGE_VERSIONS" - }, - "rules": { - "visible": "app.toolbar.versions" - } - }, - { - "id": "app.viewer.permissions", - "order": 800, - "title": "APP.ACTIONS.PERMISSIONS", - "disabled": true, - "icon": "settings_input_component", - "actions": { - "click": "MANAGE_PERMISSIONS" - }, - "rules": { - "visible": "app.toolbar.permissions" - } - } - ] - } - ], - "content": [ - { - "id": "app.viewer.pdf", - "fileExtension": "pdf", - "component": "app.components.tabs.metadata" - }, - { - "id": "app.viewer.docx", - "fileExtension": "docx", - "component": "app.components.tabs.comments" - } - ] - }, - "sidebar": [ - { - "id": "app.sidebar.properties", - "order": 100, - "title": "APP.INFO_DRAWER.TABS.PROPERTIES", - "component": "app.components.tabs.metadata" - }, - { - "id": "app.sidebar.comments", - "order": 200, - "title": "APP.INFO_DRAWER.TABS.COMMENTS", - "component": "app.components.tabs.comments" - }, - { - "id": "app.sidebar.versions", - "order": 300, - "disabled": true, - "title": "APP.INFO_DRAWER.TABS.VERSIONS", - "component": "app.components.tabs.versions" + ] + } + ], + "shared": { + "toolbarActions": [ + { + "id": "app.viewer.shared.fullscreen", + "order": 100, + "title": "APP.ACTIONS.FULLSCREEN", + "icon": "fullscreen", + "actions": { + "click": "FULLSCREEN_VIEWER" } + }, + { + "id": "app.viewer.shared.download", + "order": 200, + "title": "APP.ACTIONS.DOWNLOAD", + "icon": "get_app", + "actions": { + "click": "DOWNLOAD_NODES" + } + } ] + }, + "content": [ + { + "id": "app.viewer.pdf", + "fileExtension": "pdf", + "component": "app.components.tabs.metadata" + }, + { + "id": "app.viewer.docx", + "fileExtension": "docx", + "component": "app.components.tabs.comments" + } + ] + }, + "sidebar": [ + { + "id": "app.sidebar.properties", + "order": 100, + "title": "APP.INFO_DRAWER.TABS.PROPERTIES", + "component": "app.components.tabs.metadata", + "rules": { + "visible": "app.navigation.isNotLibraries" + } + }, + { + "id": "app.sidebar.comments", + "order": 200, + "title": "APP.INFO_DRAWER.TABS.COMMENTS", + "component": "app.components.tabs.comments", + "rules": { + "visible": "app.navigation.isNotLibraries" + } + }, + { + "id": "app.sidebar.versions", + "order": 300, + "disabled": true, + "title": "APP.INFO_DRAWER.TABS.VERSIONS", + "component": "app.components.tabs.versions", + "rules": { + "visible": "app.navigation.isNotLibraries" + } + }, + { + "id": "app.sidebar.library.properties", + "order": 500, + "title": "APP.INFO_DRAWER.TABS.LIBRARY_PROPERTIES", + "component": "app.components.tabs.library.metadata", + "rules": { + "visible": "app.libraries.toolbar" + } + } + ], + "content-metadata-presets": [ + { + "id": "app.content.metadata.custom", + "custom": [ + { + "id": "app.content.metadata.customGroup", + "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", + "items": [ + { + "id": "app.content.metadata.exifAspect", + "aspect": "exif:exif", + "properties": [ + "exif:pixelXDimension", + "exif:pixelYDimension", + "exif:dateTimeOriginal", + "exif:exposureTime", + "exif:fNumber", + "exif:flash", + "exif:focalLength", + "exif:isoSpeedRatings", + "exif:orientation", + "exif:manufacturer", + "exif:model", + "exif:software" + ] + } + ] + } + ] + } + ], + "documentList": { + "files": [ + { + "id": "app.files.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.files.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-ellipsis-cell adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.files.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.files.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.files.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "libraries": [ + { + "id": "app.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ], + "favoriteLibraries": [ + { + "id": "app.favorite.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.favorite.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ], + "shared": [ + { + "id": "app.shared.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.shared.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.shared.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.shared.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.shared.sharedBy", + "key": "sharedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.SHARED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "recent": [ + { + "id": "app.recent.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.recent.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.recent.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.recent.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.recent.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + } + ], + "favorites": [ + { + "id": "app.favorites.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.favorites.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.name", + "desktopOnly": false + }, + { + "id": "app.favorites.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.favorites.size", + "key": "sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.favorites.modifiedOn", + "key": "modifiedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.favorites.modifiedBy", + "key": "modifiedByUser.displayName", + "title": "APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY", + "type": "text", + "class": "adf-ellipsis-cell", + "sortable": true, + "desktopOnly": true + } + ], + "trashcan": [ + { + "id": "app.trashcan.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.trashcan.name", + "key": "name", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.trashcanName", + "desktopOnly": false + }, + { + "id": "app.trashcan.location", + "key": "path.name", + "title": "APP.DOCUMENT_LIST.COLUMNS.LOCATION", + "type": "text", + "sortable": true, + "template": "app.columns.location", + "desktopOnly": true + }, + { + "id": "app.trashcan.size", + "key": "content.sizeInBytes", + "title": "APP.DOCUMENT_LIST.COLUMNS.SIZE", + "type": "fileSize", + "sortable": true, + "desktopOnly": true + }, + { + "id": "app.trashcan.deletedOn", + "key": "archivedAt", + "title": "APP.DOCUMENT_LIST.COLUMNS.DELETED_ON", + "type": "date", + "format": "timeAgo", + "sortable": true, + "desktopOnly": true + } + ], + "search-libraries": [ + { + "id": "app.libraries.thumbnail", + "key": "$thumbnail", + "type": "image", + "sortable": false, + "desktopOnly": false + }, + { + "id": "app.libraries.name", + "key": "title", + "title": "APP.DOCUMENT_LIST.COLUMNS.NAME", + "type": "text", + "class": "adf-expand-cell-5", + "sortable": true, + "template": "app.columns.libraryName", + "desktopOnly": false + }, + { + "id": "app.libraries.role", + "key": "role", + "title": "APP.DOCUMENT_LIST.COLUMNS.ROLE", + "type": "text", + "sortable": true, + "template": "app.columns.libraryRole", + "desktopOnly": false + }, + { + "id": "app.libraries.visibility", + "key": "visibility", + "title": "APP.DOCUMENT_LIST.COLUMNS.VISIBILITY", + "type": "text", + "sortable": true, + "template": "app.columns.libraryStatus", + "desktopOnly": true + } + ] } + } } diff --git a/e2e/resources/test-files/file-jpg.jpg b/e2e/resources/test-files/file-jpg.jpg new file mode 100644 index 0000000000..eb6bf4a457 Binary files /dev/null and b/e2e/resources/test-files/file-jpg.jpg differ diff --git a/e2e/resources/test-files/protected.pdf b/e2e/resources/test-files/protected.pdf new file mode 100644 index 0000000000..d0d083f114 Binary files /dev/null and b/e2e/resources/test-files/protected.pdf differ diff --git a/e2e/suites/actions-available/files-folders/favorites.test.ts b/e2e/suites/actions-available/files-folders/favorites.test.ts new file mode 100755 index 0000000000..2351ed6798 --- /dev/null +++ b/e2e/suites/actions-available/files-folders/favorites.test.ts @@ -0,0 +1,182 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File/folder actions : on Favorites : ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxFavId, fileFavId, fileDocxSharedFavId, fileSharedFavId, fileFavLockedId, fileSharedFavLockedId; + let folderFavId, folderFav2Id; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id; + fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id; + folderFav2Id = (await apis.user.nodes.createFolder(data.folderFav2.name, parentId)).entry.id; + await apis.user.favorites.addFavoriteById('folder', folderFavId); + await apis.user.favorites.addFavoriteById('folder', folderFav2Id); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedFavId, + fileSharedFavId, + fileSharedFavLockedId + ]); + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileFavLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 8 }); + await apis.user.shared.waitForApi({ expect: 3 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickFavoritesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('on a file', () => { + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu); + }); + }); + + describe('on a folder', () => { + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu); + }); + }); + + describe('on multiple selection', () => { + it('multiple files - [C280656]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('multiple locked files - [C297631]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('multiple folders - [C280664]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('both files and folders - [C280657]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/files-folders/personal.test.ts b/e2e/suites/actions-available/files-folders/personal.test.ts new file mode 100755 index 0000000000..27eb298419 --- /dev/null +++ b/e2e/suites/actions-available/files-folders/personal.test.ts @@ -0,0 +1,244 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File/folder actions : on Personal Files: ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + let folderFavId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name ); + fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id; + await apis.user.nodes.createFile(data.file.name, parentId); + fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id; + fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id; + fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id; + fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + await apis.user.nodes.createFolder(data.folder.name, parentId); + folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id; + await apis.user.favorites.addFavoriteById('folder', folderFavId); + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileLockedId); + await apis.user.nodes.lockFile(fileFavLockedId); + await apis.user.nodes.lockFile(fileSharedLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 7 }); + await apis.user.shared.waitForApi({ expect: 6 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('on a file', () => { + + it('File Office - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore); + await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu); + }); + + it('File simple - []', async () => { + await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore); + await testUtil.checkContextMenu(data.file.name, data.file.contextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu); + }); + + it('File locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu); + }); + }); + + describe('on a folder', () => { + + it('Folder not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folder.name, data.folder.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore); + await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu); + }); + + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu); + }); + }); + + describe('on multiple selection', () => { + it('multiple files - [C217112]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - [C297619]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + + it('multiple folders - [C280459]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarMore); + }); + + it('both files and folders - [C280460]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/files-folders/recent.test.ts b/e2e/suites/actions-available/files-folders/recent.test.ts new file mode 100755 index 0000000000..e6e13bbb56 --- /dev/null +++ b/e2e/suites/actions-available/files-folders/recent.test.ts @@ -0,0 +1,212 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File actions : on Recent Files: ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name); + fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id; + await apis.user.nodes.createFile(data.file.name, parentId); + fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id; + fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id; + fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id; + fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileLockedId); + await apis.user.nodes.lockFile(fileFavLockedId); + await apis.user.nodes.lockFile(fileSharedLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.shared.waitForApi({ expect: 6 }); + await apis.user.search.waitForApi(username, { expect: 12 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickRecentFilesAndWait(); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('on single selection', () => { + it('File Office - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore); + await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu); + }); + + it('File simple - []', async () => { + await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore); + await testUtil.checkContextMenu(data.file.name, data.file.contextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu); + }); + + it('File locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu); + }); + }); + + describe('on multiple selection', () => { + it('multiple files - [C280468]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileLocked.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileFav.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - [C297624]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + }); + +}); diff --git a/e2e/suites/actions-available/files-folders/search.test.ts b/e2e/suites/actions-available/files-folders/search.test.ts new file mode 100755 index 0000000000..44ca365735 --- /dev/null +++ b/e2e/suites/actions-available/files-folders/search.test.ts @@ -0,0 +1,291 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File/folder actions : on Search Results : ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + let folderFavId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { searchInput } = page.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name ); + fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id; + await apis.user.nodes.createFile(data.file.name, parentId); + fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id; + fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id; + fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id; + fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + await apis.user.nodes.createFolder(data.folder.name, parentId); + folderFavId = (await apis.user.nodes.createFolder(data.folderFav.name, parentId)).entry.id; + await apis.user.favorites.addFavoriteById('folder', folderFavId); + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileLockedId); + await apis.user.nodes.lockFile(fileFavLockedId); + await apis.user.nodes.lockFile(fileSharedLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 7 }); + await apis.user.shared.waitForApi({ expect: 6 }); + await apis.user.search.waitForApi(username, { expect: 12 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + describe('on a file', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.searchToolbarMore); + await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.searchContextMenu); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.searchToolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.searchContextMenu); + }); + + it('File simple - []', async () => { + await testUtil.checkToolbarPrimary(data.file.name, data.file.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.file.name, data.file.searchToolbarMore); + await testUtil.checkContextMenu(data.file.name, data.file.searchContextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.searchToolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.searchContextMenu); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.searchToolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.searchContextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchContextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.searchToolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.searchContextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.searchToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.searchContextMenu); + }); + + it('File locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.searchToolbarMore); + await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.searchContextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.searchToolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.searchContextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.searchContextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchContextMenu); + }); + }); + + describe('on a folder', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor('folder-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Folder not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folder.name, data.folder.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.searchToolbarMore); + await testUtil.checkContextMenu(data.folder.name, data.folder.searchContextMenu); + }); + + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.searchToolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.searchContextMenu); + }); + }); + + describe('on multiple selection', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('multiple files - [C291820]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.searchToolbarMore); + }); + + it('multiple locked files - [C297626]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarMore); + }); + + it('multiple folders - [C291821]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor('folder-'); + + await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.searchContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarMore); + }); + + it('both files and folders - [C291822]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`); + + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.searchContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/files-folders/shared.test.ts b/e2e/suites/actions-available/files-folders/shared.test.ts new file mode 100755 index 0000000000..105e365f4c --- /dev/null +++ b/e2e/suites/actions-available/files-folders/shared.test.ts @@ -0,0 +1,162 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File actions : on Shared Files : ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileSharedLockedId, fileSharedFavLockedId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxSharedFavId, + fileSharedFavId, + fileSharedFavLockedId + ]); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileSharedLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 3 }); + await apis.user.shared.waitForApi({ expect: 6 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickSharedFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('single selection', () => { + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu); + }); + }); + + describe('multiple selection', () => { + it('multiple files - [C280467]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - [C297623]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + }); + +}); diff --git a/e2e/suites/actions-available/files-folders/test-data-files-folders.ts b/e2e/suites/actions-available/files-folders/test-data-files-folders.ts new file mode 100644 index 0000000000..ea17c4986b --- /dev/null +++ b/e2e/suites/actions-available/files-folders/test-data-files-folders.ts @@ -0,0 +1,472 @@ +import { Utils } from '../../../utilities/utils'; + +export const trashActions = ['Permanently Delete', 'Restore']; + +// ----- files ----- + +const fileContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileSharedFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions']; +const fileToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; +const fileFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxFavContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileDocxSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileFavContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileFavLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const fileSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; + +// ---- VIEWER ---- + +const viewerSharedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions']; +const viewerToolbarPrimary = ['Activate full-screen mode', 'Share', 'Download', 'Print', 'View Details', 'More Actions']; +const viewerToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const viewerFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const viewerDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const viewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const viewerDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; +const viewerLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions', 'Permissions']; + + +// ---- FAVORITES workarounds ---- + +// TODO: add Edit Offline when ACA-2174 is fixed +// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done +// TODO: investigate why 'Edit in Microsoft Office™' and 'Permissions' are not displayed and raise issue + +// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done +const favoritesSharedToolbarPrimary = ['Share', '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 +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 +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: change 'Share' into 'Shared Link Settings' when ACA-2175 is done +const favoritesSharedContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; + +// ---- SEARCH workarounds ---- + +const searchDocxContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchToolbarPrimary = ['Toggle search filter', 'Share', 'Download', 'View', 'View Details', 'More Actions']; +const searchSharedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; +const searchFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchSharedFavLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchFavContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchSharedLockedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchDocxFavContextMenu = ['Share', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchDocxFavToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchDocxSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchDocxSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchContextMenu = ['Share', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchFavLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchLockedContextMenu = ['Share', 'Download', 'View', 'Cancel Editing', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; + +const searchViewerToolbarMore = ['Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchViewerFavToolbarMore = ['Edit Offline', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchViewerDocxToolbarMore = ['Edit in Microsoft Office™', 'Edit Offline', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions', 'Permissions']; +const searchViewerFavLockedToolbarMore = ['Cancel Editing', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions', 'Permissions']; +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`, + description: 'file not shared, not fav, office, not locked', + + contextMenu: fileDocxContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileDocxToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore: viewerDocxToolbarMore, + + searchContextMenu: searchDocxContextMenu, + searchToolbarPrimary, + searchToolbarMore: searchDocxToolbarMore, + searchViewerToolbarMore: searchViewerDocxToolbarMore +}; + +export const fileDocxFav = { + name: `file-docx-fav-${Utils.random()}.docx`, + description: 'file not shared, fav, office, not locked', + + contextMenu: fileDocxFavContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileDocxFavToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore: viewerDocxFavToolbarMore, + + favoritesToolbarMore, + favoritesContextMenu, + + searchContextMenu: searchDocxFavContextMenu, + searchToolbarPrimary, + searchToolbarMore: searchDocxFavToolbarMore, + searchViewerToolbarMore: searchViewerDocxFavToolbarMore, +}; + +export const file = { + name: `file-${Utils.random()}.txt`, + description: 'file not shared, not fav, not office, not locked', + + contextMenu: fileContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore, + + searchViewerToolbarMore, + searchContextMenu, + searchToolbarPrimary, + searchToolbarMore +}; + +export const fileFav = { + name: `file-fav-${Utils.random()}.txt`, + description: 'file not shared, fav, not office, not locked', + + contextMenu: fileFavContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileFavToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore: viewerFavToolbarMore, + + favoritesContextMenu, + favoritesToolbarMore, + + searchContextMenu: searchFavContextMenu, + searchToolbarPrimary, + searchToolbarMore: searchFavToolbarMore, + searchViewerToolbarMore: searchViewerFavToolbarMore +}; + +export const fileDocxShared = { + name: `file-docx-shared-${Utils.random()}.docx`, + description: 'file shared, not fav, office, not locked', + + contextMenu: fileDocxSharedContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileDocxToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore: viewerDocxToolbarMore, + + searchContextMenu: searchDocxSharedContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore: searchDocxToolbarMore, + searchViewerToolbarMore: searchViewerDocxToolbarMore, + + sharedContextMenu: sharedFilesDocxContextMenu, + sharedToolbarMore: sharedFilesDocxToolbarMore +}; + +export const fileDocxSharedFav = { + name: `file-docx-shared-fav-${Utils.random()}.docx`, + description: 'file shared, fav, office, not locked', + + contextMenu: fileDocxSharedFavContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileDocxFavToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore: viewerDocxFavToolbarMore, + + favoritesContextMenu: favoritesSharedContextMenu, + favoritesToolbarPrimary: favoritesSharedToolbarPrimary, + favoritesToolbarMore, + + searchContextMenu: searchDocxSharedFavContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore: searchDocxFavToolbarMore, + searchViewerToolbarMore: searchViewerDocxFavToolbarMore, + + sharedContextMenu: sharedFilesDocxSharedFavContextMenu, + sharedToolbarMore: sharedFilesDocxSharedFavToolbarMore +}; + +export const fileShared = { + name: `file-shared-${Utils.random()}.txt`, + description: 'file shared, not fav, not office, not locked', + + contextMenu: fileSharedContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore, + + searchContextMenu: searchSharedContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore, + searchViewerToolbarMore, + + sharedContextMenu: sharedFilesSharedContextMenu, + sharedToolbarMore: sharedFilesSharedToolbarMore +}; + +export const fileSharedFav = { + name: `file-shared-fav-${Utils.random()}.txt`, + description: 'file shared, fav, not office, not locked', + + contextMenu: fileSharedFavContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileFavToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore: viewerFavToolbarMore, + + favoritesContextMenu: favoritesSharedContextMenu, + favoritesToolbarPrimary: favoritesSharedToolbarPrimary, + favoritesToolbarMore, + + searchContextMenu: searchSharedFavContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore: searchFavToolbarMore, + searchViewerToolbarMore: searchViewerFavToolbarMore, + + sharedContextMenu: sharedFilesFavSharedContextMenu, + sharedToolbarMore: sharedFilesSharedFavToolbarMore +}; + +export const fileLocked = { + name: `file-locked-${Utils.random()}.txt`, + description: 'file not shared, not fav, not office, locked', + + contextMenu: fileLockedContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileLockedToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore: viewerLockedToolbarMore, + + searchContextMenu: searchLockedContextMenu, + searchToolbarPrimary, + searchToolbarMore: searchLockedToolbarMore, + searchViewerToolbarMore: searchViewerLockedToolbarMore +}; + +export const fileFavLocked = { + name: `file-fav-locked-${Utils.random()}.txt`, + description: 'file not shared, fav, not office, locked', + + contextMenu: fileFavLockedContextMenu, + toolbarPrimary: fileToolbarPrimary, + toolbarMore: fileFavLockedToolbarMore, + viewerToolbarPrimary, + viewerToolbarMore: viewerFavLockedToolbarMore, + + favoritesContextMenu, + favoritesToolbarMore, + + searchContextMenu: searchFavLockedContextMenu, + searchToolbarPrimary, + searchToolbarMore: searchFavLockedToolbarMore, + searchViewerToolbarMore: searchViewerFavLockedToolbarMore +}; + +export const fileSharedLocked = { + name: `file-shared-locked-${Utils.random()}.txt`, + description: 'file shared, not fav, not office, locked', + + contextMenu: fileSharedLockedContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileLockedToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore: viewerLockedToolbarMore, + + searchContextMenu: searchSharedLockedContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore: searchLockedToolbarMore, + searchViewerToolbarMore: searchViewerLockedToolbarMore, + + sharedContextMenu: sharedFilesSharedContextMenu, + sharedToolbarMore: sharedFilesSharedToolbarMore +}; + +export const fileSharedFavLocked = { + name: `file-shared-fav-locked-${Utils.random()}.txt`, + description: 'file shared, fav, not office, locked', + + contextMenu: fileSharedFavLockedContextMenu, + toolbarPrimary: fileSharedToolbarPrimary, + toolbarMore: fileFavLockedToolbarMore, + viewerToolbarPrimary: viewerSharedToolbarPrimary, + viewerToolbarMore: viewerFavLockedToolbarMore, + + favoritesContextMenu: favoritesSharedContextMenu, + favoritesToolbarPrimary: favoritesSharedToolbarPrimary, + favoritesToolbarMore, + + searchContextMenu: searchSharedFavLockedContextMenu, + searchToolbarPrimary: searchSharedToolbarPrimary, + searchToolbarMore: searchFavLockedToolbarMore, + searchViewerToolbarMore: searchViewerFavLockedToolbarMore, + + sharedContextMenu: sharedFilesFavSharedContextMenu, + sharedToolbarMore: sharedFilesSharedFavToolbarMore +}; + +export const fileInTrash = { + name: `deleted-file-${Utils.random()}.txt`, + trashActions +}; + +export const file2InTrash = { + name: `deleted-file2-${Utils.random()}.txt`, + trashActions +}; + +export const folderInTrash = { + name: `deleted-folder-${Utils.random()}`, + trashActions +}; + +export const folder2InTrash = { + name: `deleted-folder2-${Utils.random()}`, + trashActions +}; + +// ---- folders --- + +const folderContextMenu = ['Download', 'Edit', 'Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +const folderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +const folderToolbarPrimary = ['Download', 'View Details', 'More Actions']; +const folderToolbarMore = ['Edit', 'Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +const folderFavToolbarMore = ['Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; + +const favoritesFolderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete']; +const favoritesFolderFavToolbarMore = ['Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete']; + +const searchFolderContextMenu = ['Download', 'Edit', 'Favorite', 'Copy', 'Permissions']; +const searchFolderToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions']; +const searchFolderToolbarMore = ['Edit', 'Favorite', 'Copy', 'Permissions']; +const searchFolderFavContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Copy', 'Permissions']; +const searchFolderFavToolbarMore = ['Edit', 'Remove Favorite', 'Copy', 'Permissions']; + +export const folder = { + name: `folder-${Utils.random()}`, + description: 'folder not favorite', + + contextMenu: folderContextMenu, + toolbarPrimary: folderToolbarPrimary, + toolbarMore: folderToolbarMore, + + searchContextMenu: searchFolderContextMenu, + searchToolbarPrimary: searchFolderToolbarPrimary, + searchToolbarMore: searchFolderToolbarMore +}; + +export const folderFav = { + name: `folder-fav-${Utils.random()}`, + description: 'folder favorite', + + contextMenu: folderFavContextMenu, + toolbarPrimary: folderToolbarPrimary, + toolbarMore: folderFavToolbarMore, + + favoritesContextMenu: favoritesFolderFavContextMenu, + favoritesToolbarMore: favoritesFolderFavToolbarMore, + + searchContextMenu: searchFolderFavContextMenu, + searchToolbarPrimary: searchFolderToolbarPrimary, + searchToolbarMore: searchFolderFavToolbarMore +}; + +export const folderFav2 = { + name: `folder-fav-2-${Utils.random()}`, + description: 'folder favorite', + + contextMenu: folderFavContextMenu, + toolbarPrimary: folderToolbarPrimary, + toolbarMore: folderFavToolbarMore, + + favoritesContextMenu: favoritesFolderFavContextMenu, + favoritesToolbarMore: favoritesFolderFavToolbarMore, + + searchContextMenu: searchFolderFavContextMenu, + searchToolbarPrimary: searchFolderToolbarPrimary, + searchToolbarMore: searchFolderFavToolbarMore +}; + +// ---- multiple selection --- + + +// TODO: raise issue to remove 'Permissions' +const multipleSelContextMenu = ['Download', 'Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +// TODO: raise issue to remove 'Permissions' +const multipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +const multipleSelToolbarPrimary = ['Download', 'View Details', 'More Actions']; +// TODO: raise issue to remove 'Permissions' +const multipleSelToolbarMore = ['Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; +// TODO: raise issue to remove 'Permissions' +const multipleSelAllFavToolbarMore = ['Remove Favorite', 'Move', 'Copy', 'Delete', 'Permissions']; + +const favoritesMultipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Move', 'Copy', 'Delete']; +const favoritesMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Move', 'Copy', 'Delete']; + +// TODO: raise issue to remove 'Permissions' +const searchMultipleSelContextMenu = ['Download', 'Favorite', 'Copy', 'Permissions']; +// TODO: raise issue to remove 'Permissions' +const searchMultipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Copy', 'Permissions']; +const searchMultipleSelToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions']; +// TODO: raise issue to remove 'Permissions' +const searchMultipleSelToolbarMore = ['Favorite', 'Copy', 'Permissions']; +// TODO: raise issue to remove 'Permissions' +const searchMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Copy', 'Permissions']; + + +export const multipleSel = { + contextMenu: multipleSelContextMenu, + toolbarPrimary: multipleSelToolbarPrimary, + toolbarMore: multipleSelToolbarMore, + + searchContextMenu: searchMultipleSelContextMenu, + searchToolbarMore: searchMultipleSelToolbarMore, + searchToolbarPrimary: searchMultipleSelToolbarPrimary +} + +export const multipleSelAllFav = { + contextMenu: multipleSelAllFavContextMenu, + toolbarPrimary: multipleSelToolbarPrimary, + toolbarMore: multipleSelAllFavToolbarMore, + + favoritesContextMenu: favoritesMultipleSelAllFavContextMenu, + favoritesToolbarMore: favoritesMultipleSelAllFavToolbarMore, + + searchToolbarPrimary: searchMultipleSelToolbarPrimary, + searchContextMenu: searchMultipleSelAllFavContextMenu, + searchToolbarMore: searchMultipleSelAllFavToolbarMore +} diff --git a/e2e/suites/actions-available/files-folders/trash.test.ts b/e2e/suites/actions-available/files-folders/trash.test.ts new file mode 100755 index 0000000000..af1e1e19dc --- /dev/null +++ b/e2e/suites/actions-available/files-folders/trash.test.ts @@ -0,0 +1,106 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File/folder actions : on Trash : ', () => { + + const username = `user-${Utils.random()}`; + + let fileInTrashId, file2InTrashId, folderInTrashId, folder2InTrashId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + fileInTrashId = (await apis.user.nodes.createFile(data.fileInTrash.name)).entry.id; + file2InTrashId = (await apis.user.nodes.createFile(data.file2InTrash.name)).entry.id; + folderInTrashId = (await apis.user.nodes.createFolder(data.folderInTrash.name)).entry.id; + folder2InTrashId = (await apis.user.nodes.createFolder(data.folder2InTrash.name)).entry.id; + + await apis.user.nodes.deleteNodeById(fileInTrashId, false); + await apis.user.nodes.deleteNodeById(file2InTrashId, false); + await apis.user.nodes.deleteNodeById(folderInTrashId, false); + await apis.user.nodes.deleteNodeById(folder2InTrashId, false); + + await apis.user.trashcan.waitForApi({ expect: 4 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.trashcan.emptyTrash(); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickTrashAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('on a file - [C286258]', async () => { + await testUtil.checkToolbarPrimary(data.fileInTrash.name, data.fileInTrash.trashActions); + await testUtil.checkContextMenu(data.fileInTrash.name, data.fileInTrash.trashActions); + }); + + it('on a folder - [C286259]', async () => { + await testUtil.checkToolbarPrimary(data.folderInTrash.name, data.folderInTrash.trashActions); + await testUtil.checkContextMenu(data.folderInTrash.name, data.folderInTrash.trashActions); + }); + + it('multiple files - [C280472]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.file2InTrash.name ], data.trashActions); + }); + + it('multiple folders - [C280473]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions); + await testUtil.checkMultipleSelToolbarPrimary([ data.folderInTrash.name, data.folder2InTrash.name ], data.trashActions); + }); + + it('both files and folders - [C280474]', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileInTrash.name, data.folderInTrash.name ], data.trashActions); + }); + +}); diff --git a/e2e/suites/actions-available/files-folders/viewer.test.ts b/e2e/suites/actions-available/files-folders/viewer.test.ts new file mode 100755 index 0000000000..fbb575534a --- /dev/null +++ b/e2e/suites/actions-available/files-folders/viewer.test.ts @@ -0,0 +1,421 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-files-folders'; +import * as testUtil from '../test-util'; + +describe('File/folder actions : in the viewer : ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + const { searchInput } = page.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocx.name ); + fileDocxFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxFav.name)).entry.id; + await apis.user.nodes.createFile(data.file.name, parentId); + fileFavId = (await apis.user.nodes.createFile(data.fileFav.name, parentId)).entry.id; + fileDocxSharedId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.user.upload.uploadFileWithRename(FILES.docxFile, parentId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.user.nodes.createFile(data.fileShared.name, parentId)).entry.id; + fileSharedFavId = (await apis.user.nodes.createFile(data.fileSharedFav.name, parentId)).entry.id; + fileLockedId = (await apis.user.nodes.createFile(data.fileLocked.name, parentId)).entry.id; + fileFavLockedId = (await apis.user.nodes.createFile(data.fileFavLocked.name, parentId)).entry.id; + fileSharedLockedId = (await apis.user.nodes.createFile(data.fileSharedLocked.name, parentId)).entry.id; + fileSharedFavLockedId = (await apis.user.nodes.createFile(data.fileSharedFavLocked.name, parentId)).entry.id; + + await apis.user.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.user.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.user.nodes.lockFile(fileLockedId); + await apis.user.nodes.lockFile(fileFavLockedId); + await apis.user.nodes.lockFile(fileSharedLockedId); + await apis.user.nodes.lockFile(fileSharedFavLockedId); + + await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.shared.waitForApi({ expect: 6 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + describe('file opened from Personal Files', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File simple - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Recent Files', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickRecentFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File simple - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Favorites', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickFavoritesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Shared Files', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickSharedFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Search Results', () => { + + beforeAll(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.searchViewerToolbarMore); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.searchViewerToolbarMore); + }); + + it('File simple - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.searchViewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.searchViewerToolbarMore); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.searchViewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchViewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.searchViewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.searchViewerToolbarMore); + }); + + it('File locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.searchViewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.searchViewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.searchViewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchViewerToolbarMore); + }); + }); + +}); diff --git a/e2e/suites/actions-available/generic.test.ts b/e2e/suites/actions-available/generic.test.ts new file mode 100755 index 0000000000..467b2d5c24 --- /dev/null +++ b/e2e/suites/actions-available/generic.test.ts @@ -0,0 +1,224 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { browser, protractor } from 'protractor'; +import { LoginPage, BrowsingPage } from '../../pages/pages'; +import { RepoClient } from '../../utilities/repo-client/repo-client'; +import { Utils } from '../../utilities/utils'; + + +describe('Generic tests : ', () => { + + const random = Utils.random(); + + const username = `user-${random}`; + + const parent = `parent-${random}`; let parentId; + + const file1 = `file1-${random}.txt`; + const file2 = `file2-${random}.txt`; + + const folder1 = `my-folder1-${Utils.random()}`; + const folder2 = `my-folder2-${Utils.random()}`; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable, toolbar } = page; + const { searchInput } = page.header; + const contextMenu = dataTable.menu; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + await apis.user.nodes.createFile(file1, parentId); + await apis.user.nodes.createFile(file2, parentId); + + await apis.user.nodes.createFolder(folder1, parentId); + await apis.user.nodes.createFolder(folder2, parentId); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('selected row is marked with a check circle icon - [C213134]', async () => { + await dataTable.selectItem(file1); + expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, 'check mark missing'); + }); + + it('Row is marked with a check circle icon on direct right click - [C286252]', async () => { + await dataTable.rightClickOnItem(file2); + expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, 'check mark missing'); + }); + + it('Context menu appears on direct right click on an item - [C286253]', async () => { + await dataTable.rightClickOnItem(file1); + expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); + }); + + it('Context menu appears when selecting an item and then right clicking on it - [C286254]', async () => { + await dataTable.selectItem(file2); + await dataTable.rightClickOnItem(file2); + expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); + }); + + it('Context menu appears correctly when right clicking on another item - [C284666]', async () => { + await dataTable.selectItem(file1); + await dataTable.rightClickOnItem(file2); + expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed`); + expect(await dataTable.hasCheckMarkIcon(file2)).toBe(true, `${file2} is not selected`); + expect(await dataTable.hasCheckMarkIcon(file1)).toBe(false, `${file1} is not selected`); + }); + + it('Context menu closes when clicking away from it - [C280619]', async () => { + await dataTable.rightClickOnItem(file1); + expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); + await page.breadcrumb.getCurrentItem().click(); + expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed'); + }); + + describe('Actions are not displayed when no item is selected', () => { + it('on Personal Files - [C213120]', async () => { + await page.clickPersonalFilesAndWait(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Trash - [C280452]', async () => { + await page.clickTrash(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Favorites - [C280449]', async () => { + await page.clickFavorites(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Recent Files - [C280447]', async () => { + await page.clickRecentFilesAndWait(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Shared Files - [C280445]', async () => { + await page.clickSharedFiles(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on My Libraries - [C280439]', async () => { + await page.goToMyLibraries(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Favorite Libraries - [C280439]', async () => { + await page.goToFavoriteLibraries(); + await dataTable.clearSelection(); + expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); + }); + + it('on Search Results - [C291815]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('*'); + + expect(await toolbar.isToggleSearchFiltersPresent()).toBe(true, `Search filter toggle is not displayed`); + expect(await toolbar.numberOfAvailableActions()).toBe(1, `more than 1 action is present`); + }); + }); + + it('Context menu appears on right click on a multiple selection of items - [C286268]', async () => { + await dataTable.selectMultipleItems([ file1, file2 ]); + await dataTable.rightClickOnMultipleSelection(); + + expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); + }); + + it('Context menu appears when right clicking on a single item while having multiple items selected - [C286269]', async () => { + await dataTable.selectMultipleItems([ file2, folder1 ]); + await dataTable.rightClickOnItem(file1); + + expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`); + expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect number of selected rows'); + expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); + expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, `${file1} is not selected`); + expect(await dataTable.hasCheckMarkIcon(file2)).toBe(false, `${file2} is selected`); + expect(await dataTable.hasCheckMarkIcon(folder1)).toBe(false, `${folder1} is selected`); + }); + + it('Unselect items with single click - [C280458]', async () => { + await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); + + expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'); + + await dataTable.clickItem(file1); + + expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number'); + }); + + it('Select / unselect items by CMD+click - [C217110]', async () => { + await browser.actions().sendKeys(protractor.Key.COMMAND).perform(); + await dataTable.clickItem(file1); + await dataTable.clickItem(file2); + await dataTable.clickItem(folder1); + await dataTable.clickItem(folder2); + await browser.actions().sendKeys(protractor.Key.NULL).perform(); + + expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'); + + await browser.actions().sendKeys(protractor.Key.COMMAND).perform(); + await dataTable.clickItem(file1); + await dataTable.clickItem(file2); + await browser.actions().sendKeys(protractor.Key.NULL).perform(); + + expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number'); + }); +}); diff --git a/e2e/suites/actions-available/libraries/library.test.ts b/e2e/suites/actions-available/libraries/library.test.ts new file mode 100755 index 0000000000..5d2ad5fe40 --- /dev/null +++ b/e2e/suites/actions-available/libraries/library.test.ts @@ -0,0 +1,328 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages'; +import { SITE_VISIBILITY } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-libraries'; +import * as testUtil from '../test-util'; + +describe('Library actions : ', () => { + const username = `user-${Utils.random()}`; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const searchResultsPage = new SearchResultsPage(); + const { searchInput } = searchResultsPage.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + + await apis.user.sites.createSite(data.publicUserMemberFav.name); + await apis.user.sites.createSite(data.privateUserMemberFav.name, SITE_VISIBILITY.PRIVATE); + await apis.user.sites.createSite(data.moderatedUserMemberFav.name, SITE_VISIBILITY.MODERATED); + + const publicUserMemberNotFavId = (await apis.user.sites.createSite(data.publicUserMemberNotFav.name)).entry.guid; + const privateUserMemberNotFavId = (await apis.user.sites.createSite(data.privateUserMemberNotFav.name, SITE_VISIBILITY.PRIVATE)).entry.guid; + const moderatedUserMemberNotFavId = (await apis.user.sites.createSite(data.moderatedUserMemberNotFav.name, SITE_VISIBILITY.MODERATED)).entry.guid; + + await apis.admin.sites.createSite(data.publicNotMemberFav.name); + await apis.admin.sites.createSite(data.moderatedNotMemberFav.name, SITE_VISIBILITY.MODERATED); + + await apis.admin.sites.createSite(data.publicNotMemberNotFav.name); + await apis.admin.sites.createSite(data.moderatedNotMemberNotFav.name, SITE_VISIBILITY.MODERATED); + + await apis.admin.sites.createSite(data.moderatedRequestedJoinFav.name, SITE_VISIBILITY.MODERATED); + await apis.admin.sites.createSite(data.moderatedRequestedJoinNotFav.name, SITE_VISIBILITY.MODERATED); + + await apis.user.sites.createSite(data.siteInTrash.name, SITE_VISIBILITY.PUBLIC); + await apis.user.sites.createSite(data.site2InTrash.name, SITE_VISIBILITY.PUBLIC); + + await apis.user.sites.waitForApi({ expect: 8 }); + await apis.admin.sites.waitForApi({ expect: 6 }); + + await apis.user.favorites.removeFavoriteById(publicUserMemberNotFavId); + await apis.user.favorites.removeFavoriteById(privateUserMemberNotFavId); + await apis.user.favorites.removeFavoriteById(moderatedUserMemberNotFavId); + + await apis.user.favorites.addFavoriteById('site', data.publicNotMemberFav.name); + await apis.user.favorites.addFavoriteById('site', data.moderatedNotMemberFav.name); + await apis.user.favorites.addFavoriteById('site', data.moderatedRequestedJoinFav.name); + + await apis.user.sites.requestToJoin(data.moderatedRequestedJoinFav.name); + await apis.user.sites.requestToJoin(data.moderatedRequestedJoinNotFav.name); + + await apis.user.queries.waitForSites('site-', { expect: 13 }); + + await apis.user.sites.deleteSite(data.siteInTrash.name, false); + await apis.user.sites.deleteSite(data.site2InTrash.name, false); + + await apis.user.trashcan.waitForApi({ expect: 2 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await Promise.all([ + apis.user.sites.deleteSites([ + data.publicUserMemberFav.name, + data.privateUserMemberFav.name, + data.moderatedUserMemberFav.name, + data.publicUserMemberNotFav.name, + data.privateUserMemberNotFav.name, + data.moderatedUserMemberNotFav.name + ]), + apis.admin.sites.deleteSites([ + data.publicNotMemberFav.name, + data.moderatedNotMemberFav.name, + data.publicNotMemberNotFav.name, + data.moderatedNotMemberNotFav.name, + data.moderatedRequestedJoinFav.name, + data.moderatedRequestedJoinNotFav.name + ]), + apis.user.trashcan.emptyTrash() + ]); + done(); + }); + + describe('on My Libraries', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.goToMyLibrariesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Public library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu); + }); + + it('Private library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu); + }); + + it('Moderated library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu); + }); + + it('Public library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu); + }); + + it('Private library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu); + }); + + it('Moderated library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu); + }); + + }); + + describe('on Favorite Libraries', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.goToFavoriteLibrariesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Public library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu); + }); + + it('Private library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu); + }); + + it('Moderated library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu); + }); + + it('Public library, user not a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu); + }); + + it('Moderated library, user not a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu); + }); + + it('Moderated library, user requested to join, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu); + }); + }); + + describe('on Search Results', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor('site-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Public library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicUserMemberFav.name, data.publicUserMemberFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicUserMemberFav.name, data.publicUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.publicUserMemberFav.name, data.publicUserMemberFav.contextMenu); + }); + + it('Private library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.privateUserMemberFav.name, data.privateUserMemberFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.privateUserMemberFav.name, data.privateUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.privateUserMemberFav.name, data.privateUserMemberFav.contextMenu); + }); + + it('Moderated library, user is a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedUserMemberFav.name, data.moderatedUserMemberFav.contextMenu); + }); + + it('Public library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.publicUserMemberNotFav.name, data.publicUserMemberNotFav.contextMenu); + }); + + it('Private library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.privateUserMemberNotFav.name, data.privateUserMemberNotFav.contextMenu); + }); + + it('Moderated library, user is a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedUserMemberNotFav.name, data.moderatedUserMemberNotFav.contextMenu); + }); + + it('Public library, user not a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicNotMemberFav.name, data.publicNotMemberFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicNotMemberFav.name, data.publicNotMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.publicNotMemberFav.name, data.publicNotMemberFav.contextMenu); + }); + + it('Moderated library, user not a member, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedNotMemberFav.name, data.moderatedNotMemberFav.contextMenu); + }); + + it('Public library, user not a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.publicNotMemberNotFav.name, data.publicNotMemberNotFav.contextMenu); + }); + + it('Moderated library, user not a member, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedNotMemberNotFav.name, data.moderatedNotMemberNotFav.contextMenu); + }); + + it('Moderated library, user requested to join, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedRequestedJoinFav.name, data.moderatedRequestedJoinFav.contextMenu); + }); + + it('Moderated library, user requested to join, not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.toolbarMore); + await testUtil.checkContextMenu(data.moderatedRequestedJoinNotFav.name, data.moderatedRequestedJoinNotFav.contextMenu); + }); + }); + + describe('on Trash', () => { + beforeEach(async (done) => { + await page.clickTrashAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('single library - []', async () => { + await testUtil.checkToolbarPrimary(data.siteInTrash.name, data.siteInTrash.trashActions); + await testUtil.checkContextMenu(data.siteInTrash.name, data.siteInTrash.trashActions); + }); + + it('multiple libraries - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions); + await testUtil.checkMultipleSelToolbarPrimary([ data.siteInTrash.name, data.site2InTrash.name ], data.trashActions); + }); + }); +}); diff --git a/e2e/suites/actions-available/libraries/test-data-libraries.ts b/e2e/suites/actions-available/libraries/test-data-libraries.ts new file mode 100644 index 0000000000..9e1d6e1ae4 --- /dev/null +++ b/e2e/suites/actions-available/libraries/test-data-libraries.ts @@ -0,0 +1,156 @@ +import { Utils } from '../../../utilities/utils'; + + +// ---- multiple selection --- + +export const trashActions = ['Permanently Delete', 'Restore']; + + +// ---- single selection ---- + +const memberFavContextMenu = ['Leave Library', 'Delete', 'Remove Favorite']; +const memberNotFavContextMenu = ['Leave Library', 'Delete', 'Favorite']; +const memberToolbarPrimary = ['Leave Library', 'View Details', 'More Actions']; +const favToolbarMore = ['Delete', 'Remove Favorite']; +const notFavToolbarMore = ['Delete', 'Favorite']; +const searchMemberToolbarPrimary = ['Toggle search filter', 'Leave Library', 'View Details', 'More Actions']; +const searchReqJoinToolbarPrimary = ['Toggle search filter', 'Cancel Join Request', 'View Details', 'More Actions']; +const searchNotMemberToolbarPrimary = ['Toggle search filter', 'Join', 'View Details', 'More Actions']; +const reqJoinToolbarMore = ['Cancel Join Request', 'View Details', 'More Actions']; +const notMemberFavContextMenu = ['Join', 'Delete', 'Remove Favorite']; +const notMemberNotFavContextMenu = ['Join', 'Delete', 'Favorite']; +const notMemberToolbarPrimary = ['Join', 'View Details', 'More Actions']; +const reqJoinNotFavContextMenu = ['Cancel Join Request', 'Delete', 'Favorite']; +const reqJoinFavContextMenu = ['Cancel Join Request', 'Delete', 'Remove Favorite']; + + +export const publicUserMemberFav = { + name: `site-public-member-fav-${Utils.random()}`, + description: 'public site, user member, user favorite', + contextMenu: memberFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const privateUserMemberFav = { + name: `site-private-member-fav-${Utils.random()}`, + description: 'private site, user member, user favorite', + contextMenu: memberFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const moderatedUserMemberFav = { + name: `site-moderated-member-fav-${Utils.random()}`, + description: 'moderated site, user member, user favorite', + contextMenu: memberFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const publicUserMemberNotFav = { + name: `site-public-member-not-fav-${Utils.random()}`, + description: 'public site, user member, not favorite', + contextMenu: memberNotFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const privateUserMemberNotFav = { + name: `site-private-member-not-fav-${Utils.random()}`, + description: 'private site, user member, not favorite', + contextMenu: memberNotFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const moderatedUserMemberNotFav = { + name: `site-moderated-member-not-fav-${Utils.random()}`, + description: 'moderated site, user member, not favorite', + contextMenu: memberNotFavContextMenu, + toolbarPrimary: memberToolbarPrimary, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchMemberToolbarPrimary +}; + +export const publicNotMemberFav = { + name: `site-public-not-member-fav-${Utils.random()}`, + description: 'public site, user not member, user favorite', + contextMenu: notMemberFavContextMenu, + toolbarPrimary: notMemberToolbarPrimary, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchNotMemberToolbarPrimary +}; + +export const moderatedNotMemberFav = { + name: `site-moderated-not-member-fav-${Utils.random()}`, + description: 'moderated site, user not member, user favorite', + contextMenu: notMemberFavContextMenu, + toolbarPrimary: notMemberToolbarPrimary, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchNotMemberToolbarPrimary +}; + +export const publicNotMemberNotFav = { + name: `site-public-not-member-not-fav-${Utils.random()}`, + description: 'public site, user not member, not favorite', + contextMenu: notMemberNotFavContextMenu, + toolbarPrimary: notMemberToolbarPrimary, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchNotMemberToolbarPrimary +}; + +export const moderatedNotMemberNotFav = { + name: `site-moderated-not-member-not-fav-${Utils.random()}`, + description: 'moderated site, user not member, not favorite', + contextMenu: notMemberNotFavContextMenu, + toolbarPrimary: notMemberToolbarPrimary, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchNotMemberToolbarPrimary +}; + +export const moderatedRequestedJoinFav = { + name: `site-moderated-req-join-fav-${Utils.random()}`, + description: 'moderated site, user requested join, user favorite', + contextMenu: reqJoinFavContextMenu, + toolbarPrimary: reqJoinToolbarMore, + toolbarMore: favToolbarMore, + + searchToolbarPrimary: searchReqJoinToolbarPrimary +}; + +export const moderatedRequestedJoinNotFav = { + name: `site-moderated-req-join-not-fav-${Utils.random()}`, + description: 'moderated site, user requested join, not favorite', + contextMenu: reqJoinNotFavContextMenu, + toolbarPrimary: reqJoinToolbarMore, + toolbarMore: notFavToolbarMore, + + searchToolbarPrimary: searchReqJoinToolbarPrimary +}; + +export const siteInTrash = { + name: `deleted-site-${Utils.random()}`, + trashActions +}; + +export const site2InTrash = { + name: `deleted-site2-${Utils.random()}`, + trashActions +}; + diff --git a/e2e/suites/actions-available/special-permissions/other-permissions.test.ts b/e2e/suites/actions-available/special-permissions/other-permissions.test.ts new file mode 100755 index 0000000000..7a7af0e993 --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/other-permissions.test.ts @@ -0,0 +1,841 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage, SearchResultsPage } from '../../../pages/pages'; +import { SITE_VISIBILITY, SITE_ROLES, FILES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import { Viewer } from '../../../components/viewer/viewer'; + +describe('', () => { + const userConsumer = `consumer-${Utils.random()}`; + const userCollaborator = `collaborator-${Utils.random()}`; + const userDemoted = `demoted-${Utils.random()}`; + + const siteName = `site-private-${Utils.random()}`; + const file1 = `my-file1-${Utils.random()}.txt`; + let file1Id; + const file2 = `my-file2-${Utils.random()}.txt`; + let file2Id; + const file3 = `my-file3-${Utils.random()}.txt`; + let file3Id; + const fileLocked = `my-file-locked-${Utils.random()}.txt`; + let fileLockedId; + + const folder1 = `my-folder1-${Utils.random()}`; + let folder1Id; + const folder2 = `my-folder2-${Utils.random()}`; + let folder2Id; + + const docxFile = FILES.docxFile; + let docxFileId; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer), + userCollaborator: new RepoClient(userCollaborator, userCollaborator), + userDemoted: new RepoClient(userDemoted, userDemoted) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable, toolbar } = page; + const viewer = new Viewer(); + const viewerToolbar = viewer.toolbar; + const searchResultsPage = new SearchResultsPage(); + const { searchInput } = searchResultsPage.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + await apis.admin.people.createUser({ username: userCollaborator }); + await apis.admin.people.createUser({ username: userDemoted }); + + await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(siteName); + + file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id; + file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id; + file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; + folder1Id = (await apis.admin.nodes.createFolder(folder1, docLibId)).entry.id; + folder2Id = (await apis.admin.nodes.createFolder(folder2, docLibId)).entry.id; + + docxFileId = (await apis.admin.upload.uploadFile(docxFile, docLibId)).entry.id; + + await apis.admin.sites.addSiteMember(siteName, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + await apis.admin.sites.addSiteMember(siteName, userCollaborator, SITE_ROLES.SITE_COLLABORATOR.ROLE); + await apis.admin.sites.addSiteMember(siteName, userDemoted, SITE_ROLES.SITE_MANAGER.ROLE); + + fileLockedId = (await apis.admin.nodes.createFile(fileLocked, docLibId)).entry.id; + await apis.userDemoted.nodes.lockFile(fileLockedId); + await apis.userDemoted.favorites.addFavoriteById('file', fileLockedId); + await apis.userDemoted.shared.shareFileById(fileLockedId); + await apis.admin.sites.updateSiteMember(siteName, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE); + + await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); + + await apis.userConsumer.shared.shareFileById(file1Id); + await apis.userConsumer.shared.shareFileById(file2Id); + await apis.userConsumer.shared.shareFileById(docxFileId); + await apis.userConsumer.shared.shareFileById(file3Id); + await apis.userConsumer.shared.waitForApi({ expect: 5 }); + + await apis.userConsumer.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, docxFileId]); + await apis.userConsumer.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]); + await apis.userConsumer.favorites.waitForApi({ expect: 6 }); + + await apis.userCollaborator.favorites.addFavoritesByIds('file', [file1Id, docxFileId]); + await apis.userCollaborator.favorites.waitForApi({ expect: 2 }); + + await apis.admin.favorites.addFavoriteById('file', fileLockedId); + + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(siteName); + done(); + }); + + describe('Collaborator', () => { + beforeAll(async (done) => { + await loginPage.loginWith(userCollaborator); + done(); + }); + + it('on File Libraries - [C297647]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.selectItem(file1); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); + expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await toolbar.closeMoreMenu(); + }); + + it('on Shared Files - [C297651]', async () => { + await page.clickSharedFilesAndWait(); + await page.dataTable.selectItem(file1); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + // TODO: change expect to true when ACA-2173 is done + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await toolbar.closeMoreMenu(); + }); + + it('on Favorites - [C297652]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.selectItem(file1); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); + // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done + expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); + + await toolbar.openMoreMenu(); + + // TODO: change expect to true when ACA-2174 is done + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is not displayed for ${file1}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); + // TODO: change expect to false when ACA-1737 is done + expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${file1}`); + // TODO: change expect to false when ACA-1737 is done + expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${file1}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await toolbar.closeMoreMenu(); + }); + + it('on Search Results - [C297653]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(file1); + await dataTable.selectItem(file1); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await toolbar.closeMoreMenu(); + }); + + describe('in the viewer', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await dataTable.clearSelection(); + await page.clickPersonalFiles(); + done(); + }); + + afterAll(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('file opened from File Libraries - [C297654]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.doubleClickOnRowByName(docxFile); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Shared Files - [C297655]', async () => { + await page.clickSharedFilesAndWait(); + await dataTable.doubleClickOnRowByName(docxFile); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Favorites - [C297656]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.doubleClickOnRowByName(docxFile); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove Favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Search Results - [C306992]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(docxFile); + await dataTable.waitForBody(); + await dataTable.doubleClickOnRowByName(docxFile); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + }); + }); + + describe('File locked - lock owner : ', () => { + beforeAll(async (done) => { + await loginPage.loginWith(userDemoted); + done(); + }); + + it('on File Libraries - [C297657]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); + expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Shared Files - [C297658]', async () => { + await page.clickSharedFilesAndWait(); + await page.dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + // TODO: change expect to true when ACA-2173 is done + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Favorites - [C297659]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done + expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + // TODO: change expect to true when ACA-2174 is fixed + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + // TODO: change expect to false when ACA-1737 is fixed + expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${fileLocked}`); + // TODO: change expect to false when ACA-1737 is fixed + expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${fileLocked}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Search Results - [C297660]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(fileLocked); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); + + await toolbar.closeMoreMenu(); + }); + + describe('in the viewer', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await dataTable.clearSelection(); + await page.clickPersonalFiles(); + done(); + }); + + afterAll(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('file opened from File Libraries - [C297661]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Shared Files - [C297662]', async () => { + await page.clickSharedFilesAndWait(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Favorites - [C297663]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Search Results - [C306993]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(fileLocked); + await dataTable.waitForBody(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + }); + }); + + describe('File locked - manager : ', () => { + beforeAll(async (done) => { + await loginPage.loginWithAdmin(); + done(); + }); + + it('on File Libraries - [C297664]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Shared Files - [C297665]', async () => { + await page.clickSharedFilesAndWait(); + await page.dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + // TODO: change expect to true when ACA-2173 is done + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + // TODO: change expect to false when ACA-2173 is done + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Favorites - [C297666]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done + expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + // TODO: change expect to true when ACA-2174 is fixed + expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + // TODO: change expect to false when ACA-1737 is done + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed'); + + await toolbar.closeMoreMenu(); + }); + + it('on Search Results - [C297667]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(fileLocked); + await dataTable.selectItem(fileLocked); + + expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); + expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); + expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); + expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); + expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); + + await toolbar.openMoreMenu(); + + expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); + expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked} in Search Results`); + expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked} in Search Results`); + expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); + expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); + expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed'); + + await toolbar.closeMoreMenu(); + }); + + describe('in the viewer', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await dataTable.clearSelection(); + await page.clickPersonalFiles(); + done(); + }); + + afterAll(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('file opened from File Libraries - [C297671]', async () => { + await page.clickFileLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Shared Files - [C297672]', async () => { + await page.clickSharedFilesAndWait(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Favorites - [C297673]', async () => { + await page.clickFavoritesAndWait(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); + expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + + it('file opened from Search Results - [C306994]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor(fileLocked); + await dataTable.waitForBody(); + await dataTable.doubleClickOnRowByName(fileLocked); + await viewer.waitForViewerToOpen(); + + expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); + expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); + expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); + expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); + expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); + expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); + + await viewerToolbar.openMoreMenu(); + + expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); + expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); + expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); + expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More Actions`); + expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); + // TODO: change expect to true when ACA-2319 is fixed + expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is not displayed`); + // TODO: change expect to true when ACA-2319 is fixed + expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is not displayed`); + expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); + expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); + + await viewerToolbar.closeMoreMenu(); + }); + }); + }); +}); diff --git a/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts b/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts new file mode 100755 index 0000000000..a645b9c8ce --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/permissions-favorites.test.ts @@ -0,0 +1,198 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-permissions'; +import * as testUtil from '../test-util'; + +describe('Special permissions actions : on Favorites : ', () => { + + const site = `site-private-${Utils.random()}`; + + const userConsumer = `consumer-${Utils.random()}`; + + let fileDocxFavId, fileFavId, fileDocxSharedFavId, fileSharedFavId, fileFavLockedId, fileSharedFavLockedId; + let folderFavId, folderFav2Id; + + const file3 = `file-3-${Utils.random()}.txt`; + let file3Id; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + + await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(site); + await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + + fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id; + fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id; + fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id; + fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id; + fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id; + fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id; + + file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; + + folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id; + folderFav2Id = (await apis.admin.nodes.createFolder(data.folderFav2.name, docLibId)).entry.id; + await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId); + await apis.userConsumer.favorites.addFavoriteById('folder', folderFav2Id); + + await apis.userConsumer.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.userConsumer.shared.shareFilesByIds([ + fileDocxSharedFavId, + fileSharedFavId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.admin.nodes.lockFile(fileFavLockedId); + await apis.admin.nodes.lockFile(fileSharedFavLockedId); + + await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); + + await apis.userConsumer.favorites.waitForApi({ expect: 9 }); + await apis.userConsumer.shared.waitForApi({ expect: 4 }); + + await loginPage.loginWith(userConsumer); + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(site); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickFavoritesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('on a file', () => { + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.favoritesContextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.favoritesContextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.favoritesContextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.favoritesContextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.favoritesContextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.favoritesContextMenu); + }); + }); + + describe('on a folder', () => { + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.favoritesToolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.favoritesContextMenu); + }); + }); + + describe('on multiple selection', () => { + it('multiple files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('multiple locked files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFavLocked.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('multiple folders - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folderFav2.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('both files and folders - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, data.folderFav.name ], data.multipleSelAllFav.favoritesToolbarMore); + }); + + it('multiple files with different granular permissions - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileFav.name, file3 ], data.multipleSelAllFav.favoritesContextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileFav.name, file3 ], data.multipleSelAllFav.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileFav.name, file3 ], data.multipleSelAllFav.favoritesToolbarMore); + }); + }); + +}); diff --git a/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts b/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts new file mode 100755 index 0000000000..bc6abb7a1b --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/permissions-my-libraries.test.ts @@ -0,0 +1,266 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-permissions'; +import * as testUtil from '../test-util'; + +describe('Special permissions actions : on File Libraries : ', () => { + + const site = `site-private-${Utils.random()}`; + + const userConsumer = `consumer-${Utils.random()}`; + + const file3 = `file-3-${Utils.random()}.txt`; + let file3Id; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + let folderFavId; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + + await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(site); + await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + + await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name ); + fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id; + await apis.admin.nodes.createFile(data.file.name, docLibId); + fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id; + fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id; + fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id; + fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id; + fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id; + fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id; + fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id; + + file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; + + await apis.admin.nodes.createFolder(data.folder.name, docLibId); + folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id; + done(); + }); + + beforeAll(async (done) => { + await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId); + + await apis.userConsumer.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.userConsumer.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.admin.nodes.lockFile(fileLockedId); + await apis.admin.nodes.lockFile(fileFavLockedId); + await apis.admin.nodes.lockFile(fileSharedLockedId); + await apis.admin.nodes.lockFile(fileSharedFavLockedId); + + await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); + + await apis.userConsumer.favorites.waitForApi({ expect: 8 }); + await apis.userConsumer.shared.waitForApi({ expect: 7 }); + done(); + }); + + beforeAll(async (done) => { + await loginPage.loginWith(userConsumer); + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(site); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.goToMyLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(site); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('on a file', () => { + + it('File Office - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore); + await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu); + }); + + it('File simple - []', async () => { + await testUtil.checkToolbarPrimary(data.file.name, data.file.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore); + await testUtil.checkContextMenu(data.file.name, data.file.contextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu); + }); + + it('File locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu); + }); + }); + + describe('on a folder', () => { + + it('Folder not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folder.name, data.folder.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore); + await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu); + }); + + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu); + }); + }); + + describe('on multiple selection', () => { + it('multiple files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocx.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileDocxSharedFav.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + + it('multiple folders - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.folderFav.name, data.folder.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folderFav.name, data.folder.name ], data.multipleSel.toolbarMore); + }); + + it('both files and folders - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folder.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folder.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folder.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files with different granular permissions - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, file3 ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.toolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/special-permissions/permissions-search.test.ts b/e2e/suites/actions-available/special-permissions/permissions-search.test.ts new file mode 100755 index 0000000000..6bcfdd7b47 --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/permissions-search.test.ts @@ -0,0 +1,310 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-permissions'; +import * as testUtil from '../test-util'; + +describe('Special permissions actions : on Search Results : ', () => { + + const site = `site-private-${Utils.random()}`; + + const userConsumer = `consumer-${Utils.random()}`; + + const file3 = `file-3-${Utils.random()}.txt`; + let file3Id; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + let folderFavId; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { searchInput } = page.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + + await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(site); + await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + + await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name ); + fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id; + await apis.admin.nodes.createFile(data.file.name, docLibId); + fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id; + fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id; + fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id; + fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id; + fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id; + fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id; + fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id; + + file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; + + await apis.admin.nodes.createFolder(data.folder.name, docLibId); + folderFavId = (await apis.admin.nodes.createFolder(data.folderFav.name, docLibId)).entry.id; + await apis.userConsumer.favorites.addFavoriteById('folder', folderFavId); + + await apis.userConsumer.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.userConsumer.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.admin.nodes.lockFile(fileLockedId); + await apis.admin.nodes.lockFile(fileFavLockedId); + await apis.admin.nodes.lockFile(fileSharedLockedId); + await apis.admin.nodes.lockFile(fileSharedFavLockedId); + + await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); + + await apis.userConsumer.favorites.waitForApi({ expect: 8 }); + await apis.userConsumer.shared.waitForApi({ expect: 7 }); + await apis.userConsumer.search.waitForApi(userConsumer, { expect: 13 }); + + await loginPage.loginWith(userConsumer); + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(site); + done(); + }); + + describe('on a file', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocx.name, data.fileDocx.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocx.name, data.fileDocx.toolbarMore); + await testUtil.checkContextMenu(data.fileDocx.name, data.fileDocx.contextMenu); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxFav.name, data.fileDocxFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxFav.name, data.fileDocxFav.contextMenu); + }); + + it('File simple - []', async () => { + await testUtil.checkToolbarPrimary(data.file.name, data.file.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.file.name, data.file.toolbarMore); + await testUtil.checkContextMenu(data.file.name, data.file.contextMenu); + }); + + it('File favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFav.name, data.fileFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFav.name, data.fileFav.toolbarMore); + await testUtil.checkContextMenu(data.fileFav.name, data.fileFav.contextMenu); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.contextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.contextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.toolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.contextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.contextMenu); + }); + + it('File locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileLocked.name, data.fileLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileLocked.name, data.fileLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileLocked.name, data.fileLocked.contextMenu); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileFavLocked.name, data.fileFavLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileFavLocked.name, data.fileFavLocked.contextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.contextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.contextMenu); + }); + }); + + describe('on a folder', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor('folder-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('Folder not favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folder.name, data.folder.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folder.name, data.folder.toolbarMore); + await testUtil.checkContextMenu(data.folder.name, data.folder.contextMenu); + }); + + it('Folder favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.folderFav.name, data.folderFav.searchToolbarPrimary); + await testUtil.checkToolbarMoreActions(data.folderFav.name, data.folderFav.toolbarMore); + await testUtil.checkContextMenu(data.folderFav.name, data.folderFav.contextMenu); + }); + }); + + describe('on multiple selection', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('multiple files - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.fileDocxShared.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.fileDocxShared.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.fileDocxShared.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, data.fileSharedFav.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + + it('multiple folders - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor('folder-'); + + await testUtil.checkMultipleSelContextMenu([ data.folder.name, data.folderFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.folder.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.folder.name, data.folderFav.name ], data.multipleSel.toolbarMore); + }); + + it('both files and folders - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(`=${data.file.name} or =${data.folderFav.name}`); + + await testUtil.checkMultipleSelContextMenu([ data.file.name, data.folderFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.file.name, data.folderFav.name ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.file.name, data.folderFav.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files with different granular permissions - []', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + + await testUtil.checkMultipleSelContextMenu([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileDocxFav.name, file3 ], data.multipleSel.searchToolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileDocxFav.name, file3 ], data.multipleSelAllFav.toolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts b/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts new file mode 100755 index 0000000000..6f5404bc0a --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/permissions-shared.test.ts @@ -0,0 +1,179 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-permissions'; +import * as testUtil from '../test-util'; + +describe('Special permissions actions : on Shared Files : ', () => { + + const site = `site-private-${Utils.random()}`; + + const userConsumer = `consumer-${Utils.random()}`; + + const file3 = `file-3-${Utils.random()}.txt`; + let file3Id; + + let fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileSharedLockedId, fileSharedFavLockedId; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + + await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(site); + await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + + fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id; + fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id; + fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id; + fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id; + + file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; + + await apis.userConsumer.favorites.addFavoritesByIds('file', [ + fileDocxSharedFavId, + fileSharedFavId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.userConsumer.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId, + file3Id + ]); + + await apis.admin.nodes.lockFile(fileSharedLockedId); + await apis.admin.nodes.lockFile(fileSharedFavLockedId); + + await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); + + await apis.userConsumer.favorites.waitForApi({ expect: 7 }); + await apis.userConsumer.shared.waitForApi({ expect: 4 }); + + await loginPage.loginWith(userConsumer); + done(); + }); + + afterAll(async (done) => { + await apis + await apis.admin.sites.deleteSite(site); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickSharedFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + describe('single selection', () => { + + it('File Office, shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxShared.name, data.fileDocxShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileDocxShared.name, data.fileDocxShared.sharedContextMenu); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileDocxSharedFav.name, data.fileDocxSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileDocxSharedFav.name, data.fileDocxSharedFav.sharedContextMenu); + }); + + it('File shared - []', async () => { + await testUtil.checkToolbarPrimary(data.fileShared.name, data.fileShared.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileShared.name, data.fileShared.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileShared.name, data.fileShared.sharedContextMenu); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFav.name, data.fileSharedFav.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFav.name, data.fileSharedFav.sharedContextMenu); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedLocked.name, data.fileSharedLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedLocked.name, data.fileSharedLocked.sharedContextMenu); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkToolbarPrimary(data.fileSharedFavLocked.name, data.fileSharedFavLocked.toolbarPrimary); + await testUtil.checkToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedToolbarMore); + await testUtil.checkContextMenu(data.fileSharedFavLocked.name, data.fileSharedFavLocked.sharedContextMenu); + }); + }); + + describe('multiple selection', () => { + it('multiple files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileShared.name, data.fileSharedFav.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files - all favorite - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, data.fileSharedFavLocked.name ], data.multipleSelAllFav.toolbarMore); + }); + + it('multiple locked files - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedLocked.name, data.fileSharedFavLocked.name ], data.multipleSel.toolbarMore); + }); + + it('multiple files with different granular permissions - []', async () => { + await testUtil.checkMultipleSelContextMenu([ data.fileSharedFav.name, file3 ], data.multipleSelAllFav.contextMenu); + await testUtil.checkMultipleSelToolbarPrimary([ data.fileSharedFav.name, file3 ], data.multipleSel.toolbarPrimary); + await testUtil.checkMultipleSelToolbarMoreActions([ data.fileSharedFav.name, file3 ], data.multipleSelAllFav.toolbarMore); + }); + }); + +}); diff --git a/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts b/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts new file mode 100755 index 0000000000..9675361630 --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/permissions-viewer.test.ts @@ -0,0 +1,401 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../../pages/pages'; +import { FILES, SITE_VISIBILITY, SITE_ROLES } from '../../../configs'; +import { RepoClient } from '../../../utilities/repo-client/repo-client'; +import { Utils } from '../../../utilities/utils'; +import * as data from './test-data-permissions'; +import * as testUtil from '../test-util'; + +describe('Special permissions actions : in the Viewer : ', () => { + + const site = `site-private-${Utils.random()}`; + + const userConsumer = `consumer-${Utils.random()}`; + + let fileDocxFavId, fileFavId, fileDocxSharedId, fileDocxSharedFavId, fileSharedId, fileSharedFavId, fileLockedId, fileFavLockedId, fileSharedLockedId, fileSharedFavLockedId; + + const apis = { + admin: new RepoClient(), + userConsumer: new RepoClient(userConsumer, userConsumer) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + const { searchInput } = page.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username: userConsumer }); + + await apis.admin.sites.createSite(site, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(site); + await apis.admin.sites.addSiteMember(site, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); + + await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocx.name ); + fileDocxFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxFav.name)).entry.id; + await apis.admin.nodes.createFile(data.file.name, docLibId); + fileFavId = (await apis.admin.nodes.createFile(data.fileFav.name, docLibId)).entry.id; + fileDocxSharedId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxShared.name)).entry.id; + fileDocxSharedFavId = (await apis.admin.upload.uploadFileWithRename(FILES.docxFile, docLibId, data.fileDocxSharedFav.name)).entry.id; + fileSharedId = (await apis.admin.nodes.createFile(data.fileShared.name, docLibId)).entry.id; + fileSharedFavId = (await apis.admin.nodes.createFile(data.fileSharedFav.name, docLibId)).entry.id; + fileLockedId = (await apis.admin.nodes.createFile(data.fileLocked.name, docLibId)).entry.id; + fileFavLockedId = (await apis.admin.nodes.createFile(data.fileFavLocked.name, docLibId)).entry.id; + fileSharedLockedId = (await apis.admin.nodes.createFile(data.fileSharedLocked.name, docLibId)).entry.id; + fileSharedFavLockedId = (await apis.admin.nodes.createFile(data.fileSharedFavLocked.name, docLibId)).entry.id; + + done(); + }); + + beforeAll(async (done) => { + await apis.userConsumer.favorites.addFavoritesByIds('file', [ + fileDocxFavId, + fileFavId, + fileDocxSharedFavId, + fileSharedFavId, + fileFavLockedId, + fileSharedFavLockedId + ]); + + await apis.userConsumer.shared.shareFilesByIds([ + fileDocxSharedId, + fileDocxSharedFavId, + fileSharedId, + fileSharedFavId, + fileSharedLockedId, + fileSharedFavLockedId + ]); + + await apis.admin.nodes.lockFile(fileLockedId); + await apis.admin.nodes.lockFile(fileFavLockedId); + await apis.admin.nodes.lockFile(fileSharedLockedId); + await apis.admin.nodes.lockFile(fileSharedFavLockedId); + + await apis.userConsumer.favorites.waitForApi({ expect: 6 }); + await apis.userConsumer.shared.waitForApi({ expect: 6 }); + done(); + }); + + beforeAll(async (done) => { + await loginPage.loginWith(userConsumer); + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(site); + done(); + }); + + describe('file opened from File Libraries', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.goToMyLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(site); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File simple - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Favorites', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickFavoritesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Shared Files', () => { + + beforeEach(async (done) => { + await Utils.pressEscape(); + await page.clickSharedFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office, shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); + + describe('file opened from Search Results', () => { + + beforeAll(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFiles(); + await searchInput.searchFor('file-'); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File Office - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocx.name, data.fileDocx.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocx.name, data.fileDocx.viewerToolbarMore); + }); + + it('File Office, favorite - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxFav.name, data.fileDocxFav.viewerToolbarMore); + }); + + it('File simple - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.file.name, data.file.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.file.name, data.file.viewerToolbarMore); + }); + + it('File favorite - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileFav.name, data.fileFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFav.name, data.fileFav.viewerToolbarMore); + }); + + it('File Office, shared - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxShared.name, data.fileDocxShared.viewerToolbarMore); + }); + + it('File Office, shared, favorite - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileDocxSharedFav.name, data.fileDocxSharedFav.viewerToolbarMore); + }); + + it('File shared - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileShared.name, data.fileShared.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileShared.name, data.fileShared.viewerToolbarMore); + }); + + it('File shared, favorite - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFav.name, data.fileSharedFav.viewerToolbarMore); + }); + + it('File locked - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileLocked.name, data.fileLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileLocked.name, data.fileLocked.viewerToolbarMore); + }); + + it('File favorite, locked - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileFavLocked.name, data.fileFavLocked.viewerToolbarMore); + }); + + it('File shared, locked - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedLocked.name, data.fileSharedLocked.viewerToolbarMore); + }); + + it('File shared, favorite, locked - []', async () => { + // await searchInput.clickSearchButton(); + // await searchInput.checkOnlyFiles(); + // await searchInput.searchFor('file-'); + + await testUtil.checkViewerToolbarPrimaryActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarPrimary); + await testUtil.checkViewerToolbarMoreActions(data.fileSharedFavLocked.name, data.fileSharedFavLocked.viewerToolbarMore); + }); + }); +}); diff --git a/e2e/suites/actions-available/special-permissions/test-data-permissions.ts b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts new file mode 100644 index 0000000000..8ee488b663 --- /dev/null +++ b/e2e/suites/actions-available/special-permissions/test-data-permissions.ts @@ -0,0 +1,335 @@ +import { Utils } from '../../../utilities/utils'; + + +// ----- files ----- + +const consumerContextMenu = ['Share', 'Download', 'View', 'Favorite', 'Copy', 'Manage Versions']; +const consumerFavContextMenu = ['Share', 'Download', 'View', 'Remove Favorite', 'Copy', 'Manage Versions']; +const consumerSharedContextMenu = ['Shared Link Settings', 'Download', 'View', 'Favorite', 'Copy', 'Manage Versions']; +const consumerSharedFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Remove Favorite', 'Copy', 'Manage Versions']; + +const consumerToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions']; +const consumerSharedToolbarPrimary = ['Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; + +const searchConsumerToolbarPrimary = ['Toggle search filter', 'Share', 'Download', 'View', 'View Details', 'More Actions']; +const searchConsumerSharedToolbarPrimary = ['Toggle search filter', 'Shared Link Settings', 'Download', 'View', 'View Details', 'More Actions']; + +const consumerToolbarMore = ['Favorite', 'Copy', 'Manage Versions']; +const consumerFavToolbarMore = ['Remove Favorite', 'Copy', 'Manage Versions']; + +// ---- VIEWER ---- + +const consumerViewerSharedToolbarPrimary = ['Activate full-screen mode', 'Shared Link Settings', 'Download', 'Print', 'View Details', 'More Actions']; +const consumerViewerToolbarPrimary = ['Activate full-screen mode', 'Share', 'Download', 'Print', 'View Details', 'More Actions']; +const consumerViewerFavToolbarMore = ['Remove Favorite', 'Copy', 'Manage Versions']; +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 +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 +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: change 'Share' into 'Shared Link Settings' when ACA-2175 is done +const favoritesConsumerSharedContextMenu = ['Share', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Move', 'Copy', 'Delete', 'Manage Versions']; +// TODO: change 'Share' into 'Shared Link Settings' when ACA-2175 is done +const favoritesConsumerSharedToolbarPrimary = ['Share', 'Download', 'View', 'View Details', 'More Actions']; + + +// ---- SHARED FILES workaround ---- + +// TODO: remove 'Upload New Version' when ACA-2173 is done +const sharedConsumerToolbarMore = ['Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; +// TODO: remove 'Upload New Version' when ACA-2173 is done +const sharedConsumerFavToolbarMore = ['Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; +// TODO: remove 'Upload New Version' when ACA-2173 is done +const sharedConsumerContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Favorite', 'Copy', 'Manage Versions']; +// TODO: remove 'Upload New Version' when ACA-2173 is done +const sharedConsumerFavContextMenu = ['Shared Link Settings', 'Download', 'View', 'Upload New Version', 'Remove Favorite', 'Copy', 'Manage Versions']; + + +export const fileDocx = { + name: `file-docx-${Utils.random()}.docx`, + description: 'file not shared, not fav, office, not locked', + + contextMenu: consumerContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const fileDocxFav = { + name: `file-docx-fav-${Utils.random()}.docx`, + description: 'file not shared, fav, office, not locked', + + contextMenu: consumerFavContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerContextMenu, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const file = { + name: `file-${Utils.random()}.txt`, + description: 'file not shared, not fav, not office, not locked', + + contextMenu: consumerContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const fileFav = { + name: `file-fav-${Utils.random()}.txt`, + description: 'file not shared, fav, not office, not locked', + + contextMenu: consumerFavContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerContextMenu, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const fileDocxShared = { + name: `file-docx-shared-${Utils.random()}.docx`, + description: 'file shared, not fav, office, not locked', + + contextMenu: consumerSharedContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + sharedToolbarMore: sharedConsumerToolbarMore, + sharedContextMenu: sharedConsumerContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +export const fileDocxSharedFav = { + name: `file-docx-shared-fav-${Utils.random()}.docx`, + description: 'file shared, fav, office, not locked', + + contextMenu: consumerSharedFavContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerSharedContextMenu, + favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, + + sharedToolbarMore: sharedConsumerFavToolbarMore, + sharedContextMenu: sharedConsumerFavContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +export const fileShared = { + name: `file-shared-${Utils.random()}.txt`, + description: 'file shared, not fav, not office, not locked', + + contextMenu: consumerSharedContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + sharedToolbarMore: sharedConsumerToolbarMore, + sharedContextMenu: sharedConsumerContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +export const fileSharedFav = { + name: `file-shared-fav-${Utils.random()}.txt`, + description: 'file shared, fav, not office, not locked', + + contextMenu: consumerSharedFavContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerSharedContextMenu, + favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, + + sharedToolbarMore: sharedConsumerFavToolbarMore, + sharedContextMenu: sharedConsumerFavContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +export const fileLocked = { + name: `file-locked-${Utils.random()}.txt`, + description: 'file not shared, not fav, not office, locked', + + contextMenu: consumerContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const fileFavLocked = { + name: `file-fav-locked-${Utils.random()}.txt`, + description: 'file not shared, fav, not office, locked', + + contextMenu: consumerFavContextMenu, + toolbarPrimary: consumerToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerContextMenu, + + searchToolbarPrimary: searchConsumerToolbarPrimary +}; + +export const fileSharedLocked = { + name: `file-shared-locked-${Utils.random()}.txt`, + description: 'file shared, not fav, not office, locked', + + contextMenu: consumerSharedContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerToolbarMore, + + sharedToolbarMore: sharedConsumerToolbarMore, + sharedContextMenu: sharedConsumerContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +export const fileSharedFavLocked = { + name: `file-shared-fav-locked-${Utils.random()}.txt`, + description: 'file shared, fav, not office, locked', + + contextMenu: consumerSharedFavContextMenu, + toolbarPrimary: consumerSharedToolbarPrimary, + toolbarMore: consumerFavToolbarMore, + viewerToolbarPrimary: consumerViewerSharedToolbarPrimary, + viewerToolbarMore: consumerViewerFavToolbarMore, + + favoritesToolbarMore: favoritesConsumerToolbarMore, + favoritesContextMenu: favoritesConsumerSharedContextMenu, + favoritesToolbarPrimary: favoritesConsumerSharedToolbarPrimary, + + sharedToolbarMore: sharedConsumerFavToolbarMore, + sharedContextMenu: sharedConsumerFavContextMenu, + + searchToolbarPrimary: searchConsumerSharedToolbarPrimary +}; + +// ---- folders --- + +const consumerFolderContextMenu = ['Download', 'Favorite', 'Copy']; +const consumerFolderToolbarPrimary = ['Download', 'View Details', 'More Actions']; +const consumerFolderToolbarMore = ['Favorite', 'Copy']; +const searchConsumerFolderToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions']; +const consumerFolderFavContextMenu = ['Download', 'Remove Favorite', 'Copy']; +const consumerFolderFavToolbarMore = ['Remove Favorite', 'Copy']; + +// ---- FAVORITES workarounds ---- + +// TODO: remove 'Edit', 'Move' and 'Delete' when ACA-1737 is done +const favoritesConsumerFolderContextMenu = ['Download', 'Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete']; +// TODO: remove 'Edit', 'Move' and 'Delete' when ACA-1737 is done +const favoritesConsumerFolderToolbarMore = ['Edit', 'Remove Favorite', 'Move', 'Copy', 'Delete']; + +export const folder = { + name: `folder-${Utils.random()}`, + description: 'folder not favorite', + contextMenu: consumerFolderContextMenu, + toolbarPrimary: consumerFolderToolbarPrimary, + toolbarMore: consumerFolderToolbarMore, + + searchToolbarPrimary: searchConsumerFolderToolbarPrimary +}; + +export const folderFav = { + name: `folder-fav-${Utils.random()}`, + description: 'folder favorite', + contextMenu: consumerFolderFavContextMenu, + toolbarPrimary: consumerFolderToolbarPrimary, + toolbarMore: consumerFolderFavToolbarMore, + + favoritesContextMenu: favoritesConsumerFolderContextMenu, + favoritesToolbarMore: favoritesConsumerFolderToolbarMore, + + searchToolbarPrimary: searchConsumerFolderToolbarPrimary, +}; + +export const folderFav2 = { + name: `folder-fav-2-${Utils.random()}`, + description: 'folder 2 favorite' +}; + +// ---- multiple selection --- + +const multipleSelContextMenu = ['Download', 'Favorite', 'Copy']; +const multipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Copy']; +const multipleSelToolbarPrimary = ['Download', 'View Details', 'More Actions']; +const multipleSelToolbarMore = ['Favorite', 'Copy']; +const multipleSelAllFavToolbarMore = ['Remove Favorite', 'Copy']; +const searchMultipleSelToolbarPrimary = ['Toggle search filter', 'Download', 'View Details', 'More Actions']; + +// ---- FAVORITES workarounds ---- + +// TODO: remove 'Move' and 'Delete' when ACA-1737 is done +const favoritesMultipleSelContextMenu = ['Download', 'Favorite', 'Move', 'Copy', 'Delete']; +// TODO: remove 'Move' and 'Delete' when ACA-1737 is done +const favoritesMultipleSelToolbarMore = ['Favorite', 'Move', 'Copy', 'Delete']; +// TODO: remove 'Move' and 'Delete' when ACA-1737 is done +const favoritesMultipleSelAllFavContextMenu = ['Download', 'Remove Favorite', 'Move', 'Copy', 'Delete']; +// TODO: remove 'Move' and 'Delete' when ACA-1737 is done +const favoritesMultipleSelAllFavToolbarMore = ['Remove Favorite', 'Move', 'Copy', 'Delete']; + + +export const multipleSel = { + contextMenu: multipleSelContextMenu, + toolbarPrimary: multipleSelToolbarPrimary, + toolbarMore: multipleSelToolbarMore, + + favoritesContextMenu: favoritesMultipleSelContextMenu, + favoritesToolbarMore: favoritesMultipleSelToolbarMore, + + searchToolbarPrimary: searchMultipleSelToolbarPrimary +} + +export const multipleSelAllFav = { + contextMenu: multipleSelAllFavContextMenu, + toolbarPrimary: multipleSelToolbarPrimary, + toolbarMore: multipleSelAllFavToolbarMore, + + favoritesContextMenu: favoritesMultipleSelAllFavContextMenu, + favoritesToolbarMore: favoritesMultipleSelAllFavToolbarMore, + + searchToolbarPrimary: searchMultipleSelToolbarPrimary +} diff --git a/e2e/suites/actions-available/test-util.ts b/e2e/suites/actions-available/test-util.ts new file mode 100644 index 0000000000..1dc54aeb86 --- /dev/null +++ b/e2e/suites/actions-available/test-util.ts @@ -0,0 +1,102 @@ +import { BrowsingPage } from '../../pages/pages'; +import { Viewer } from '../../components/viewer/viewer'; +import { Utils } from '../../utilities/utils'; + +const page = new BrowsingPage(); +const { dataTable, toolbar } = page; +const contextMenu = dataTable.menu; +const viewer = new Viewer(); + + +export async function checkContextMenu(item: string, expectedContextMenu: string[]) { + await dataTable.rightClickOnItem(item); + const actualActions = await contextMenu.getMenuItems(); + expect(actualActions.length).toBe(expectedContextMenu.length, 'Incorrect number of context menu items'); + expect(JSON.stringify(actualActions)).toEqual(JSON.stringify(expectedContextMenu), 'Incorrect context menu actions'); +} + +export async function checkToolbarPrimary(item: string, expectedToolbarPrimary: string[]) { + await dataTable.selectItem(item); + + const actualPrimaryActions = await toolbar.getButtons(); + expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of toolbar primary items'); + expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect toolbar primary actions'); +} + +export async function checkToolbarMoreActions(item: string, expectedToolbarMore: string[]) { + await dataTable.selectItem(item); + + await toolbar.openMoreMenu(); + + const actualMoreActions = await toolbar.menu.getMenuItems(); + expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items'); + expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions'); + + await toolbar.closeMoreMenu(); +} + +export async function checkMultipleSelContextMenu(items: string[], expectedContextMenu: string[]) { + await dataTable.selectMultipleItems(items); + await dataTable.rightClickOnMultipleSelection(); + + const actualActions = await contextMenu.getMenuItems(); + expect(actualActions.length).toBe(expectedContextMenu.length, 'Incorrect number of context menu items'); + expect(JSON.stringify(actualActions)).toEqual(JSON.stringify(expectedContextMenu), 'Incorrect context menu actions'); +} + +export async function checkMultipleSelToolbarPrimary(items: string[], expectedToolbarPrimary: string[]) { + await dataTable.selectMultipleItems(items); + + const actualPrimaryActions = await toolbar.getButtons(); + expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of toolbar primary items'); + expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect toolbar primary actions'); +} + +export async function checkMultipleSelToolbarMoreActions(items: string[], expectedToolbarMore: string[]) { + await dataTable.selectMultipleItems(items); + + await toolbar.openMoreMenu(); + + const actualMoreActions = await toolbar.menu.getMenuItems(); + expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items'); + expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions'); + + await toolbar.closeMoreMenu(); +} + +export async function checkViewerToolbarPrimaryActions(item: string, expectedToolbarPrimary: string[]) { + await dataTable.doubleClickOnRowByName(item); + await viewer.waitForViewerToOpen(); + + let actualPrimaryActions = await toolbar.getButtons(); + + actualPrimaryActions = removeClosePreviousNextOldInfo(actualPrimaryActions); + + expect(actualPrimaryActions.length).toBe(expectedToolbarPrimary.length, 'Incorrect number of viewer toolbar primary items'); + expect(JSON.stringify(actualPrimaryActions)).toEqual(JSON.stringify(expectedToolbarPrimary), 'Incorrect viewer toolbar primary actions'); + + await Utils.pressEscape(); +} + +export async function checkViewerToolbarMoreActions(item: string, expectedToolbarMore: string[]) { + await dataTable.doubleClickOnRowByName(item); + await viewer.waitForViewerToOpen(); + await toolbar.openMoreMenu(); + + const actualMoreActions = await toolbar.menu.getMenuItems(); + + expect(actualMoreActions.length).toBe(expectedToolbarMore.length, 'Incorrect number of toolbar More menu items'); + expect(JSON.stringify(actualMoreActions)).toEqual(JSON.stringify(expectedToolbarMore), 'Incorrect toolbar More actions'); + + await toolbar.closeMoreMenu(); + await Utils.pressEscape(); +} + + +function removeClosePreviousNextOldInfo(actions: string[]) { + return actions.filter(elem => { + if ( (elem !== 'Close') && (elem !== 'Previous File') && (elem !== 'Next File') && (elem !== 'View details')) { + return elem; + } + }); +} diff --git a/e2e/suites/actions/context-menu-multiple-selection.test.ts b/e2e/suites/actions/context-menu-multiple-selection.test.ts deleted file mode 100755 index 0283d3a9f8..0000000000 --- a/e2e/suites/actions/context-menu-multiple-selection.test.ts +++ /dev/null @@ -1,656 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages'; -import { SITE_VISIBILITY } from '../../configs'; -import { RepoClient } from '../../utilities/repo-client/repo-client'; -import { Utils } from '../../utilities/utils'; - -describe('Context menu actions - multiple selection : ', () => { - const username = `user-${Utils.random()}`; - - const parent = `parent=${Utils.random()}`; let parentId; - - const file1 = `my-file1-${Utils.random()}.txt`; let file1Id; - const file2 = `my-file2-${Utils.random()}.txt`; let file2Id; - const fileLocked1 = `my-fileLocked1-${Utils.random()}.txt`; let fileLocked1Id; - const fileLocked2 = `my-fileLocked2-${Utils.random()}.txt`; let fileLocked2Id; - - const folder1 = `my-folder1-${Utils.random()}`; let folder1Id; - const folder2 = `my-folder2-${Utils.random()}`; let folder2Id; - - const fileInTrash1 = `deletedFile1-${Utils.random()}.txt`; let fileInTrash1Id; - const fileInTrash2 = `deletedFile2-${Utils.random()}.txt`; let fileInTrash2Id; - const folderInTrash1 = `deletedFolder1-${Utils.random()}`; let folderInTrash1Id; - const folderInTrash2 = `deletedFolder2-${Utils.random()}`; let folderInTrash2Id; - - const siteName = `site-${Utils.random()}`; - const file1Site = `my-inSite-file1-${Utils.random()}.txt`; - const file2Site = `my-inSite-file2-${Utils.random()}.txt`; - const fileLocked1Site = `my-inSite-fileLocked1-${Utils.random()}.txt`; let fileLocked1SiteId; - const fileLocked2Site = `my-inSite-fileLocked2-${Utils.random()}.txt`; let fileLocked2SiteId; - const folder1Site = `my-inSite-folder1-${Utils.random()}`; - const folder2Site = `my-inSite-folder2-${Utils.random()}`; - - const apis = { - admin: new RepoClient(), - user: new RepoClient(username, username) - }; - - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable } = page; - const contextMenu = dataTable.menu; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; - - beforeAll(async (done) => { - await apis.admin.people.createUser({ username }); - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - folder1Id = (await apis.user.nodes.createFolder(folder1, parentId)).entry.id; - folder2Id = (await apis.user.nodes.createFolder(folder2, parentId)).entry.id; - - fileLocked1Id = (await apis.user.nodes.createFile(fileLocked1, parentId)).entry.id; - fileLocked2Id = (await apis.user.nodes.createFile(fileLocked2, parentId)).entry.id; - await apis.user.nodes.lockFile(fileLocked1Id); - await apis.user.nodes.lockFile(fileLocked2Id); - - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); - const docLibId = await apis.user.sites.getDocLibId(siteName); - await apis.user.nodes.createFile(file1Site, docLibId); - await apis.user.nodes.createFile(file2Site, docLibId); - await apis.user.nodes.createFolder(folder1Site, docLibId); - await apis.user.nodes.createFolder(folder2Site, docLibId); - fileLocked1SiteId = (await apis.user.nodes.createFile(fileLocked1Site, docLibId)).entry.id; - fileLocked2SiteId = (await apis.user.nodes.createFile(fileLocked2Site, docLibId)).entry.id; - await apis.user.nodes.lockFile(fileLocked1SiteId); - await apis.user.nodes.lockFile(fileLocked2SiteId); - - await apis.user.shared.shareFilesByIds([ file1Id, file2Id, fileLocked1Id, fileLocked2Id ]); - await apis.user.shared.waitForApi({ expect: 4 }); - - await apis.user.favorites.addFavoritesByIds('file', [ file1Id, file2Id, fileLocked1Id, fileLocked2Id ]); - await apis.user.favorites.addFavoritesByIds('folder', [ folder1Id, folder2Id ]); - await apis.user.favorites.waitForApi({ expect: 6 + 1 }); - - fileInTrash1Id = (await apis.user.nodes.createFile(fileInTrash1)).entry.id; - fileInTrash2Id = (await apis.user.nodes.createFile(fileInTrash2)).entry.id; - folderInTrash1Id = (await apis.user.nodes.createFolder(folderInTrash1)).entry.id; - folderInTrash2Id = (await apis.user.nodes.createFolder(folderInTrash2)).entry.id; - await apis.user.nodes.deleteNodesById([ fileInTrash1Id, fileInTrash2Id, folderInTrash1Id, folderInTrash2Id ], false); - - await loginPage.loginWith(username); - done(); - }); - - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(parentId); - await apis.user.sites.deleteSite(siteName); - await apis.user.trashcan.emptyTrash(); - done(); - }); - - describe('Generic tests', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(parent); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu appears on right click on a multiple selection of items - [C286268]', async () => { - await dataTable.selectMultipleItems([ file1, file2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - }); - - it('Context menu appears when right clicking on a single item while having multiple items selected - [C286269]', async () => { - await dataTable.selectMultipleItems([ file2, folder1 ]); - await dataTable.rightClickOnItem(file1); - - expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${file1}`); - expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect number of selected rows'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await dataTable.hasCheckMarkIcon(file1)).toBe(true, `${file1} is not selected`); - expect(await dataTable.hasCheckMarkIcon(file2)).toBe(false, `${file2} is selected`); - expect(await dataTable.hasCheckMarkIcon(folder1)).toBe(false, `${folder1} is selected`); - }); - }); - - describe('on Personal Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(parent); - await dataTable.waitForBody(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280661]', async () => { - await dataTable.selectMultipleItems([file1, file2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297627]', async () => { - await dataTable.selectMultipleItems([fileLocked1, fileLocked2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple folders are selected - [C280632]', async () => { - await dataTable.selectMultipleItems([folder1, folder2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when both files and folders are selected - [C280631]', async () => { - await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('on File Libraries', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280641]', async () => { - await dataTable.selectMultipleItems([ file1Site, file2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297628]', async () => { - await dataTable.selectMultipleItems([ fileLocked1Site, fileLocked2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple folders are selected - [C280574]', async () => { - await dataTable.selectMultipleItems([ folder1Site, folder2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when both files and folders are selected - [C280642]', async () => { - await dataTable.selectMultipleItems([ file1Site, file2Site, folder1Site, folder2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('on Shared Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280648]', async () => { - await dataTable.selectMultipleItems([ file1, file2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is not displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297629]', async () => { - await dataTable.selectMultipleItems([ fileLocked1, fileLocked2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is not displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('Recent Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280652]', async () => { - await dataTable.selectMultipleItems([ file1, file2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297630]', async () => { - await dataTable.selectMultipleItems([ fileLocked1, fileLocked2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('Favorites', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickFavoritesAndWait(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280656]', async () => { - await dataTable.selectMultipleItems([ file1, file2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297631]', async () => { - await dataTable.selectMultipleItems([ fileLocked1, fileLocked2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple folders are selected - [C280664]', async () => { - await dataTable.selectMultipleItems([ folder1, folder2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when both files and folders are selected - [C280657]', async () => { - await dataTable.selectMultipleItems([ file1, file2, folder1, folder2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('Trash', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickTrashAndWait(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C286273]', async () => { - await dataTable.selectMultipleItems([ fileInTrash1, fileInTrash2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isPermanentDeletePresent()).toBe(true, 'Permanently delete is not displayed'); - expect(await contextMenu.isRestorePresent()).toBe(true, 'Restore is not displayed'); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple folders are selected - [C286274]', async () => { - await dataTable.selectMultipleItems([ folderInTrash1, folderInTrash2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isPermanentDeletePresent()).toBe(true, 'Permanently delete is not displayed'); - expect(await contextMenu.isRestorePresent()).toBe(true, 'Restore is not displayed'); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when both files and folders are selected - [C286275]', async () => { - await dataTable.selectMultipleItems([ fileInTrash1, fileInTrash2, folderInTrash1, folderInTrash2 ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isPermanentDeletePresent()).toBe(true, 'Permanently delete is not displayed'); - expect(await contextMenu.isRestorePresent()).toBe(true, 'Restore is not displayed'); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(false, 'Download is displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); - - describe('on Search Results', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C291831]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-inSite-file'); - await dataTable.selectMultipleItems([ file1Site, file2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple locked files are selected - [C297632]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-inSite-file'); - await dataTable.selectMultipleItems([ fileLocked1Site, fileLocked2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when multiple folders are selected - [C291832]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-inSite-folder'); - await dataTable.selectMultipleItems([ folder1Site, folder2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - - it('correct actions appear when both files and folders are selected - [C291833]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-inSite-f'); - await dataTable.selectMultipleItems([ file1Site, file2Site, folder1Site, folder2Site ]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - }); - }); -}); diff --git a/e2e/suites/actions/context-menu-single-selection.test.ts b/e2e/suites/actions/context-menu-single-selection.test.ts deleted file mode 100755 index ed80b3d02b..0000000000 --- a/e2e/suites/actions/context-menu-single-selection.test.ts +++ /dev/null @@ -1,697 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages'; -import { SITE_VISIBILITY } from '../../configs'; -import { RepoClient } from '../../utilities/repo-client/repo-client'; -import { Utils } from '../../utilities/utils'; - -describe('Context menu actions - single selection : ', () => { - const username = `user-${Utils.random()}`; - - const fileUser = `fileUser-${Utils.random()}.txt`; let fileUserId; - const folderUser = `folderUser-${Utils.random()}`; let folderUserId; - const fileInTrash = `fileForDelete-${Utils.random()}.txt`; let fileInTrashId; - const folderInTrash = `folderForDelete-${Utils.random()}`; let folderInTrashId; - const fileLocked = `fileLocked-${Utils.random()}.txt`; let fileLockedId; - - const siteName = `userSite-${Utils.random()}`; - const fileSiteUser = `fileUser-${Utils.random()}.txt`; - const fileLockedInSite = `file-locked-site-${Utils.random()}.txt`; let fileLockedInSiteId; - const folderSiteUser = `folderUser-${Utils.random()}`; - - const adminPublic = `admin-public-${Utils.random()}`; - const adminModerated = `admin-moderated-${Utils.random()}`; - - const apis = { - admin: new RepoClient(), - user: new RepoClient(username, username) - }; - - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable } = page; - const contextMenu = dataTable.menu; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; - - beforeAll(async (done) => { - await apis.admin.people.createUser({ username }); - - fileUserId = (await apis.user.nodes.createFile(fileUser)).entry.id; - folderUserId = (await apis.user.nodes.createFolder(folderUser)).entry.id; - - fileLockedId = (await apis.user.nodes.createFile(fileLocked)).entry.id; - await apis.user.nodes.lockFile(fileLockedId); - - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); - const docLibId = await apis.user.sites.getDocLibId(siteName); - await apis.user.nodes.createFile(fileSiteUser, docLibId); - fileLockedInSiteId = (await apis.user.nodes.createFile(fileLockedInSite, docLibId)).entry.id; - await apis.user.nodes.createFolder(folderSiteUser, docLibId); - await apis.user.nodes.lockFile(fileLockedInSiteId); - - fileInTrashId = (await apis.user.nodes.createFiles([fileInTrash])).entry.id; - folderInTrashId = (await apis.user.nodes.createFolders([ folderInTrash ])).entry.id; - await apis.user.nodes.deleteNodeById(fileInTrashId, false); - await apis.user.nodes.deleteNodeById(folderInTrashId, false); - - await apis.user.shared.shareFileById(fileUserId); - await apis.user.shared.shareFileById(fileLockedId); - await apis.user.shared.waitForApi({ expect: 2 }); - - await apis.user.favorites.addFavoriteById('file', fileUserId); - await apis.user.favorites.addFavoriteById('file', fileLockedId); - await apis.user.favorites.addFavoriteById('folder', folderUserId); - await apis.user.favorites.waitForApi({ expect: 4 }); - - await apis.admin.sites.createSite(adminPublic); - await apis.admin.sites.createSite(adminModerated, SITE_VISIBILITY.MODERATED); - await apis.user.favorites.addFavoriteById('site', adminPublic); - await apis.user.favorites.addFavoriteById('site', adminModerated); - await apis.user.sites.requestToJoin(adminModerated); - - await apis.user.queries.waitForSites(siteName, { expect: 1 }); - await apis.user.queries.waitForSites(adminPublic, { expect: 1 }); - await apis.user.queries.waitForSites(adminModerated, { expect: 1 }); - - await loginPage.loginWith(username); - done(); - }); - - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(fileUserId); - await apis.user.nodes.deleteNodeById(folderUserId); - await apis.user.sites.deleteSite(siteName); - await apis.admin.sites.deleteSite(adminPublic); - await apis.admin.sites.deleteSite(adminModerated); - await apis.user.trashcan.emptyTrash(); - done(); - }); - - describe('Generic tests', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Row is marked with a check circle icon on direct right click - [C286252]', async () => { - await dataTable.rightClickOnItem(fileUser); - - expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing'); - }); - - it('Context menu appears on direct right click on an item - [C286253]', async () => { - await dataTable.rightClickOnItem(fileUser); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - }); - - it('Context menu appears when selecting an item and then right clicking on it - [C286254]', async () => { - await dataTable.selectItem(fileUser); - await dataTable.rightClickOnItem(fileUser); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - }); - - it('Context menu appears correctly when right clicking on another item - [C284666]', async () => { - await dataTable.selectItem(fileUser); - await dataTable.rightClickOnItem(folderUser); - - expect(await dataTable.hasContextMenu()).toBe(true, `Context menu is not displayed for ${folderUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await dataTable.hasCheckMarkIcon(folderUser)).toBe(true, `${folderUser} is not selected`); - expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(false, `${fileUser} is not selected`); - }); - - it('Context menu closes when clicking away from it - [C280619]', async () => { - await dataTable.rightClickOnItem(fileUser); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - - await page.sidenav.getActiveLink().click(); - - expect(await dataTable.hasContextMenu()).toBe(false, 'Context menu is displayed'); - }); - }); - - describe('on Personal Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C280615]', async () => { - await dataTable.rightClickOnItem(fileUser); - - expect(await contextMenu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${fileUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297633]', async () => { - await dataTable.rightClickOnItem(fileLocked); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileLocked}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${fileLocked}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileLocked}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLocked}`); - }); - - it('Context menu has the correct actions for a folder - [C280616]', async () => { - await dataTable.rightClickOnItem(folderUser); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folderUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folderUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${folderUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${folderUser}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folderUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderUser}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderUser}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`); - }); - }); - - describe('on File Libraries', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C280594]', async () => { - await dataTable.rightClickOnItem(fileSiteUser); - - expect(await contextMenu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileSiteUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileSiteUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileSiteUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileSiteUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileSiteUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297634]', async () => { - await dataTable.rightClickOnItem(fileLockedInSite); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(true, `Cancel editing is displayed for ${fileLockedInSite}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileLockedInSite}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLockedInSite}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLockedInSite}`); - }); - - it('Context menu has the correct actions for a folder - [C280595]', async () => { - await dataTable.rightClickOnItem(folderSiteUser); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folderSiteUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions displayed for ${folderSiteUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version displayed for ${folderSiteUser}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderSiteUser}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderSiteUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderSiteUser}`); - }); - }); - - describe('on a library', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Available actions for a library - My Libraries - [C290080]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.rightClickOnItem(siteName); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isLeaveLibraryPresent()).toBe(true, `Leave is not displayed for ${siteName}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${siteName}`); - }); - - it('Available actions for a library - Favorite Libraries - user is a member - [C290081]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.rightClickOnItem(siteName); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isLeaveLibraryPresent()).toBe(true, `Leave is not displayed for ${siteName}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${siteName}`); - }); - - it('Available actions for a library - Favorite Libraries - user is not a member - [C290082]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.rightClickOnItem(adminPublic); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isJoinLibraryPresent()).toBe(true, `Join is not displayed for ${adminPublic}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminPublic}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${adminPublic}`); - }); - - it('Available actions for a moderated library - Favorite Libraries - user requested to join - [C290089]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.rightClickOnItem(adminModerated); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isCancelJoinPresent()).toBe(true, `Cancel join is not displayed for ${adminModerated}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminModerated}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${adminModerated}`); - }); - - it('Available actions for a library - Search Results - user is a member - [C291812]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(siteName); - await dataTable.rightClickOnItem(siteName); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isLeaveLibraryPresent()).toBe(true, `Leave is not displayed for ${siteName}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${siteName}`); - }); - - it('Available actions for a library - Search Results - user is not a member - [C291813]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(adminPublic); - await dataTable.rightClickOnItem(adminPublic); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isJoinLibraryPresent()).toBe(true, `Join is not displayed for ${adminPublic}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminPublic}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${adminPublic}`); - }); - - it('Available actions for a moderated library - Search Results - user requested to join - [C291814]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(adminModerated); - await dataTable.rightClickOnItem(adminModerated); - - expect(await dataTable.hasContextMenu()).toBe(true, 'Context menu is not displayed'); - expect(await contextMenu.isCancelJoinPresent()).toBe(true, `Cancel join is not displayed for ${adminModerated}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminModerated}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${adminModerated}`); - }); - }); - - describe('on Shared Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C280601]', async () => { - await dataTable.rightClickOnItem(fileUser); - - // TODO: change expect to true when ACA-2173 is done - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await contextMenu.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed for ${fileUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297635]', async () => { - await dataTable.rightClickOnItem(fileLocked); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2173 is done - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileLocked}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileLocked}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await contextMenu.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed for ${fileLocked}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileLocked}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileLocked}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileLocked}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLocked}`); - }); - }); - - describe('on Recent Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C280622]', async () => { - await dataTable.rightClickOnItem(fileUser); - - expect(await contextMenu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297636]', async () => { - await dataTable.rightClickOnItem(fileLocked); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileLocked}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileLocked}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileLocked}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileLocked}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileLocked}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLocked}`); - }); - }); - - describe('on Favorites', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickFavoritesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C280608]', async () => { - await dataTable.rightClickOnItem(fileUser); - - // TODO: change expect to true when ACA-2174 is done - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${fileUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297637]', async () => { - await dataTable.rightClickOnItem(fileLocked); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2174 is done - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileLocked}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileLocked}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileLocked}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${fileLocked}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLocked}`); - }); - - it('Context menu has the correct actions for a folder - [C280609]', async () => { - await dataTable.rightClickOnItem(folderUser); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folderUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${folderUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`); - expect(await contextMenu.isMovePresent()).toBe(true, `Move is not displayed for ${folderUser}`); - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderUser}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folderUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderUser}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderUser}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`); - }); - }); - - describe('on Trash', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickTrashAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C286258]', async () => { - await dataTable.rightClickOnItem(fileInTrash); - - expect(await contextMenu.isPermanentDeletePresent()).toBe(true, `Permanently delete is not displayed for ${fileInTrash}`); - expect(await contextMenu.isRestorePresent()).toBe(true, `Restore is not displayed for ${fileInTrash}`); - expect(await contextMenu.isDownloadPresent()).toBe(false, `Download is displayed for ${fileInTrash}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${fileInTrash}`); - expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed for ${fileInTrash}`); - expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed for ${fileInTrash}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${fileInTrash}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileInTrash}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${fileInTrash}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${fileInTrash}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${fileInTrash}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileInTrash}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileInTrash}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileInTrash}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileInTrash}`); - }); - - it('Context menu has the correct actions for a folder - [C286259]', async () => { - await dataTable.rightClickOnItem(folderInTrash); - - expect(await contextMenu.isPermanentDeletePresent()).toBe(true, `Permanently delete is not displayed for ${folderInTrash}`); - expect(await contextMenu.isRestorePresent()).toBe(true, `Restore is not displayed for ${folderInTrash}`); - expect(await contextMenu.isDownloadPresent()).toBe(false, `Download is displayed for ${folderInTrash}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folderInTrash}`); - expect(await contextMenu.isFavoritePresent()).toBe(false, `Favorite is displayed for ${folderInTrash}`); - expect(await contextMenu.isCopyPresent()).toBe(false, `Copy is displayed for ${folderInTrash}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${folderInTrash}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folderInTrash}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderInTrash}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folderInTrash}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderInTrash}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${folderInTrash}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${folderInTrash}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderInTrash}`); - }); - }); - - describe('on Search Results', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Context menu has the correct actions for a file - [C291827]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileSiteUser); - await dataTable.rightClickOnItem(fileSiteUser); - - expect(await contextMenu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileSiteUser}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${fileSiteUser}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileSiteUser}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileSiteUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileSiteUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileSiteUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileSiteUser}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileSiteUser}`); - }); - - it('Context menu has the correct actions for a locked file - [C297638]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileLocked); - await dataTable.rightClickOnItem(fileLocked); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${fileLocked}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); - expect(await contextMenu.isSharePresent()).toBe(true, `Share is not displayed for ${fileLocked}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions not displayed for ${fileLocked}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version not displayed for ${fileLocked}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${fileLocked}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${fileLocked}`); - }); - - it('Context menu has the correct actions for a folder - [C291828]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions(folderSiteUser); - await dataTable.rightClickOnItem(folderSiteUser); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isToggleFavoritePresent()).toBe(true, `Toggle favorite is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${folderSiteUser}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folderSiteUser}`); - expect(await contextMenu.isManagePermissionsPresent()).toBe(true, `Permissions is not displayed for ${folderSiteUser}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folderSiteUser}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions displayed for ${folderSiteUser}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version displayed for ${folderSiteUser}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folderSiteUser}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderSiteUser}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderSiteUser}`); - }); - }); -}); diff --git a/e2e/suites/actions/copy.test.ts b/e2e/suites/actions/copy.test.ts index 4de50108ef..aa1b0267d9 100755 --- a/e2e/suites/actions/copy.test.ts +++ b/e2e/suites/actions/copy.test.ts @@ -36,19 +36,36 @@ describe('Copy content', () => { const destinationRF = `destinationRecent-${Utils.random()}`; let destinationIdRF; const destinationSF = `destinationShared-${Utils.random()}`; let destinationIdSF; const destinationFav = `destinationFav-${Utils.random()}`; let destinationIdFav; + const destinationSearch = `destinationSearch-${Utils.random()}`; let destinationIdSearch; const file1 = `file1-${Utils.random()}.txt`; let file1Id; const folder1 = `folder1-${Utils.random()}`; let folder1Id; - const fileInFolder = `fileInFolder-${Utils.random()}.txt`; + const fileInFolder = `fileInFolder-${Utils.random()}.txt`; let fileInFolderId; + + const folder2 = `folder2-${Utils.random()}`; let folder2Id; + const fileInFolder2 = fileInFolder; + + const folderExisting = `folder-existing-${Utils.random()}`; let folderExistingId; + const file1InFolderExisting = `file1InFolderExisting-${Utils.random()}.txt`; + const file2InFolderExisting = `file2InFolderExisting-${Utils.random()}.txt`; const file2 = `file2-${Utils.random()}.txt`; let file2Id; const file3 = `file3-${Utils.random()}.txt`; let file3Id; + const file4 = `file4-${Utils.random()}.txt`; let file4Id; + + const fileLocked1 = `file-locked1-${Utils.random()}.txt`; let fileLocked1Id; + + const folderWithLockedFiles = `folder-locked1-${Utils.random()}`; let folderWithLockedFilesId; + const fileLockedInFolder = `file-locked-${Utils.random()}`; let fileLockedInFolderId; - const existingFile = `existing-${Utils.random()}`; let existingFileId; + const existingFile = `existing-${Utils.random()}.txt`; let existingFileToCopyId; + + const existingFolder = `existing-${Utils.random()}`; let existingFolderToCopyId; + + let existingIdPF, existingIdFav, existingIdSearch; + let folderExistingPFId, folderExistingFavId, folderExistingSearchId; - const existingFolder = `existing-${Utils.random()}`; - let existingId1, existingId2, existingId2RF, existingId2SF, existingId2Fav; const file2InFolder = `file2InFolder-${Utils.random()}.txt`; const file3InFolder = `file3InFolder-${Utils.random()}.txt`; @@ -57,6 +74,9 @@ describe('Copy content', () => { const folderSiteRF = `folderSiteRecent-${Utils.random()}`; const folderSiteSF = `folderSiteShared-${Utils.random()}`; const folderSiteFav = `folderSiteFav-${Utils.random()}`; + const folderSiteSearch = `folderSiteSearch-${Utils.random()}`; + + let locationId, destinationId; const apis = { admin: new RepoClient(), @@ -67,6 +87,7 @@ describe('Copy content', () => { const page = new BrowsingPage(); const { dataTable, toolbar } = page; const copyDialog = new CopyMoveDialog(); + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -76,41 +97,81 @@ describe('Copy content', () => { destinationIdRF = (await apis.user.nodes.createFolder(destinationRF)).entry.id; destinationIdSF = (await apis.user.nodes.createFolder(destinationSF)).entry.id; destinationIdFav = (await apis.user.nodes.createFolder(destinationFav)).entry.id; + destinationIdSearch = (await apis.user.nodes.createFolder(destinationSearch)).entry.id; - file1Id = (await apis.user.nodes.createFile(file1, sourceId)).entry.id; - await apis.user.shared.shareFileById(file1Id); - await apis.user.favorites.addFavoriteById('file', file1Id); + existingFileToCopyId = (await apis.user.nodes.createFile(existingFile, sourceId)).entry.id; + await apis.user.shared.shareFileById(existingFileToCopyId); + await apis.user.favorites.addFavoriteById('file', existingFileToCopyId); + + await apis.user.nodes.createFile(existingFile, destinationIdPF); + await apis.user.nodes.createFile(existingFile, destinationIdRF); + await apis.user.nodes.createFile(existingFile, destinationIdSF); + await apis.user.nodes.createFile(existingFile, destinationIdFav); + await apis.user.nodes.createFile(existingFile, destinationIdSearch); + + existingFolderToCopyId = (await apis.user.nodes.createFolder(existingFolder, sourceId)).entry.id; + + existingIdPF = (await apis.user.nodes.createFolder(existingFolder, destinationIdPF)).entry.id; + await apis.user.nodes.createFolder(existingFolder, destinationIdRF); + await apis.user.nodes.createFolder(existingFolder, destinationIdSF); + existingIdFav = (await apis.user.nodes.createFolder(existingFolder, destinationIdFav)).entry.id; + existingIdSearch = (await apis.user.nodes.createFolder(existingFolder, destinationIdSearch)).entry.id; + await apis.user.nodes.createFile(file2InFolder, existingFolderToCopyId); + + await apis.user.nodes.createFile(file3InFolder, existingIdPF); + await apis.user.nodes.createFile(file3InFolder, existingIdFav); + await apis.user.nodes.createFile(file3InFolder, existingIdSearch); + + await apis.user.favorites.addFavoriteById('folder', existingFolderToCopyId); folder1Id = (await apis.user.nodes.createFolder(folder1, sourceId)).entry.id; - await apis.user.nodes.createFile(fileInFolder, folder1Id); + fileInFolderId = (await apis.user.nodes.createFile(fileInFolder, folder1Id)).entry.id; await apis.user.favorites.addFavoriteById('folder', folder1Id); + await apis.user.favorites.addFavoriteById('file', fileInFolderId); + await apis.user.shared.shareFileById(fileInFolderId); + + folderExistingId = (await apis.user.nodes.createFolder(folderExisting, sourceId)).entry.id; + await apis.user.favorites.addFavoriteById('folder', folderExistingId); + await apis.user.nodes.createFile(file1InFolderExisting, folderExistingId); + + folderExistingPFId = (await apis.user.nodes.createFolder(folderExisting, destinationIdPF)).entry.id; + await apis.user.nodes.createFile(file2InFolderExisting, folderExistingPFId); + + folderExistingFavId = (await apis.user.nodes.createFolder(folderExisting, destinationIdFav)).entry.id; + await apis.user.nodes.createFile(file2InFolderExisting, folderExistingFavId); + + folderExistingSearchId = (await apis.user.nodes.createFolder(folderExisting, destinationIdSearch)).entry.id; + await apis.user.nodes.createFile(file2InFolderExisting, folderExistingSearchId); + + folder2Id = (await apis.user.nodes.createFolder(folder2, sourceId)).entry.id; + await apis.user.nodes.createFile(fileInFolder2, folder2Id); + await apis.user.favorites.addFavoriteById('folder', folder2Id); + + fileLocked1Id = (await apis.user.nodes.createFile(fileLocked1, sourceId)).entry.id; + await apis.user.nodes.lockFile(fileLocked1Id); + folderWithLockedFilesId = (await apis.user.nodes.createFolder(folderWithLockedFiles, sourceId)).entry.id; + fileLockedInFolderId = (await apis.user.nodes.createFile(fileLockedInFolder, folderWithLockedFilesId)).entry.id; + await apis.user.nodes.lockFile(fileLockedInFolderId); + await apis.user.favorites.addFavoriteById('folder', folderWithLockedFilesId); + + file1Id = (await apis.user.nodes.createFile(file1, sourceId)).entry.id; file2Id = (await apis.user.nodes.createFile(file2, sourceId)).entry.id; file3Id = (await apis.user.nodes.createFile(file3, sourceId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, sourceId)).entry.id; + + await apis.user.shared.shareFileById(file1Id); await apis.user.shared.shareFileById(file2Id); await apis.user.shared.shareFileById(file3Id); + await apis.user.shared.shareFileById(file4Id); + await apis.user.shared.shareFileById(fileLocked1Id); + + await apis.user.favorites.addFavoriteById('file', file1Id); await apis.user.favorites.addFavoriteById('file', file2Id); await apis.user.favorites.addFavoriteById('file', file3Id); + await apis.user.favorites.addFavoriteById('file', file4Id); - existingFileId = (await apis.user.nodes.createFile(`${existingFile}.txt`, sourceId)).entry.id; - await apis.user.shared.shareFileById(existingFileId); - await apis.user.favorites.addFavoriteById('file', existingFileId); - await apis.user.nodes.createFile(`${existingFile}.txt`, destinationIdPF); - await apis.user.nodes.createFile(`${existingFile}.txt`, destinationIdRF); - await apis.user.nodes.createFile(`${existingFile}.txt`, destinationIdSF); - await apis.user.nodes.createFile(`${existingFile}.txt`, destinationIdFav); - - existingId1 = (await apis.user.nodes.createFolder(existingFolder, sourceId)).entry.id; - existingId2 = (await apis.user.nodes.createFolder(existingFolder, destinationIdPF)).entry.id; - existingId2RF = (await apis.user.nodes.createFolder(existingFolder, destinationIdRF)).entry.id; - existingId2SF = (await apis.user.nodes.createFolder(existingFolder, destinationIdSF)).entry.id; - existingId2Fav = (await apis.user.nodes.createFolder(existingFolder, destinationIdFav)).entry.id; - await apis.user.nodes.createFile(file2InFolder, existingId1); - await apis.user.nodes.createFile(file3InFolder, existingId2); - await apis.user.nodes.createFile(file3InFolder, existingId2RF); - await apis.user.nodes.createFile(file3InFolder, existingId2SF); - await apis.user.nodes.createFile(file3InFolder, existingId2Fav); - await apis.user.favorites.addFavoriteById('folder', existingId1); + await apis.user.favorites.addFavoriteById('file', fileLocked1Id); await apis.user.sites.createSite(siteName); const docLibId = await apis.user.sites.getDocLibId(siteName); @@ -118,9 +179,10 @@ describe('Copy content', () => { await apis.user.nodes.createFolder(folderSiteRF, docLibId); await apis.user.nodes.createFolder(folderSiteSF, docLibId); await apis.user.nodes.createFolder(folderSiteFav, docLibId); + await apis.user.nodes.createFolder(folderSiteSearch, docLibId); - await apis.user.shared.waitForApi({ expect: 4 }); - await apis.user.favorites.waitForApi({ expect: 7 }); + await apis.user.shared.waitForApi({ expect: 7 }); + await apis.user.favorites.waitForApi({ expect: 13 }); await loginPage.loginWith(username); done(); @@ -128,220 +190,85 @@ describe('Copy content', () => { afterAll(async (done) => { await apis.user.nodes.deleteNodeById(sourceId); - await apis.user.nodes.deleteNodeById(destinationIdPF); - await apis.user.nodes.deleteNodeById(destinationIdRF); - await apis.user.nodes.deleteNodeById(destinationIdSF); - await apis.user.nodes.deleteNodeById(destinationIdFav); await apis.user.sites.deleteSite(siteName); done(); }); - describe('from Personal Files', () => { + describe('from Recent Files', () => { beforeEach(async (done) => { await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(source); + await page.clickRecentFilesAndWait(); done(); }); - it('Copy a file - [C217135]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationPF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationPF); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(destinationIdRF); + done(); }); - it('Copy a folder with content - [C291888]', async () => { - await dataTable.selectItem(folder1); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationPF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationPF); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in destination folder`); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(false, `${fileInFolder} is present in destination`); + it('Copy a file - [C280194]', async () => copyFile(file1, source, destinationRF)); - await dataTable.doubleClickOnRowByName(folder1); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} is not present in parent folder`); - }); + it('Copy multiple items - [C280201]', async () => copyMultipleItems([file2, file3], source, destinationRF)); - it('Copy multiple items - [C291889]', async () => { - await dataTable.selectMultipleItems([file2, file3]); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationPF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in source folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationPF); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); + it('Copy a file with a name that already exists on the destination - [C280196]', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationRF)); - it('Copy a file with a name that already exists on the destination - [C217137]', async () => { - await dataTable.selectItem(existingFile); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationPF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationPF); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(true, `${existingFile}-1.txt not present in destination folder`); - }); + it('Copy items into a library - [C291899]', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteRF)); - it('Copy a folder with a name that already exists on the destination - [C217138]', async () => { - await dataTable.selectItem(existingFolder); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationPF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFolder)).toBe(true, `${existingFolder} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationPF); - expect(await dataTable.isItemPresent(existingFolder)).toBe(true, `${existingFolder} not present in destination folder`); - await dataTable.doubleClickOnRowByName(existingFolder); - expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, `${file2InFolder} not present in destination folder`); - expect(await dataTable.isItemPresent(file3InFolder)).toBe(true, `${file3InFolder} not present in destination folder`); - }); + it('Copy locked file - [C280198]', async () => copyLockedFile(fileLocked1, source, destinationRF, () => { + locationId = sourceId; + destinationId = destinationIdRF; + })); + + it('Undo copy of files - [C280202]', async () => undoCopyFile(file4, source, destinationRF)); - it('Copy items into a library - [C280282]', async () => { - await dataTable.selectMultipleItems([file1, folder1]); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('File Libraries'); - await copyDialog.doubleClickOnRow(siteName); - await copyDialog.doubleClickOnRow('documentLibrary'); - await copyDialog.selectDestination(folderSitePF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in source folder`); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in source folder`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSitePF); - - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in destination folder`); - await dataTable.doubleClickOnRowByName(folder1); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} not present in parent folder`); - }); }); - describe('from Recent Files', () => { + describe('from Personal Files', () => { beforeEach(async (done) => { await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(source); done(); }); - it('Copy a file - [C280194]', async () => { - await dataTable.selectItem(file1, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationRF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(destinationIdPF); + done(); }); - it('Copy multiple items - [C280201]', async () => { - await dataTable.selectMultipleItems([file2, file3], source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationRF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); + it('Copy a file - [C217135]', async () => copyFile(file1, '', destinationPF)); - it('Copy a file with a name that already exists on the destination - [C280196]', async () => { - await dataTable.selectItem(existingFile, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationRF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationRF); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(true, `${existingFile}-1.txt not present in destination folder`); - }); + it('Copy a folder with content - [C291888]', async () => copyFolderWithContent(folder1, '', destinationPF)); + + it('Copy multiple items - [C291889]', async () => copyMultipleItems([file2, file3], '', destinationPF)); + + it('Copy a file with a name that already exists on the destination - [C217137]', async () => copyFileWithNameThatAlreadyExists(existingFile, '', destinationPF)); + + it('Copy a folder with a name that already exists on the destination - [C217138]', async () => copyFolderWithNameThatAlreadyExists(existingFolder, '', destinationPF)); + + it('Copy items into a library - [C280282]', async () => copyItemsIntoLibrary([file1, folder1], '', folderSitePF)); + + it('Copy locked file - [C217139]', async () => copyLockedFile(fileLocked1, '', destinationPF, () => { + locationId = sourceId; + destinationId = destinationIdPF; + })); + + it('Copy folder that contains locked file - [C217140]', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, '', destinationPF, () => { + locationId = folderWithLockedFilesId; + destinationId = destinationIdPF; + })); + + it('Undo copy of files - [C217171]', async () => undoCopyFile(file4, '', destinationPF)); + + it('Undo copy of folders - [C217172]', async () => undoCopyFolder(folder2, '', destinationPF)); + + it('Undo copy of a file when a file with same name already exists on the destination - [C217173]', async () => undoCopyFileWithExistingName(fileInFolder, '', folder2, async () => { + await dataTable.doubleClickOnRowByName(folder1); + await dataTable.waitForHeader(); + })); + + it('Undo copy of a folder when a folder with same name already exists on the destination - [C217174]', async () => undoCopyFolderWithExistingName(folderExisting, '', destinationPF)); - it('Copy items into a library - [C291899]', async () => { - await dataTable.selectItem(file1, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('File Libraries'); - await copyDialog.doubleClickOnRow(siteName); - await copyDialog.doubleClickOnRow('documentLibrary'); - await copyDialog.selectDestination(folderSiteRF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteRF); - - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - }); }); describe('from Shared Files', () => { @@ -351,77 +278,26 @@ describe('Copy content', () => { done(); }); - it('Copy a file - [C280206]', async () => { - await dataTable.selectItem(file1, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationSF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(destinationIdSF); + done(); }); - it('Copy multiple items - [C280213]', async () => { - await dataTable.selectMultipleItems([file2, file3], source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationSF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); + it('Copy a file - [C280206]', async () => copyFile(file1, source, destinationSF)); - it('Copy a file with a name that already exists on the destination - [C280208]', async () => { - await dataTable.selectItem(existingFile, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationSF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationSF); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(true, `${existingFile}-1.txt not present in destination folder`); - }); + it('Copy multiple items - [C280213]', async () => copyMultipleItems([file2, file3], source, destinationSF)); + + it('Copy a file with a name that already exists on the destination - [C280208]', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationSF)); + + it('Copy items into a library - [C291900]', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteSF)); + + it('Copy locked file - [C280210]', async () => copyLockedFile(fileLocked1, source, destinationSF, () => { + locationId = sourceId; + destinationId = destinationIdSF; + })); + + it('Undo copy of files - [C280214]', async () => undoCopyFile(file4, source, destinationSF)); - it('Copy items into a library - [C291900]', async () => { - await dataTable.selectItem(file1, source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('File Libraries'); - await copyDialog.doubleClickOnRow(siteName); - await copyDialog.doubleClickOnRow('documentLibrary'); - await copyDialog.selectDestination(folderSiteSF); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in source folder`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteSF); - - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - }); }); describe('from Favorites', () => { @@ -431,126 +307,408 @@ describe('Copy content', () => { done(); }); - it('Copy a file - [C280218]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(destinationIdFav); + done(); }); - it('Copy a folder with content - [C280219]', async () => { - await dataTable.selectItem(folder1); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in destination folder`); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(false, `${fileInFolder} is present in destination`); + it('Copy a file - [C280218]', async () => copyFile(file1, source, destinationFav)); - await dataTable.doubleClickOnRowByName(folder1); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} is not present in parent folder`); - }); + it('Copy a folder with content - [C280219]', async () => copyFolderWithContent(folder1, source, destinationFav)); - it('Copy multiple items - [C280225]', async () => { - await dataTable.selectMultipleItems([file2, file3]); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in source folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(file2)).toBe(true, `${file2} not present in destination folder`); - expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} not present in destination folder`); - }); + it('Copy multiple items - [C280225]', async () => copyMultipleItems([file2, file3], source, destinationFav)); - it('Copy a file with a name that already exists on the destination - [C280220]', async () => { - await dataTable.selectItem(existingFile); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(`${existingFile}.txt`)).toBe(true, `${existingFile}.txt not present in destination folder`); - expect(await dataTable.isItemPresent(`${existingFile}-1.txt`)).toBe(true, `${existingFile}-1.txt not present in destination folder`); - }); + it('Copy a file with a name that already exists on the destination - [C280220]', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationFav)); - it('Copy a folder with a name that already exists on the destination - [C280221]', async () => { - await dataTable.selectItem(existingFolder); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('Personal Files'); - await copyDialog.selectDestination(destinationFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 1 item'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(existingFolder)).toBe(true, `${existingFolder} not present in source folder`); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(destinationFav); - expect(await dataTable.isItemPresent(existingFolder)).toBe(true, `${existingFolder} not present in destination folder`); - await dataTable.doubleClickOnRowByName(existingFolder); - expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, `${file2InFolder} not present in destination folder`); - expect(await dataTable.isItemPresent(file3InFolder)).toBe(true, `${file3InFolder} not present in destination folder`); + it('Copy a folder with a name that already exists on the destination - [C280221]', async () => copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationFav)); + + it('Copy items into a library - [C291901]', async () => copyItemsIntoLibrary([file1, folder1], source, folderSiteFav)); + + it('Copy locked file - [C280222]', async () => copyLockedFile(fileLocked1, source, destinationFav, () => { + locationId = sourceId; + destinationId = destinationIdFav; + })); + + it('Copy folder that contains locked file - [C280223]', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationFav, () => { + locationId = folderWithLockedFilesId; + destinationId = destinationIdFav; + })); + + it('Undo copy of files - [C280226]', async () => undoCopyFile(file4, source, destinationFav)); + + it('Undo copy of folders - [C280227]', async () => undoCopyFolder(folder2, source, destinationFav)); + + it('Undo copy of a file when a file with same name already exists on the destination - [C280228]', async () => undoCopyFileWithExistingName(fileInFolder, folder1, folder2)); + + it('Undo copy of a folder when a folder with same name already exists on the destination - [C280229]', async () => undoCopyFolderWithExistingName(folderExisting, source, destinationFav)); + + }); + + describe('from Search Results', () => { + beforeEach(async (done) => { + await Utils.pressEscape(); + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + done(); }); - it('Copy items into a library - [C291901]', async () => { - await dataTable.selectMultipleItems([file1, folder1], source); - await toolbar.clickMoreActionsCopy(); - await copyDialog.selectLocation('File Libraries'); - await copyDialog.doubleClickOnRow(siteName); - await copyDialog.doubleClickOnRow('documentLibrary'); - await copyDialog.selectDestination(folderSiteFav); - await copyDialog.clickCopy(); - const msg = await page.getSnackBarMessage(); - expect(msg).toContain('Copied 2 items'); - expect(msg).toContain('Undo'); - - await copyDialog.waitForDialogToClose(); - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in source folder`); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in source folder`); - - await page.goToMyLibraries(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.doubleClickOnRowByName(folderSiteFav); - - expect(await dataTable.isItemPresent(file1)).toBe(true, `${file1} not present in destination folder`); - expect(await dataTable.isItemPresent(folder1)).toBe(true, `${folder1} not present in destination folder`); - await dataTable.doubleClickOnRowByName(folder1); - expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} not present in parent folder`); + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(destinationIdSearch); + done(); }); + + it('Copy a file - [C306932]', async () => copyFile(file1, source, destinationSearch, async () => { + await searchInput.searchFor(file1); + await dataTable.waitForBody(); + })); + + it('Copy a folder with content - [C306943]', async () => copyFolderWithContent(folder1, source, destinationSearch, async () => { + await searchInput.searchFor(folder1); + await dataTable.waitForBody(); + })); + + it('Copy multiple items - [C306944]', async () => copyMultipleItems([file2, file3], source, destinationSearch, async () => { + await searchInput.searchFor('file'); + await dataTable.waitForBody(); + })); + + it('Copy a file with a name that already exists on the destination - [C306933]', async () => copyFileWithNameThatAlreadyExists(existingFile, source, destinationSearch, async () => { + await searchInput.searchFor(existingFile); + await dataTable.waitForBody(); + })); + + it('Copy a folder with a name that already exists on the destination - [C306934]', async () => copyFolderWithNameThatAlreadyExists(existingFolder, source, destinationSearch, async () => { + await searchInput.searchFor(existingFolder); + await dataTable.waitForBody(); + })); + + it('Copy items into a library - [C306942]', async () => copyItemsIntoLibrary([file1, file2], source, folderSiteSearch, async () => { + await searchInput.searchFor('file'); + await dataTable.waitForBody(); + })); + + it('Copy locked file - [C306935]', async () => copyLockedFile(fileLocked1, source, destinationSearch, async () => { + locationId = sourceId; + destinationId = destinationIdSearch; + await searchInput.searchFor(fileLocked1); + await dataTable.waitForBody(); + })); + + it('Copy folder that contains locked file - [C306936]', async () => copyFolderThatContainsLockedFile(folderWithLockedFiles, source, destinationSearch, async () => { + locationId = folderWithLockedFilesId; + destinationId = destinationIdSearch; + await searchInput.searchFor(folderWithLockedFiles); + await dataTable.waitForBody(); + })); + + it('Undo copy of files - [C306938]', async () => undoCopyFile(file4, source, destinationSearch, async () => { + await searchInput.searchFor(file4); + await dataTable.waitForBody(); + })); + + it('Undo copy of folders - [C306939]', async () => undoCopyFolder(folder2, source, destinationSearch, async () => { + await searchInput.searchFor(folder2); + await dataTable.waitForBody(); + })); + + it('Undo copy of a file when a file with same name already exists on the destination - [C306940]', async () => undoCopyFileWithExistingName(fileInFolder, folder1, folder2, async () => { + await searchInput.searchFor(fileInFolder); + await dataTable.waitForBody(); + })); + + it('Undo copy of a folder when a folder with same name already exists on the destination - [C306941]', async () => undoCopyFolderWithExistingName(folderExisting, source, destinationSearch, async () => { + await searchInput.searchFor(folderExisting); + await dataTable.waitForBody(); + })); }); + async function copyFile(fileName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(fileName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} not present in ${destination} folder`); + } + + async function copyFolderWithContent(folderName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(folderName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in ${destination} folder`); + expect(await dataTable.isItemPresent(fileInFolder)).toBe(false, `${fileInFolder} is present in ${destination}`); + + await dataTable.doubleClickOnRowByName(folderName); + expect(await dataTable.isItemPresent(fileInFolder)).toBe(true, `${fileInFolder} is not present in ${folderName} folder in ${destination}`); + } + + async function copyMultipleItems(items: string[], location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectMultipleItems(items, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 2 items'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(items[0])).toBe(true, `${items[0]} not present in source folder`); + expect(await dataTable.isItemPresent(items[1])).toBe(true, `${items[1]} not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(items[0])).toBe(true, `${items[0]} not present in ${destination} folder`); + expect(await dataTable.isItemPresent(items[1])).toBe(true, `${items[1]} not present in ${destination} folder`); + } + + async function copyFileWithNameThatAlreadyExists(fileName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(fileName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName}.txt not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName}.txt not present in ${destination} folder`); + } + + async function copyFolderWithNameThatAlreadyExists(folderName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(folderName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in ${destination} folder`); + await dataTable.doubleClickOnRowByName(folderName); + expect(await dataTable.isItemPresent(file2InFolder)).toBe(true, `${file2InFolder} not present in ${destination} folder in ${folderName}`); + expect(await dataTable.isItemPresent(file3InFolder)).toBe(true, `${file3InFolder} not present in ${destination} folder in ${folderName}`); + } + + async function copyItemsIntoLibrary(items: string[], location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + const noOfItems = items.length; + await dataTable.selectMultipleItems(items, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('File Libraries'); + await copyDialog.doubleClickOnRow(siteName); + await copyDialog.doubleClickOnRow('documentLibrary'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain(`Copied ${noOfItems} ${ noOfItems === 1 ? 'item' : 'items'}`); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + for (const item of items) { + expect(await dataTable.isItemPresent(item)).toBe(true, `${item} not present in source folder`); + } + + await page.goToMyLibraries(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.doubleClickOnRowByName(destination); + + for (const item of items) { + expect(await dataTable.isItemPresent(item)).toBe(true, `${item} not present in ${destination} folder`); + } + } + + async function copyLockedFile(fileName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + + await dataTable.selectItem(fileName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} not present in source folder`); + expect(await apis.user.nodes.isFileLockedByName(fileName, locationId)).toBe(true, `${fileName} not locked in ${location}`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} not present in ${destination} folder`); + expect(await apis.user.nodes.isFileLockedByName(fileName, destinationId)).toBe(false, `${fileName} is locked in ${destination}`); + } + + async function copyFolderThatContainsLockedFile(folderName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + + await dataTable.selectItem(folderName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await copyDialog.waitForDialogToClose(); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in source folder`); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in ${destination} folder`); + expect(await dataTable.isItemPresent(fileLockedInFolder)).toBe(false, `${fileLockedInFolder} is present in ${destination}`); + expect(await apis.user.nodes.isFileLockedByName(fileLockedInFolder, locationId)).toBe(true, `${fileLockedInFolder} not locked in ${location}`); + + await dataTable.doubleClickOnRowByName(folderName); + expect(await dataTable.isItemPresent(fileLockedInFolder)).toBe(true, `${fileLockedInFolder} is not present in ${folderName} folder from ${destination}`); + expect(await apis.user.nodes.isFileLockedByName(fileLockedInFolder, (await apis.user.nodes.getNodeIdFromParent(folderWithLockedFiles, destinationId)))).toBe(false, `${fileLockedInFolder} is locked in ${destination}`); + } + + async function undoCopyFile(fileName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(fileName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await page.clickSnackBarAction(); + + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(fileName)).toBe(false, `${fileName} present in ${destination} folder`); + + await page.clickTrash(); + expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty'); + } + + async function undoCopyFolder(folderName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + await dataTable.selectItem(folderName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await page.clickSnackBarAction(); + + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(folderName)).toBe(false, `${folderName} present in ${destination} folder`); + + await page.clickTrash(); + expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty'); + } + + async function undoCopyFileWithExistingName(fileName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + + await dataTable.selectItem(fileName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.doubleClickOnRow(source); + await copyDialog.selectDestination(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await page.clickSnackBarAction(); + + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(source); + await dataTable.doubleClickOnRowByName(folder2); + expect(await dataTable.isItemPresent(fileInFolder2)).toBe(true, `${fileInFolder2} not present in ${destination} folder`); + expect(await dataTable.isItemPresent(`${fileInFolder2}-1`)).toBe(false, `${fileInFolder2}-1 is present in ${destination} folder`); + + await page.clickTrash(); + expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty'); + } + + async function undoCopyFolderWithExistingName(folderName: string, location: string = '', destination: string, doBefore = null) { + if (doBefore) { + await doBefore(); + } + + await dataTable.selectItem(folderName, location); + await toolbar.clickMoreActionsCopy(); + await copyDialog.selectLocation('Personal Files'); + await copyDialog.doubleClickOnRow(destination); + await copyDialog.clickCopy(); + const msg = await page.getSnackBarMessage(); + expect(msg).toContain('Copied 1 item'); + expect(msg).toContain('Undo'); + + await page.clickSnackBarAction(); + + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(destination); + expect(await dataTable.isItemPresent(folderName)).toBe(true, `${folderName} not present in ${destination} folder`); + await dataTable.doubleClickOnRowByName(folderName); + expect(await dataTable.isItemPresent(file2InFolderExisting)).toBe(true, `${file2InFolderExisting} not present in ${folderName} in ${destination} folder`); + expect(await dataTable.isItemPresent(file1InFolderExisting)).toBe(false, `${file1InFolderExisting} present in ${folderName} in ${destination} folder`); + + await page.clickTrash(); + expect(await dataTable.isEmptyList()).toBe(true, 'Trash is not empty'); + } + }); diff --git a/e2e/suites/actions/download.test.ts b/e2e/suites/actions/download.test.ts index 8391e010e1..02c694f31d 100755 --- a/e2e/suites/actions/download.test.ts +++ b/e2e/suites/actions/download.test.ts @@ -105,7 +105,7 @@ describe('Download', () => { await apis.user.trashcan.emptyTrash(); done(); }); - + afterEach(async (done) => { await Utils.renameFile(archiveZip, `${Utils.random()}.zip`); done(); @@ -273,7 +273,7 @@ describe('Download', () => { await page.clickPersonalFilesAndWait(); await searchInput.clickSearchButton(); await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions('*Search*'); + await searchInput.searchFor('*Search*'); done(); }); diff --git a/e2e/suites/actions/edit-folder.test.ts b/e2e/suites/actions/edit-folder.test.ts index e66128c630..780c6ca662 100755 --- a/e2e/suites/actions/edit-folder.test.ts +++ b/e2e/suites/actions/edit-folder.test.ts @@ -39,7 +39,8 @@ describe('Edit folder', () => { const folderNameToEdit = `folder-${Utils.random()}`; const duplicateFolderName = `folder-${Utils.random()}`; - const folderNameEdited = `folder-${Utils.random()}`; + const folderNameEdited = `folder-renamed-${Utils.random()}`; + const folderNameEdited2 = `folder-search-renamed-${Utils.random()}`; const folderDescriptionEdited = 'description edited'; const sitePrivate = `site-private-${Utils.random()}`; @@ -54,6 +55,10 @@ describe('Edit folder', () => { const folderFavoriteToEdit = `folder-fav-${Utils.random()}`; let folderFavoriteToEditId; const folderFavoriteDuplicate = `folder-fav-${Utils.random()}`; let folderFavoriteDuplicateId; + const folderSearch = `folder-search-${Utils.random()}`; + const folderSearchToEdit = `folder-search-${Utils.random()}`; let folderSearchToEditId; + const folderSearchDuplicate = `folder-search-${Utils.random()}`; + const apis = { admin: new RepoClient(), user: new RepoClient(username, username) @@ -63,6 +68,7 @@ describe('Edit folder', () => { const page = new BrowsingPage(); const editDialog = new CreateOrEditFolderDialog(); const { dataTable, toolbar } = page; + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -86,6 +92,10 @@ describe('Edit folder', () => { folderFavoriteToEditId = (await apis.user.nodes.createFolder(folderFavoriteToEdit)).entry.id; folderFavoriteDuplicateId = (await apis.user.nodes.createFolder(folderFavoriteDuplicate)).entry.id; + await apis.user.nodes.createFolder(folderSearch); + folderSearchToEditId = (await apis.user.nodes.createFolder(folderSearchToEdit)).entry.id; + await apis.user.nodes.createFolder(folderSearchDuplicate); + await apis.user.favorites.addFavoriteById('folder', folderFavoriteId); await apis.user.favorites.addFavoriteById('folder', folderFavoriteToEditId); await apis.user.favorites.addFavoriteById('folder', folderFavoriteDuplicateId); @@ -98,7 +108,7 @@ describe('Edit folder', () => { await Promise.all([ apis.admin.sites.deleteSite(sitePrivate), apis.user.sites.deleteSite(siteName), - apis.user.nodes.deleteNodesById([ parentId, folderFavoriteToEditId, folderFavoriteDuplicateId ]) + apis.user.nodes.deleteNodesById([ parentId, folderFavoriteToEditId, folderFavoriteDuplicateId, folderSearchToEditId ]) ]); done(); }); @@ -288,4 +298,51 @@ describe('Edit folder', () => { expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); }); }); + + describe('on Search Results', () => { + beforeAll(async (done) => { + await apis.user.search.waitForNodes('folder-search', { expect: 3 }); + done(); + }); + + it('properties are modified when pressing OK - [C306947]', async () => { + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor(folderSearchToEdit); + await dataTable.waitForBody(); + + await dataTable.selectItem(folderSearchToEdit); + await toolbar.openMoreMenu(); + await toolbar.menu.clickEditFolder(); + await editDialog.waitForDialogToOpen(); + await editDialog.enterDescription(folderDescriptionEdited); + await editDialog.enterName(folderNameEdited2); + await editDialog.clickUpdate(); + await editDialog.waitForDialogToClose(); + + await page.refresh(); + expect(await dataTable.isItemPresent(folderNameEdited2)).toBe(true, 'Folder not displayed'); + const desc = await apis.user.nodes.getNodeProperty(folderSearchToEditId, 'cm:description'); + expect(desc).toEqual(folderDescriptionEdited); + }); + + it('with duplicate folder name - [C306948]', async () => { + await page.clickPersonalFiles(); + await searchInput.clickSearchButton(); + await searchInput.checkOnlyFolders(); + await searchInput.searchFor(folderSearch); + await dataTable.waitForBody(); + + await dataTable.selectItem(folderSearch); + await toolbar.openMoreMenu(); + await toolbar.menu.clickEditFolder(); + await editDialog.waitForDialogToOpen(); + await editDialog.enterName(folderSearchDuplicate); + await editDialog.clickUpdate(); + + expect(await page.getSnackBarMessage()).toEqual(`There's already a folder with this name. Try a different name.`); + expect(await editDialog.isDialogOpen()).toBe(true, 'dialog is not present'); + }); + }); }); diff --git a/e2e/suites/actions/edit-offline.test.ts b/e2e/suites/actions/edit-offline.test.ts index 96e5ecb91a..30ee08b685 100755 --- a/e2e/suites/actions/edit-offline.test.ts +++ b/e2e/suites/actions/edit-offline.test.ts @@ -35,10 +35,15 @@ describe('Edit offline', () => { const fileLocked = `file-locked-${Utils.random()}.docx`; let fileLockedId; const fileLocked2 = `file-locked2-${Utils.random()}.docx`; let fileLocked2Id; + const fileSearch1 = `file-search-1-${Utils.random()}.docx`; let fileSearch1Id; + const fileSearchLocked = `file-search-locked-${Utils.random()}.docx`; let fileSearchLockedId; + const fileSearchLocked2 = `file-search-locked2-${Utils.random()}.docx`; let fileSearchLocked2Id; + const parentPF = `parentPersonal-${Utils.random()}`; let parentPFId; const parentSF = `parentShared-${Utils.random()}`; let parentSFId; const parentRF = `parentRecent-${Utils.random()}`; let parentRFId; const parentFav = `parentFav-${Utils.random()}`; let parentFavId; + const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId; const apis = { admin: new RepoClient(), @@ -48,6 +53,7 @@ describe('Edit offline', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -56,6 +62,7 @@ describe('Edit offline', () => { 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(); }); @@ -65,6 +72,7 @@ describe('Edit offline', () => { 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(); }); @@ -143,7 +151,7 @@ describe('Edit offline', () => { done(); }); - xit('File is locked and downloaded when clicking Edit Offline - []', async () => { + xit('File is locked and downloaded when clicking Edit Offline - [C306950]', async () => { await dataTable.selectItem(file1, parentSF); await toolbar.clickMoreActionsEditOffline(); @@ -151,13 +159,13 @@ describe('Edit offline', () => { expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); }); - xit('Lock information is displayed - []', async () => { + xit('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 - []', async () => { + xit('Cancel Editing unlocks the file - [C306952]', async () => { await dataTable.selectItem(fileLocked); await toolbar.clickMoreActionsCancelEditing(); await dataTable.clearSelection(); @@ -243,7 +251,7 @@ describe('Edit offline', () => { done(); }); - xit('File is locked and downloaded when clicking Edit Offline - []', async () => { + xit('File is locked and downloaded when clicking Edit Offline - [C306956]', async () => { await dataTable.selectItem(file1); await toolbar.clickMoreActionsEditOffline(); @@ -251,13 +259,13 @@ describe('Edit offline', () => { expect(await apis.user.nodes.isFileLockedWrite(file1Id)).toBe(true, `${file1} is not locked`); }); - xit('Lock information is displayed - []', async () => { + xit('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 - []', async () => { + xit('Cancel Editing unlocks the file - [C306958]', async () => { await dataTable.selectItem(fileLocked); await toolbar.clickMoreActionsCancelEditing(); await dataTable.clearSelection(); @@ -267,4 +275,58 @@ describe('Edit offline', () => { }); }); + describe('on Search Results', () => { + beforeAll(async (done) => { + 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; + + await apis.user.nodes.lockFile(fileSearchLockedId); + await apis.user.nodes.lockFile(fileSearchLocked2Id); + + await apis.user.search.waitForNodes('file-search', { expect: 3 }); + + await loginPage.loginWith(username); + done(); + }); + + beforeEach(async (done) => { + await page.clickPersonalFilesAndWait(); + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('file-search'); + await dataTable.waitForBody(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + it('File is locked and downloaded when clicking Edit Offline - [C306953]', async () => { + await dataTable.selectItem(fileSearch1); + await toolbar.clickMoreActionsEditOffline(); + + expect(await Utils.fileExistsOnOS(fileSearch1)).toBe(true, 'File not found in download location'); + 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 () => { + 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`); + }); + + it('Cancel Editing unlocks the file - [C306955]', async () => { + await dataTable.selectItem(fileSearchLocked); + await toolbar.clickMoreActionsCancelEditing(); + await dataTable.clearSelection(); + + 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`); + }); + }); }); diff --git a/e2e/suites/actions/library-actions.test.ts b/e2e/suites/actions/library-actions.test.ts index 1bc988c4cc..0bf77ad998 100755 --- a/e2e/suites/actions/library-actions.test.ts +++ b/e2e/suites/actions/library-actions.test.ts @@ -36,10 +36,26 @@ describe('Library actions', () => { const sitePublic2Admin = `admin-public2-${Utils.random()}`; const sitePublic3Admin = `admin-public3-${Utils.random()}`; const sitePublic4Admin = `admin-public4-${Utils.random()}`; + const sitePublic5Admin = `admin-public5-${Utils.random()}`; + const sitePublic6Admin = `admin-public6-${Utils.random()}`; + const sitePublic7Admin = `admin-public7-${Utils.random()}`; + const sitePublic8Admin = `admin-public8-${Utils.random()}`; + + const sitePublicUser = `user-public1-${Utils.random()}`; + const siteForDelete1 = `user-public2-${Utils.random()}`; + const siteForDelete2 = `user-public3-${Utils.random()}`; + const siteModerated1Admin = `admin-moderated1-${Utils.random()}`; const siteModerated2Admin = `admin-moderated2-${Utils.random()}`; - const sitePublicUser = `user-public-${Utils.random()}`; + const siteSearchModerated1Admin = `site-moderated-search-1-${Utils.random()}`; + const siteSearchModerated2Admin = `site-moderated-search-2-${Utils.random()}`; + + const siteSearchPublic1Admin = `site-public-search-1-${Utils.random()}`; + const siteSearchPublic2Admin = `site-public-search-2-${Utils.random()}`; + const siteSearchPublic3Admin = `site-public-search-3-${Utils.random()}`; + const siteSearchPublic4Admin = `site-public-search-4-${Utils.random()}`; + const siteSearchForDelete = `site-public-search-5-${Utils.random()}`; const apis = { admin: new RepoClient(), @@ -49,30 +65,23 @@ describe('Library actions', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; + const { searchInput } = page.header; const confirmDialog = new ConfirmDialog(); beforeAll(async (done) => { await apis.admin.people.createUser({ username }); - await apis.admin.sites.createSite(sitePublic1Admin); - await apis.admin.sites.createSite(sitePublic2Admin); - await apis.admin.sites.createSite(sitePublic3Admin); - await apis.admin.sites.createSite(sitePublic4Admin); - await apis.admin.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED); - await apis.admin.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED); - - await apis.user.sites.createSite(sitePublicUser); - await apis.admin.sites.addSiteMember(sitePublic2Admin, username, SITE_ROLES.SITE_COLLABORATOR.ROLE); - await apis.admin.sites.addSiteMember(sitePublic3Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); - await apis.admin.sites.addSiteMember(sitePublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.admin.sites.createSite(siteSearchPublic1Admin); + await apis.admin.sites.createSite(siteSearchPublic2Admin); + await apis.admin.sites.createSite(siteSearchPublic3Admin); + await apis.admin.sites.createSite(siteSearchPublic4Admin); + await apis.admin.sites.createSite(siteSearchModerated1Admin, SITE_VISIBILITY.MODERATED); + await apis.admin.sites.createSite(siteSearchModerated2Admin, SITE_VISIBILITY.MODERATED); + await apis.user.sites.createSite(siteSearchForDelete); - await apis.user.favorites.addFavoriteById('site', sitePublic1Admin); - await apis.user.favorites.addFavoriteById('site', sitePublic3Admin); - await apis.user.favorites.addFavoriteById('site', siteModerated1Admin); - await apis.user.favorites.addFavoriteById('site', siteModerated2Admin); - - await apis.user.sites.requestToJoin(siteModerated2Admin); + await apis.user.queries.waitForSites('site-public-search', { expect: 5 }); + await apis.user.queries.waitForSites('site-moderated-search', { expect: 2 }); await loginPage.loginWith(username); done(); @@ -80,104 +89,343 @@ describe('Library actions', () => { afterEach(async (done) => { await Utils.pressEscape(); - await dataTable.clearSelection(); + await page.header.expandSideNav(); + await page.clickPersonalFiles(); done(); }); afterAll(async (done) => { await apis.admin.sites.deleteSite(sitePublic1Admin); + await apis.admin.sites.deleteSite(siteSearchPublic1Admin); await apis.admin.sites.deleteSite(sitePublic2Admin); await apis.admin.sites.deleteSite(sitePublic3Admin); await apis.admin.sites.deleteSite(sitePublic4Admin); + await apis.admin.sites.deleteSite(sitePublic5Admin); + await apis.admin.sites.deleteSite(sitePublic6Admin); + await apis.admin.sites.deleteSite(sitePublic7Admin); + await apis.admin.sites.deleteSite(sitePublic8Admin); + + await apis.admin.sites.deleteSite(siteSearchPublic2Admin); + await apis.admin.sites.deleteSite(siteSearchPublic3Admin); + await apis.admin.sites.deleteSite(siteSearchPublic4Admin); await apis.admin.sites.deleteSite(siteModerated1Admin); await apis.admin.sites.deleteSite(siteModerated2Admin); + await apis.admin.sites.deleteSite(siteSearchModerated1Admin); + await apis.admin.sites.deleteSite(siteSearchModerated2Admin); await apis.user.sites.deleteSite(sitePublicUser); + await apis.admin.trashcan.emptyTrash(); done(); }); - it('Join a public library - Favorite Libraries - [C290105]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(sitePublic1Admin); - await toolbar.clickJoin(); + describe('Join a public library', () => { - expect(await dataTable.getLibraryRole(sitePublic1Admin)).toEqual('Consumer'); - }); + beforeAll(async done => { + await apis.admin.sites.createSite(sitePublic1Admin); + await apis.user.favorites.addFavoriteById('site', sitePublic1Admin); + done(); + }); - it('Join a moderated library - Favorite Libraries - [C290109]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(siteModerated1Admin); - await toolbar.clickJoin(); + it('from Favorite Libraries - [C290105]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(sitePublic1Admin); + await toolbar.clickJoin(); - expect(await dataTable.getLibraryRole(siteModerated1Admin)).toEqual(''); - const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated1Admin); - expect(hasJoinRequest).toBe(true, `Join request does not exist on ${siteModerated1Admin}`); - }); + expect(await dataTable.getLibraryRole(sitePublic1Admin)).toEqual('Consumer'); + }); + + it('from Search Results - [C306959]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchPublic1Admin); + await dataTable.waitForBody(); - it('Leave a library - My Libraries - [C290106]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(sitePublic2Admin); - await toolbar.clickLeave(); - await page.waitForDialog(); - await confirmDialog.clickOk(); + await dataTable.selectItem(siteSearchPublic1Admin); + await toolbar.clickJoin(); + + expect(await dataTable.getLibraryRole(siteSearchPublic1Admin)).toEqual('Consumer'); + }); - expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); - expect(await dataTable.isItemPresent(sitePublic2Admin)).toBe(false, `${sitePublic2Admin} is displayed`); }); - it('Leave a library - Favorite Libraries - [C290110]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(sitePublic3Admin); - await toolbar.clickLeave(); - await page.waitForDialog(); - await confirmDialog.clickOk(); + describe('Join a moderated library', () => { + + beforeAll(async done => { + await apis.admin.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED); + await apis.user.favorites.addFavoriteById('site', siteModerated1Admin); + await apis.user.queries.waitForSites(siteSearchModerated1Admin, { expect: 1 }); + done(); + }); + + it('from Favorite Libraries - [C290109]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(siteModerated1Admin); + await toolbar.clickJoin(); + + expect(await dataTable.getLibraryRole(siteModerated1Admin)).toEqual(''); + const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated1Admin); + expect(hasJoinRequest).toBe(true, `Join request does not exist on ${siteModerated1Admin}`); + }); + + it('from Search Results - [C306960]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchModerated1Admin); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchModerated1Admin); + await toolbar.clickJoin(); + + expect(await dataTable.getLibraryRole(siteSearchModerated1Admin)).toEqual(''); + const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated1Admin); + expect(hasJoinRequest).toBe(true, `Join request does not exist on ${siteSearchModerated1Admin}`); + }); - expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); - expect(await dataTable.isItemPresent(sitePublic3Admin)).toBe(true, `${sitePublic3Admin} is not displayed`); }); - it('Confirmation dialog UI - [C290136]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(sitePublic4Admin); - await toolbar.clickLeave(); - await page.waitForDialog(); - - expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open'); - expect(await confirmDialog.getTitle()).toContain('Leave this library?'); - expect(await confirmDialog.getText()).toContain('Leaving will remove your access.'); - expect(await confirmDialog.isOkEnabled()).toBe(true, 'OK button is not enabled'); - expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled'); + describe('Leave a library', () => { + + beforeAll(async done => { + await apis.admin.sites.createSite(sitePublic2Admin); + await apis.admin.sites.createSite(sitePublic3Admin); + await apis.admin.sites.createSite(sitePublic4Admin); + await apis.admin.sites.createSite(sitePublic5Admin); + await apis.user.sites.createSite(sitePublicUser); + await apis.user.favorites.addFavoriteById('site', sitePublic3Admin); + await apis.admin.sites.addSiteMember(sitePublic2Admin, username, SITE_ROLES.SITE_COLLABORATOR.ROLE); + await apis.admin.sites.addSiteMember(sitePublic3Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.admin.sites.addSiteMember(siteSearchPublic2Admin, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE); + await apis.admin.sites.addSiteMember(sitePublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.admin.sites.addSiteMember(sitePublic5Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.user.queries.waitForSites(siteSearchPublic2Admin, { expect: 1 }); + done(); + }); + + it('from My Libraries - [C290106]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublic2Admin); + await toolbar.clickLeave(); + await page.waitForDialog(); + await confirmDialog.clickOk(); + + expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); + expect(await dataTable.isItemPresent(sitePublic2Admin)).toBe(false, `${sitePublic2Admin} is displayed`); + }); + + it('from Favorite Libraries - [C290110]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(sitePublic3Admin); + await toolbar.clickLeave(); + await page.waitForDialog(); + await confirmDialog.clickOk(); + + expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); + expect(await dataTable.isItemPresent(sitePublic3Admin)).toBe(true, `${sitePublic3Admin} is not displayed`); + }); + + it('from Search Results - [C306961]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchPublic2Admin); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchPublic2Admin); + await toolbar.clickLeave(); + await page.waitForDialog(); + await confirmDialog.clickOk(); + + expect(await page.getSnackBarMessage()).toEqual(`You have left the library`); + expect(await dataTable.isItemPresent(siteSearchPublic2Admin)).toBe(true, `${siteSearchPublic2Admin} is not displayed`); + }); + + it('Confirmation dialog UI - [C290136]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublic4Admin); + await toolbar.clickLeave(); + await page.waitForDialog(); + + expect(await confirmDialog.isDialogOpen()).toBe(true, 'Confirm delete dialog not open'); + expect(await confirmDialog.getTitle()).toContain('Leave this library?'); + expect(await confirmDialog.getText()).toContain('Leaving will remove your access.'); + expect(await confirmDialog.isOkEnabled()).toBe(true, 'OK button is not enabled'); + expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled'); + }); + + it('Cancel Leave Library - [C290111]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublic5Admin); + await toolbar.clickLeave(); + await page.waitForDialog(); + + expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled'); + await confirmDialog.clickCancel(); + expect(await dataTable.isItemPresent(sitePublic5Admin)).toBe(true, `${sitePublic5Admin} was deleted`); + }); + + it('Leave a library - failure notification - [C290107]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublicUser); + await toolbar.clickLeave(); + await page.waitForDialog(); + await confirmDialog.clickOk(); + + expect(await page.getSnackBarMessage()).toEqual(`Cannot leave this library`); + }); }); - it('Cancel Leave library - [C290111]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(sitePublic4Admin); - await toolbar.clickLeave(); - await page.waitForDialog(); + describe('Cancel join', () => { - expect(await confirmDialog.isCancelEnabled()).toBe(true, 'Cancel button is not enabled'); - await confirmDialog.clickCancel(); - expect(await dataTable.isItemPresent(sitePublic4Admin)).toBe(true, `${sitePublic4Admin} was deleted`); - }); + beforeAll(async done => { + await apis.admin.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED); + await apis.user.favorites.addFavoriteById('site', siteModerated2Admin); + await apis.user.sites.requestToJoin(siteModerated2Admin); + await apis.user.sites.requestToJoin(siteSearchModerated2Admin); + await apis.user.queries.waitForSites(siteSearchModerated2Admin, { expect: 1 }); + done(); + }); - it('Leave a library - failure notification - [C290107]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(sitePublicUser); - await toolbar.clickLeave(); - await page.waitForDialog(); - await confirmDialog.clickOk(); + it('from Favorite Libraries - [C290108]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(siteModerated2Admin); + await toolbar.clickButton('Cancel Join Request'); + + expect(await page.getSnackBarMessage()).toEqual(`Canceled the request to join the library`); + + const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated2Admin); + expect(hasJoinRequest).toBe(false, `Join request exists on ${siteModerated2Admin}`); + }); + + it('from Search Results - [C306962]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchModerated2Admin); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchModerated2Admin); + await toolbar.clickButton('Cancel Join Request'); + + expect(await page.getSnackBarMessage()).toEqual(`Canceled the request to join the library`); + + const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteSearchModerated2Admin); + expect(hasJoinRequest).toBe(false, `Join request exists on ${siteSearchModerated2Admin}`); + }); - expect(await page.getSnackBarMessage()).toEqual(`Cannot leave this library`); }); - it('Cancel join - Favorite Libraries - [C290108]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(siteModerated2Admin); - await toolbar.clickButton('Cancel join request'); + describe('Mark library as favorite', () => { + + beforeAll(async done => { + await apis.admin.sites.createSite(sitePublic6Admin); + await apis.admin.sites.addSiteMember(sitePublic6Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.user.queries.waitForSites(siteSearchPublic3Admin, { expect: 1 }); + done(); + }); + + it('from My Libraries - [C289974]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublic6Admin); + await toolbar.clickMoreActionsFavorite(); - expect(await page.getSnackBarMessage()).toEqual(`Canceled the request to join the library`); + expect(await apis.user.favorites.isFavoriteWithRetry(sitePublic6Admin, { expect: true })).toBe(true, `${sitePublic6Admin} not favorite`); + }); + + it('from on Search Results - [C306963]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchPublic3Admin); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchPublic3Admin); + await toolbar.clickMoreActionsFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic3Admin, { expect: true })).toBe(true, `${siteSearchPublic3Admin} not favorite`); + }); + + }); + + describe('Remove library from favorites', () => { + + beforeAll(async done => { + await apis.admin.sites.createSite(sitePublic7Admin); + await apis.admin.sites.createSite(sitePublic8Admin); + await apis.user.favorites.addFavoriteById('site', sitePublic7Admin); + await apis.user.favorites.addFavoriteById('site', sitePublic8Admin); + await apis.user.favorites.addFavoriteById('site', siteSearchPublic4Admin); + await apis.admin.sites.addSiteMember(sitePublic7Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.admin.sites.addSiteMember(sitePublic8Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.admin.sites.addSiteMember(siteSearchPublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE); + await apis.user.queries.waitForSites(siteSearchPublic4Admin, { expect: 1 }); + done(); + }); + + it('from My Libraries - [C289975]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(sitePublic7Admin); + await toolbar.clickMoreActionsRemoveFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(sitePublic7Admin, { expect: false })).toBe(false, `${sitePublic7Admin} still favorite`); + }); + + it('from Favorite Libraries - [C289976]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(sitePublic8Admin); + await toolbar.clickMoreActionsRemoveFavorite(); + + expect(await dataTable.isItemPresent(sitePublic8Admin)).toBe(false, `${sitePublic8Admin} is displayed`); + expect(await apis.user.favorites.isFavoriteWithRetry(sitePublic8Admin, { expect: false })).toBe(false, `${sitePublic8Admin} still favorite`); + }); + + it('from Search Results - [C306964]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchPublic4Admin); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchPublic4Admin); + await toolbar.clickMoreActionsRemoveFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(siteSearchPublic4Admin, { expect: false })).toBe(false, `${siteSearchPublic4Admin} still favorite`); + }); + }); - const hasJoinRequest = await apis.user.sites.hasMembershipRequest(siteModerated2Admin); - expect(hasJoinRequest).toBe(false, `Join request exists on ${siteModerated2Admin}`); + describe('Delete a library', () => { + + beforeAll(async done => { + await apis.user.sites.createSite(siteForDelete1); + await apis.user.sites.createSite(siteForDelete2); + await apis.user.queries.waitForSites(siteSearchForDelete, { expect: 1 }); + done(); + }); + + it('from My Libraries - [C289988]', async () => { + await page.goToMyLibrariesAndWait(); + await dataTable.selectItem(siteForDelete1); + await toolbar.clickMoreActionsDelete(); + + expect(await page.getSnackBarMessage()).toEqual(`Library deleted`); + expect(await dataTable.isItemPresent(siteForDelete1)).toBe(false, `${siteForDelete1} still displayed`); + }); + + it('from Favorite Libraries - [C289991]', async () => { + await page.goToFavoriteLibrariesAndWait(); + await dataTable.selectItem(siteForDelete2); + await toolbar.clickMoreActionsDelete(); + + expect(await page.getSnackBarMessage()).toEqual(`Library deleted`); + expect(await dataTable.isItemPresent(siteForDelete2)).toBe(false, `${siteForDelete2} still displayed`); + }); + + it('from Search Results - [C306965]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(siteSearchForDelete); + await dataTable.waitForBody(); + + await dataTable.selectItem(siteSearchForDelete); + await toolbar.clickMoreActionsDelete(); + + expect(await page.getSnackBarMessage()).toEqual(`Library deleted`); + expect(await dataTable.isItemPresent(siteSearchForDelete)).toBe(false, `${siteSearchForDelete} still displayed`); + }); }); }); diff --git a/e2e/suites/actions/mark-favorite.test.ts b/e2e/suites/actions/mark-favorite.test.ts index 9b517c4d9a..b078486deb 100644 --- a/e2e/suites/actions/mark-favorite.test.ts +++ b/e2e/suites/actions/mark-favorite.test.ts @@ -24,7 +24,7 @@ */ import { LoginPage, BrowsingPage } from '../../pages/pages'; -import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; +import { SITE_VISIBILITY } from '../../configs'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; @@ -47,6 +47,19 @@ describe('Mark items as favorites', () => { let fileNotFavUIId, fileFavUIId, fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id, folderId, parentId; + const fileSearchNotFav1 = `search-fileNotFav1-${Utils.random()}.txt`; + const fileSearchNotFav2 = `search-fileNotFav2-${Utils.random()}.txt`; + const fileSearchNotFav3 = `search-fileNotFav3-${Utils.random()}.txt`; + const fileSearchNotFav4 = `search-fileNotFav4-${Utils.random()}.txt`; + const fileSearchFav1 = `search-fileFav1-${Utils.random()}.txt`; + const fileSearchFav2 = `search-fileFav2-${Utils.random()}.txt`; + const fileSearchFav3 = `search-fileFav3-${Utils.random()}.txt`; + const fileSearchFav4 = `search-fileFav4-${Utils.random()}.txt`; + const folderSearch = `search-folder-${Utils.random()}`; + + let fileSearchNotFav1Id, fileSearchNotFav2Id, fileSearchNotFav3Id, fileSearchNotFav4Id; + let fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id, folderSearchId; + const apis = { admin: new RepoClient(), user: new RepoClient(username, username) @@ -55,6 +68,7 @@ describe('Mark items as favorites', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable, toolbar } = page; + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -73,8 +87,19 @@ describe('Mark items as favorites', () => { fileFav4Id = (await apis.user.nodes.createFile(fileFav4, parentId)).entry.id; folderId = (await apis.user.nodes.createFolder(folder, parentId)).entry.id; + fileSearchNotFav1Id = (await apis.user.nodes.createFile(fileSearchNotFav1, parentId)).entry.id; + fileSearchNotFav2Id = (await apis.user.nodes.createFile(fileSearchNotFav2, parentId)).entry.id; + fileSearchNotFav3Id = (await apis.user.nodes.createFile(fileSearchNotFav3, parentId)).entry.id; + fileSearchNotFav4Id = (await apis.user.nodes.createFile(fileSearchNotFav4, parentId)).entry.id; + fileSearchFav1Id = (await apis.user.nodes.createFile(fileSearchFav1, parentId)).entry.id; + fileSearchFav2Id = (await apis.user.nodes.createFile(fileSearchFav2, parentId)).entry.id; + fileSearchFav3Id = (await apis.user.nodes.createFile(fileSearchFav3, parentId)).entry.id; + fileSearchFav4Id = (await apis.user.nodes.createFile(fileSearchFav4, parentId)).entry.id; + folderSearchId = (await apis.user.nodes.createFolder(folderSearch, parentId)).entry.id; + await apis.user.favorites.addFavoritesByIds('file', [ fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); - await apis.user.favorites.waitForApi({ expect: 5 }); + await apis.user.favorites.addFavoritesByIds('file', [ fileSearchFav1Id, fileSearchFav2Id, fileSearchFav3Id, fileSearchFav4Id ]); + await apis.user.favorites.waitForApi({ expect: 9 }); await apis.user.shared.shareFilesByIds([ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.shared.shareFilesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); @@ -89,12 +114,17 @@ describe('Mark items as favorites', () => { done(); }); + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + describe('on Personal Files', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFavUIId, fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.addFavoriteById('folder', folderId); await apis.user.favorites.removeFavoritesByIds([ fileNotFavUIId , fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); - await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.favorites.waitForApi({ expect: 10 }); done(); }); @@ -123,7 +153,7 @@ describe('Mark items as favorites', () => { await dataTable.selectItem(fileFavUI); await toolbar.openMoreMenu(); - expect(await toolbar.menu.getItemIconText('Remove favorite')).toEqual('star'); + expect(await toolbar.menu.getItemIconText('Remove Favorite')).toEqual('star'); }); it('favorite a file - [C217189]', async () => { @@ -176,7 +206,7 @@ describe('Mark items as favorites', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); - await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.favorites.waitForApi({ expect: 10 }); done(); }); @@ -229,7 +259,7 @@ describe('Mark items as favorites', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); - await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.favorites.waitForApi({ expect: 10 }); done(); }); @@ -282,7 +312,7 @@ describe('Mark items as favorites', () => { afterAll(async (done) => { await apis.user.favorites.addFavoritesByIds('file', [ fileFav1Id, fileFav2Id, fileFav3Id, fileFav4Id ]); await apis.user.favorites.removeFavoritesByIds([ fileNotFav1Id, fileNotFav2Id, fileNotFav3Id, fileNotFav4Id ]); - await apis.user.favorites.waitForApi({ expect: 6 }); + await apis.user.favorites.waitForApi({ expect: 10 }); done(); }); @@ -315,7 +345,74 @@ describe('Mark items as favorites', () => { await dataTable.selectItem(fileFav2); await toolbar.openMoreMenu(); - expect(await toolbar.menu.getItemIconText('Remove favorite')).toEqual('star'); + expect(await toolbar.menu.getItemIconText('Remove Favorite')).toEqual('star'); + }); + }); + + describe('on Search Results', () => { + beforeAll(async done => { + await apis.user.search.waitForNodes('search-f', { expect: 9 }); + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('search-f'); + await dataTable.waitForBody(); + done(); + }); + + beforeEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + afterAll(async done => { + await page.header.expandSideNav(); + await page.clickPersonalFiles(); + done(); + }); + + it('favorite a file - [C306966]', async () => { + await dataTable.selectItem(fileSearchNotFav1); + await toolbar.clickMoreActionsFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav1Id, { expect: true })).toBe(true, `${fileSearchNotFav1} not marked as favorite`); + }); + + it('favorite a folder - [C306971]', async () => { + await dataTable.selectItem(folderSearch); + await toolbar.clickMoreActionsFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(folderSearchId, { expect: true })).toBe(true, `${folderSearch} not marked as favorite`); + }); + + it('unfavorite an item - [C306967]', async () => { + await dataTable.selectItem(fileSearchFav1); + await toolbar.clickMoreActionsRemoveFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav1Id, { expect: false })).toBe(false, `${fileSearchFav1} is marked as favorite`); + }); + + it('favorite multiple items - all unfavorite - [C306968]', async () => { + await dataTable.selectMultipleItems([ fileSearchNotFav2, fileSearchNotFav3 ]); + await toolbar.clickMoreActionsFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav2Id, { expect: true })).toBe(true, `${fileSearchNotFav2} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav3Id, { expect: true })).toBe(true, `${fileSearchNotFav3} not marked as favorite`); + }); + + it('favorite multiple items - some favorite and some unfavorite - [C306970]', async () => { + await dataTable.selectMultipleItems([ fileSearchNotFav4, fileSearchFav2 ]); + await toolbar.clickMoreActionsFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchNotFav4Id, { expect: true })).toBe(true, `${fileSearchNotFav4} not marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav2Id, { expect: true })).toBe(true, `${fileSearchFav2} not marked as favorite`); + }); + + it('unfavorite multiple items - [C306969]', async () => { + await dataTable.selectMultipleItems([ fileSearchFav3, fileSearchFav4 ]) + await toolbar.clickMoreActionsRemoveFavorite(); + + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav3Id, { expect: false })).toBe(false, `${fileSearchFav3} marked as favorite`); + expect(await apis.user.favorites.isFavoriteWithRetry(fileSearchFav4Id, { expect: false })).toBe(false, `${fileSearchFav4} marked as favorite`); }); }); @@ -423,60 +520,4 @@ describe('Mark items as favorites', () => { expect(await apis.user.favorites.isFavoriteWithRetry(fileSiteFav4Id, { expect: true })).toBe(true, 'item not marked as favorite'); }); }); - - describe('on a library', () => { - const adminSite1 = `adminSite1-${Utils.random()}`; - const adminSite2 = `adminSite2-${Utils.random()}`; - const adminSite3 = `adminSite3-${Utils.random()}`; - - beforeAll(async (done) => { - await apis.admin.sites.createSite(adminSite1); - await apis.admin.sites.createSite(adminSite2); - await apis.admin.sites.createSite(adminSite3); - await apis.admin.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE); - await apis.admin.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONSUMER.ROLE); - await apis.admin.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_CONSUMER.ROLE); - - await apis.user.favorites.addFavoriteById('site', adminSite2); - await apis.user.favorites.addFavoriteById('site', adminSite3); - done(); - }); - - beforeEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - - afterAll(async (done) => { - await apis.admin.sites.deleteSite(adminSite1); - await apis.admin.sites.deleteSite(adminSite2); - await apis.admin.sites.deleteSite(adminSite3); - done(); - }); - - it('Mark a library as favorite - [C289974]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(adminSite1); - await toolbar.clickMoreActionsFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(adminSite1, { expect: true })).toBe(true, `${adminSite1} not favorite`); - }); - - it('Remove a library from favorites - on My Libraries - [C289975]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(adminSite2); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await apis.user.favorites.isFavoriteWithRetry(adminSite2, { expect: false })).toBe(false, `${adminSite2} still favorite`); - }); - - it('Remove a library from favorites - on Favorite Libraries - [C289976]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(adminSite3); - await toolbar.clickMoreActionsRemoveFavorite(); - - expect(await dataTable.isItemPresent(adminSite3)).toBe(false, `${adminSite3} is displayed`); - expect(await apis.user.favorites.isFavoriteWithRetry(adminSite3, { expect: false })).toBe(false, `${adminSite3} still favorite`); - }); - }); }); diff --git a/e2e/suites/actions/new-menu.test.ts b/e2e/suites/actions/new-menu.test.ts index 79e1b2395d..e5b1349ccc 100755 --- a/e2e/suites/actions/new-menu.test.ts +++ b/e2e/suites/actions/new-menu.test.ts @@ -149,7 +149,7 @@ describe('New menu', () => { await page.clickPersonalFiles(); await sidenav.openNewMenu(); - const tooltip = await sidenav.menu.getItemTooltip('Create folder'); + const tooltip = await sidenav.menu.getItemTooltip('Create Folder'); expect(tooltip).toContain('Create new folder'); }); @@ -158,7 +158,7 @@ describe('New menu', () => { await dataTable.doubleClickOnRowByName(siteAdmin); await sidenav.openNewMenu(); - const tooltip = await sidenav.menu.getItemTooltip('Create folder'); + const tooltip = await sidenav.menu.getItemTooltip('Create Folder'); expect(tooltip).toContain(`Folders cannot be created whilst viewing the current items`); }); diff --git a/e2e/suites/actions/share-file.test.ts b/e2e/suites/actions/share-file.test.ts index ddaafda7c2..46c7652755 100755 --- a/e2e/suites/actions/share-file.test.ts +++ b/e2e/suites/actions/share-file.test.ts @@ -33,29 +33,31 @@ import { Utils } from '../../utilities/utils'; describe('Share a file', () => { const username = `user-${Utils.random()}`; - const parent = `parent-${Utils.random()}`; let parentId; - const expiryDate: any = '2020-12-25T18:30:00.000+0000'; + const file1 = `file1-${Utils.random()}.txt`; let file1Id; + const file2 = `file2-${Utils.random()}.txt`; let file2Id; + let file3 = `file3-${Utils.random()}.txt`; let file3Id; + const file4 = `file4-${Utils.random()}.txt`; let file4Id; + let file5 = `file5-${Utils.random()}.txt`; let file5Id; + let file6 = `file6-${Utils.random()}.txt`; let file6Id; + let file7 = `file7-${Utils.random()}.txt`; let file7Id; + const file8 = `file8-${Utils.random()}.txt`; let file8Id; + let file9 = `file9-${Utils.random()}.txt`; let file9Id; + + const viewer = new Viewer(); + const page = new BrowsingPage(); + const { dataTable, toolbar } = page; + const shareLinkPreUrl = "/#/preview/s/"; const apis = { admin: new RepoClient(), user: new RepoClient(username, username) }; - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable, toolbar } = page; - const shareDialog = new ShareDialog(); - const viewer = new Viewer(); - const contextMenu = dataTable.menu; - beforeAll(async (done) => { await apis.admin.people.createUser({ username }); - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - - await loginPage.loginWith(username); done(); }); @@ -64,951 +66,1037 @@ describe('Share a file', () => { done(); }); - describe('from Personal Files', () => { - - const file1 = `file1-${Utils.random()}.txt`; let file1Id; - const file2 = `file2-${Utils.random()}.txt`; let file2Id; - const file3 = `file3-${Utils.random()}.txt`; let file3Id; - const file4 = `file4-${Utils.random()}.txt`; let file4Id; - const file5 = `file5-${Utils.random()}.txt`; let file5Id; - const file6 = `file6-${Utils.random()}.txt`; let file6Id; - const file7 = `file7-${Utils.random()}.txt`; let file7Id; - const file8 = `file8-${Utils.random()}.txt`; let file8Id; - const file9 = `file9-${Utils.random()}.txt`; let file9Id; - - beforeAll(async (done) => { - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; - file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; - file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; - file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; - file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; - file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; - file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; - await apis.user.shared.shareFileById(file6Id, expiryDate); - await apis.user.shared.shareFileById(file7Id, expiryDate); - await apis.user.shared.waitForApi({ expect: 2 }); - done(); - }); - - beforeEach(async (done) => { - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(parent); - await dataTable.waitForHeader(); - done(); - }); - - afterEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(file1Id); - await apis.user.nodes.deleteNodeById(file2Id); - await apis.user.nodes.deleteNodeById(file3Id); - await apis.user.nodes.deleteNodeById(file4Id); - await apis.user.nodes.deleteNodeById(file5Id); - await apis.user.nodes.deleteNodeById(file6Id); - await apis.user.nodes.deleteNodeById(file7Id); - await apis.user.nodes.deleteNodeById(file8Id); - await apis.user.nodes.deleteNodeById(file9Id); - await apis.user.shared.waitForApi({ expect: 0 }); - done(); - }); - - it('Share dialog default values - [C286327]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - }); - - it('Close dialog - [C286328]', async () => { - await dataTable.selectItem(file2); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - await shareDialog.clickClose(); - expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); - }); - - it('Share a file - [C286329]', async () => { - await dataTable.selectItem(file3); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file3Id); - expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} is not in the Shared files list`); - }); - - it('Copy shared file URL - [C286330]', async () => { - await dataTable.selectItem(file4); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url = await shareDialog.getLinkUrl(); - expect(url).toContain('/preview/s/'); - - await shareDialog.copyUrl(); - expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); - - await browser.get(url); - expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); - expect(await viewer.getFileTitle()).toEqual(file4); - - await page.load(); - }); - - it('Share a file with expiration date - [C286332]', async () => { - await dataTable.selectItem(file5); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); - expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); - const date = await shareDialog.dateTimePicker.setDefaultDay(); - await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); - - const setDate = (`${date}`).replace(',', ''); - const inputDate = await shareDialog.getExpireDate(); - - expect(new Date(inputDate)).toEqual(new Date(setDate)); - - const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); - - expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); - }); - - it('Expire date is displayed correctly - [C286337]', async () => { - await dataTable.selectItem(file6); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); - expect(expireProperty).toEqual(expiryDate); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); - }); - - it('Disable the share link expiration - [C286333]', async () => { - await dataTable.selectItem(file7); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); - - await shareDialog.clickClose(); - expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); - }); - - it('Shared file URL is not changed when Share dialog is closed and opened again - [C286335]', async () => { - await dataTable.selectItem(file8); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url1 = await shareDialog.getLinkUrl(); - await shareDialog.clickClose(); - await shareDialog.waitForDialogToClose(); - - await page.dataTable.clearSelection(); - await dataTable.selectItem(file8); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url2 = await shareDialog.getLinkUrl(); - - expect(url1).toEqual(url2); - }); - - it('Share a file from the context menu - [C286345]', async () => { - await dataTable.rightClickOnItem(file9); - await contextMenu.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file9Id); - expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file9)).toBe(true, `${file9} is not in the Shared files list`); - }); - }); - - describe('from File Libraries', () => { - - const file1 = `file1-${Utils.random()}.txt`; - const file2 = `file2-${Utils.random()}.txt`; - const file3 = `file3-${Utils.random()}.txt`; let file3Id; - const file4 = `file4-${Utils.random()}.txt`; - const file5 = `file5-${Utils.random()}.txt`; let file5Id; - const file6 = `file6-${Utils.random()}.txt`; let file6Id; - const file7 = `file7-${Utils.random()}.txt`; let file7Id; - const file8 = `file8-${Utils.random()}.txt`; - const file9 = `file9-${Utils.random()}.txt`; let file9Id; - - const siteName = `site-${Utils.random()}`; - const parentInSite = `parent-site-${Utils.random()}`; let parentInSiteId; - - beforeAll(async (done) => { - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); - const docLibId = await apis.user.sites.getDocLibId(siteName); - parentInSiteId = (await apis.user.nodes.createFolder(parentInSite, docLibId)).entry.id; - - await apis.user.nodes.createFile(file1, parentInSiteId); - await apis.user.nodes.createFile(file2, parentInSiteId); - file3Id = (await apis.user.nodes.createFile(file3, parentInSiteId)).entry.id; - await apis.user.nodes.createFile(file4, parentInSiteId); - file5Id = (await apis.user.nodes.createFile(file5, parentInSiteId)).entry.id; - file6Id = (await apis.user.nodes.createFile(file6, parentInSiteId)).entry.id; - file7Id = (await apis.user.nodes.createFile(file7, parentInSiteId)).entry.id; - await apis.user.nodes.createFile(file8, parentInSiteId); - file9Id = (await apis.user.nodes.createFile(file9, parentInSiteId)).entry.id; - await apis.user.shared.shareFileById(file6Id, expiryDate); - await apis.user.shared.shareFileById(file7Id, expiryDate); - await apis.user.shared.waitForApi({ expect: 2 }); - done(); - }); - - beforeEach(async (done) => { - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.doubleClickOnRowByName(parentInSite); - await dataTable.waitForHeader(); - done(); - }); - - afterEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - - afterAll(async (done) => { - await apis.admin.sites.deleteSite(siteName); - await apis.user.shared.waitForApi({ expect: 0 }); - done(); - }); - - it('Share dialog default values - [C286639]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - }); - - it('Close dialog - [C286640]', async () => { - await dataTable.selectItem(file2); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - await shareDialog.clickClose(); - expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); - }); - - it('Share a file - [C286641]', async () => { - await dataTable.selectItem(file3); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file3Id); - expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} is not in the Shared files list`); - }); - - it('Copy shared file URL - [C286642]', async () => { - await dataTable.selectItem(file4); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url = await shareDialog.getLinkUrl(); - expect(url).toContain('/preview/s/'); - - await shareDialog.copyUrl(); - expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); - - await browser.get(url); - expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); - expect(await viewer.getFileTitle()).toEqual(file4); - - await page.load(); - }); - - it('Share a file with expiration date - [C286643]', async () => { - await dataTable.selectItem(file5); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); - expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); - const date = await shareDialog.dateTimePicker.setDefaultDay(); - await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); - - const setDate = (`${date}`).replace(',', ''); - const inputDate = await shareDialog.getExpireDate(); - - expect(new Date(inputDate)).toEqual(new Date(setDate)); - - const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); - - expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); - }); - - it('Expire date is displayed correctly - [C286644]', async () => { - await dataTable.selectItem(file6); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); - expect(expireProperty).toEqual(expiryDate); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); - }); - - it('Disable the share link expiration - [C286645]', async () => { - await dataTable.selectItem(file7); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); - - await shareDialog.clickClose(); - expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); - }); - - it('Shared file URL is not changed when Share dialog is closed and opened again - [C286646]', async () => { - await dataTable.selectItem(file8); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url1 = await shareDialog.getLinkUrl(); - await shareDialog.clickClose(); - await shareDialog.waitForDialogToClose(); - - await page.dataTable.clearSelection(); - await dataTable.selectItem(file8); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url2 = await shareDialog.getLinkUrl(); - - expect(url1).toEqual(url2); - }); - - it('Share a file from the context menu - [C286647]', async () => { - await dataTable.rightClickOnItem(file9); - await contextMenu.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file9Id); - expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file9)).toBe(true, `${file9} is not in the Shared files list`); - }); - }); - - describe('from Recent Files', () => { - - const file1 = `file1-${Utils.random()}.txt`; let file1Id; - const file2 = `file2-${Utils.random()}.txt`; let file2Id; - const file3 = `file3-${Utils.random()}.txt`; let file3Id; - const file4 = `file4-${Utils.random()}.txt`; let file4Id; - const file5 = `file5-${Utils.random()}.txt`; let file5Id; - const file6 = `file6-${Utils.random()}.txt`; let file6Id; - const file7 = `file7-${Utils.random()}.txt`; let file7Id; - const file8 = `file8-${Utils.random()}.txt`; let file8Id; - const file9 = `file9-${Utils.random()}.txt`; let file9Id; + describe('when logged out', () => { + let file6SharedLink; beforeAll(async (done) => { - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; - file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; - file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; - file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; - file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; - file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; - await apis.user.shared.shareFileById(file6Id, expiryDate); - await apis.user.shared.shareFileById(file7Id, expiryDate); - await apis.user.shared.waitForApi({ expect: 2 }); - done(); - }); - - beforeEach(async (done) => { - await page.refresh(); - await page.clickRecentFilesAndWait(); - done(); - }); - - afterEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(file1Id); - await apis.user.nodes.deleteNodeById(file2Id); - await apis.user.nodes.deleteNodeById(file3Id); - await apis.user.nodes.deleteNodeById(file4Id); - await apis.user.nodes.deleteNodeById(file5Id); - await apis.user.nodes.deleteNodeById(file6Id); - await apis.user.nodes.deleteNodeById(file7Id); - await apis.user.nodes.deleteNodeById(file8Id); - await apis.user.nodes.deleteNodeById(file9Id); - await apis.user.shared.waitForApi({ expect: 0 }); - done(); - }); - - it('Share dialog default values - [C286657]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - }); - - it('Close dialog - [C286658]', async () => { - await dataTable.selectItem(file2); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - await shareDialog.clickClose(); - expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); - }); - - it('Share a file - [C286659]', async () => { - await dataTable.selectItem(file3); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file3Id); - expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} is not in the Shared files list`); - }); - - it('Copy shared file URL - [C286660]', async () => { - await dataTable.selectItem(file4); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url = await shareDialog.getLinkUrl(); - expect(url).toContain('/preview/s/'); - - await shareDialog.copyUrl(); - expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); - - await browser.get(url); - expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); - expect(await viewer.getFileTitle()).toEqual(file4); - - await page.load(); - }); - - it('Share a file with expiration date - [C286661]', async () => { - await dataTable.selectItem(file5); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); - expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); - const date = await shareDialog.dateTimePicker.setDefaultDay(); - await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); - - const setDate = (`${date}`).replace(',', ''); - const inputDate = await shareDialog.getExpireDate(); - - expect(new Date(inputDate)).toEqual(new Date(setDate)); - - const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); - - expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); - }); - - it('Expire date is displayed correctly - [C286662]', async () => { - await dataTable.selectItem(file6); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); - expect(expireProperty).toEqual(expiryDate); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); - }); - - it('Disable the share link expiration - [C286663]', async () => { - await dataTable.selectItem(file7); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); - - await shareDialog.clickClose(); - expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); - }); - - it('Shared file URL is not changed when Share dialog is closed and opened again - [C286664]', async () => { - await dataTable.selectItem(file8); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url1 = await shareDialog.getLinkUrl(); - await shareDialog.clickClose(); - await shareDialog.waitForDialogToClose(); - - await page.dataTable.clearSelection(); - await dataTable.selectItem(file8); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url2 = await shareDialog.getLinkUrl(); - - expect(url1).toEqual(url2); - }); - - it('Share a file from the context menu - [C286665]', async () => { - await dataTable.rightClickOnItem(file9); - await contextMenu.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file9Id); - expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file9)).toBe(true, `${file9} is not in the Shared files list`); - }); - }); - - describe('from Shared Files', () => { - - const file1 = `file1-${Utils.random()}.txt`; let file1Id; - const file2 = `file2-${Utils.random()}.txt`; let file2Id; - const file3 = `file3-${Utils.random()}.txt`; let file3Id; - const file4 = `file4-${Utils.random()}.txt`; let file4Id; - const file5 = `file5-${Utils.random()}.txt`; let file5Id; - const file6 = `file6-${Utils.random()}.txt`; let file6Id; - const file7 = `file7-${Utils.random()}.txt`; let file7Id; - - beforeAll(async (done) => { - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; - file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; - file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; - file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; - file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; - - await apis.user.shared.shareFileById(file1Id); - await apis.user.shared.shareFileById(file2Id); - await apis.user.shared.shareFileById(file3Id); - await apis.user.shared.shareFileById(file4Id, expiryDate); - await apis.user.shared.shareFileById(file5Id, expiryDate); - await apis.user.shared.shareFileById(file6Id); - await apis.user.shared.shareFileById(file7Id); - await apis.user.shared.waitForApi({ expect: 7 }); - done(); - }); - - beforeEach(async (done) => { - await page.refresh(); - await page.clickSharedFilesAndWait(); - done(); - }); - - afterEach(async (done) => { - await Utils.pressEscape(); + const sharedId = (await apis.user.shared.shareFileById(file6Id)).entry.id; + file6SharedLink = `${shareLinkPreUrl}${sharedId}`; + await apis.user.shared.waitForApi({ expect: 1 }); done(); }); afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(file1Id); - await apis.user.nodes.deleteNodeById(file2Id); - await apis.user.nodes.deleteNodeById(file3Id); - await apis.user.nodes.deleteNodeById(file4Id); - await apis.user.nodes.deleteNodeById(file5Id); await apis.user.nodes.deleteNodeById(file6Id); - await apis.user.nodes.deleteNodeById(file7Id); await apis.user.shared.waitForApi({ expect: 0 }); done(); }); - it('Share dialog default values - [C286648]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - }); - - it('Close dialog - [C286649]', async () => { - await dataTable.selectItem(file2); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - await shareDialog.clickClose(); - expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); - }); - - it('Copy shared file URL - [C286651]', async () => { - await dataTable.selectItem(file3); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url = await shareDialog.getLinkUrl(); - expect(url).toContain('/preview/s/'); - - await shareDialog.copyUrl(); - expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); - - await browser.get(url); + it('A non-logged user can download the shared file from the viewer - [C286326]', async () => { + await browser.get(file6SharedLink); expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); - expect(await viewer.getFileTitle()).toEqual(file3); - - await page.load(); - }); - - it('Expire date is displayed correctly - [C286653]', async () => { - await dataTable.selectItem(file4); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); + expect(await viewer.getFileTitle()).toEqual(file6); - const expireProperty = await apis.user.nodes.getSharedExpiryDate(file4Id); - expect(expireProperty).toEqual(expiryDate); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + await toolbar.clickDownload(); + expect(await Utils.fileExistsOnOS(file6)).toBe(true, 'File not found in download location'); }); + }) - it('Disable the share link expiration - [C286654]', async () => { - await dataTable.selectItem(file5); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); + describe('when logged in', () => { + const expiryDate: any = '2020-12-25T18:30:00.000+0000'; - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); - - await shareDialog.clickClose(); - expect(await apis.user.nodes.getSharedExpiryDate(file5Id)).toBe(undefined, `${file5} link still has expiration`); - }); - - it('Shared file URL is not changed when Share dialog is closed and opened again - [C286655]', async () => { - await dataTable.selectItem(file6); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url1 = await shareDialog.getLinkUrl(); - await shareDialog.clickClose(); - await shareDialog.waitForDialogToClose(); - - await page.dataTable.clearSelection(); - await dataTable.selectItem(file6); - await toolbar.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - const url2 = await shareDialog.getLinkUrl(); - - expect(url1).toEqual(url2); - }); - - it('Open Share dialog from context menu - [C286656]', async () => { - await dataTable.rightClickOnItem(file7); - await contextMenu.clickSharedLinkSettings(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file7}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - }); - }); - - describe('from Favorites', () => { - - const file1 = `file1-${Utils.random()}.txt`; let file1Id; - const file2 = `file2-${Utils.random()}.txt`; let file2Id; - const file3 = `file3-${Utils.random()}.txt`; let file3Id; - const file4 = `file4-${Utils.random()}.txt`; let file4Id; - const file5 = `file5-${Utils.random()}.txt`; let file5Id; - const file6 = `file6-${Utils.random()}.txt`; let file6Id; - const file7 = `file7-${Utils.random()}.txt`; let file7Id; - const file8 = `file8-${Utils.random()}.txt`; let file8Id; - const file9 = `file9-${Utils.random()}.txt`; let file9Id; + const loginPage = new LoginPage(); + const shareDialog = new ShareDialog(); + const contextMenu = dataTable.menu; + const { searchInput } = page.header; beforeAll(async (done) => { - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; - file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; - file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; - file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; - file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; - file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; - file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; - - await apis.user.favorites.addFavoriteById('file', file1Id); - await apis.user.favorites.addFavoriteById('file', file2Id); - await apis.user.favorites.addFavoriteById('file', file3Id); - await apis.user.favorites.addFavoriteById('file', file4Id); - await apis.user.favorites.addFavoriteById('file', file5Id); - await apis.user.favorites.addFavoriteById('file', file6Id); - await apis.user.favorites.addFavoriteById('file', file7Id); - await apis.user.favorites.addFavoriteById('file', file8Id); - await apis.user.favorites.addFavoriteById('file', file9Id); - - await apis.user.shared.shareFileById(file6Id, expiryDate); - await apis.user.shared.shareFileById(file7Id, expiryDate); - await apis.user.favorites.waitForApi({ expect: 9 }); - await apis.user.shared.waitForApi({ expect: 2 }); + await loginPage.loginWith(username); done(); }); - beforeEach(async (done) => { - await page.clickFavoritesAndWait(); - done(); + describe('from Personal Files', () => { + + beforeAll(async (done) => { + file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; + file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; + file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; + file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; + file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; + await apis.user.shared.shareFileById(file6Id, expiryDate); + await apis.user.shared.shareFileById(file7Id, expiryDate); + await apis.user.shared.waitForApi({ expect: 2 }); + done(); + }); + + beforeEach(async (done) => { + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(file1Id); + await apis.user.nodes.deleteNodeById(file2Id); + await apis.user.nodes.deleteNodeById(file3Id); + await apis.user.nodes.deleteNodeById(file4Id); + await apis.user.nodes.deleteNodeById(file5Id); + await apis.user.nodes.deleteNodeById(file6Id); + await apis.user.nodes.deleteNodeById(file7Id); + await apis.user.nodes.deleteNodeById(file8Id); + await apis.user.nodes.deleteNodeById(file9Id); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share dialog default values - [C286327]', async () => { + await dataTable.selectItem(file1); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); + + it('Close dialog - [C286328]', async () => { + await dataTable.selectItem(file2); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + await shareDialog.clickClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + }); + + it('Share a file - [C286329]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file3Id); + expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); + expect(url).toContain(sharedId); + }); + + it('Copy shared file URL - [C286330]', async () => { + await dataTable.selectItem(file4); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + expect(url).toContain(shareLinkPreUrl); + + await shareDialog.copyUrl(); + expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).toEqual(file4); + + await page.load(); + }); + + it('Share a file with expiration date - [C286332]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); + expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); + const date = await shareDialog.dateTimePicker.setDefaultDay(); + await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); + + const setDate = (`${date}`).replace(',', ''); + const inputDate = await shareDialog.getExpireDate(); + + expect(new Date(inputDate)).toEqual(new Date(setDate)); + + const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); + + expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); + }); + + it('Expire date is displayed correctly - [C286337]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C286333]', async () => { + await dataTable.selectItem(file7); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + }); + + it('Shared file URL is not changed when Share dialog is closed and opened again - [C286335]', async () => { + await dataTable.selectItem(file8); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url1 = await shareDialog.getLinkUrl(); + await shareDialog.clickClose(); + await shareDialog.waitForDialogToClose(); + + await page.dataTable.clearSelection(); + await dataTable.selectItem(file8); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url2 = await shareDialog.getLinkUrl(); + + expect(url1).toEqual(url2); + }); + + it('Share a file from the context menu - [C286345]', async () => { + await dataTable.rightClickOnItem(file9); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file9Id); + expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); + expect(url).toContain(sharedId); + }); }); - afterEach(async (done) => { - await Utils.pressEscape(); - done(); + describe('from File Libraries', () => { + + const siteName = `site-${Utils.random()}`; + const parentInSite = `parent-site-${Utils.random()}`; let parentInSiteId; + + beforeAll(async (done) => { + await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC); + const docLibId = await apis.user.sites.getDocLibId(siteName); + parentInSiteId = (await apis.user.nodes.createFolder(parentInSite, docLibId)).entry.id; + + await apis.user.nodes.createFile(file1, parentInSiteId); + await apis.user.nodes.createFile(file2, parentInSiteId); + file3Id = (await apis.user.nodes.createFile(file3, parentInSiteId)).entry.id; + await apis.user.nodes.createFile(file4, parentInSiteId); + file5Id = (await apis.user.nodes.createFile(file5, parentInSiteId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentInSiteId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentInSiteId)).entry.id; + await apis.user.nodes.createFile(file8, parentInSiteId); + file9Id = (await apis.user.nodes.createFile(file9, parentInSiteId)).entry.id; + await apis.user.shared.shareFileById(file6Id, expiryDate); + await apis.user.shared.shareFileById(file7Id, expiryDate); + await apis.user.shared.waitForApi({ expect: 2 }); + done(); + }); + + beforeEach(async (done) => { + await page.goToMyLibrariesAndWait(); + await dataTable.doubleClickOnRowByName(siteName); + await dataTable.waitForHeader(); + await dataTable.doubleClickOnRowByName(parentInSite); + await dataTable.waitForHeader(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + afterAll(async (done) => { + await apis.admin.sites.deleteSite(siteName); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share dialog default values - [C286639]', async () => { + await dataTable.selectItem(file1); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); + + it('Close dialog - [C286640]', async () => { + await dataTable.selectItem(file2); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + await shareDialog.clickClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + }); + + it('Share a file - [C286641]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file3Id); + expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); + expect(url).toContain(sharedId); + }); + + it('Copy shared file URL - [C286642]', async () => { + await dataTable.selectItem(file4); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + expect(url).toContain(shareLinkPreUrl); + + await shareDialog.copyUrl(); + expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).toEqual(file4); + + await page.load(); + }); + + it('Share a file with expiration date - [C286643]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); + expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); + const date = await shareDialog.dateTimePicker.setDefaultDay(); + await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); + + const setDate = (`${date}`).replace(',', ''); + const inputDate = await shareDialog.getExpireDate(); + + expect(new Date(inputDate)).toEqual(new Date(setDate)); + + const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); + + expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); + }); + + it('Expire date is displayed correctly - [C286644]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C286645]', async () => { + await dataTable.selectItem(file7); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + }); + + it('Shared file URL is not changed when Share dialog is closed and opened again - [C286646]', async () => { + await dataTable.selectItem(file8); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url1 = await shareDialog.getLinkUrl(); + await shareDialog.clickClose(); + await shareDialog.waitForDialogToClose(); + + await page.dataTable.clearSelection(); + await dataTable.selectItem(file8); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url2 = await shareDialog.getLinkUrl(); + + expect(url1).toEqual(url2); + }); + + it('Share a file from the context menu - [C286647]', async () => { + await dataTable.rightClickOnItem(file9); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file9Id); + expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); + expect(url).toContain(sharedId); + }); }); - afterAll(async (done) => { - await apis.user.nodes.deleteNodeById(file1Id); - await apis.user.nodes.deleteNodeById(file2Id); - await apis.user.nodes.deleteNodeById(file3Id); - await apis.user.nodes.deleteNodeById(file4Id); - await apis.user.nodes.deleteNodeById(file5Id); - await apis.user.nodes.deleteNodeById(file6Id); - await apis.user.nodes.deleteNodeById(file7Id); - await apis.user.nodes.deleteNodeById(file8Id); - await apis.user.nodes.deleteNodeById(file9Id); - await apis.user.shared.waitForApi({ expect: 0 }); - done(); + describe('from Recent Files', () => { + + beforeAll(async (done) => { + file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; + file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; + file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; + file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; + file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; + await apis.user.shared.shareFileById(file6Id, expiryDate); + await apis.user.shared.shareFileById(file7Id, expiryDate); + await apis.user.shared.waitForApi({ expect: 2 }); + done(); + }); + + beforeEach(async (done) => { + await page.clickRecentFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(file1Id); + await apis.user.nodes.deleteNodeById(file2Id); + await apis.user.nodes.deleteNodeById(file3Id); + await apis.user.nodes.deleteNodeById(file4Id); + await apis.user.nodes.deleteNodeById(file5Id); + await apis.user.nodes.deleteNodeById(file6Id); + await apis.user.nodes.deleteNodeById(file7Id); + await apis.user.nodes.deleteNodeById(file8Id); + await apis.user.nodes.deleteNodeById(file9Id); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share dialog default values - [C286657]', async () => { + await dataTable.selectItem(file1); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); + + it('Close dialog - [C286658]', async () => { + await dataTable.selectItem(file2); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + await shareDialog.clickClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + }); + + it('Share a file - [C286659]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file3Id); + expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); + expect(url).toContain(sharedId); + }); + + it('Copy shared file URL - [C286660]', async () => { + await dataTable.selectItem(file4); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + expect(url).toContain(shareLinkPreUrl); + + await shareDialog.copyUrl(); + expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).toEqual(file4); + + await page.load(); + }); + + it('Share a file with expiration date - [C286661]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); + expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); + const date = await shareDialog.dateTimePicker.setDefaultDay(); + await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); + + const setDate = (`${date}`).replace(',', ''); + const inputDate = await shareDialog.getExpireDate(); + + expect(new Date(inputDate)).toEqual(new Date(setDate)); + + const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); + + expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); + }); + + it('Expire date is displayed correctly - [C286662]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C286663]', async () => { + await dataTable.selectItem(file7); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + }); + + it('Shared file URL is not changed when Share dialog is closed and opened again - [C286664]', async () => { + await dataTable.selectItem(file8); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url1 = await shareDialog.getLinkUrl(); + await shareDialog.clickClose(); + await shareDialog.waitForDialogToClose(); + + await page.dataTable.clearSelection(); + await dataTable.selectItem(file8); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url2 = await shareDialog.getLinkUrl(); + + expect(url1).toEqual(url2); + }); + + it('Share a file from the context menu - [C286665]', async () => { + await dataTable.rightClickOnItem(file9); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file9Id); + expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); + expect(url).toContain(sharedId); + }); }); - it('Share dialog default values - [C286666]', async () => { - await dataTable.selectItem(file1); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); - expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); - expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); - expect(await shareDialog.getLinkUrl()).toContain('/preview/s/'); - expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); - expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); - expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + describe('from Shared Files', () => { + + beforeAll(async (done) => { + file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; + file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; + file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; + + await apis.user.shared.shareFileById(file1Id); + await apis.user.shared.shareFileById(file2Id); + await apis.user.shared.shareFileById(file3Id); + await apis.user.shared.shareFileById(file4Id, expiryDate); + await apis.user.shared.shareFileById(file5Id, expiryDate); + await apis.user.shared.shareFileById(file6Id); + await apis.user.shared.shareFileById(file7Id); + await apis.user.shared.waitForApi({ expect: 7 }); + done(); + }); + + beforeEach(async (done) => { + await page.clickSharedFilesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(file1Id); + await apis.user.nodes.deleteNodeById(file2Id); + await apis.user.nodes.deleteNodeById(file3Id); + await apis.user.nodes.deleteNodeById(file4Id); + await apis.user.nodes.deleteNodeById(file5Id); + await apis.user.nodes.deleteNodeById(file6Id); + await apis.user.nodes.deleteNodeById(file7Id); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share dialog default values - [C286648]', async () => { + await dataTable.selectItem(file1); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); + + it('Close dialog - [C286649]', async () => { + await dataTable.selectItem(file2); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + await shareDialog.clickClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + }); + + it('Copy shared file URL - [C286651]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + expect(url).toContain(shareLinkPreUrl); + + await shareDialog.copyUrl(); + expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).toEqual(file3); + + await page.load(); + }); + + it('Expire date is displayed correctly - [C286653]', async () => { + await dataTable.selectItem(file4); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file4Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C286654]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file5Id)).toBe(undefined, `${file5} link still has expiration`); + }); + + it('Shared file URL is not changed when Share dialog is closed and opened again - [C286655]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url1 = await shareDialog.getLinkUrl(); + await shareDialog.clickClose(); + await shareDialog.waitForDialogToClose(); + + await page.dataTable.clearSelection(); + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url2 = await shareDialog.getLinkUrl(); + + expect(url1).toEqual(url2); + }); + + it('Open Share dialog from context menu - [C286656]', async () => { + await dataTable.rightClickOnItem(file7); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file7}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); }); - it('Close dialog - [C286667]', async () => { - await dataTable.selectItem(file2); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); - await shareDialog.clickClose(); - expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + describe('from Favorites', () => { + + beforeAll(async (done) => { + file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; + file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; + file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; + file8Id = (await apis.user.nodes.createFile(file8, parentId)).entry.id; + file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; + + await apis.user.favorites.addFavoriteById('file', file1Id); + await apis.user.favorites.addFavoriteById('file', file2Id); + await apis.user.favorites.addFavoriteById('file', file3Id); + await apis.user.favorites.addFavoriteById('file', file4Id); + await apis.user.favorites.addFavoriteById('file', file5Id); + await apis.user.favorites.addFavoriteById('file', file6Id); + await apis.user.favorites.addFavoriteById('file', file7Id); + await apis.user.favorites.addFavoriteById('file', file8Id); + await apis.user.favorites.addFavoriteById('file', file9Id); + + await apis.user.shared.shareFileById(file6Id, expiryDate); + await apis.user.shared.shareFileById(file7Id, expiryDate); + await apis.user.favorites.waitForApi({ expect: 9 }); + await apis.user.shared.waitForApi({ expect: 2 }); + done(); + }); + + beforeEach(async (done) => { + await page.clickFavoritesAndWait(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(file1Id); + await apis.user.nodes.deleteNodeById(file2Id); + await apis.user.nodes.deleteNodeById(file3Id); + await apis.user.nodes.deleteNodeById(file4Id); + await apis.user.nodes.deleteNodeById(file5Id); + await apis.user.nodes.deleteNodeById(file6Id); + await apis.user.nodes.deleteNodeById(file7Id); + await apis.user.nodes.deleteNodeById(file8Id); + await apis.user.nodes.deleteNodeById(file9Id); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share dialog default values - [C286666]', async () => { + await dataTable.selectItem(file1); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.getTitle()).toEqual(`Share ${file1}`); + expect(await shareDialog.getInfoText()).toEqual('Click the link below to copy it to the clipboard.'); + expect(await shareDialog.getLabels().get(0).getText()).toEqual('Link to share'); + expect(await shareDialog.getLinkUrl()).toContain(shareLinkPreUrl); + expect(await shareDialog.isUrlReadOnly()).toBe('true', 'url is not readonly'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + expect(await shareDialog.getLabels().get(1).getText()).toEqual('Expires on'); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expire toggle is checked'); + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + }); + + it('Close dialog - [C286667]', async () => { + await dataTable.selectItem(file2); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isCloseEnabled()).toBe(true, 'Close button is not enabled'); + await shareDialog.clickClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog is open'); + }); + + it('Share a file - [C286668]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file3Id); + expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); + expect(url).toContain(sharedId); + }); + + it('Copy shared file URL - [C286669]', async () => { + await dataTable.selectItem(file4); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + expect(url).toContain(shareLinkPreUrl); + + await shareDialog.copyUrl(); + expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).toEqual(file4); + + await page.load(); + }); + + it('Share a file with expiration date - [C286670]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); + expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); + const date = await shareDialog.dateTimePicker.setDefaultDay(); + await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); + + const setDate = (`${date}`).replace(',', ''); + const inputDate = await shareDialog.getExpireDate(); + + expect(new Date(inputDate)).toEqual(new Date(setDate)); + + const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); + + expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); + }); + + it('Expire date is displayed correctly - [C286671]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C286672]', async () => { + await dataTable.selectItem(file7); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + }); + + it('Shared file URL is not changed when Share dialog is closed and opened again - [C286673]', async () => { + await dataTable.selectItem(file8); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url1 = await shareDialog.getLinkUrl(); + await shareDialog.clickClose(); + await shareDialog.waitForDialogToClose(); + + await page.dataTable.clearSelection(); + await dataTable.selectItem(file8); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + const url2 = await shareDialog.getLinkUrl(); + + expect(url1).toEqual(url2); + }); + + it('Share a file from the context menu - [C286674]', async () => { + await dataTable.rightClickOnItem(file9); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file9Id); + expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); + expect(url).toContain(sharedId); + }); }); - it('Share a file - [C286668]', async () => { - await dataTable.selectItem(file3); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file3Id); - expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file3)).toBe(true, `${file3} is not in the Shared files list`); - }); - - it('Copy shared file URL - [C286669]', async () => { - await dataTable.selectItem(file4); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url = await shareDialog.getLinkUrl(); - expect(url).toContain('/preview/s/'); - - await shareDialog.copyUrl(); - expect(await page.getSnackBarMessage()).toBe('Link copied to the clipboard'); - - await browser.get(url); - expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); - expect(await viewer.getFileTitle()).toEqual(file4); - - await page.load(); - }); - - it('Share a file with expiration date - [C286670]', async () => { - await dataTable.selectItem(file5); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); - expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); - const date = await shareDialog.dateTimePicker.setDefaultDay(); - await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); - - const setDate = (`${date}`).replace(',', ''); - const inputDate = await shareDialog.getExpireDate(); - - expect(new Date(inputDate)).toEqual(new Date(setDate)); - - const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); - - expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); - }); - - it('Expire date is displayed correctly - [C286671]', async () => { - await dataTable.selectItem(file6); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); - expect(expireProperty).toEqual(expiryDate); - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); - }); - - it('Disable the share link expiration - [C286672]', async () => { - await dataTable.selectItem(file7); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - - expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); - expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); - - await shareDialog.clickExpirationToggle(); - expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); - expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); - - await shareDialog.clickClose(); - expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + describe('from Search Results', () => { + + file3 = `search-file3-${Utils.random()}.txt`; + file5 = `search-file5-${Utils.random()}.txt`; + file6 = `search-file6-${Utils.random()}.txt`; + file7 = `search-file7-${Utils.random()}.txt`; + file9 = `search-file9-${Utils.random()}.txt`; + + beforeAll(async (done) => { + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file5Id = (await apis.user.nodes.createFile(file5, parentId)).entry.id; + file6Id = (await apis.user.nodes.createFile(file6, parentId)).entry.id; + file7Id = (await apis.user.nodes.createFile(file7, parentId)).entry.id; + file9Id = (await apis.user.nodes.createFile(file9, parentId)).entry.id; + await apis.user.shared.shareFileById(file6Id, expiryDate); + await apis.user.shared.shareFileById(file7Id, expiryDate); + await apis.user.shared.waitForApi({ expect: 2 }); + await apis.user.search.waitForNodes('search-f', { expect: 5 }); + done(); + }); + + beforeEach(async done => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('search-f'); + await dataTable.waitForBody(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(file3Id); + await apis.user.nodes.deleteNodeById(file5Id); + await apis.user.nodes.deleteNodeById(file6Id); + await apis.user.nodes.deleteNodeById(file7Id); + await apis.user.nodes.deleteNodeById(file9Id); + await apis.user.shared.waitForApi({ expect: 0 }); + done(); + }); + + it('Share a file - [C306975]', async () => { + await dataTable.selectItem(file3); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file3Id); + expect(await apis.user.nodes.isFileShared(file3Id)).toBe(true, `${file3} is not shared`); + expect(url).toContain(sharedId); + }); + + it('Share a file with expiration date - [C306977]', async () => { + await dataTable.selectItem(file5); + await toolbar.clickShare(); + await shareDialog.waitForDialogToOpen(); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expire toggle not checked'); + expect(await shareDialog.dateTimePicker.isCalendarOpen()).toBe(true, 'Calendar not opened'); + const date = await shareDialog.dateTimePicker.setDefaultDay(); + await shareDialog.dateTimePicker.waitForDateTimePickerToClose(); + + const setDate = (`${date}`).replace(',', ''); + const inputDate = await shareDialog.getExpireDate(); + + expect(new Date(inputDate)).toEqual(new Date(setDate)); + + const expireDateProperty = await apis.user.nodes.getSharedExpiryDate(file5Id); + + expect(Utils.formatDate(expireDateProperty)).toEqual(Utils.formatDate(inputDate)); + }); + + it('Expire date is displayed correctly - [C306978]', async () => { + await dataTable.selectItem(file6); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); + expect(expireProperty).toEqual(expiryDate); + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(Utils.formatDate(await shareDialog.getExpireDate())).toEqual(Utils.formatDate(expiryDate)); + }); + + it('Disable the share link expiration - [C306979]', async () => { + await dataTable.selectItem(file7); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); + expect(await shareDialog.getExpireDate()).not.toBe('', 'Expire date input is empty'); + + await shareDialog.clickExpirationToggle(); + expect(await shareDialog.isExpireToggleEnabled()).toBe(false, 'Expiration is checked'); + expect(await shareDialog.getExpireDate()).toBe('', 'Expire date input is not empty'); + + await shareDialog.clickClose(); + expect(await apis.user.nodes.getSharedExpiryDate(file7Id)).toBe(undefined, `${file7} link still has expiration`); + }); + + it('Share a file from the context menu - [C306981]', async () => { + await dataTable.rightClickOnItem(file9); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickShare(); + await shareDialog.waitForDialogToOpen(); + + const url = await shareDialog.getLinkUrl(); + await Utils.pressEscape(); + const sharedId = await apis.user.nodes.getSharedId(file9Id); + expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); + expect(url).toContain(sharedId); + }); }); - - it('Shared file URL is not changed when Share dialog is closed and opened again - [C286673]', async () => { - await dataTable.selectItem(file8); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url1 = await shareDialog.getLinkUrl(); - await shareDialog.clickClose(); - await shareDialog.waitForDialogToClose(); - - await page.dataTable.clearSelection(); - await dataTable.selectItem(file8); - await toolbar.clickShare(); - await shareDialog.waitForDialogToOpen(); - const url2 = await shareDialog.getLinkUrl(); - - expect(url1).toEqual(url2); - }); - - it('Share a file from the context menu - [C286674]', async () => { - await dataTable.rightClickOnItem(file9); - await contextMenu.clickShare(); - await shareDialog.waitForDialogToOpen(); - - const url = await shareDialog.getLinkUrl(); - await Utils.pressEscape(); - const sharedId = await apis.user.nodes.getSharedId(file9Id); - expect(await apis.user.nodes.isFileShared(file9Id)).toBe(true, `${file9} is not shared`); - expect(url).toContain(sharedId); - - // TODO: disable check cause api is slow to update - // await page.clickSharedFiles(); - // expect(await dataTable.isItemPresent(file9)).toBe(true, `${file9} is not in the Shared files list`); - }); - }); - + }) }); diff --git a/e2e/suites/actions/special-permissions-available-actions.test.ts b/e2e/suites/actions/special-permissions-available-actions.test.ts deleted file mode 100755 index 06a76ed684..0000000000 --- a/e2e/suites/actions/special-permissions-available-actions.test.ts +++ /dev/null @@ -1,1888 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages'; -import { SITE_VISIBILITY, SITE_ROLES, FILES } from '../../configs'; -import { RepoClient } from '../../utilities/repo-client/repo-client'; -import { Utils } from '../../utilities/utils'; -import { Viewer } from '../../components/viewer/viewer'; - -describe('Special permissions available actions : ', () => { - const userConsumer = `consumer-${Utils.random()}`; - const userManager = `manager-${Utils.random()}`; - const userCollaborator = `collaborator-${Utils.random()}`; - const userDemoted = `demoted-${Utils.random()}`; - - const siteName = `site-private-${Utils.random()}`; - const file1 = `my-file1-${Utils.random()}.txt`; - let file1Id; - const file2 = `my-file2-${Utils.random()}.txt`; - let file2Id; - const file3 = `my-file3-${Utils.random()}.txt`; - let file3Id; - const fileLocked = `my-file-locked-${Utils.random()}.txt`; - let fileLockedId; - - const folder1 = `my-folder1-${Utils.random()}`; - let folder1Id; - const folder2 = `my-folder2-${Utils.random()}`; - let folder2Id; - - const docxFile = FILES.docxFile; - let docxFileId; - - const apis = { - admin: new RepoClient(), - userConsumer: new RepoClient(userConsumer, userConsumer), - userCollaborator: new RepoClient(userCollaborator, userCollaborator), - userDemoted: new RepoClient(userDemoted, userDemoted) - }; - - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable, toolbar } = page; - const contextMenu = dataTable.menu; - const viewer = new Viewer(); - const viewerToolbar = viewer.toolbar; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; - - beforeAll(async (done) => { - await apis.admin.people.createUser({ username: userConsumer }); - await apis.admin.people.createUser({ username: userManager }); - await apis.admin.people.createUser({ username: userCollaborator }); - await apis.admin.people.createUser({ username: userDemoted }); - - await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE); - const docLibId = await apis.admin.sites.getDocLibId(siteName); - - file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id; - file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id; - file3Id = (await apis.admin.nodes.createFile(file3, docLibId)).entry.id; - folder1Id = (await apis.admin.nodes.createFolder(folder1, docLibId)).entry.id; - folder2Id = (await apis.admin.nodes.createFolder(folder2, docLibId)).entry.id; - - docxFileId = (await apis.admin.upload.uploadFile(docxFile, docLibId)).entry.id; - - await apis.admin.sites.addSiteMember(siteName, userManager, SITE_ROLES.SITE_MANAGER.ROLE); - await apis.admin.sites.addSiteMember(siteName, userConsumer, SITE_ROLES.SITE_CONSUMER.ROLE); - await apis.admin.sites.addSiteMember(siteName, userCollaborator, SITE_ROLES.SITE_COLLABORATOR.ROLE); - await apis.admin.sites.addSiteMember(siteName, userDemoted, SITE_ROLES.SITE_MANAGER.ROLE); - - fileLockedId = (await apis.admin.nodes.createFile(fileLocked, docLibId)).entry.id; - await apis.userDemoted.nodes.lockFile(fileLockedId); - await apis.userDemoted.favorites.addFavoriteById('file', fileLockedId); - await apis.userDemoted.shared.shareFileById(fileLockedId); - await apis.admin.sites.updateSiteMember(siteName, userDemoted, SITE_ROLES.SITE_CONSUMER.ROLE); - - await apis.admin.nodes.setGranularPermission(file3Id, false, userConsumer, SITE_ROLES.SITE_MANAGER.ROLE); - - await apis.userConsumer.shared.shareFileById(file1Id); - await apis.userConsumer.shared.shareFileById(file2Id); - await apis.userConsumer.shared.shareFileById(docxFileId); - await apis.userConsumer.shared.shareFileById(file3Id); - await apis.userConsumer.shared.waitForApi({ expect: 5 }); - - await apis.userConsumer.favorites.addFavoritesByIds('file', [file1Id, file2Id, file3Id, docxFileId]); - await apis.userConsumer.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]); - await apis.userConsumer.favorites.waitForApi({ expect: 6 }); - - await apis.userCollaborator.favorites.addFavoritesByIds('file', [file1Id, docxFileId]); - await apis.userCollaborator.favorites.waitForApi({ expect: 2 }); - - await apis.admin.favorites.addFavoriteById('file', fileLockedId); - - done(); - }); - - afterAll(async (done) => { - await apis.admin.sites.deleteSite(siteName); - done(); - }); - - describe('Consumer', () => { - beforeAll(async (done) => { - await loginPage.loginWith(userConsumer); - done(); - }); - - describe('toolbar displays correct actions when selecting multiple files with different granular permissions', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280476]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for selected files`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for selected files`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for selected files`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for selected files`); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C280477]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for selected files`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for selected files`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for selected files`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for selected files`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C280478]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for selected files`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for selected files`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for selected files`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for selected files`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291823]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-file'); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for selected files`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for selected files`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for selected files`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for selected files`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('toolbar actions appear correctly for a file', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280455]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${file1}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${file1}`); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C280456]', async () => { - await page.clickSharedFilesAndWait(); - await page.dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${file1}`); - // TODO: change expect to false when ACA-2173 is done - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is displayed for ${file1}`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C213121]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is displayed for ${file1}`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291818]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(file1); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${file1}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${file1}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('toolbar actions appear correctly for a folder', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280444]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectItem(folder1); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folder1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${folder1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${folder1}`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${folder1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${folder1}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folder1}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C286266]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(folder1); - - expect(await toolbar.isViewPresent()).toBe(false, `View is not displayed for ${folder1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${folder1}`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is displayed for ${folder1}`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${folder1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${folder1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folder1}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291819]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions(folder1); - await dataTable.selectItem(folder1); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folder1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${folder1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${folder1}`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${folder1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${folder1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folder1}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('toolbar actions appear correctly for multiple selection of files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280464]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C286284]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C286285]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for selected files`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for selected files`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for selected files`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for selected files`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291824]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-file'); - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('toolbar actions appear correctly for multiple selection of folders', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280465]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C286286]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291825]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-folder'); - await dataTable.selectMultipleItems([folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('toolbar actions appear correctly for when both files and folders are selected', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280466]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([file1, folder1]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C286287]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([file1, folder1]); - - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed`); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C291826]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-f'); - await dataTable.selectMultipleItems([file1, folder1]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - expect(await toolbar.isSharePresent()).toBe(false, `Share is displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('context menu actions are correct for a file', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280599]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.rightClickOnItem(file1); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${file1}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${file1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${file1}`); - expect(await contextMenu.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - }); - - it('on Shared Files - [C286264]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.rightClickOnItem(file1); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await contextMenu.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed for ${file1}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${file1}`); - // TODO: change expect to false when ACA-2173 is done - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is displayed for ${file1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${file1}`); - }); - - it('on Favorites - [C286262]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.rightClickOnItem(file1); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isMovePresent()).toBe(true, `Move is displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is displayed for ${file1}`); - // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isUploadNewVersionPresent()).toBe(true, `Upload new version is displayed for ${file1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${file1}`); - }); - - it('on Search Results - [C291829]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(file1); - await dataTable.rightClickOnItem(file1); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await contextMenu.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await contextMenu.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(true, `Manage Versions is not displayed for ${file1}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${file1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await contextMenu.isViewDetailsPresent()).toBe(false, `View details is displayed for ${file1}`); - }); - }); - - describe('context menu actions are correct for a folder', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280600]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.rightClickOnItem(folder1); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${folder1}`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${folder1}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folder1}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folder1}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folder1}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folder1}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - }); - - it('on Favorites - [C286263]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.rightClickOnItem(folder1); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isEditFolderPresent()).toBe(true, `Edit folder is displayed for ${folder1}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isMovePresent()).toBe(true, `Move is displayed for ${folder1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is displayed for ${folder1}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folder1}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folder1}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folder1}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - }); - - it('on Search Results - [C291830]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions(folder1); - await dataTable.rightClickOnItem(folder1); - - expect(await contextMenu.isDownloadPresent()).toBe(true, `Download is not displayed for ${folder1}`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${folder1}`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folder1}`); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folder1}`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed for ${folder1}`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed for ${folder1}`); - expect(await contextMenu.isViewPresent()).toBe(false, `View is displayed for ${folder1}`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed for ${folder1}`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folder1}`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed for ${folder1}`); - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folder1}`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folder1}`); - }); - }); - - describe('context menu actions are correct for multiple selection of files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280647]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([file1, file2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Shared Files - [C286283]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Favorites - [C286280]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([file1, file2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isMovePresent()).toBe(true, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Search Results - [C291834]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-file'); - await dataTable.selectMultipleItems([file1, file2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - }); - - describe('context menu actions are correct for multiple selection of folders', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280666]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([folder1, folder2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Favorites - [C286281]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([folder1, folder2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isMovePresent()).toBe(true, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Search Results - [C291835]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-folder'); - await dataTable.selectMultipleItems([folder1, folder2]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isEditFolderPresent()).toBe(false, `Edit folder is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - }); - - describe('context menu actions are correct when both files and folders are selected', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('on File Libraries - [C280669]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectMultipleItems([file1, folder1]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Favorites - [C286282]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectMultipleItems([file1, folder1]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isDeletePresent()).toBe(true, `Delete is displayed`); - // TODO: change expect to false when ACA-1737 is done - expect(await contextMenu.isMovePresent()).toBe(true, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - - it('on Search Results - [C291836]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-f'); - await dataTable.selectMultipleItems([file1, folder1]); - await dataTable.rightClickOnMultipleSelection(); - - expect(await contextMenu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await contextMenu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await contextMenu.isViewPresent()).toBe(false, 'View is displayed'); - expect(await contextMenu.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await contextMenu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await contextMenu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await contextMenu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await contextMenu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await contextMenu.isManageVersionsPresent()).toBe(false, `Manage Versions is displayed`); - expect(await contextMenu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - expect(await contextMenu.isSharePresent()).toBe(false, `Share is displayed`); - }); - }); - - describe('toolbar actions appear correctly in the viewer', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('file from File Libraries - [C268128]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('file from Shared Files - [C286310]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('file from Favorites - [C286311]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - }); - - describe('Collaborator', () => { - beforeAll(async (done) => { - await loginPage.loginWith(userCollaborator); - done(); - }); - - it('on File Libraries - [C297647]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C297651]', async () => { - await page.clickSharedFilesAndWait(); - await page.dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - // TODO: change expect to true when ACA-2173 is done - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C297652]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - - await toolbar.openMoreMenu(); - - // TODO: change expect to true when ACA-2174 is done - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is not displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${file1}`); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C297653]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(file1); - await dataTable.selectItem(file1); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${file1}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${file1}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${file1}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${file1}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${file1}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${file1}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${file1}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${file1}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${file1}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${file1}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - describe('in the viewer', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('file opened from File Libraries - [C297654]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Shared Files - [C297655]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Favorites - [C297656]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.doubleClickOnRowByName(docxFile); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove Favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - }); - }); - - describe('File locked - lock owner : ', () => { - beforeAll(async (done) => { - await loginPage.loginWith(userDemoted); - done(); - }); - - it('on File Libraries - [C297657]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C297658]', async () => { - await page.clickSharedFilesAndWait(); - await page.dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2173 is done - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C297659]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2174 is fixed - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - // TODO: change expect to false when ACA-1737 is fixed - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is displayed for ${fileLocked}`); - // TODO: change expect to false when ACA-1737 is fixed - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C297660]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileLocked); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is not displayed'); - - await toolbar.closeMoreMenu(); - }); - - describe('in the viewer', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('file opened from File Libraries - [C297661]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Shared Files - [C297662]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Favorites - [C297663]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(false, `Move is displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - }); - }); - - describe('File locked - manager : ', () => { - beforeAll(async (done) => { - await loginPage.loginWithAdmin(); - done(); - }); - - it('on File Libraries - [C297664]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Shared Files - [C297665]', async () => { - await page.clickSharedFilesAndWait(); - await page.dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2173 is done - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - // TODO: change expect to false when ACA-2173 is done - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Favorites - [C297666]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - // TODO: replace with isSharedLinkSettingsPresent when ACA-2175 is done - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2174 is fixed - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - // TODO: change expect to false when ACA-1737 is done - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, 'Upload new version is displayed'); - - await toolbar.closeMoreMenu(); - }); - - it('on Search Results - [C297667]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileLocked); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked} in Search Results`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked} in Search Results`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, 'Manage versions is not displayed'); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, 'Upload new version is displayed'); - - await toolbar.closeMoreMenu(); - }); - - describe('in the viewer', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFiles(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('file opened from File Libraries - [C297671]', async () => { - await page.clickFileLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Shared Files - [C297672]', async () => { - await page.clickSharedFilesAndWait(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - - it('file opened from Favorites - [C297673]', async () => { - await page.clickFavoritesAndWait(); - await dataTable.doubleClickOnRowByName(fileLocked); - await viewer.waitForViewerToOpen(); - - expect(await viewerToolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await viewerToolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await viewerToolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await viewerToolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await viewerToolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await viewerToolbar.isSharedLinkSettingsPresent()).toBe(true, 'Shared link settings is not displayed'); - expect(await viewerToolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed`); - - await viewerToolbar.openMoreMenu(); - - expect(await viewerToolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await viewerToolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await viewerToolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await viewerToolbar.menu.isSharePresent()).toBe(false, `Share is displayed in More actions`); - expect(await viewerToolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await viewerToolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await viewerToolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await viewerToolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await viewerToolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await viewerToolbar.closeMoreMenu(); - }); - }); - }); -}); diff --git a/e2e/suites/actions/toolbar-multiple-selection.test.ts b/e2e/suites/actions/toolbar-multiple-selection.test.ts deleted file mode 100755 index 3ba1aaae09..0000000000 --- a/e2e/suites/actions/toolbar-multiple-selection.test.ts +++ /dev/null @@ -1,703 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { browser, protractor } from 'protractor'; -import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages'; -import { SITE_VISIBILITY } from '../../configs'; -import { RepoClient } from '../../utilities/repo-client/repo-client'; -import { Utils } from '../../utilities/utils'; - -describe('Toolbar actions - multiple selection : ', () => { - const username = `user-${Utils.random()}`; - - const parent = `parent-${Utils.random()}`; let parentId; - - const file1 = `my-file1-${Utils.random()}.txt`; let file1Id; - const file2 = `my-file2-${Utils.random()}.txt`; let file2Id; - - const folder1 = `my-folder1-${Utils.random()}`; let folder1Id; - const folder2 = `my-folder2-${Utils.random()}`; let folder2Id; - - const fileForDelete1 = `file-${Utils.random()}.txt`; let fileForDelete1Id; - const fileForDelete2 = `file-${Utils.random()}.txt`; let fileForDelete2Id; - const folderForDelete1 = `folder-${Utils.random()}`; let folderForDelete1Id; - const folderForDelete2 = `folder-${Utils.random()}`; let folderForDelete2Id; - - const siteName = `site-${Utils.random()}`; - const file1InSite = `my-fileInSite1-${Utils.random()}.txt`; - const file2InSite = `my-fileInSite2-${Utils.random()}.txt`; - const folder1InSite = `my-folderInSite1-${Utils.random()}`; - const folder2InSite = `my-folderInSite2-${Utils.random()}`; - const fileLocked1InSite = `my-fileLockedInSite1-${Utils.random()}.txt`; let fileLocked1InSiteId; - const fileLocked2InSite = `my-fileLockedInSite2-${Utils.random()}.txt`; let fileLocked2InSiteId; - - const fileLocked1 = `my-fileLocked1-${Utils.random()}.txt`; let fileLocked1Id; - const fileLocked2 = `my-fileLocked2-${Utils.random()}.txt`; let fileLocked2Id; - - const apis = { - admin: new RepoClient(), - user: new RepoClient(username, username) - }; - - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable, toolbar } = page; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; - - beforeAll(async (done) => { - await apis.admin.people.createUser({ username }); - - parentId = (await apis.user.nodes.createFolder(parent)).entry.id; - - file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; - file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; - folder1Id = (await apis.user.nodes.createFolder(folder1, parentId)).entry.id; - folder2Id = (await apis.user.nodes.createFolder(folder2, parentId)).entry.id; - fileForDelete1Id = (await apis.user.nodes.createFile(fileForDelete1, parentId)).entry.id; - fileForDelete2Id = (await apis.user.nodes.createFile(fileForDelete2, parentId)).entry.id; - folderForDelete1Id = (await apis.user.nodes.createFolder(folderForDelete1, parentId)).entry.id; - folderForDelete2Id = (await apis.user.nodes.createFolder(folderForDelete2, parentId)).entry.id; - fileLocked1Id = (await apis.user.nodes.createFile(fileLocked1, parentId)).entry.id; - fileLocked2Id = (await apis.user.nodes.createFile(fileLocked2, parentId)).entry.id; - await apis.user.nodes.lockFile(fileLocked1Id); - await apis.user.nodes.lockFile(fileLocked2Id); - - await apis.user.shared.shareFilesByIds([file1Id, file2Id, fileLocked1Id, fileLocked2Id]); - await apis.user.shared.waitForApi({ expect: 4 }); - - await apis.user.favorites.addFavoritesByIds('file', [file1Id, file2Id, fileLocked1Id, fileLocked2Id]); - await apis.user.favorites.addFavoritesByIds('folder', [folder1Id, folder2Id]); - await apis.user.favorites.waitForApi({ expect: 6 }); - - await apis.user.nodes.deleteNodesById([fileForDelete1Id, fileForDelete2Id, folderForDelete1Id, folderForDelete2Id], false); - await apis.user.trashcan.waitForApi({ expect: 4 }); - - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE); - const docLibId = await apis.user.sites.getDocLibId(siteName); - await apis.user.nodes.createFile(file1InSite, docLibId); - await apis.user.nodes.createFile(file2InSite, docLibId); - await apis.user.nodes.createFolder(folder1InSite, docLibId); - await apis.user.nodes.createFolder(folder2InSite, docLibId); - fileLocked1InSiteId = (await apis.user.nodes.createFile(fileLocked1InSite, docLibId)).entry.id; - fileLocked2InSiteId = (await apis.user.nodes.createFile(fileLocked2InSite, docLibId)).entry.id; - - await apis.user.nodes.lockFile(fileLocked1InSiteId); - await apis.user.nodes.lockFile(fileLocked2InSiteId); - - await apis.user.search.waitForApi(username, { expect: 6 }); - - await loginPage.loginWith(username); - done(); - }); - - afterAll(async (done) => { - await Promise.all([ - apis.user.nodes.deleteNodeById(parentId), - apis.user.trashcan.emptyTrash(), - apis.user.sites.deleteSite(siteName) - ]); - done(); - }); - - describe('on Personal Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFilesAndWait(); - await dataTable.doubleClickOnRowByName(parent); - await dataTable.waitForBody(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('Unselect items with single click - [C280458]', async () => { - await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); - - expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'); - - await dataTable.selectItem(file1); - - expect(await dataTable.countSelectedRows()).toEqual(1, 'incorrect selected rows number'); - }); - - it('Select / unselect selected items by CMD+click - [C217110]', async () => { - await browser.actions().sendKeys(protractor.Key.COMMAND).perform(); - await dataTable.selectItem(file1); - await dataTable.selectItem(file2); - await dataTable.selectItem(folder1); - await dataTable.selectItem(folder2); - await browser.actions().sendKeys(protractor.Key.NULL).perform(); - - expect(await dataTable.countSelectedRows()).toEqual(4, 'incorrect selected rows number'); - - await browser.actions().sendKeys(protractor.Key.COMMAND).perform(); - await dataTable.selectItem(file1); - await dataTable.selectItem(file2); - await browser.actions().sendKeys(protractor.Key.NULL).perform(); - - expect(await dataTable.countSelectedRows()).toEqual(2, 'incorrect selected rows number'); - }); - - it('correct actions appear when multiple files are selected - [C217112]', async () => { - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297619]', async () => { - await dataTable.selectMultipleItems([fileLocked1, fileLocked2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple folders are selected - [C280459]', async () => { - await dataTable.selectMultipleItems([folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when both files and folders are selected - [C280460]', async () => { - await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on File Libraries', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280461]', async () => { - await dataTable.selectMultipleItems([file1InSite, file2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed for selected files'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297620]', async () => { - await dataTable.selectMultipleItems([fileLocked1InSite, fileLocked2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed for selected files'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple folders are selected - [C280462]', async () => { - await dataTable.selectMultipleItems([folder1InSite, folder2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when both files and folders are selected - [C280463]', async () => { - await dataTable.selectMultipleItems([file1InSite, file2InSite, folder1InSite, folder2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Shared Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickSharedFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280467]', async () => { - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297623]', async () => { - await dataTable.selectMultipleItems([fileLocked1, fileLocked2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Recent Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickRecentFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280468]', async () => { - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297624]', async () => { - await dataTable.selectMultipleItems([fileLocked1, fileLocked2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Favorites', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickFavoritesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280469]', async () => { - await dataTable.selectMultipleItems([file1, file2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297625]', async () => { - await dataTable.selectMultipleItems([fileLocked1, fileLocked2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple folders are selected - [C280470]', async () => { - await dataTable.selectMultipleItems([folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when both files and folders are selected - [C280471]', async () => { - await dataTable.selectMultipleItems([file1, file2, folder1, folder2]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for selected files`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Trash', () => { - beforeEach(async (done) => { - await page.clickTrashAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C280472]', async () => { - await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2]); - - expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); - expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); - }); - - it('correct actions appear when multiple folders are selected - [C280473]', async () => { - await dataTable.selectMultipleItems([folderForDelete1, folderForDelete2]); - - expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); - expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); - }); - - it('correct actions appear when both files and folders are selected - [C280474]', async () => { - await dataTable.selectMultipleItems([fileForDelete1, fileForDelete2, folderForDelete1, folderForDelete2]); - - expect(await toolbar.isButtonPresent('Permanently delete')).toBe(true, 'Permanently delete is displayed'); - expect(await toolbar.isButtonPresent('Restore')).toBe(true, 'Restore is not displayed'); - }); - }); - - describe('on Search Results', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('correct actions appear when multiple files are selected - [C291820]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-fileInSite'); - await dataTable.selectMultipleItems([file1InSite, file2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed for selected files'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple locked files are selected - [C297626]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions('my-fileLockedInSite'); - await dataTable.selectMultipleItems([fileLocked1InSite, fileLocked2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed for selected files'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed for selected files'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed for selected files'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when multiple folders are selected - [C291821]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-folderInSite'); - await dataTable.selectMultipleItems([folder1InSite, folder2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when both files and folders are selected - [C291822]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions('my-f'); - await dataTable.selectMultipleItems([file1InSite, file2InSite, folder1InSite, folder2InSite]); - - expect(await toolbar.isViewPresent()).toBe(false, 'View is displayed'); - expect(await toolbar.isDownloadPresent()).toBe(true, 'Download is not displayed'); - expect(await toolbar.isEditFolderPresent()).toBe(false, 'Edit folder is displayed'); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for selected files`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for selected files`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for selected files`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed for selected files`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed`); - - await toolbar.closeMoreMenu(); - }); - }); -}); diff --git a/e2e/suites/actions/toolbar-single-selection.test.ts b/e2e/suites/actions/toolbar-single-selection.test.ts deleted file mode 100755 index 1119da4911..0000000000 --- a/e2e/suites/actions/toolbar-single-selection.test.ts +++ /dev/null @@ -1,760 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { LoginPage, BrowsingPage, SearchResultsPage } from '../../pages/pages'; -import { SITE_VISIBILITY } from '../../configs'; -import { RepoClient } from '../../utilities/repo-client/repo-client'; -import { Utils } from '../../utilities/utils'; - -describe('Toolbar actions - single selection : ', () => { - const username = `user-${Utils.random()}`; - - const fileUser = `fileUser-${Utils.random()}.txt`; let fileUserId; - const folderUser = `folderUser-${Utils.random()}`; let folderUserId; - const fileForDelete = `fileForDelete-${Utils.random()}.txt`; let fileForDeleteId; - const folderForDelete = `folderForDelete-${Utils.random()}`; let folderForDeleteId; - const fileLocked = `fileLocked-${Utils.random()}.txt`; let fileLockedId; - - const siteName = `site-${Utils.random()}`; - const fileInSite = `file-site-${Utils.random()}.txt`; - const fileLockedInSite = `file-locked-site-${Utils.random()}.txt`; let fileLockedInSiteId; - const folderInSite = `folder-site-${Utils.random()}`; - - const adminPublic = `admin-public-${Utils.random()}`; - const adminModerated = `admin-moderated-${Utils.random()}`; - - const apis = { - admin: new RepoClient(), - user: new RepoClient(username, username) - }; - - const loginPage = new LoginPage(); - const page = new BrowsingPage(); - const { dataTable, toolbar } = page; - const searchResultsPage = new SearchResultsPage(); - const { searchInput } = searchResultsPage.header; - - beforeAll(async (done) => { - await apis.admin.people.createUser({ username }); - - fileUserId = (await apis.user.nodes.createFile(fileUser)).entry.id; - fileForDeleteId = (await apis.user.nodes.createFile(fileForDelete)).entry.id; - folderForDeleteId = (await apis.user.nodes.createFolder(folderForDelete)).entry.id; - folderUserId = (await apis.user.nodes.createFolder(folderUser)).entry.id; - fileLockedId = (await apis.user.nodes.createFile(fileLocked)).entry.id; - - await apis.user.shared.shareFileById(fileUserId); - await apis.user.shared.shareFileById(fileLockedId); - await apis.user.shared.waitForApi({ expect: 2 }); - - await apis.user.favorites.addFavoriteById('file', fileUserId); - await apis.user.favorites.addFavoriteById('folder', folderUserId); - await apis.user.favorites.addFavoriteById('file', fileLockedId); - await apis.user.favorites.waitForApi({ expect: 3 }); - - await apis.user.nodes.lockFile(fileLockedId); - - await apis.user.sites.createSite(siteName, SITE_VISIBILITY.PRIVATE); - const docLibId = await apis.user.sites.getDocLibId(siteName); - await apis.user.nodes.createFile(fileInSite, docLibId); - fileLockedInSiteId = (await apis.user.nodes.createFile(fileLockedInSite, docLibId)).entry.id; - await apis.user.nodes.createFolder(folderInSite, docLibId); - - await apis.user.nodes.lockFile(fileLockedInSiteId); - - await apis.user.nodes.deleteNodeById(fileForDeleteId, false); - await apis.user.nodes.deleteNodeById(folderForDeleteId, false); - - await apis.admin.sites.createSite(adminPublic); - await apis.admin.sites.createSite(adminModerated, SITE_VISIBILITY.MODERATED); - await apis.user.favorites.addFavoriteById('site', adminPublic); - await apis.user.favorites.addFavoriteById('site', adminModerated); - await apis.user.sites.requestToJoin(adminModerated); - - await apis.user.queries.waitForSites(siteName, { expect: 1 }); - - await loginPage.loginWith(username); - done(); - }); - - afterAll(async (done) => { - await Promise.all([ - apis.user.nodes.deleteNodeById(fileUserId), - apis.user.nodes.deleteNodeById(folderUserId), - apis.user.sites.deleteSite(siteName), - apis.admin.sites.deleteSite(adminPublic), - apis.admin.sites.deleteSite(adminModerated), - apis.user.trashcan.emptyTrash() - ]); - done(); - }); - - describe('on Personal Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await dataTable.clearSelection(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('selected row is marked with a check circle icon - [C213134]', async () => { - await dataTable.selectItem(fileUser); - - expect(await dataTable.hasCheckMarkIcon(fileUser)).toBe(true, 'check mark missing'); - }); - - it('actions are not displayed when no item is selected - [C213120]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C213122]', async () => { - await dataTable.selectItem(fileUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload New Version is not displayed for ${fileUser}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297612]', async () => { - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLocked}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a folder is selected - [C213123]', async () => { - await dataTable.selectItem(folderUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${folderUser}`); - expect(await toolbar.menu.isRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folderUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folderUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderUser}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on File Libraries', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.goToMyLibrariesAndWait(); - await dataTable.doubleClickOnRowByName(siteName); - await dataTable.waitForHeader(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('actions are not displayed when no item is selected - [C280439]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C280440]', async () => { - await dataTable.selectItem(fileInSite); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileInSite}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileInSite}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileInSite}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileInSite}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileInSite}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileInSite}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileInSite}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297614]', async () => { - await dataTable.selectItem(fileLockedInSite); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLockedInSite}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLockedInSite}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLockedInSite}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLockedInSite}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLockedInSite}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLockedInSite}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a folder is selected - [C280441]', async () => { - await dataTable.selectItem(folderInSite); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderInSite}`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderInSite}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderInSite}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderInSite}`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderInSite}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderInSite}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderInSite}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderInSite}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${folderInSite}`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed for ${folderInSite}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folderInSite}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderInSite}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on a library', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFiles(); - done(); - }); - - it('Available actions for a library - My Libraries - [C213135]', async () => { - await page.goToMyLibrariesAndWait(); - await dataTable.selectItem(siteName); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${siteName}`); - expect(await toolbar.isButtonPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${siteName}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a library - Favorite Libraries - user is a member - [C289892]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(siteName); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${siteName}`); - expect(await toolbar.isButtonPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${siteName}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a library - Favorite Libraries - user is not a member - [C290090]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(adminPublic); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminPublic}`); - expect(await toolbar.isButtonPresent('Join')).toBe(true, `Join is not displayed for ${adminPublic}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminPublic}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${adminPublic}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a moderated library - Favorite Libraries - user requested to join - [C290091]', async () => { - await page.goToFavoriteLibrariesAndWait(); - await dataTable.selectItem(adminModerated); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminModerated}`); - expect(await toolbar.isButtonPresent('Cancel join request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminModerated}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${adminModerated}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a library - Search Results - [C290084]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(siteName); - await dataTable.selectItem(siteName); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${siteName}`); - expect(await toolbar.isButtonPresent('Leave library')).toBe(true, `Leave is not displayed for ${siteName}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${siteName}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${siteName}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a library - Search Results - user is not a member - [C290085]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(adminPublic); - await dataTable.selectItem(adminPublic); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminPublic}`); - expect(await toolbar.isButtonPresent('Join')).toBe(true, `Join is not displayed for ${adminPublic}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminPublic}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${adminPublic}`); - - await toolbar.closeMoreMenu(); - }); - - it('Available actions for a moderated library - Search Results - user requested to join - [C290086]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkLibraries(); - await searchInput.searchForTextAndCloseSearchOptions(adminModerated); - await dataTable.selectItem(adminModerated); - - expect(await toolbar.isEmpty()).toBe(false, 'toolbar not displayed'); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `View details is not displayed for ${adminModerated}`); - expect(await toolbar.isButtonPresent('Cancel join request')).toBe(true, `Cancel join is not displayed for ${adminModerated}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${adminModerated}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${adminModerated}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Shared Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickSharedFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('actions are not displayed when no item is selected - [C280445]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C286265]', async () => { - await page.dataTable.selectItem(fileUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed for ${fileUser}`); - - await toolbar.openMoreMenu(); - - // TODO: change expect to true when ACA-2173 is done - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297615]', async () => { - await page.dataTable.selectItem(fileLocked); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLocked}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed for ${fileLocked}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2173 is done - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Recent Files', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickRecentFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('actions are not displayed when no item is selected - [C280447]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C280448]', async () => { - await dataTable.selectItem(fileUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297616]', async () => { - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLocked}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Favorites', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickFavoritesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('actions are not displayed when no item is selected - [C280449]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C280450]', async () => { - await dataTable.selectItem(fileUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - - await toolbar.openMoreMenu(); - - // TODO: change expect to true when ACA-2174 is done - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297617]', async () => { - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLocked}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - // TODO: change expect to true when ACA-2174 is done - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a folder is selected - [C280451]', async () => { - await dataTable.selectItem(folderUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed for ${folderUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed for ${folderUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folderUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folderUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderUser}`); - - await toolbar.closeMoreMenu(); - }); - }); - - describe('on Trash', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickTrashAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('actions are not displayed when no item is selected - [C280452]', async () => { - expect(await toolbar.isEmpty()).toBe(true, `actions displayed though nothing selected`); - }); - - it('correct actions appear when a file is selected - [C280453]', async () => { - await dataTable.selectItem(fileForDelete); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileForDelete}`); - expect(await toolbar.isPermanentlyDeletePresent()).toBe(true, `Permanently delete is not displayed for file`); - expect(await toolbar.isRestorePresent()).toBe(true, `Restore is not displayed for file`); - }); - - it('correct actions appear when a folder is selected - [C280454]', async () => { - await dataTable.selectItem(folderForDelete); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderForDelete}`); - expect(await toolbar.isPermanentlyDeletePresent()).toBe(true, `Permanently delete is displayed for folder`); - expect(await toolbar.isRestorePresent()).toBe(true, `Restore is not displayed for folder`); - }); - }); - - describe('on Search Results', () => { - beforeEach(async (done) => { - await Utils.pressEscape(); - await page.clickPersonalFilesAndWait(); - done(); - }); - - afterAll(async (done) => { - await Utils.pressEscape(); - done(); - }); - - it('nodes actions are not displayed when no item is selected - [C291815]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkFilesAndFolders(); - await searchInput.searchForTextAndCloseSearchOptions(fileInSite); - - expect(await toolbar.isToggleSearchFiltersPresent()).toBe(true, `Search filter toggle is not displayed`); - expect(await toolbar.numberOfAvailableActions()).toBe(1, `more than 1 action is present`); - }); - - it('correct actions appear when a file is selected - [C291816]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileUser); - await dataTable.selectItem(fileUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileUser}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileUser}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed for ${fileUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${fileUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileUser}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a locked file is selected - [C297618]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFiles(); - await searchInput.searchForTextAndCloseSearchOptions(fileLocked); - await dataTable.selectItem(fileLocked); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${fileLocked}`); - expect(await toolbar.isViewPresent()).toBe(true, `View is not displayed for ${fileLocked}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed for ${fileLocked}`); - expect(await toolbar.isEditFolderPresent()).toBe(false, `Edit folder is displayed for ${fileLocked}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${fileLocked}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${fileLocked}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${fileLocked}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed for ${fileLocked}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed for ${fileLocked}`); - - await toolbar.closeMoreMenu(); - }); - - it('correct actions appear when a folder is selected - [C291817]', async () => { - await searchInput.clickSearchButton(); - await searchInput.checkOnlyFolders(); - await searchInput.searchForTextAndCloseSearchOptions(folderUser); - await dataTable.selectItem(folderUser); - - expect(await toolbar.isEmpty()).toBe(false, `actions not displayed for ${folderUser}`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed for ${folderUser}`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not enabled for ${folderUser}`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditFolderPresent()).toBe(true, `Edit folder is not displayed for ${folderUser}`); - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed for ${folderUser}`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed for ${folderUser}`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed for ${folderUser}`); - expect(await toolbar.menu.isDeletePresent()).toBe(false, `Delete is displayed for ${folderUser}`); - expect(await toolbar.menu.isMovePresent()).toBe(false, `Move is displayed for ${folderUser}`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed for ${folderUser}`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(false, `Manage versions is displayed for ${folderUser}`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(false, `Upload new version is displayed for ${folderUser}`); - - await toolbar.closeMoreMenu(); - }); - }); -}); diff --git a/e2e/suites/actions/unshare-file-search-results.test.ts b/e2e/suites/actions/unshare-file-search-results.test.ts new file mode 100755 index 0000000000..5b494b8356 --- /dev/null +++ b/e2e/suites/actions/unshare-file-search-results.test.ts @@ -0,0 +1,239 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { browser } from 'protractor'; +import { LoginPage, BrowsingPage } from '../../pages/pages'; +import { SITE_VISIBILITY, SITE_ROLES } from '../../configs'; +import { RepoClient } from '../../utilities/repo-client/repo-client'; +import { ShareDialog } from '../../components/dialog/share-dialog'; +import { ConfirmDialog } from '../../components/dialog/confirm-dialog'; +import { Viewer } from '../../components/viewer/viewer'; +import { Utils } from '../../utilities/utils'; + +describe('Unshare a file from Search Results', () => { + const username = `user-${Utils.random()}`; + + const parent = `parent-${Utils.random()}`; let parentId; + + const file1 = `search-file1-${Utils.random()}.txt`; let file1Id; + const file2 = `search-file2-${Utils.random()}.txt`; let file2Id; + const file3 = `search-file3-${Utils.random()}.txt`; let file3Id; + const file4 = `search-file4-${Utils.random()}.txt`; let file4Id; + + const sitePrivate = `site-private-${Utils.random()}`; + + const fileSite1 = `search-fileSite1-${Utils.random()}.txt`; let fileSite1Id; + const fileSite2 = `search-fileSite2-${Utils.random()}.txt`; let fileSite2Id; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable, toolbar } = page; + const shareDialog = new ShareDialog(); + const confirmDialog = new ConfirmDialog(); + const contextMenu = dataTable.menu; + const viewer = new Viewer(); + const { searchInput } = page.header; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + + file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id; + file2Id = (await apis.user.nodes.createFile(file2, parentId)).entry.id; + file3Id = (await apis.user.nodes.createFile(file3, parentId)).entry.id; + file4Id = (await apis.user.nodes.createFile(file4, parentId)).entry.id; + + await apis.user.shared.shareFileById(file1Id); + await apis.user.shared.shareFileById(file2Id); + await apis.user.shared.shareFileById(file3Id); + await apis.user.shared.shareFileById(file4Id); + + await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE); + const docLibId = await apis.admin.sites.getDocLibId(sitePrivate); + + fileSite1Id = (await apis.admin.nodes.createFile(fileSite1, docLibId)).entry.id; + fileSite2Id = (await apis.admin.nodes.createFile(fileSite2, docLibId)).entry.id; + + await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE); + + await apis.admin.shared.shareFileById(fileSite1Id); + await apis.user.shared.shareFileById(fileSite2Id); + + await apis.user.shared.waitForApi({ expect: 6 }); + await apis.user.search.waitForNodes('search-file', { expect: 6 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + await apis.admin.sites.deleteSite(sitePrivate); + done(); + }); + + afterEach(async (done) => { + await page.closeOpenDialogs(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + it('Unshare dialog UI - [C306995]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file1); + await dataTable.waitForBody(); + + await dataTable.selectItem(file1); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); + await shareDialog.clickShareToggle(); + + expect(await confirmDialog.isDialogOpen()).toBe(true, 'Unshare dialog is not open'); + expect(await confirmDialog.getTitle()).toContain('Remove this shared link'); + expect(await confirmDialog.getText()).toContain('This link will be deleted and a new link will be created next time this file is shared'); + expect(await confirmDialog.isRemoveEnabled()).toBe(true, 'REMOVE button is not enabled'); + expect(await confirmDialog.isCancelEnabled()).toBe(true, 'CANCEL button is not enabled'); + }); + + it('Unshare a file - [C306996]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file2); + await dataTable.waitForBody(); + + await dataTable.selectItem(file2); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + await shareDialog.clickShareToggle(); + + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(file2Id)).toBe(false, `${file2} is shared`); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).not.toEqual(file2); + + await page.load(); + }); + + it('Cancel the Unshare action - [C306997]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file3); + await dataTable.waitForBody(); + + await dataTable.selectItem(file3); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + const urlBefore = await shareDialog.getLinkUrl(); + await shareDialog.clickShareToggle(); + + await confirmDialog.clickCancel(); + await confirmDialog.waitForDialogToClose(); + expect(await shareDialog.isDialogOpen()).toBe(true, 'Share dialog not open'); + expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle is off'); + + const urlAfter = await shareDialog.getLinkUrl(); + expect(urlBefore).toEqual(urlAfter); + }); + + it('Unshare a file from the context menu - [C306999]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file4); + await dataTable.waitForBody(); + + await dataTable.rightClickOnItem(file4); + await contextMenu.waitForMenuToOpen(); + await contextMenu.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + const url = await shareDialog.getLinkUrl(); + await shareDialog.clickShareToggle(); + + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(file4Id)).toBe(false, `${file4} is shared`); + + await browser.get(url); + expect(await viewer.isViewerOpened()).toBe(true, 'viewer is not open'); + expect(await viewer.getFileTitle()).not.toEqual(file4); + + await page.load(); + }); + + it('Consumer - on Search Results - file shared by other user - [C306998]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSite1); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSite1); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + + const msg = await page.getSnackBarMessage(); + expect(msg).toContain(`You don't have permission to unshare this file`); + }); + + it('Consumer - on Search Results - file shared by the user - [C307000]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSite2); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSite2); + await toolbar.clickSharedLinkSettings(); + await shareDialog.waitForDialogToOpen(); + + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(fileSite2Id)).toBe(false, `${fileSite2} is shared`); + }); + +}); diff --git a/e2e/suites/actions/unshare-file.test.ts b/e2e/suites/actions/unshare-file.test.ts index dee4dc7f9d..e3b802962e 100755 --- a/e2e/suites/actions/unshare-file.test.ts +++ b/e2e/suites/actions/unshare-file.test.ts @@ -83,7 +83,7 @@ describe('Unshare a file', () => { }); beforeEach(async (done) => { - await page.refresh(); + await page.closeOpenDialogs(); await page.clickPersonalFilesAndWait(); await dataTable.doubleClickOnRowByName(parent); await dataTable.waitForHeader(); @@ -91,7 +91,7 @@ describe('Unshare a file', () => { }); afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); done(); }); @@ -132,10 +132,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 - // await page.clickSharedFiles(); - // 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); @@ -173,10 +169,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 - // await page.clickSharedFiles(); - // 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); @@ -213,7 +205,7 @@ describe('Unshare a file', () => { }); beforeEach(async (done) => { - await page.refresh(); + await page.closeOpenDialogs(); await page.goToMyLibrariesAndWait(); await dataTable.doubleClickOnRowByName(siteName); await dataTable.waitForHeader(); @@ -223,7 +215,7 @@ describe('Unshare a file', () => { }); afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); done(); }); @@ -261,10 +253,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 - // await page.clickSharedFiles(); - // 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); @@ -302,10 +290,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 - // await page.clickSharedFiles(); - // 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); @@ -335,13 +319,13 @@ describe('Unshare a file', () => { }); beforeEach(async (done) => { - await page.refresh(); + await page.closeOpenDialogs(); await page.clickRecentFilesAndWait(); done(); }); afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); done(); }); @@ -382,10 +366,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 - // await page.clickSharedFiles(); - // 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); @@ -423,10 +403,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 - // await page.clickSharedFiles(); - // 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); @@ -456,13 +432,13 @@ describe('Unshare a file', () => { }); beforeEach(async (done) => { - await page.refresh(); + await page.closeOpenDialogs(); await page.clickSharedFilesAndWait(); done(); }); afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); done(); }); @@ -582,13 +558,13 @@ describe('Unshare a file', () => { }); beforeEach(async (done) => { - await page.refresh(); + await page.closeOpenDialogs(); await page.clickFavoritesAndWait(); done(); }); afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); done(); }); @@ -633,10 +609,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 - // await page.clickSharedFiles(); - // 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); @@ -678,10 +650,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 - // await page.clickSharedFiles(); - // 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); @@ -694,25 +662,38 @@ describe('Unshare a file', () => { const sitePrivate = `site-private-${Utils.random()}`; - const file1 = `file1-${Utils.random()}.txt`; let file1Id; - const file2 = `file2-${Utils.random()}.txt`; let file2Id; + const file1FileLib = `file1-FL-${Utils.random()}.txt`; let file1FileLibId; + const file2FileLib = `file2-FL-${Utils.random()}.txt`; let file2FileLibId; + const file1Shared = `file1-Shared-${Utils.random()}.txt`; let file1SharedId; + const file2Shared = `file2-Shared-${Utils.random()}.txt`; let file2SharedId; + const file1Fav = `file1-Fav-${Utils.random()}.txt`; let file1FavId; + const file2Fav = `file2-Fav-${Utils.random()}.txt`; let file2FavId; beforeAll(async (done) => { await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE); const docLibId = await apis.admin.sites.getDocLibId(sitePrivate); - file1Id = (await apis.admin.nodes.createFile(file1, docLibId)).entry.id; - file2Id = (await apis.admin.nodes.createFile(file2, docLibId)).entry.id; + file1FileLibId = (await apis.admin.nodes.createFile(file1FileLib, docLibId)).entry.id; + file2FileLibId = (await apis.admin.nodes.createFile(file2FileLib, docLibId)).entry.id; + file1SharedId = (await apis.admin.nodes.createFile(file1Shared, docLibId)).entry.id; + file2SharedId = (await apis.admin.nodes.createFile(file2Shared, docLibId)).entry.id; + file1FavId = (await apis.admin.nodes.createFile(file1Fav, docLibId)).entry.id; + file2FavId = (await apis.admin.nodes.createFile(file2Fav, docLibId)).entry.id; await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE); - await apis.admin.shared.shareFileById(file1Id); - await apis.user.shared.shareFileById(file2Id); - await apis.user.shared.waitForApi({ expect: 2 }); + await apis.admin.shared.shareFileById(file1FileLibId); + await apis.user.shared.shareFileById(file2FileLibId); + await apis.admin.shared.shareFileById(file1SharedId); + await apis.user.shared.shareFileById(file2SharedId); + await apis.admin.shared.shareFileById(file1FavId); + await apis.user.shared.shareFileById(file2FavId); + + await apis.user.favorites.addFavoriteById('file', file1FavId); + await apis.user.favorites.addFavoriteById('file', file2FavId); - await apis.user.favorites.addFavoriteById('file', file1Id); - await apis.user.favorites.addFavoriteById('file', file2Id); await apis.user.favorites.waitForApi({ expect: 2 }); + await apis.user.shared.waitForApi({ expect: 6 }); done(); }); @@ -722,13 +703,9 @@ describe('Unshare a file', () => { done(); }); - beforeEach(async (done) => { - await page.refresh(); - done(); - }); - afterEach(async (done) => { - await Utils.pressEscape(); + await page.closeOpenDialogs(); + await page.clickPersonalFilesAndWait(); done(); }); @@ -736,62 +713,104 @@ describe('Unshare a file', () => { await page.goToMyLibrariesAndWait(); await dataTable.doubleClickOnRowByName(sitePrivate); await dataTable.waitForHeader(); - await dataTable.selectItem(file1); + await dataTable.selectItem(file1FileLib); await toolbar.clickSharedLinkSettings(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + + const msg = await page.getSnackBarMessage(); + expect(msg).toContain(`You don't have permission to unshare this file`); }); it('on File Libraries - file shared by the user - [C286701]', async () => { await page.goToMyLibrariesAndWait(); await dataTable.doubleClickOnRowByName(sitePrivate); await dataTable.waitForHeader(); - await dataTable.selectItem(file2); + await dataTable.selectItem(file2FileLib); await toolbar.clickSharedLinkSettings(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(file2FileLibId)).toBe(false, `${file2FileLib} is shared`); }); it('on Shared Files - file shared by other user - [C286687]', async () => { await page.clickSharedFilesAndWait(); - await dataTable.selectItem(file1); + await dataTable.selectItem(file1Shared); await toolbar.clickSharedLinkSettings(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + + const msg = await page.getSnackBarMessage(); + expect(msg).toContain(`You don't have permission to unshare this file`); }); it('on Shared Files - file shared by the user - [C286702]', async () => { await page.clickSharedFilesAndWait(); - await dataTable.selectItem(file1); + await dataTable.selectItem(file2Shared); await toolbar.clickSharedLinkSettings(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(file2SharedId)).toBe(false, `${file2Shared} is shared`); }); it('on Favorites - file shared by other user - [C286697]', async () => { await page.clickFavoritesAndWait(); - await dataTable.selectItem(file1); + await dataTable.selectItem(file1Fav); // TODO: remove workaround for favorites // await toolbar.clickSharedLinkSettings(); await toolbar.clickShare(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + + const msg = await page.getSnackBarMessage(); + expect(msg).toContain(`You don't have permission to unshare this file`); }); it('on Favorites - file shared by the user - [C286703]', async () => { await page.clickFavoritesAndWait(); - await dataTable.selectItem(file1); + await dataTable.selectItem(file2Fav); // TODO: remove workaround for favorites // await toolbar.clickSharedLinkSettings(); await toolbar.clickShare(); await shareDialog.waitForDialogToOpen(); - expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle enabled for consumer'); + expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); + + await shareDialog.clickShareToggle(); + await confirmDialog.clickRemove(); + await confirmDialog.waitForDialogToClose(); + await shareDialog.waitForDialogToClose(); + + expect(await shareDialog.isDialogOpen()).toBe(false, 'Share dialog open'); + expect(await apis.user.nodes.isFileShared(file2FavId)).toBe(false, `${file2Fav} is shared`); }); }); diff --git a/e2e/suites/actions/upload-new-version.test.ts b/e2e/suites/actions/upload-new-version.test.ts index 955005ee77..0363a68e06 100755 --- a/e2e/suites/actions/upload-new-version.test.ts +++ b/e2e/suites/actions/upload-new-version.test.ts @@ -39,10 +39,18 @@ describe('Upload new version', () => { const fileLocked1 = `file-locked1-${Utils.random()}.docx`; let fileLocked1Id; const fileLocked2 = `file-locked2-${Utils.random()}.docx`; let fileLocked2Id; + const fileSearch1 = `search-file1-${Utils.random()}.docx`; let fileSearch1Id; + const fileSearch2 = `search-file2-${Utils.random()}.docx`; let fileSearch2Id; + const fileSearch3 = `search-file3-${Utils.random()}.docx`; let fileSearch3Id; + const fileSearch4 = `search-file4-${Utils.random()}.docx`; let fileSearch4Id; + const fileLockedSearch1 = `search-file-locked1-${Utils.random()}.docx`; let fileLockedSearch1Id; + const fileLockedSearch2 = `search-file-locked2-${Utils.random()}.docx`; let fileLockedSearch2Id; + const parentPF = `parentPersonal-${Utils.random()}`; let parentPFId; const parentSF = `parentShared-${Utils.random()}`; let parentSFId; const parentRF = `parentRecent-${Utils.random()}`; let parentRFId; const parentFav = `parentFav-${Utils.random()}`; let parentFavId; + const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId; const file = FILES.pdfFile; let fileId; const fileToUpload1 = FILES.docxFile; @@ -60,6 +68,7 @@ describe('Upload new version', () => { const page = new BrowsingPage(); const { dataTable, toolbar } = page; const uploadNewVersionDialog = new UploadNewVersionDialog(); + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -68,6 +77,7 @@ describe('Upload new version', () => { 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(); }); @@ -77,6 +87,7 @@ describe('Upload new version', () => { 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(); }); @@ -253,7 +264,6 @@ describe('Upload new version', () => { }); afterEach(async (done) => { - // await Utils.pressEscape(); await page.refresh(); done(); }); @@ -400,7 +410,6 @@ describe('Upload new version', () => { }); afterEach(async (done) => { - // await Utils.pressEscape(); await page.refresh(); done(); }); @@ -548,7 +557,6 @@ describe('Upload new version', () => { }); afterEach(async (done) => { - // await Utils.pressEscape(); await page.refresh(); done(); }); @@ -669,4 +677,178 @@ describe('Upload new version', () => { }); }); + describe('on Search Results', () => { + beforeAll(async (done) => { + fileId = (await apis.user.upload.uploadFile(file, parentSearchId)).entry.id; + fileSearch1Id = (await apis.user.nodes.createFile(fileSearch1, parentSearchId)).entry.id; + fileSearch2Id = (await apis.user.nodes.createFile(fileSearch2, parentSearchId)).entry.id; + fileSearch3Id = (await apis.user.nodes.createFile(fileSearch3, parentSearchId)).entry.id; + fileSearch4Id = (await apis.user.nodes.createFile(fileSearch4, parentSearchId)).entry.id; + + fileLockedSearch1Id = (await apis.user.nodes.createFile(fileLockedSearch1, parentSearchId)).entry.id; + fileLockedSearch2Id = (await apis.user.nodes.createFile(fileLockedSearch2, parentSearchId)).entry.id; + + await apis.user.nodes.lockFile(fileLockedSearch1Id); + await apis.user.nodes.lockFile(fileLockedSearch2Id); + + await apis.user.search.waitForNodes('search-f', { expect: 6 }) + + await loginPage.loginWith(username); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.header.expandSideNav(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + it('dialog UI defaults - [C307003]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file); + await dataTable.waitForBody(); + await dataTable.selectItem(file, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload1); + await page.waitForDialog(); + + expect(await uploadNewVersionDialog.getTitle()).toEqual('Upload New Version'); + expect(await uploadNewVersionDialog.getText()).toContain('What level of changes were made to this version?'); + expect(await uploadNewVersionDialog.isDescriptionDisplayed()).toBe(true, 'Description not displayed'); + expect(await uploadNewVersionDialog.isMinorOptionDisplayed()).toBe(true, 'Minor option not displayed'); + expect(await uploadNewVersionDialog.isMajorOptionDisplayed()).toBe(true, 'Major option not displayed'); + expect(await uploadNewVersionDialog.isCancelButtonEnabled()).toBe(true, 'Cancel button not enabled'); + expect(await uploadNewVersionDialog.isUploadButtonEnabled()).toBe(true, 'Update button not enabled'); + }); + + it('file is updated after uploading a new version - major - [C307004]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSearch1); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSearch1, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload1); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMajor(); + await uploadNewVersionDialog.enterDescription('new major version description'); + await uploadNewVersionDialog.clickUpload(); + + // TODO: enable when ACA-2329 is fixed + // expect(await dataTable.isItemPresent(fileToUpload1, parentSearch)).toBe(true, 'File not updated'); + expect(await apis.user.nodes.getFileVersionType(fileSearch1Id)).toEqual('MAJOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch1Id)).toEqual('1.0', 'File has incorrect version label'); + }); + + it('file is updated after uploading a new version - minor - [C307005]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSearch2); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSearch2, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload2); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMinor(); + await uploadNewVersionDialog.enterDescription('new minor version description'); + await uploadNewVersionDialog.clickUpload(); + + // TODO: enable when ACA-2329 is fixed + // expect(await dataTable.isItemPresent(fileToUpload2, parentSearch)).toBe(true, 'File not updated'); + expect(await apis.user.nodes.getFileVersionType(fileSearch2Id)).toEqual('MINOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch2Id)).toEqual('0.1', 'File has incorrect version label'); + }); + + it('file is not updated when clicking Cancel - [C307006]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSearch3); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSearch3, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload3); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMinor(); + await uploadNewVersionDialog.enterDescription('new version description'); + await uploadNewVersionDialog.clickCancel(); + + expect(await dataTable.isItemPresent(fileSearch3, parentSearch)).toBe(true, 'File was updated'); + expect(await apis.user.nodes.getFileVersionType(fileSearch3Id)).toEqual('', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch3Id)).toEqual('', 'File has incorrect version label'); + }); + + it('upload new version fails when new file name already exists - [C307007]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileSearch4); + await dataTable.waitForBody(); + await dataTable.selectItem(fileSearch4, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(file); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMinor(); + await uploadNewVersionDialog.enterDescription('new version description'); + await uploadNewVersionDialog.clickUpload(); + + await page.refresh(); + + expect(await dataTable.isItemPresent(fileSearch4, parentSearch)).toBe(true, 'File was updated'); + expect(await apis.user.nodes.getFileVersionType(fileSearch4Id)).toEqual('', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileSearch4Id)).toEqual('', 'File has incorrect version label'); + }); + + it('file is unlocked after uploading a new version - [C307008]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileLockedSearch1); + await dataTable.waitForBody(); + await dataTable.selectItem(fileLockedSearch1, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload4); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMinor(); + await uploadNewVersionDialog.enterDescription('new version description'); + await uploadNewVersionDialog.clickUpload(); + + // TODO: enable when ACA-2329 is fixed + // expect(await dataTable.isItemPresent(fileToUpload4, parentSearch)).toBe(true, 'File name was not changed'); + expect(await apis.user.nodes.isFileLockedWrite(fileLockedSearch1Id)).toBe(false, `${fileLockedSearch1} is still locked`); + expect(await apis.user.nodes.getFileVersionType(fileLockedSearch1Id)).toEqual('MINOR', 'File has incorrect version type'); + expect(await apis.user.nodes.getFileVersionLabel(fileLockedSearch1Id)).toEqual('0.1', 'File has incorrect version label'); + }); + + it('file remains locked after canceling of uploading a new version - [C307009]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileLockedSearch2); + await dataTable.waitForBody(); + await dataTable.selectItem(fileLockedSearch2, parentSearch); + await toolbar.clickMoreActionsUploadNewVersion(); + + await Utils.uploadFileNewVersion(fileToUpload5); + await page.waitForDialog(); + + await uploadNewVersionDialog.clickMinor(); + await uploadNewVersionDialog.enterDescription('new version description'); + await uploadNewVersionDialog.clickCancel(); + + expect(await dataTable.isItemPresent(fileToUpload5, parentSearch)).toBe(false, 'File was updated'); + expect(await dataTable.isItemPresent(fileLockedSearch2, parentSearch)).toBe(true, 'File not displayed'); + expect(await apis.user.nodes.isFileLockedWrite(fileLockedSearch2Id)).toBe(true, `${fileLockedSearch2} was unlocked`); + }); + }); + }); diff --git a/e2e/suites/extensions/ext-viewer.test.ts b/e2e/suites/extensions/ext-viewer.test.ts index 9acefaca4c..80d7275a42 100755 --- a/e2e/suites/extensions/ext-viewer.test.ts +++ b/e2e/suites/extensions/ext-viewer.test.ts @@ -45,19 +45,19 @@ describe('Extensions - Viewer', () => { let docxFileId; const customAction = { - id: 'app.toolbar.my-action', + id: 'app.viewer.my-action', title: 'My action', icon: 'http' }; const customSecondaryAction = { - id: 'app.toolbar.my-secondary-action', + id: 'app.viewer.my-secondary-action', title: 'My secondary action', icon: 'alarm' }; const downloadButton = { - id: 'app.toolbar.download', + id: 'app.viewer.download', title: 'My custom title' }; diff --git a/e2e/suites/info-drawer/comments.test.ts b/e2e/suites/info-drawer/comments.test.ts index d2f0ced841..b7a76fe6dd 100755 --- a/e2e/suites/info-drawer/comments.test.ts +++ b/e2e/suites/info-drawer/comments.test.ts @@ -35,6 +35,8 @@ describe('Comments', () => { const parent = `parent-${Utils.random()}`; let parentId; const file1 = `file1-${Utils.random()}.txt`; + const folder1 = `folder1-${Utils.random()}`; + const folder2 = `folder2-${Utils.random()}`; let folder2Id; const fileWith1Comment = `file1Comment-${Utils.random()}.txt`; let fileWith1CommentId; const fileWith2Comments = `file2Comments-${Utils.random()}.txt`; let fileWith2CommentsId; @@ -53,6 +55,7 @@ describe('Comments', () => { }; const infoDrawer = new InfoDrawer(); + const { commentsTab } = infoDrawer; const loginPage = new LoginPage(); const page = new BrowsingPage(); @@ -80,6 +83,10 @@ describe('Comments', () => { await apis.user.shared.shareFilesByIds([file2SharedId, fileWith1CommentId, fileWith2CommentsId]); await apis.user.favorites.addFavoritesByIds('file', [file2FavoritesId, fileWith1CommentId, fileWith2CommentsId]); + await apis.user.nodes.createFolder(folder1, parentId); + folder2Id = (await apis.user.nodes.createFolder(folder2, parentId)).entry.id; + await apis.user.favorites.addFavoriteById('folder', folder2Id); + await loginPage.loginWith(username); done(); }); @@ -96,11 +103,6 @@ describe('Comments', () => { done(); }); - afterEach(async (done) => { - await dataTable.clearSelection(); - done(); - }); - it('Comments tab default fields - [C299173]', async () => { await dataTable.selectItem(file1); await page.toolbar.clickViewDetails(); @@ -108,9 +110,9 @@ describe('Comments', () => { await infoDrawer.clickCommentsTab(); expect(await infoDrawer.getActiveTabTitle()).toBe('COMMENTS'); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (0)'); - expect(await infoDrawer.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (0)'); + expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); }); it('Comment info display - [C280582]', async () => { @@ -119,15 +121,15 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); - expect(await infoDrawer.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); - expect(await infoDrawer.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); - expect(await infoDrawer.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); - expect(await infoDrawer.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); - expect(await infoDrawer.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); + expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); + expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); + expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); + expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); + expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); }); it('Comments are displayed ordered by created date in descending order - [C280583]', async () => { @@ -136,8 +138,8 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getNthCommentId(1)).toContain(comment2File2Entry.id); - expect(await infoDrawer.getNthCommentId(2)).toContain(comment1File2Entry.id); + expect(await commentsTab.getNthCommentId(1)).toContain(comment2File2Entry.id); + expect(await commentsTab.getNthCommentId(2)).toContain(comment1File2Entry.id); }); it('Total number of comments is displayed - [C280585]', async () => { @@ -146,7 +148,7 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (2)'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (2)'); }); it('Add button is enabled when typing in the comment field - [C280589]', async () => { @@ -155,25 +157,40 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); - await infoDrawer.typeComment('my comment'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(true, 'Add comment button not enabled'); + await commentsTab.typeComment('my comment'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(true, 'Add comment button not enabled'); }); - it('Add a comment - [C280590]', async () => { + it('Add a comment on a file - [C280590]', async () => { const myComment = 'my comment'; await dataTable.selectItem(file2Personal); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - await infoDrawer.typeComment(myComment); - await infoDrawer.clickAddButton(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentDisplayed()).toBe(true, `Comment not displayed`); - expect(await infoDrawer.getCommentText()).toBe(myComment, 'Incorrect comment text'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); + }); + + it('Add a comment on a folder - [C299208]', async () => { + const myComment = 'my comment'; + + await dataTable.selectItem(folder1); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + await infoDrawer.clickCommentsTab(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); + + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); }); it('Escape key clears the text when focus is on the textarea - [C280591]', async () => { @@ -181,19 +198,19 @@ describe('Comments', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - await infoDrawer.typeComment('myComment'); + await commentsTab.typeComment('myComment'); - expect(await infoDrawer.getCommentTextFromTextArea()).toBe('myComment'); + expect(await commentsTab.getCommentTextFromTextArea()).toBe('myComment'); await Utils.pressEscape(); - expect(await infoDrawer.getCommentTextFromTextArea()).toBe(''); + expect(await commentsTab.getCommentTextFromTextArea()).toBe(''); }); }); describe('from Favorites', () => { beforeAll(async (done) => { - await apis.user.favorites.waitForApi({ expect: 3 }); + await apis.user.favorites.waitForApi({ expect: 4 }); done(); }); @@ -203,7 +220,7 @@ describe('Comments', () => { }); afterEach(async (done) => { - await dataTable.clearSelection(); + await page.clickPersonalFiles(); done(); }); @@ -213,15 +230,16 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); - expect(await infoDrawer.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); - expect(await infoDrawer.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); - expect(await infoDrawer.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); - expect(await infoDrawer.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); - expect(await infoDrawer.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); + expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); + expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); + expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); + // ACA-2348 expect broken because of parallel test suites + // expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); + expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); }); it('Comments are displayed ordered by created date in descending order - [C299197]', async () => { @@ -230,8 +248,8 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getNthCommentId(1)).toContain(comment2File2Entry.id); - expect(await infoDrawer.getNthCommentId(2)).toContain(comment1File2Entry.id); + expect(await commentsTab.getNthCommentId(1)).toContain(comment2File2Entry.id); + expect(await commentsTab.getNthCommentId(2)).toContain(comment1File2Entry.id); }); it('Total number of comments is displayed - [C299198]', async () => { @@ -240,22 +258,37 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (2)'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (2)'); }); - it('Add a comment - [C299199]', async () => { + it('Add a comment on a file - [C299199]', async () => { const myComment = 'my comment'; await dataTable.selectItem(file2Favorites); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - await infoDrawer.typeComment(myComment); - await infoDrawer.clickAddButton(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); + + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); + }); + + it('Add a comment on a folder - [C299209]', async () => { + const myComment = 'my comment'; + + await dataTable.selectItem(folder2); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + await infoDrawer.clickCommentsTab(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentDisplayed()).toBe(true, `Comment not displayed`); - expect(await infoDrawer.getCommentText()).toBe(myComment, 'Incorrect comment text'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); }); }); @@ -271,7 +304,7 @@ describe('Comments', () => { }); afterEach(async (done) => { - await dataTable.clearSelection(); + await page.clickPersonalFiles(); done(); }); @@ -281,15 +314,15 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); - expect(await infoDrawer.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); - expect(await infoDrawer.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); - expect(await infoDrawer.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); - expect(await infoDrawer.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); - expect(await infoDrawer.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); + expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); + expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); + expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); + expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); + expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); }); it('Comments are displayed ordered by created date in descending order - [C299189]', async () => { @@ -298,8 +331,8 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getNthCommentId(1)).toContain(comment2File2Entry.id); - expect(await infoDrawer.getNthCommentId(2)).toContain(comment1File2Entry.id); + expect(await commentsTab.getNthCommentId(1)).toContain(comment2File2Entry.id); + expect(await commentsTab.getNthCommentId(2)).toContain(comment1File2Entry.id); }); it('Total number of comments is displayed - [C299190]', async () => { @@ -308,22 +341,22 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (2)'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (2)'); }); - it('Add a comment - [C299191]', async () => { + it('Add a comment on a file - [C299191]', async () => { const myComment = 'my comment'; await dataTable.selectItem(file2Shared); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - await infoDrawer.typeComment(myComment); - await infoDrawer.clickAddButton(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentDisplayed()).toBe(true, `Comment not displayed`); - expect(await infoDrawer.getCommentText()).toBe(myComment, 'Incorrect comment text'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); }); }); @@ -339,7 +372,7 @@ describe('Comments', () => { }); afterEach(async (done) => { - await dataTable.clearSelection(); + await page.clickPersonalFiles(); done(); }); @@ -349,15 +382,15 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); - expect(await infoDrawer.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentTextAreaDisplayed()).toBe(true, 'Comment field not present'); + expect(await commentsTab.isAddCommentButtonEnabled()).toBe(false, 'Add comment button not disabled'); - expect(await infoDrawer.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); - expect(await infoDrawer.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); - expect(await infoDrawer.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); - expect(await infoDrawer.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); - expect(await infoDrawer.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); + expect(await commentsTab.isCommentDisplayed(commentFile1Entry.id)).toBe(true, `Comment with id: ${commentFile1Entry.id} not displayed`); + expect(await commentsTab.getCommentText(commentFile1Entry.id)).toBe(commentFile1Entry.content, 'Incorrect comment text'); + expect(await commentsTab.getCommentUserName(commentFile1Entry.id)).toBe(`${username} ${username}`, 'Incorrect comment user'); + expect(await commentsTab.getCommentTime(commentFile1Entry.id)).toBe(moment(commentFile1Entry.createdAt).fromNow(), 'Incorrect comment created time'); + expect(await commentsTab.isCommentUserAvatarDisplayed(commentFile1Entry.id)).toBe(true, 'User avatar not displayed'); }); it('Comments are displayed ordered by created date in descending order - [C299193]', async () => { @@ -366,8 +399,8 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getNthCommentId(1)).toContain(comment2File2Entry.id); - expect(await infoDrawer.getNthCommentId(2)).toContain(comment1File2Entry.id); + expect(await commentsTab.getNthCommentId(1)).toContain(comment2File2Entry.id); + expect(await commentsTab.getNthCommentId(2)).toContain(comment1File2Entry.id); }); it('Total number of comments is displayed - [C299194]', async () => { @@ -376,22 +409,22 @@ describe('Comments', () => { await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (2)'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (2)'); }); - it('Add a comment - [C299195]', async () => { + it('Add a comment on a file - [C299195]', async () => { const myComment = 'my comment'; await dataTable.selectItem(file2Recent); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.clickCommentsTab(); - await infoDrawer.typeComment(myComment); - await infoDrawer.clickAddButton(); + await commentsTab.typeComment(myComment); + await commentsTab.clickAddButton(); - expect(await infoDrawer.getCommentsTabHeaderText()).toBe('Comments (1)'); - expect(await infoDrawer.isCommentDisplayed()).toBe(true, `Comment not displayed`); - expect(await infoDrawer.getCommentText()).toBe(myComment, 'Incorrect comment text'); + expect(await commentsTab.getCommentsTabHeaderText()).toBe('Comments (1)'); + expect(await commentsTab.isCommentDisplayed()).toBe(true, `Comment not displayed`); + expect(await commentsTab.getCommentText()).toBe(myComment, 'Incorrect comment text'); }); }); diff --git a/e2e/suites/info-drawer/file-folder-properties.test.ts b/e2e/suites/info-drawer/file-folder-properties.test.ts new file mode 100755 index 0000000000..d26ad95b1c --- /dev/null +++ b/e2e/suites/info-drawer/file-folder-properties.test.ts @@ -0,0 +1,249 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../pages/pages'; +import { RepoClient } from '../../utilities/repo-client/repo-client'; +import { InfoDrawer } from './../../components/info-drawer/info-drawer'; +import { Utils } from '../../utilities/utils'; +import { FILES, DATE_TIME_FORMAT, DATE_FORMAT } from '../../configs'; +import * as moment from 'moment'; + +describe('File / Folder properties', () => { + const username = `user1-${Utils.random()}`; + + const parent = `parent-${Utils.random()}`; let parentId; + + const file1 = { + name: `file1-${Utils.random()}.txt`, + title: 'file title', + description: 'file description', + author: 'file author' + }; + let file1Id; + + const image1 = { + name: FILES.jpgFile, + title: 'image title', + description: 'image description', + author: 'image author' + } + let image1Id; + + const folder1 = { + name: `folder1-${Utils.random()}`, + title: 'folder title', + description: 'folder description', + author: 'folder author' + }; + let folder1Id; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const infoDrawer = new InfoDrawer(); + const { propertiesTab } = infoDrawer; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + + beforeAll(async (done) => { + await apis.admin.people.createUser({ username }); + parentId = (await apis.user.nodes.createFolder(parent)).entry.id; + file1Id = (await apis.user.nodes.createFile(file1.name, parentId, file1.title, file1.description, file1.author)).entry.id; + folder1Id = (await apis.user.nodes.createFolder(folder1.name, parentId, folder1.title, folder1.description, folder1.author)).entry.id; + image1Id = (await apis.user.upload.uploadFile(image1.name, parentId)).entry.id; + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + beforeEach(async (done) => { + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + done(); + }); + + describe('View properties', () => { + it('Default tabs - [C299162]', async () => { + await dataTable.selectItem(file1.name); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + + expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); + expect(await infoDrawer.isPropertiesTabDisplayed()).toBe(true, 'Properties tab is not displayed'); + expect(await infoDrawer.isCommentsTabDisplayed()).toBe(true, 'Comments tab is not displayed'); + expect(await infoDrawer.getTabsCount()).toBe(2, 'Incorrect number of tabs'); + }); + + it('File properties - [C269003]', async () => { + const apiProps = await apis.user.nodes.getNodeById(file1Id); + + const expectedPropLabels = [ + 'Name', + 'Title', + 'Creator', + 'Created Date', + 'Size', + 'Modifier', + 'Modified Date', + 'Mimetype', + 'Author', + 'Description' + ]; + const expectedPropValues = [ + file1.name, + file1.title, + apiProps.entry.createdByUser.displayName, + moment(apiProps.entry.createdAt).format(DATE_FORMAT), + `${apiProps.entry.content.sizeInBytes} Bytes`, + apiProps.entry.modifiedByUser.displayName, + moment(apiProps.entry.modifiedAt).format(DATE_FORMAT), + apiProps.entry.content.mimeTypeName, + file1.author, + file1.description + ]; + + await dataTable.selectItem(file1.name); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + + expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed'); + expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values'); + expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled'); + expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled'); + }); + + it('Folder properties - [C307106]', async () => { + const apiProps = await apis.user.nodes.getNodeById(folder1Id); + + const expectedPropLabels = [ + 'Name', + 'Title', + 'Creator', + 'Created Date', + 'Modifier', + 'Modified Date', + 'Author', + 'Description' + ]; + const expectedPropValues = [ + folder1.name, + folder1.title, + apiProps.entry.createdByUser.displayName, + moment(apiProps.entry.createdAt).format(DATE_FORMAT), + apiProps.entry.modifiedByUser.displayName, + moment(apiProps.entry.modifiedAt).format(DATE_FORMAT), + folder1.author, + folder1.description + ]; + + await dataTable.selectItem(folder1.name); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + + expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed'); + expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values'); + expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled'); + expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled'); + }); + + it('Less / More information buttons - [C269004]', async () => { + await dataTable.selectItem(file1.name); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + + expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled'); + expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded'); + + await propertiesTab.clickLessInformationButton(); + + expect(await propertiesTab.isLessInfoButtonDisplayed()).toBe(false, 'Less information button displayed'); + expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled'); + expect(await propertiesTab.isPropertiesListExpanded()).toBe(false, 'Properties list expanded'); + + await propertiesTab.clickMoreInformationButton(); + + expect(await propertiesTab.isMoreInfoButtonDisplayed()).toBe(false, 'More information button displayed'); + expect(await propertiesTab.isLessInfoButtonEnabled()).toBe(true, 'Less information button not enabled'); + expect(await propertiesTab.isPropertiesListExpanded()).toBe(true, 'Properties list not expanded'); + }); + + it('Image properties - [C269007]', async () => { + const apiProps = await apis.user.nodes.getNodeById(image1Id); + + const expectedPropLabels = [ + 'Image Width', + 'Image Height', + 'Date and Time', + 'Exposure Time', + 'F Number', + 'Flash Activated', + 'Focal Length', + 'ISO Speed', + 'Orientation', + 'Camera Manufacturer', + 'Camera Model', + 'Camera Software' + ]; + const expectedPropValues = [ + apiProps.entry.properties['exif:pixelXDimension'].toString(), + apiProps.entry.properties['exif:pixelYDimension'].toString(), + moment(apiProps.entry.properties['exif:dateTimeOriginal']).format(DATE_TIME_FORMAT), + apiProps.entry.properties['exif:exposureTime'].toString(), + apiProps.entry.properties['exif:fNumber'].toString(), + apiProps.entry.properties['exif:flash'], + apiProps.entry.properties['exif:focalLength'].toString(), + apiProps.entry.properties['exif:isoSpeedRatings'], + (apiProps.entry.properties['exif:orientation']).toString(), + apiProps.entry.properties['exif:manufacturer'], + apiProps.entry.properties['exif:model'], + apiProps.entry.properties['exif:software'] + ]; + + await dataTable.selectItem(image1.name); + await page.toolbar.clickViewDetails(); + await infoDrawer.waitForInfoDrawerToOpen(); + + await propertiesTab.clickLessInformationButton(); + await propertiesTab.clickImagePropertiesPanel(); + await propertiesTab.waitForImagePropertiesPanelToExpand(); + + expect(await propertiesTab.isImagePropertiesPanelDisplayed()).toBe(true, 'Image properties panel not displayed'); + expect(await propertiesTab.getVisiblePropertiesLabels()).toEqual(expectedPropLabels, 'Incorrect properties displayed'); + expect(await propertiesTab.getVisiblePropertiesValues()).toEqual(expectedPropValues, 'Incorrect properties values'); + expect(await propertiesTab.isEditPropertiesButtonEnabled()).toBe(true, 'Edit button not enabled'); + expect(await propertiesTab.isMoreInfoButtonEnabled()).toBe(true, 'More information button not enabled'); + }); + }); + +}); diff --git a/e2e/suites/info-drawer/general.test.ts b/e2e/suites/info-drawer/general.test.ts index 4add293f9b..4465e5f55c 100755 --- a/e2e/suites/info-drawer/general.test.ts +++ b/e2e/suites/info-drawer/general.test.ts @@ -76,15 +76,15 @@ describe('General', () => { done(); }); - it('Info drawer for a file - default tabs - [C299162]', async () => { + it('Info drawer closes on page refresh - [C268999]', async () => { await dataTable.selectItem(file1); await page.toolbar.clickViewDetails(); - await infoDrawer.waitForInfoDrawerToOpen(); + expect(await infoDrawer.isOpen()).toBe(true, 'Info drawer not open'); - expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); - expect(await infoDrawer.isPropertiesTabDisplayed()).toBe(true, 'Properties tab is not displayed'); - expect(await infoDrawer.isCommentsTabDisplayed()).toBe(true, 'Comments tab is not displayed'); - expect(await infoDrawer.getTabsCount()).toBe(2, 'Incorrect number of tabs'); + await page.refresh(); + await dataTable.waitForBody(); + + expect(await infoDrawer.isOpen()).toBe(false, 'Info drawer open'); }); }); diff --git a/e2e/suites/info-drawer/library-properties.test.ts b/e2e/suites/info-drawer/library-properties.test.ts index 032db8baaa..29518cc14d 100755 --- a/e2e/suites/info-drawer/library-properties.test.ts +++ b/e2e/suites/info-drawer/library-properties.test.ts @@ -62,6 +62,7 @@ describe('Library properties', () => { }; const infoDrawer = new InfoDrawer(); + const { aboutTab } = infoDrawer; const loginPage = new LoginPage(); const page = new BrowsingPage(); @@ -108,17 +109,17 @@ describe('Library properties', () => { expect(await infoDrawer.getHeaderTitle()).toEqual('Details'); expect(await infoDrawer.isAboutTabDisplayed()).toBe(true, 'About tab is not displayed'); - expect(await infoDrawer.isNameDisplayed()).toBe(true, 'Name field not displayed'); - expect(await infoDrawer.isLibraryIdDisplayed()).toBe(true, 'Library ID field not displayed'); - expect(await infoDrawer.isVisibilityDisplayed()).toBe(true, 'Visibility field not displayed'); - expect(await infoDrawer.isDescriptionDisplayed()).toBe(true, 'Description field not displayed'); + expect(await aboutTab.isNameDisplayed()).toBe(true, 'Name field not displayed'); + expect(await aboutTab.isLibraryIdDisplayed()).toBe(true, 'Library ID field not displayed'); + expect(await aboutTab.isVisibilityDisplayed()).toBe(true, 'Visibility field not displayed'); + expect(await aboutTab.isDescriptionDisplayed()).toBe(true, 'Description field not displayed'); - expect(await infoDrawer.getName()).toEqual(site.name); - expect(await infoDrawer.getLibraryId()).toEqual(site.id); - expect((await infoDrawer.getVisibility()).toLowerCase()).toEqual((site.visibility).toLowerCase()); - expect(await infoDrawer.getDescription()).toEqual(site.description); + expect(await aboutTab.getName()).toEqual(site.name); + expect(await aboutTab.getLibraryId()).toEqual(site.id); + expect((await aboutTab.getVisibility()).toLowerCase()).toEqual((site.visibility).toLowerCase()); + expect(await aboutTab.getDescription()).toEqual(site.description); - expect(await infoDrawer.isEditDisplayed()).toBe(true, 'Edit action is not displayed'); + expect(await aboutTab.isEditLibraryPropertiesDisplayed()).toBe(true, 'Edit action is not displayed'); }); it('Editable properties - [C289338]', async () => { @@ -126,18 +127,18 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickEdit(); + expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); + await aboutTab.clickEditLibraryProperties(); - expect(await infoDrawer.isNameEnabled()).toBe(true, 'Name field not enabled'); - expect(await infoDrawer.isLibraryIdEnabled()).toBe(false, 'Library ID field not disabled'); - expect(await infoDrawer.isVisibilityEnabled()).toBe(true, 'Visibility field not enabled'); - expect(await infoDrawer.isDescriptionEnabled()).toBe(true, 'Description field not enabled'); + expect(await aboutTab.isNameEnabled()).toBe(true, 'Name field not enabled'); + expect(await aboutTab.isLibraryIdEnabled()).toBe(false, 'Library ID field not disabled'); + expect(await aboutTab.isVisibilityEnabled()).toBe(true, 'Visibility field not enabled'); + expect(await aboutTab.isDescriptionEnabled()).toBe(true, 'Description field not enabled'); - expect(await infoDrawer.isCancelDisplayed()).toBe(true, 'Cancel button not displayed'); - expect(await infoDrawer.isUpdateDisplayed()).toBe(true, 'Update button not displayed'); - expect(await infoDrawer.isCancelEnabled()).toBe(true, 'Cancel button not enabled'); - expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); + expect(await aboutTab.isCancelDisplayed()).toBe(true, 'Cancel button not displayed'); + expect(await aboutTab.isUpdateDisplayed()).toBe(true, 'Update button not displayed'); + expect(await aboutTab.isCancelEnabled()).toBe(true, 'Cancel button not enabled'); + expect(await aboutTab.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); it('Edit site details - [C289339]', async () => { @@ -145,15 +146,15 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickEdit(); + expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); + await aboutTab.clickEditLibraryProperties(); - await infoDrawer.enterName(siteUpdated.name); - await infoDrawer.enterDescription(siteUpdated.description); - await infoDrawer.setVisibility(siteUpdated.visibility); - expect(await infoDrawer.isUpdateEnabled()).toBe(true, 'Update button not enabled'); + await aboutTab.enterName(siteUpdated.name); + await aboutTab.enterDescription(siteUpdated.description); + await aboutTab.setVisibility(siteUpdated.visibility); + expect(await aboutTab.isUpdateEnabled()).toBe(true, 'Update button not enabled'); - await infoDrawer.clickUpdate(); + await aboutTab.clickUpdate(); expect(await page.getSnackBarMessage()).toEqual('Library properties updated'); expect(await dataTable.isItemPresent(siteUpdated.name)).toBe(true, 'New site name not displayed in the list'); @@ -172,14 +173,14 @@ describe('Library properties', () => { await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isEditEnabled()).toBe(true, 'Edit action is not enabled'); - await infoDrawer.clickEdit(); + expect(await aboutTab.isEditLibraryPropertiesEnabled()).toBe(true, 'Edit action is not enabled'); + await aboutTab.clickEditLibraryProperties(); - await infoDrawer.enterName(newName); - await infoDrawer.enterDescription(newDesc); - await infoDrawer.setVisibility(SITE_VISIBILITY.MODERATED); + await aboutTab.enterName(newName); + await aboutTab.enterDescription(newDesc); + await aboutTab.setVisibility(SITE_VISIBILITY.MODERATED); - await infoDrawer.clickCancel(); + await aboutTab.clickCancel(); expect(await dataTable.isItemPresent(newName)).toBe(false, 'New site name is displayed in the list'); expect(await dataTable.isItemPresent(site.name)).toBe(true, 'Original site name not displayed in the list'); @@ -192,37 +193,37 @@ describe('Library properties', () => { await dataTable.selectItem(siteDup); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickEdit(); + await aboutTab.clickEditLibraryProperties(); - await infoDrawer.enterName(site.name); - expect(await infoDrawer.isMessageDisplayed()).toBe(true, 'Message not displayed'); - expect(await infoDrawer.getMessage()).toEqual('Library name already in use'); + await aboutTab.enterName(site.name); + expect(await aboutTab.isMessageDisplayed()).toBe(true, 'Message not displayed'); + expect(await aboutTab.getMessage()).toEqual('Library name already in use'); }); it('Site name too long - [C289342]', async () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickEdit(); + await aboutTab.clickEditLibraryProperties(); - await infoDrawer.enterName(Utils.string257); + await aboutTab.enterName(Utils.string257); await Utils.pressTab(); - expect(await infoDrawer.isErrorDisplayed()).toBe(true, 'Message not displayed'); - expect(await infoDrawer.getError()).toEqual('Use 256 characters or less for title'); - expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); + expect(await aboutTab.isErrorDisplayed()).toBe(true, 'Message not displayed'); + expect(await aboutTab.getError()).toEqual('Use 256 characters or less for title'); + expect(await aboutTab.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); it('Site description too long - [C289343]', async () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickEdit(); + await aboutTab.clickEditLibraryProperties(); - await infoDrawer.enterDescription(Utils.string513); + await aboutTab.enterDescription(Utils.string513); await Utils.pressTab(); - expect(await infoDrawer.isErrorDisplayed()).toBe(true, 'Message not displayed'); - expect(await infoDrawer.getError()).toEqual('Use 512 characters or less for description'); - expect(await infoDrawer.isUpdateEnabled()).toBe(false, 'Update button not disabled'); + expect(await aboutTab.isErrorDisplayed()).toBe(true, 'Message not displayed'); + expect(await aboutTab.getError()).toEqual('Use 512 characters or less for description'); + expect(await aboutTab.isUpdateEnabled()).toBe(false, 'Update button not disabled'); }); describe('Non manager', () => { @@ -238,7 +239,7 @@ describe('Library properties', () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - expect(await infoDrawer.isEditDisplayed()).toBe(false, 'Edit action is displayed'); + expect(await aboutTab.isEditLibraryPropertiesDisplayed()).toBe(false, 'Edit action is displayed'); }); it('Error notification - [C289344]', async () => { @@ -248,12 +249,12 @@ describe('Library properties', () => { await dataTable.selectItem(site.name); await page.toolbar.clickViewDetails(); await infoDrawer.waitForInfoDrawerToOpen(); - await infoDrawer.clickEdit(); + await aboutTab.clickEditLibraryProperties(); await apis.user.sites.updateSiteMember(site.id, user3, SITE_ROLES.SITE_CONSUMER.ROLE); - await infoDrawer.enterDescription('new description'); - await infoDrawer.clickUpdate(); + await aboutTab.enterDescription('new description'); + await aboutTab.clickUpdate(); expect(await page.getSnackBarMessage()).toEqual('There was an error updating library properties'); }); diff --git a/e2e/suites/list-views/empty-list.test.ts b/e2e/suites/list-views/empty-list.test.ts index b8fa7e43ea..93ecafd09f 100755 --- a/e2e/suites/list-views/empty-list.test.ts +++ b/e2e/suites/list-views/empty-list.test.ts @@ -180,4 +180,26 @@ describe('Empty list views', () => { expect(await pagination.isPreviousButtonPresent()).toBe(false, 'Previous button is present'); expect(await pagination.isNextButtonPresent()).toBe(false, 'Next button is present'); }); + + it('Empty Search results - Libraries - [C290020]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + /* cspell:disable-next-line */ + await searchInput.searchFor('qwertyuiop'); + await dataTable.waitForBody(); + + expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty'); + expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results'); + }); + + it('Empty Search results - Files / Folders - [C290031]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + /* cspell:disable-next-line */ + await searchInput.searchFor('qwertyuiop'); + await dataTable.waitForBody(); + + expect(await dataTable.isEmptyList()).toBe(true, 'list is not empty'); + expect(await dataTable.getEmptySearchResultsText()).toContain('Your search returned 0 results'); + }); }); diff --git a/e2e/suites/list-views/permissions.test.ts b/e2e/suites/list-views/permissions.test.ts index 081f4286c1..0e42c6efdb 100755 --- a/e2e/suites/list-views/permissions.test.ts +++ b/e2e/suites/list-views/permissions.test.ts @@ -40,6 +40,7 @@ describe('Special permissions', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); const { dataTable } = page; + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -100,6 +101,24 @@ describe('Special permissions', () => { await page.refresh(); expect(await dataTable.isEmptyList()).toBe(true, 'Items are still displayed'); }); + + it('on Search Results - [C290122]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileName); + await dataTable.waitForBody(); + + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} is not displayed`); + + await apis.admin.sites.deleteSiteMember(sitePrivate, username); + + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileName); + await dataTable.waitForBody(); + + expect(await dataTable.isItemPresent(fileName)).toBe(false, `${fileName} is displayed`); + }); }); describe(`Location column is empty if user doesn't have permissions on the file's parent folder`, () => { @@ -143,5 +162,15 @@ describe('Special permissions', () => { expect(await dataTable.countRows()).toBe(1, 'Incorrect number of items'); expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown'); }); + + it('on Search results - [C306868]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileName); + await dataTable.waitForBody(); + + expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} is not displayed`); + expect(await dataTable.getItemLocation(fileName)).toEqual('Unknown'); + }); }); }); diff --git a/e2e/suites/navigation/sidebar.test.ts b/e2e/suites/navigation/sidebar.test.ts index 83a47645a3..1787c9b4c4 100755 --- a/e2e/suites/navigation/sidebar.test.ts +++ b/e2e/suites/navigation/sidebar.test.ts @@ -61,22 +61,22 @@ describe('Sidebar', () => { it('My Libraries is automatically selected on expanding File Libraries - [C289900]', async () => { await sidenav.expandFileLibraries(); expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.MY_LIBRARIES); - expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active'); - expect(await sidenav.childIsActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries is not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active'); }); it('navigate to Favorite Libraries - [C289902]', async () => { await page.goToFavoriteLibraries(); expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.FAVORITE_LIBRARIES); - expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active'); - expect(await sidenav.childIsActive(SIDEBAR_LABELS.FAVORITE_LIBRARIES)).toBe(true, 'Favorite Libraries link not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries link is not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.FAVORITE_LIBRARIES)).toBe(true, 'Favorite Libraries link not active'); }); it('navigate to My Libraries - [C289901]', async () => { await page.goToMyLibraries(); expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.MY_LIBRARIES); - expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(false, 'File Libraries link is active'); - expect(await sidenav.childIsActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.FILE_LIBRARIES)).toBe(true, 'File Libraries link is not active'); + expect(await sidenav.isActive(SIDEBAR_LABELS.MY_LIBRARIES)).toBe(true, 'My Libraries link not active'); }); it('navigates to "Shared Files" - [C213110]', async () => { @@ -209,7 +209,7 @@ describe('Sidebar', () => { it('sidebar is collapsed automatically when Search Results opens - [C277223]', async () => { await searchInput.clickSearchButton(); /* cspell:disable-next-line */ - await searchInput.searchForTextAndCloseSearchOptions('qwertyuiop'); + await searchInput.searchFor('qwertyuiop'); await searchResultsPage.waitForResults(); expect(await header.isExpandedSidenav()).toBe(false, 'Sidebar not collapsed'); @@ -218,7 +218,7 @@ describe('Sidebar', () => { it('sidenav returns to the default state when navigating away from the Search Results page - [C277224]', async () => { await searchInput.clickSearchButton(); /* cspell:disable-next-line */ - await searchInput.searchForTextAndCloseSearchOptions('qwertyuiop'); + await searchInput.searchFor('qwertyuiop'); await searchResultsPage.waitForResults(); await page.clickFavorites(); @@ -228,7 +228,7 @@ describe('Sidebar', () => { it('sidenav can be expanded when search results page is displayed - [C277230]', async () => { await searchInput.clickSearchButton(); /* cspell:disable-next-line */ - await searchInput.searchForTextAndCloseSearchOptions('qwertyuiop'); + await searchInput.searchFor('qwertyuiop'); await searchResultsPage.waitForResults(); await header.expandSideNav(); diff --git a/e2e/suites/actions/single-click.test.ts b/e2e/suites/navigation/single-click.test.ts similarity index 83% rename from e2e/suites/actions/single-click.test.ts rename to e2e/suites/navigation/single-click.test.ts index 870e7b1c44..d372517896 100755 --- a/e2e/suites/actions/single-click.test.ts +++ b/e2e/suites/navigation/single-click.test.ts @@ -49,6 +49,7 @@ describe('Single click on item name', () => { const page = new BrowsingPage(); const { dataTable, breadcrumb } = page; const viewer = new Viewer(); + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -97,7 +98,7 @@ describe('Single click on item name', () => { }); it('Hyperlink appears when mouse over a file/folder - [C280032]', async () => { - expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing'); + expect(await dataTable.hasLinkOnName(file1)).toBe(true, 'Link on name is missing'); }); it('File preview opens when clicking the hyperlink - [C280033]', async () => { @@ -196,4 +197,43 @@ describe('Single click on item name', () => { }); }); + describe('on Search Results', () => { + beforeEach(async done => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + done(); + }); + + afterEach(async (done) => { + await Utils.pressEscape(); + await page.clickPersonalFilesAndWait(); + done(); + }); + + it('Hyperlink appears when mouse over a file - [C306988]', async () => { + await searchInput.searchFor(file1); + await dataTable.waitForBody(); + + expect(await dataTable.hasLinkOnSearchResultName(file1)).toBe(true, 'Link on name is missing'); + }); + + it('File preview opens when clicking the hyperlink - [C306989]', async () => { + await searchInput.searchFor(file1); + await dataTable.waitForBody(); + await dataTable.clickSearchResultNameLink(file1); + + expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); + + await Utils.pressEscape(); + }); + + it('Navigate inside the folder when clicking the hyperlink - [C306990]', async () => { + await searchInput.searchFor(folder1); + await dataTable.waitForBody(); + await dataTable.clickSearchResultNameLink(folder1); + + expect(await breadcrumb.getCurrentItemName()).toBe(folder1); + }); + }); + }); diff --git a/e2e/suites/pagination/pag-favorites.test.ts b/e2e/suites/pagination/pag-favorites.test.ts index 95b0a804e3..0a94f9ab90 100755 --- a/e2e/suites/pagination/pag-favorites.test.ts +++ b/e2e/suites/pagination/pag-favorites.test.ts @@ -83,11 +83,9 @@ describe('Pagination on multiple pages on Favorites', () => { it('Items per page values - [C280114]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); diff --git a/e2e/suites/pagination/pag-file-libraries.test.ts b/e2e/suites/pagination/pag-file-libraries.test.ts index a042c1f5b9..91edddffcb 100755 --- a/e2e/suites/pagination/pag-file-libraries.test.ts +++ b/e2e/suites/pagination/pag-file-libraries.test.ts @@ -78,11 +78,9 @@ describe('Pagination on multiple pages', () => { it('Items per page values - [C280087]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); @@ -181,11 +179,9 @@ describe('Pagination on multiple pages', () => { it('Items per page values - [C291876]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); diff --git a/e2e/suites/pagination/pag-personal-files.test.ts b/e2e/suites/pagination/pag-personal-files.test.ts index eeef6ea253..18a0a948be 100755 --- a/e2e/suites/pagination/pag-personal-files.test.ts +++ b/e2e/suites/pagination/pag-personal-files.test.ts @@ -55,6 +55,7 @@ describe('Pagination on multiple pages on Personal Files', () => { beforeEach(async (done) => { await page.clickPersonalFilesAndWait(); await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); done(); }); @@ -79,11 +80,9 @@ describe('Pagination on multiple pages on Personal Files', () => { it('Items per page values - [C280078]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); @@ -93,7 +92,7 @@ describe('Pagination on multiple pages on Personal Files', () => { expect(await pagination.getMaxItems()).toContain('25'); expect(await pagination.getTotalPages()).toContain('of 5'); await pagination.openCurrentPageMenu(); - expect(pagination.menu.getItemsCount()).toBe(5); + expect(await pagination.menu.getItemsCount()).toBe(5); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); @@ -101,7 +100,7 @@ describe('Pagination on multiple pages on Personal Files', () => { expect(await pagination.getMaxItems()).toContain('50'); expect(await pagination.getTotalPages()).toContain('of 3'); await pagination.openCurrentPageMenu(); - expect(pagination.menu.getItemsCount()).toBe(3); + expect(await pagination.menu.getItemsCount()).toBe(3); await pagination.menu.closeMenu(); await pagination.openMaxItemsMenu(); diff --git a/e2e/suites/pagination/pag-recent-files.test.ts b/e2e/suites/pagination/pag-recent-files.test.ts index 8154121696..32e377dcfa 100755 --- a/e2e/suites/pagination/pag-recent-files.test.ts +++ b/e2e/suites/pagination/pag-recent-files.test.ts @@ -79,11 +79,9 @@ describe('Pagination on multiple pages on Recent Files', () => { it('Items per page values - [C280105]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); @@ -140,8 +138,8 @@ describe('Pagination on multiple pages on Recent Files', () => { await dataTable.waitForHeader(); await pagination.clickPrevious(); await dataTable.waitForHeader(); - expect(pagination.getRange()).toContain('1-25 of 101'); - expect(dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); + expect(await pagination.getRange()).toContain('1-25 of 101'); + expect(await dataTable.isItemPresent('file-88')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); }); diff --git a/e2e/suites/pagination/pag-search-results.test.ts b/e2e/suites/pagination/pag-search-results.test.ts index b6b21d6e3f..dd9fa015bb 100755 --- a/e2e/suites/pagination/pag-search-results.test.ts +++ b/e2e/suites/pagination/pag-search-results.test.ts @@ -81,11 +81,9 @@ describe('Pagination on multiple pages on Search Results', () => { it('Items per page values - [C290126]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); @@ -140,7 +138,7 @@ describe('Pagination on multiple pages on Search Results', () => { await dataTable.waitForBody(); await pagination.clickPrevious(); await dataTable.waitForBody(); - expect(pagination.getRange()).toContain('1-25 of 101'); + expect(await pagination.getRange()).toContain('1-25 of 101'); await pagination.resetToDefaultPageNumber(); }); diff --git a/e2e/suites/pagination/pag-shared-files.test.ts b/e2e/suites/pagination/pag-shared-files.test.ts index d3439a1b82..4a2695cc39 100755 --- a/e2e/suites/pagination/pag-shared-files.test.ts +++ b/e2e/suites/pagination/pag-shared-files.test.ts @@ -82,12 +82,9 @@ describe('Pagination on multiple pages on Shared Files', () => { it('Items per page values - [C280096]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); - + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); diff --git a/e2e/suites/pagination/pag-trash.test.ts b/e2e/suites/pagination/pag-trash.test.ts index 30c0e863b5..bebb729d73 100755 --- a/e2e/suites/pagination/pag-trash.test.ts +++ b/e2e/suites/pagination/pag-trash.test.ts @@ -78,11 +78,9 @@ describe('Pagination on multiple pages on Trash', () => { it('Items per page values - [C280123]', async () => { await pagination.openMaxItemsMenu(); - const [ first, second, third ] = [1, 2, 3] - .map(async nth => await pagination.menu.getNthItem(nth).getText()); - expect(first).toBe('25'); - expect(second).toBe('50'); - expect(third).toBe('100'); + expect(await pagination.menu.getNthItem(1).getText()).toBe('25'); + expect(await pagination.menu.getNthItem(2).getText()).toBe('50'); + expect(await pagination.menu.getNthItem(3).getText()).toBe('100'); await pagination.menu.closeMenu(); }); @@ -130,8 +128,8 @@ describe('Pagination on multiple pages on Trash', () => { it('navigate to next and previous pages - [C280128]', async () => { await pagination.clickNext(); await dataTable.waitForHeader(); - expect(pagination.getRange()).toContain('26-50 of 101'); - expect(dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); + expect(await pagination.getRange()).toContain('26-50 of 101'); + expect(await dataTable.isItemPresent('file-70')).toBe(true, 'File not found on page'); await pagination.resetToDefaultPageNumber(); await pagination.openCurrentPageMenu(); diff --git a/e2e/suites/search/search-results-files-folders.test.ts b/e2e/suites/search/search-results-files-folders.test.ts new file mode 100644 index 0000000000..db589b1970 --- /dev/null +++ b/e2e/suites/search/search-results-files-folders.test.ts @@ -0,0 +1,214 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, SearchResultsPage } from '../../pages/pages'; +import { RepoClient } from '../../utilities/repo-client/repo-client'; +import { Utils } from '../../utilities/utils'; +import * as moment from 'moment'; + +describe('Search results - files and folders', () => { + const username = `user-${Utils.random()}`; + + const file = `test-file-${Utils.random()}.txt`; + let fileId; + const fileTitle = 'file title'; + const fileDescription = 'file description'; + + /* cspell:disable-next-line */ + const fileRussian = `любимый-сайт-${Utils.random()}`; + let fileRussianId; + + const folder = `test-folder-${Utils.random()}`; + let folderId; + const folderTitle = 'folder title'; + const folderDescription = 'folder description'; + + const site = `test-site-${Utils.random()}`; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new SearchResultsPage(); + const { searchInput } = page.header; + const { dataTable, breadcrumb } = page; + + beforeAll(async done => { + await apis.admin.people.createUser({ username }); + + fileId = (await apis.user.nodes.createFile( + file, + '-my-', + fileTitle, + fileDescription + )).entry.id; + await apis.user.nodes.editNodeContent(fileId, 'edited by user'); + folderId = (await apis.user.nodes.createFolder( + folder, + '-my-', + folderTitle, + folderDescription + )).entry.id; + fileRussianId = (await apis.user.nodes.createFile(fileRussian)).entry.id; + await apis.user.sites.createSite(site); + + await apis.user.search.waitForApi(username, { expect: 2 }); + await apis.user.queries.waitForSites(site, { expect: 1 }); + + await loginPage.loginWith(username); + done(); + }); + + afterAll(async done => { + await Promise.all([ + apis.user.nodes.deleteNodeById(fileId), + apis.user.nodes.deleteNodeById(fileRussianId), + apis.user.nodes.deleteNodeById(folderId), + apis.user.sites.deleteSite(site) + ]); + done(); + }); + + beforeEach(async done => { + await page.refresh(); + done(); + }); + + it('Results page title - [C307002]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('test-'); + await dataTable.waitForBody(); + + expect(await page.breadcrumb.getCurrentItemName()).toEqual( + 'Search Results' + ); + }); + + it('File information - [C279183]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('test-'); + await dataTable.waitForBody(); + + const fileEntry = await apis.user.nodes.getNodeById(fileId); + const modifiedDate = moment(fileEntry.entry.modifiedAt).format( + 'MMM D, YYYY, h:mm:ss A' + ); + const modifiedBy = fileEntry.entry.modifiedByUser.displayName; + const size = fileEntry.entry.content.sizeInBytes; + + expect(await dataTable.isItemPresent(file)).toBe( + true, + `${file} is not displayed` + ); + + expect(await dataTable.getRowCellsCount(file)).toEqual( + 2, + 'incorrect number of columns' + ); + + expect(await dataTable.getSearchResultLinesCount(file)).toEqual( + 4, + 'incorrect number of lines for search result' + ); + expect(await dataTable.getSearchResultNameAndTitle(file)).toBe( + `${file} ( ${fileTitle} )` + ); + expect(await dataTable.getSearchResultDescription(file)).toBe( + fileDescription + ); + expect(await dataTable.getSearchResultModified(file)).toBe( + `Modified: ${modifiedDate} by ${modifiedBy} | Size: ${size} Bytes` + ); + expect(await dataTable.getSearchResultLocation(file)).toMatch( + /Location:\s+Personal Files/ + ); + }); + + it('Folder information - [C306867]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor('test-'); + await dataTable.waitForBody(); + + const folderEntry = await apis.user.nodes.getNodeById(folderId); + const modifiedDate = moment(folderEntry.entry.modifiedAt).format( + 'MMM D, YYYY, h:mm:ss A' + ); + const modifiedBy = folderEntry.entry.modifiedByUser.displayName; + + expect(await dataTable.isItemPresent(folder)).toBe( + true, + `${folder} is not displayed` + ); + + expect(await dataTable.getRowCellsCount(folder)).toEqual( + 2, + 'incorrect number of columns' + ); + + expect(await dataTable.getSearchResultLinesCount(folder)).toEqual( + 4, + 'incorrect number of lines for search result' + ); + expect(await dataTable.getSearchResultNameAndTitle(folder)).toBe( + `${folder} ( ${folderTitle} )` + ); + expect(await dataTable.getSearchResultDescription(folder)).toBe( + folderDescription + ); + expect(await dataTable.getSearchResultModified(folder)).toBe( + `Modified: ${modifiedDate} by ${modifiedBy}` + ); + expect(await dataTable.getSearchResultLocation(folder)).toMatch( + /Location:\s+Personal Files/ + ); + }); + + it('Search file with special characters - [C290029]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(fileRussian); + await dataTable.waitForBody(); + + expect(await dataTable.isItemPresent(fileRussian)).toBe( + true, + `${fileRussian} is not displayed` + ); + }); + + it('Location column redirect - file in user Home - [C279177]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(file); + await dataTable.waitForBody(); + + await dataTable.clickItemLocation(file); + expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); + }); +}); diff --git a/e2e/suites/search/search-results.test.ts b/e2e/suites/search/search-results-general.test.ts similarity index 77% rename from e2e/suites/search/search-results.test.ts rename to e2e/suites/search/search-results-general.test.ts index 9c9d26df95..cc21b4ef5e 100644 --- a/e2e/suites/search/search-results.test.ts +++ b/e2e/suites/search/search-results-general.test.ts @@ -26,8 +26,9 @@ import { LoginPage, SearchResultsPage } from '../../pages/pages'; import { RepoClient } from '../../utilities/repo-client/repo-client'; import { Utils } from '../../utilities/utils'; +import { browser } from 'protractor'; -describe('Search results', () => { +describe('Search results general', () => { const username = `user-${Utils.random()}`; const file = `test-file-${Utils.random()}.txt`; let fileId; @@ -116,4 +117,36 @@ describe('Search results', () => { expect(await dataTable.isItemPresent(site)).toBe(true, `${site} not displayed`); }); + it('Results are updated automatically when changing the search term - [C279162]', async () => { + await searchInput.clickSearchButton(); + await searchInput.searchFor(file); + await page.waitForResults(); + + expect(await dataTable.isItemPresent(file)).toBe(true, `${file} is not displayed`); + expect(await dataTable.isItemPresent(folder)).toBe(false, `${folder} is displayed`); + + await searchInput.clickSearchButton(); + await searchInput.searchFor(folder); + + expect(await dataTable.isItemPresent(file)).toBe(false, `${file} is displayed`); + expect(await dataTable.isItemPresent(folder)).toBe(true, `${folder} is not displayed`); + }); + + it('Results are returned when accessing an URL containing a search query - [C279178]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkLibraries(); + await searchInput.searchFor(site); + await page.waitForResults(); + + expect(await dataTable.isItemPresent(site)).toBe(true, `${site} not displayed`); + + const url = await browser.getCurrentUrl(); + + await page.clickPersonalFiles(); + await browser.get(url); + await page.waitForResults(); + + expect(await dataTable.isItemPresent(site)).toBe(true, `${site} not displayed`); + }); + }); diff --git a/e2e/suites/search/search-results-libraries.test.ts b/e2e/suites/search/search-results-libraries.test.ts index 249da46152..a40ed84f73 100644 --- a/e2e/suites/search/search-results-libraries.test.ts +++ b/e2e/suites/search/search-results-libraries.test.ts @@ -103,13 +103,14 @@ describe('Search results - libraries', () => { await apis.user.sites.waitForApi({ expect: 12 }); await apis.user.queries.waitForSites('lib', { expect: 2 }); + await apis.user.queries.waitForSites('my-site', { expect: 1 }); await loginPage.loginWith(username); done(); }); afterAll(async (done) => { - await Promise.all([ + await Promise.all([ apis.admin.sites.deleteSites([ adminSite1, adminSite2, adminSite3, adminSite4, adminPrivate ]), apis.user.sites.deleteSites([ site1.id, site2.id, site3.id, site4.id, userSitePublic, userSiteModerated, userSitePrivate, siteRussian.id ]) ]); diff --git a/e2e/suites/viewer/viewer-actions.test.ts b/e2e/suites/viewer/viewer-actions.test.ts index 6228f0ff47..11777415ff 100755 --- a/e2e/suites/viewer/viewer-actions.test.ts +++ b/e2e/suites/viewer/viewer-actions.test.ts @@ -66,7 +66,7 @@ describe('Viewer actions', () => { const destination = `destPF-${Utils.random()}`; let destinationId; const docxPersonalFiles = `docxPF-${Utils.random()}.docx`; let docxFileId; - const docxLockedPersonalFiles = `docxLockedPF-${Utils.random()}.docx`; let docxLockedId; + const xlsxPersonalFiles = `xlsxPF-${Utils.random()}.xlsx`; const pdfPersonalFiles = `pdfPF-${Utils.random()}.pdf`; const filePersonalFiles = docxFile2; let filePersonalFilesId; @@ -80,7 +80,7 @@ describe('Viewer actions', () => { destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxPersonalFiles)).entry.id; - docxLockedId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxLockedPersonalFiles)).entry.id; + filePersonalFilesId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxPersonalFiles); await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfPersonalFiles); @@ -91,7 +91,7 @@ describe('Viewer actions', () => { await apis.user.nodes.lockFile(fileForCancelEditingId); await apis.user.nodes.lockFile(fileForUploadNewVersionId); - await apis.user.nodes.lockFile(docxLockedId); + await loginPage.loginWith(username); done(); @@ -116,58 +116,6 @@ describe('Viewer actions', () => { done(); }); - it('Correct actions appear in the viewer toolbar - [C282025]', async () => { - await dataTable.doubleClickOnRowByName(docxPersonalFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('Correct actions appear in the viewer toolbar for a locked file - [C297583]', async () => { - await dataTable.doubleClickOnRowByName(docxLockedPersonalFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - it('Download action - [C268129]', async () => { await dataTable.doubleClickOnRowByName(docxPersonalFiles); await viewer.waitForViewerToOpen(); @@ -251,7 +199,7 @@ describe('Viewer actions', () => { await viewer.waitForViewerToOpen(); await toolbar.clickMoreActionsCancelEditing(); - expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`); + expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open'); }); @@ -321,7 +269,7 @@ describe('Viewer actions', () => { const destination = `destFL-${Utils.random()}`; let destinationId; const docxLibraries = `docxFL-${Utils.random()}.docx`; let docxFileId; - const docxLockedLibraries = `docxLockedFL-${Utils.random()}.docx`; let docxLockedId; + const xlsxLibraries = `xlsxFL-${Utils.random()}.xlsx`; const pdfLibraries = `pdfFL-${Utils.random()}.pdf`; const fileLibraries = docxFile2; let fileLibrariesId; @@ -335,9 +283,9 @@ describe('Viewer actions', () => { const docLibId = await apis.user.sites.getDocLibId(siteName); destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, docLibId, docxLibraries)).entry.id; - docxLockedId = (await apis.user.upload.uploadFileWithRename(docxFile, docLibId, docxLockedLibraries)).entry.id; + fileLibrariesId = (await apis.user.upload.uploadFile(docxFile2, docLibId)).entry.id; - await apis.user.nodes.lockFile(docxLockedId); + await apis.user.upload.uploadFileWithRename(xlsxFileForMove, docLibId, xlsxLibraries); await apis.user.upload.uploadFileWithRename(pdfFileForDelete, docLibId, pdfLibraries); @@ -371,58 +319,6 @@ describe('Viewer actions', () => { done(); }); - it('Correct actions appear in the viewer toolbar - [C297587]', async () => { - await dataTable.doubleClickOnRowByName(docxLibraries); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('Correct actions appear in the viewer toolbar for a locked file - [C297588]', async () => { - await dataTable.doubleClickOnRowByName(docxLockedLibraries); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - it('Download action - [C286369]', async () => { await dataTable.doubleClickOnRowByName(docxLibraries); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); @@ -506,7 +402,7 @@ describe('Viewer actions', () => { await viewer.waitForViewerToOpen(); await toolbar.clickMoreActionsCancelEditing(); - expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`); + expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open'); }); @@ -552,7 +448,7 @@ describe('Viewer actions', () => { const destination = `destRF-${Utils.random()}`; let destinationId; const docxRecentFiles = `docxRF-${Utils.random()}.docx`; let docxFileId; - const docxLockedRecentFiles = `docxLockedRF-${Utils.random()}.docx`; let docxLockedId; + const xlsxRecentFiles = `xlsxRF-${Utils.random()}.xlsx`; const pdfRecentFiles = `pdfRF-${Utils.random()}.pdf`; const fileRecent = docxFile2; let fileRecentId; @@ -566,7 +462,7 @@ describe('Viewer actions', () => { parentId = (await apis.user.nodes.createFolder(parent)).entry.id; destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxRecentFiles)).entry.id; - docxLockedId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxLockedRecentFiles)).entry.id; + fileRecentId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; fileForEditOfflineId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, fileForEditOffline)).entry.id; @@ -576,7 +472,7 @@ describe('Viewer actions', () => { await apis.user.nodes.lockFile(fileForCancelEditingId); await apis.user.nodes.lockFile(fileForUploadNewVersionId); - await apis.user.nodes.lockFile(docxLockedId); + await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxRecentFiles); await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfRecentFiles); @@ -603,58 +499,6 @@ describe('Viewer actions', () => { done(); }); - it('Correct actions appear in the viewer toolbar - [C297592]', async () => { - await dataTable.doubleClickOnRowByName(docxRecentFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('Correct actions appear in the viewer toolbar for a locked file - [C297593]', async () => { - await dataTable.doubleClickOnRowByName(docxLockedRecentFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await toolbar.menu.isToggleFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - it('Download action - [C286383]', async () => { await dataTable.doubleClickOnRowByName(docxRecentFiles); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); @@ -739,7 +583,7 @@ describe('Viewer actions', () => { await viewer.waitForViewerToOpen(); await toolbar.clickMoreActionsCancelEditing(); - expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`); + expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open'); }); @@ -785,7 +629,7 @@ describe('Viewer actions', () => { const destination = `destSF-${Utils.random()}`; let destinationId; const docxSharedFiles = `docxSF-${Utils.random()}.docx`; let docxFileId; - const docxLockedSharedFiles = `docxLockedSF-${Utils.random()}.docx`; let docxLockedId; + const xlsxSharedFiles = `xlsxSF-${Utils.random()}.xlsx`; let xlsxFileId; const pdfSharedFiles = `pdfSF-${Utils.random()}.pdf`; let pdfFileId; const fileShared = docxFile2; let fileSharedId; @@ -798,7 +642,7 @@ describe('Viewer actions', () => { parentId = (await apis.user.nodes.createFolder(parent)).entry.id; destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxSharedFiles)).entry.id; - docxLockedId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxLockedSharedFiles)).entry.id; + xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxSharedFiles)).entry.id; pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfSharedFiles)).entry.id; fileSharedId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; @@ -809,9 +653,9 @@ describe('Viewer actions', () => { await apis.user.nodes.lockFile(fileForCancelEditingId); await apis.user.nodes.lockFile(fileForUploadNewVersionId); - await apis.user.nodes.lockFile(docxLockedId); - await apis.user.shared.shareFilesByIds([docxFileId, docxLockedId, xlsxFileId, pdfFileId, fileForCancelEditingId, fileForEditOfflineId, fileForUploadNewVersionId, fileSharedId]) + + await apis.user.shared.shareFilesByIds([docxFileId, xlsxFileId, pdfFileId, fileForCancelEditingId, fileForEditOfflineId, fileForUploadNewVersionId, fileSharedId]) await apis.user.shared.waitForApi({expect: 8}); await loginPage.loginWith(username); @@ -835,58 +679,6 @@ describe('Viewer actions', () => { done(); }); - it('Correct actions appear in the viewer toolbar - [C297597]', async () => { - await dataTable.doubleClickOnRowByName(docxSharedFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('Correct actions appear in the viewer toolbar for a locked file - [C297598]', async () => { - await dataTable.doubleClickOnRowByName(docxLockedSharedFiles); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharedLinkSettingsPresent()).toBe(true, `Shared link settings is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await toolbar.menu.isFavoritePresent()).toBe(true, `Favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - it('Download action - [C286376]', async () => { await dataTable.doubleClickOnRowByName(docxSharedFiles); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); @@ -971,7 +763,7 @@ describe('Viewer actions', () => { await viewer.waitForViewerToOpen(); await toolbar.clickMoreActionsCancelEditing(); - expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`); + expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open'); }); @@ -1019,7 +811,7 @@ describe('Viewer actions', () => { let destinationId; const docxFavorites = `docxFav-${Utils.random()}.docx`; let docxFileId; - const docxLockedFavorites = `docxLockedFav-${Utils.random()}.docx`; let docxLockedId; + const xlsxFavorites = `xlsxFav-${Utils.random()}.xlsx`; let xlsxFileId; const pdfFavorites = `pdfFav-${Utils.random()}.pdf`; let pdfFileId; const fileFav = docxFile2; let fileFavId; @@ -1032,7 +824,7 @@ describe('Viewer actions', () => { parentId = (await apis.user.nodes.createFolder(parent)).entry.id; destinationId = (await apis.user.nodes.createFolder(destination)).entry.id; docxFileId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxFavorites)).entry.id; - docxLockedId = (await apis.user.upload.uploadFileWithRename(docxFile, parentId, docxLockedFavorites)).entry.id; + xlsxFileId = (await apis.user.upload.uploadFileWithRename(xlsxFileForMove, parentId, xlsxFavorites)).entry.id; pdfFileId = (await apis.user.upload.uploadFileWithRename(pdfFileForDelete, parentId, pdfFavorites)).entry.id; fileFavId = (await apis.user.upload.uploadFile(docxFile2, parentId)).entry.id; @@ -1043,9 +835,9 @@ describe('Viewer actions', () => { await apis.user.nodes.lockFile(fileForCancelEditingId); await apis.user.nodes.lockFile(fileForUploadNewVersionId); - await apis.user.nodes.lockFile(docxLockedId); - await apis.user.favorites.addFavoritesByIds('file', [docxFileId, docxLockedId, xlsxFileId, pdfFileId, fileForEditOfflineId, fileForCancelEditingId, fileForUploadNewVersionId, fileFavId]) + + await apis.user.favorites.addFavoritesByIds('file', [docxFileId, xlsxFileId, pdfFileId, fileForEditOfflineId, fileForCancelEditingId, fileForUploadNewVersionId, fileFavId]) await apis.user.favorites.waitForApi({expect: 8}); await loginPage.loginWith(username); @@ -1069,58 +861,6 @@ describe('Viewer actions', () => { done(); }); - it('Correct actions appear in the viewer toolbar - [C297599]', async () => { - await dataTable.doubleClickOnRowByName(docxFavorites); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(true, `Edit offline is not displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(false, `Cancel editing is displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - - it('Correct actions appear in the viewer toolbar for a locked file - [C297600]', async () => { - await dataTable.doubleClickOnRowByName(docxLockedFavorites); - await viewer.waitForViewerToOpen(); - - expect(await toolbar.isEmpty()).toBe(false, `viewer toolbar is empty`); - expect(await toolbar.isViewPresent()).toBe(false, `View is displayed`); - expect(await toolbar.isDownloadPresent()).toBe(true, `Download is not displayed`); - expect(await toolbar.isPrintPresent()).toBe(true, `Print is not displayed`); - expect(await toolbar.isFullScreenPresent()).toBe(true, `Full screen is not displayed`); - expect(await toolbar.isSharePresent()).toBe(true, `Share is not displayed`); - expect(await toolbar.isViewDetailsPresent()).toBe(true, `view details is not displayed`); - - await toolbar.openMoreMenu(); - - expect(await toolbar.menu.isEditOfflinePresent()).toBe(false, `Edit offline is displayed`); - expect(await toolbar.menu.isCancelEditingPresent()).toBe(true, `Cancel editing is not displayed`); - expect(await toolbar.menu.isToggleRemoveFavoritePresent()).toBe(true, `Remove favorite is not displayed`); - expect(await toolbar.menu.isCopyPresent()).toBe(true, `Copy is not displayed`); - expect(await toolbar.menu.isMovePresent()).toBe(true, `Move is not displayed`); - expect(await toolbar.menu.isDeletePresent()).toBe(true, `Delete is not displayed`); - expect(await toolbar.menu.isManageVersionsPresent()).toBe(true, `Manage versions is not displayed`); - expect(await toolbar.menu.isUploadNewVersionPresent()).toBe(true, `Upload new version is not displayed`); - - await toolbar.closeMoreMenu(); - }); - it('Download action - [C286390]', async () => { await dataTable.doubleClickOnRowByName(docxFavorites); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); @@ -1205,7 +945,7 @@ describe('Viewer actions', () => { await viewer.waitForViewerToOpen(); await toolbar.clickMoreActionsCancelEditing(); - expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`); + expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`); expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open'); }); diff --git a/e2e/suites/viewer/viewer-general.test.ts b/e2e/suites/viewer/viewer-general.test.ts index 3341402230..d536524956 100755 --- a/e2e/suites/viewer/viewer-general.test.ts +++ b/e2e/suites/viewer/viewer-general.test.ts @@ -49,8 +49,9 @@ describe('Viewer general', () => { const loginPage = new LoginPage(); const page = new BrowsingPage(); - const dataTable = page.dataTable; + const { dataTable } = page; const viewer = new Viewer(); + const { searchInput } = page.header; beforeAll(async (done) => { await apis.admin.people.createUser({ username }); @@ -75,6 +76,7 @@ describe('Viewer general', () => { }); beforeEach(async (done) => { + await page.header.expandSideNav(); await page.clickPersonalFilesAndWait(); await dataTable.doubleClickOnRowByName(parent); await dataTable.waitForHeader(); @@ -83,6 +85,7 @@ describe('Viewer general', () => { afterEach(async (done) => { await Utils.pressEscape(); + await page.header.expandSideNav(); done(); }); @@ -175,4 +178,17 @@ describe('Viewer general', () => { expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); }); + it('Viewer opens for a file from Search Results - [C279175]', async () => { + await searchInput.clickSearchButton(); + await searchInput.checkFilesAndFolders(); + await searchInput.searchFor(xlsxFile); + await dataTable.waitForBody(); + + await dataTable.doubleClickOnRowByName(xlsxFile); + expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not opened'); + expect(await viewer.isViewerToolbarDisplayed()).toBe(true, 'Toolbar not displayed'); + expect(await viewer.isCloseButtonDisplayed()).toBe(true, 'Close button is not displayed'); + expect(await viewer.isFileTitleDisplayed()).toBe(true, 'File title is not displayed'); + }); + }); diff --git a/e2e/suites/viewer/viewer-protected-file.test.ts b/e2e/suites/viewer/viewer-protected-file.test.ts new file mode 100755 index 0000000000..b6ecebd466 --- /dev/null +++ b/e2e/suites/viewer/viewer-protected-file.test.ts @@ -0,0 +1,119 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { LoginPage, BrowsingPage } from '../../pages/pages'; +import { FILES } from '../../configs'; +import { RepoClient } from '../../utilities/repo-client/repo-client'; +import { Utils } from '../../utilities/utils'; +import { Viewer } from '../../components/viewer/viewer'; +import { PasswordDialog } from './../../components/dialog/password-dialog'; + +describe('Viewer - password protected file', () => { + const username = `user-${Utils.random()}`; + + const parent = `parent-${Utils.random()}`; let parentId; + + const protectedFile = FILES.protectedFile; + + const apis = { + admin: new RepoClient(), + user: new RepoClient(username, username) + }; + + const loginPage = new LoginPage(); + const page = new BrowsingPage(); + const { dataTable } = page; + const viewer = new Viewer(); + const passwordDialog = new PasswordDialog(); + + beforeAll(async (done) => { + 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) => { + await page.header.expandSideNav(); + await page.clickPersonalFilesAndWait(); + await dataTable.doubleClickOnRowByName(parent); + await dataTable.waitForHeader(); + await dataTable.doubleClickOnRowByName(protectedFile.name); + await viewer.waitForViewerToOpen(); + await page.waitForDialog(); + done(); + }); + + afterEach(async (done) => { + if (await passwordDialog.isDialogOpen()) { + await passwordDialog.clickClose(); + } + await Utils.pressEscape(); + done(); + }); + + afterAll(async (done) => { + await apis.user.nodes.deleteNodeById(parentId); + done(); + }); + + it('Password dialog appears when opening a protected file - [C268958]', async () => { + expect(await passwordDialog.isDialogOpen()).toBe(true, 'Password dialog not open'); + expect(await passwordDialog.isPasswordInputDisplayed()).toBe(true, 'Password input not displayed'); + expect(await passwordDialog.isSubmitEnabled()).toBe(false, 'Submit button not disabled'); + expect(await passwordDialog.isCloseEnabled()).toBe(true, 'Close button not enabled'); + expect(await viewer.isPdfViewerContentDisplayed()).toBe(false, 'file content is displayed'); + }); + + it('File content is displayed when entering the correct password - [C268959]', async () => { + await passwordDialog.enterPassword(protectedFile.password); + expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled'); + + await passwordDialog.clickSubmit(); + await passwordDialog.waitForDialogToClose(); + + expect(await viewer.isPdfViewerContentDisplayed()).toBe(true, 'file content not displayed'); + }); + + it('Error appears when entering an incorrect password - [C268960]', async () => { + await passwordDialog.enterPassword('incorrect'); + expect(await passwordDialog.isSubmitEnabled()).toBe(true, 'Submit button not enabled'); + await passwordDialog.clickSubmit(); + + expect(await passwordDialog.getErrorMessage()).toBe('Password is wrong'); + expect(await viewer.isPdfViewerContentDisplayed()).toBe(false, 'file content is displayed'); + }); + + it('Refresh the page while Password dialog is open - [C268961]', async () => { + await passwordDialog.enterPassword(protectedFile.password); + await page.refresh(); + await viewer.waitForViewerToOpen(); + + expect(await viewer.isPdfViewerContentDisplayed()).toBe(false, 'file content is displayed'); + expect(await passwordDialog.isDialogOpen()).toBe(true, 'Password dialog not open'); + }); +}); diff --git a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts index 3f119bb045..d884d925cb 100755 --- a/e2e/utilities/repo-client/apis/favorites/favorites-api.ts +++ b/e2e/utilities/repo-client/apis/favorites/favorites-api.ts @@ -67,7 +67,7 @@ export class FavoritesApi extends RepoApi { try { return await this.favoritesApi.createFavorite('-me-', data); } catch (error) { - // console.log('--- add favorite by id catch '); + console.log('--- add favorite by id catch '); } } @@ -116,7 +116,7 @@ export class FavoritesApi extends RepoApi { try { return await this.favoritesApi.deleteFavorite('-me-', nodeId); } catch (error) { - // console.log('--- remove favorite by id catch '); + console.log('--- remove favorite by id catch ', error); } } diff --git a/e2e/utilities/repo-client/apis/nodes/nodes-api.ts b/e2e/utilities/repo-client/apis/nodes/nodes-api.ts index 52e3c9746a..0cf4613bf6 100755 --- a/e2e/utilities/repo-client/apis/nodes/nodes-api.ts +++ b/e2e/utilities/repo-client/apis/nodes/nodes-api.ts @@ -27,6 +27,7 @@ import { RepoApi } from '../repo-api'; import { NodeBodyCreate } from './node-body-create'; import { NodeContentTree, flattenNodeContentTree } from './node-content-tree'; import { NodesApi as AdfNodeApi, NodeBodyLock} from '@alfresco/js-api'; +import { Utils } from '../../../../utilities/utils'; export class NodesApi extends RepoApi { nodesApi = new AdfNodeApi(this.alfrescoJsApi); @@ -45,6 +46,11 @@ export class NodesApi extends RepoApi { return await this.nodesApi.getNode(id); } + async getNodeIdFromParent(name: string, parentId: string) { + const children = (await this.getNodeChildren(parentId)).list.entries; + return children.find(elem => elem.entry.name === name).entry.id; + } + async getNodeDescription(name: string, parentId: string) { const children = (await this.getNodeChildren(parentId)).list.entries; return children.find(elem => elem.entry.name === name).entry.properties['cm:description']; @@ -136,13 +142,14 @@ export class NodesApi extends RepoApi { return await this.createNode('cm:content', name, parentId, title, description, imageProps); } - async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null, majorVersion: boolean = true) { + async createNode(nodeType: string, name: string, parentId: string = '-my-', title: string = '', description: string = '', imageProps: any = null, author: string = '', majorVersion: boolean = true) { const nodeBody = { name, nodeType, properties: { 'cm:title': title, - 'cm:description': description + 'cm:description': description, + 'cm:author': author } }; if (imageProps) { @@ -150,22 +157,36 @@ export class NodesApi extends RepoApi { } await this.apiAuth(); - return await this.nodesApi.createNode(parentId, nodeBody, { majorVersion: true }); + + try { + return await this.nodesApi.createNode(parentId, nodeBody, { majorVersion }); + } catch (error) { + console.log('===========> API create node catch ==========='); + } + } - async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', majorVersion: boolean = true) { - return await this.createNode('cm:content', name, parentId, title, description, majorVersion); + async createFile(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '', majorVersion: boolean = true) { + try { + return await this.createNode('cm:content', name, parentId, title, description, null, author, majorVersion); + } catch (error) { + console.log('==== catch createFile: ', error); + } } async createImage(name: string, parentId: string = '-my-', title: string = '', description: string = '') { return await this.createImageNode('cm:content', name, parentId, title, description); } - async createFolder(name: string, parentId: string = '-my-', title: string = '', description: string = '') { - return await this.createNode('cm:folder', name, parentId, title, description); + async createFolder(name: string, parentId: string = '-my-', title: string = '', description: string = '', author: string = '') { + try { + return await this.createNode('cm:folder', name, parentId, title, description, null, author); + } catch (error) { + console.log('======> API create folder catch =========='); + } } - async createChildren(data: NodeBodyCreate[]): Promise { + async createChildren(data: NodeBodyCreate[]) { await this.apiAuth(); return await this.nodesApi.createNode('-my-', data); } @@ -245,7 +266,33 @@ export class NodesApi extends RepoApi { } async isFileLockedWrite(nodeId: string) { - await this.apiAuth(); return (await this.getLockType(nodeId)) === 'WRITE_LOCK'; } + + async isFileLockedWriteWithRetry(nodeId: string, expect: boolean) { + const data = { + expect: expect, + retry: 5 + }; + let isLocked; + try { + const locked = async () => { + isLocked = (await this.getLockType(nodeId)) === 'WRITE_LOCK'; + if ( isLocked !== data.expect ) { + return Promise.reject(isLocked); + } else { + return Promise.resolve(isLocked); + } + } + return await Utils.retryCall(locked, data.retry); + } catch (error) { + console.log('-----> catch isLockedWriteWithRetry: ', error); + } + return isLocked; + } + + async isFileLockedByName(fileName: string, parentId: string) { + const id = await this.getNodeIdFromParent(fileName, parentId); + return await this.isFileLockedWrite(id); + } } diff --git a/e2e/utilities/repo-client/apis/sites/sites-api.ts b/e2e/utilities/repo-client/apis/sites/sites-api.ts index 36e3bd16bb..037f5c5419 100755 --- a/e2e/utilities/repo-client/apis/sites/sites-api.ts +++ b/e2e/utilities/repo-client/apis/sites/sites-api.ts @@ -74,8 +74,12 @@ export class SitesApi extends RepoApi { id: siteId || title }; - await this.apiAuth(); + try { + await this.apiAuth(); return await this.sitesApi.createSite(site); + } catch (error) { + console.log('=== create site catch: ', error); + } } async createSites(titles: string[], visibility?: string) { diff --git a/e2e/utilities/repo-client/apis/upload/upload-api.ts b/e2e/utilities/repo-client/apis/upload/upload-api.ts index 48d91a0294..b7e9cd5b9f 100644 --- a/e2e/utilities/repo-client/apis/upload/upload-api.ts +++ b/e2e/utilities/repo-client/apis/upload/upload-api.ts @@ -54,8 +54,15 @@ export class UploadApi extends RepoApi { nodeType: 'cm:content' }; - await this.apiAuth(); - return await this.upload.uploadFile(file, '', parentFolderId, null, opts); + try { + await this.apiAuth(); + return await this.upload.uploadFile(file, '', parentFolderId, null, opts); + } catch (error) { + console.log('=== catch upload file with rename: ', error); + } + + + } } diff --git a/e2e/utilities/reporters/console/console-logger.ts b/e2e/utilities/reporters/console/console-logger.ts deleted file mode 100755 index 9287a5ac7e..0000000000 --- a/e2e/utilities/reporters/console/console-logger.ts +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -/* tslint:disable */ -const chalk = require('chalk'); -/* tslint:enable */ - -export const log = { - i: 0, - - get indentation(): string { - return new Array(this.i).fill(' ').join(''); - }, - - indent() { - this.i++; - return this; - }, - - unindent() { - this.i--; - return this; - }, - - log(message: string = '', options: any = { ignoreIndentation: false }) { - const indentation = (!options.ignoreIndentation) - ? this.indentation - : ''; - - console.log(`${indentation}${message}`); - - return this; - }, - - blank() { - return this.log(); - }, - - info(message: string = '', options: any = { bold: false, title: false }) { - const { bold } = options; - const style = (bold ? chalk.bold : chalk).gray; - - return this.log(style(message), options); - }, - - success(message: string = '', options: any = { bold: false }) { - const style = options.bold ? chalk.bold.green : chalk.green; - - return this.log(style(message), options); - }, - - error(message: string = '', options: any = { bold: false }) { - const style = options.bold ? chalk.bold.red : chalk.red; - - return this.log(style(message), options); - } -}; diff --git a/e2e/utilities/reporters/console/console.ts b/e2e/utilities/reporters/console/console.ts deleted file mode 100755 index fd72697696..0000000000 --- a/e2e/utilities/reporters/console/console.ts +++ /dev/null @@ -1,90 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { log } from './console-logger'; - -const errors = []; - -export const consoleReporter = { - jasmineStarted(suiteInfo) { - log.blank().info( - `Running ${suiteInfo.totalSpecsDefined} tests`, - { bold: true, title: true } - ).blank(); - }, - - suiteStarted(suite) { - log.info(suite.description).indent(); - }, - - specDone: (spec) => { - const { - status, - description, - failedExpectations - } = spec; - - if (status === 'passed') { - log.success(`∙ ${description}`); - } - - if (status === 'failed') { - log.error(`✕ ${description}`, { bold: true }); - - errors.push(spec); - - failedExpectations.forEach((failed) => { - log.error(` ${failed.message}`); - }); - } - }, - - suiteDone: (result) => { - log.unindent(); - }, - - jasmineDone: (result) => { - if (!!errors.length) { - log .blank() - .blank() - .info(`${errors.length} failing tests`, { bold: true, title: true }); - - errors.forEach(error => { - log .blank() - .error(`✕ ${error.fullName}`, { bold: true }); - - error.failedExpectations.forEach(failed => { - log .info(`${failed.message}`) - .blank() - .error(`${failed.stack}`); - }); - }); - } else { - log.success(`All tests passed!`, { bold: true }); - } - - log.blank().blank(); - } -}; diff --git a/extension.schema.json b/extension.schema.json index 43ddee95a7..d9fe567aa6 100644 --- a/extension.schema.json +++ b/extension.schema.json @@ -199,6 +199,10 @@ "description": "Element order", "type": "number" }, + "disabled": { + "description": "Toggles disabled state", + "type": "boolean" + }, "children": { "description": "Navigation children items", "type": "array", @@ -223,6 +227,10 @@ "route": { "description": "Route reference identifier", "type": "string" + }, + "disabled": { + "description": "Toggles disabled state", + "type": "boolean" } }, "not": { @@ -363,6 +371,14 @@ "id": { "type": "string", "description": "Unique identifier" + }, + "includeAll": { + "type": "boolean", + "description": "Enable to automatically show all properties" + }, + "disabled": { + "description": "Toggles disabled state", + "type": "boolean" } }, "patternProperties": { @@ -676,6 +692,16 @@ "description": "Viewer component extensions", "type": "object", "properties": { + "rules": { + "description": "Viewer rules", + "type": "object", + "properties": { + "canPreview": { + "description": "Controls whether preview is enabled for particular node", + "type": "string" + } + } + }, "openWith": { "description": "The [Open With] menu extensions", "type": "array", @@ -730,6 +756,10 @@ "id": { "type": "string", "description": "Unique identifier" + }, + "disabled": { + "type": "boolean", + "description": "Toggle disabled state" } }, "patternProperties": { diff --git a/package-lock.json b/package-lock.json index d6b3b79e53..ee559b0e51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,37 +1,37 @@ { "name": "alfresco-content-app", - "version": "1.7.0", + "version": "1.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { "@alfresco/adf-content-services": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.0.0.tgz", - "integrity": "sha512-fslg/adVczwvrDJV4i/9zWgsrYv+zvqhmiFXubS+vORDvl48fqf3575OIfDSoeRblPrINzyoupH61DHWzAKa/w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-3.3.0.tgz", + "integrity": "sha512-VzEqJC+e2CYtFSwSJDXI8PR7xFCozsV113CpLEW9GT1rcNOyZrwQUe1MZqD3iNJzZdtsw+VI1kfsOwX9v0LNeA==", "requires": { "tslib": "^1.9.0" } }, "@alfresco/adf-core": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.0.0.tgz", - "integrity": "sha512-3WbOGNPDM1YIG0fSQC2NiEwoNVoBU555yiW6jcNIMI6tSMVw13zuDyA9+wOmo6KY4FZlABah3hGcD/DfqBfNLg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-3.3.0.tgz", + "integrity": "sha512-OKjG0FduZWj/Ux4O/hKtvz4opWCLrrRP0bsQfRPMfNymIUlHHhS12ciPVSlKaVlozrJ4poyjq8maGa8gqSDMcA==", "requires": { "tslib": "^1.9.0" } }, "@alfresco/adf-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.0.0.tgz", - "integrity": "sha512-piQvPQbG6Zx6J+M8U4Qv6m42gUOOOy9W3Zwgq+DdVCjP60RfhXcS+HW8wUMUxFOTgjonFOIyNA26BddIOoUhEQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-3.3.0.tgz", + "integrity": "sha512-Fvet22KpZ8zLGKccgsjlf9uEE2+47h0QMDMSX1S4tMbLlLs34PpHQiYNPOEKZgeV/kWx0+nhM7QhQUfH8NpRUA==", "requires": { "tslib": "^1.9.0" } }, "@alfresco/js-api": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-3.0.0.tgz", - "integrity": "sha512-eiJQRJH+GHw9OszNoHWyGrc/llcI5qQBult5G3TfmRDK3c1YcCLHXbQmaN7hgoOuk0i88oPziXC6ZFS/rfi+fA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-3.3.0.tgz", + "integrity": "sha512-A15Q5j4jVNFUI0hdw0zIGonU05Wbjvq8ZJBijrkC3fq904oYuq49giKpPkbXjowk9xBfZZejGvaDMT5jYTXlxg==", "requires": { "event-emitter": "0.3.4", "superagent": "3.8.2" @@ -59,17 +59,17 @@ } }, "@angular-devkit/build-angular": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-0.13.1.tgz", - "integrity": "sha512-vkKwMVQ+NNCcVR3HFMffS+Mq4b2afXeUjI+02N38hBuFTppnC83uivUB6Uu2NUk5NTSQA4BnJlG5CbMs6N4QYg==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-0.13.9.tgz", + "integrity": "sha512-onh07LhdxotDFjja0KKsDWNCwgpM/ymuRr5h0e+vT4AgklP2Uioz1CpzVOgxPIKkdVdGR9QgDinVsWAmY90J8g==", "dev": true, "requires": { - "@angular-devkit/architect": "0.13.1", - "@angular-devkit/build-optimizer": "0.13.1", - "@angular-devkit/build-webpack": "0.13.1", - "@angular-devkit/core": "7.3.1", - "@ngtools/webpack": "7.3.1", - "ajv": "6.7.0", + "@angular-devkit/architect": "0.13.9", + "@angular-devkit/build-optimizer": "0.13.9", + "@angular-devkit/build-webpack": "0.13.9", + "@angular-devkit/core": "7.3.9", + "@ngtools/webpack": "7.3.9", + "ajv": "6.9.1", "autoprefixer": "9.4.6", "circular-dependency-plugin": "5.0.2", "clean-css": "4.2.1", @@ -84,8 +84,8 @@ "loader-utils": "1.2.3", "mini-css-extract-plugin": "0.5.0", "minimatch": "3.0.4", - "node-sass": "4.11.0", - "opn": "5.4.0", + "node-sass": "4.12.0", + "open": "6.0.0", "parse5": "4.0.0", "postcss": "7.0.14", "postcss-import": "12.0.1", @@ -96,7 +96,7 @@ "semver": "5.6.0", "source-map-loader": "0.2.4", "source-map-support": "0.5.10", - "speed-measure-webpack-plugin": "1.3.0", + "speed-measure-webpack-plugin": "1.3.1", "stats-webpack-plugin": "0.7.0", "style-loader": "0.23.1", "stylus": "0.54.5", @@ -112,22 +112,22 @@ }, "dependencies": { "@angular-devkit/architect": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.1.tgz", - "integrity": "sha512-QDmIbqde75ZZSEFbw6Q6kQWq4cY6C7D67yujXw6XTyubDNAs1tyXJyxTIB8vjSlEKwRizTTDd/B0ZXVcke3Mvw==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.9.tgz", + "integrity": "sha512-EAFtCs9dsGhpMRC45PoYsrkiExpWz9Ax15qXfzwdDRacz5DmdOVt+QpkLW1beUOwiyj/bhFyj23eaONK2RTn/w==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.1", + "@angular-devkit/core": "7.3.9", "rxjs": "6.3.3" } }, "@angular-devkit/core": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.1.tgz", - "integrity": "sha512-56XDWWfIzOAkEk69lBLgmCYybPUA4yjunhmMlCk7vVdb7gbQUyzNjFD04Uj0GjlejatAQ5F76tRwygD9C+3RXQ==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { - "ajv": "6.7.0", + "ajv": "6.9.1", "chokidar": "2.0.4", "fast-json-stable-stringify": "2.0.0", "rxjs": "6.3.3", @@ -135,9 +135,9 @@ } }, "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.1.tgz", + "integrity": "sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -146,6 +146,60 @@ "uri-js": "^4.2.2" } }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "optional": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "node-sass": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", + "dev": true, + "optional": true, + "requires": { + "async-foreach": "^0.1.3", + "chalk": "^1.1.1", + "cross-spawn": "^3.0.0", + "gaze": "^1.0.0", + "get-stdin": "^4.0.1", + "glob": "^7.0.3", + "in-publish": "^2.0.0", + "lodash": "^4.17.11", + "meow": "^3.7.0", + "mkdirp": "^0.5.1", + "nan": "^2.13.2", + "node-gyp": "^3.8.0", + "npmlog": "^4.0.0", + "request": "^2.88.0", + "sass-graph": "^2.2.4", + "stdout-stream": "^1.4.0", + "true-case-path": "^1.0.2" + } + }, "parse5": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", @@ -160,6 +214,13 @@ "requires": { "tslib": "^1.9.0" } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "optional": true } } }, @@ -187,9 +248,9 @@ } }, "@angular-devkit/build-optimizer": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.13.1.tgz", - "integrity": "sha512-LmvHiI3H451aVWY5Ac6Fqz0i1eX/mUfWN+uJvo8NaL6Jc0HKYX2o3l4ODr8UUECWWctUC9AMD522ZMwAvnvsKQ==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.13.9.tgz", + "integrity": "sha512-GQtCntthQHSBv5l1ZY5p00JOECb/WcE1qUBo5kFjp84z0fszDkhOy52M1kcWCX4PFzJaY4DKk58hbUE/2UN0jw==", "dev": true, "requires": { "loader-utils": "1.2.3", @@ -203,43 +264,37 @@ "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", "dev": true - }, - "typescript": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.4.tgz", - "integrity": "sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg==", - "dev": true } } }, "@angular-devkit/build-webpack": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.13.1.tgz", - "integrity": "sha512-OGwC7bAl3u+w7Glw+OqIrN7OD1BkDXgrWbeQSpKAmsx6VdNPCnI4NPS+JldWNp70LVlE2nQlJUhtEqMVfBMnlg==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.13.9.tgz", + "integrity": "sha512-6ypu6pzNmQxzATF4rTWEhGSl5hyGQ8a/3aCZF/ux+XGc3d4hi2HW+NWlDm1UEna6ZjNtgEPlgfP4q8BKrjRmfA==", "dev": true, "requires": { - "@angular-devkit/architect": "0.13.1", - "@angular-devkit/core": "7.3.1", + "@angular-devkit/architect": "0.13.9", + "@angular-devkit/core": "7.3.9", "rxjs": "6.3.3" }, "dependencies": { "@angular-devkit/architect": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.1.tgz", - "integrity": "sha512-QDmIbqde75ZZSEFbw6Q6kQWq4cY6C7D67yujXw6XTyubDNAs1tyXJyxTIB8vjSlEKwRizTTDd/B0ZXVcke3Mvw==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.9.tgz", + "integrity": "sha512-EAFtCs9dsGhpMRC45PoYsrkiExpWz9Ax15qXfzwdDRacz5DmdOVt+QpkLW1beUOwiyj/bhFyj23eaONK2RTn/w==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.1", + "@angular-devkit/core": "7.3.9", "rxjs": "6.3.3" } }, "@angular-devkit/core": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.1.tgz", - "integrity": "sha512-56XDWWfIzOAkEk69lBLgmCYybPUA4yjunhmMlCk7vVdb7gbQUyzNjFD04Uj0GjlejatAQ5F76tRwygD9C+3RXQ==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { - "ajv": "6.7.0", + "ajv": "6.9.1", "chokidar": "2.0.4", "fast-json-stable-stringify": "2.0.0", "rxjs": "6.3.3", @@ -247,9 +302,9 @@ } }, "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.1.tgz", + "integrity": "sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -306,19 +361,19 @@ } }, "@angular-devkit/schematics": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.4.tgz", - "integrity": "sha512-BLI4MDHmpzw+snu/2Dw1nMmfJ0VAARTbU6DrmzXyl2Se45+iE/tdRy4yNx3IfHhyoCrVZ15R0y9CXeEsLftlIg==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-7.3.9.tgz", + "integrity": "sha512-xzROGCYp7aQbeJ3V6YC0MND7wKEAdWqmm/GaCufEk0dDS8ZGe0sQhcM2oBRa2nQqGQNeThFIH51kx+FayrJP0w==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.4", + "@angular-devkit/core": "7.3.9", "rxjs": "6.3.3" }, "dependencies": { "@angular-devkit/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.4.tgz", - "integrity": "sha512-MBfen51iOBKfK4tlg5KwmPxePsF1QoFNUMGLuvUUwPkteonrGcupX1Q7NWTpf+HA+i08mOnZGuepeuQkD12IQw==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { "ajv": "6.9.1", @@ -352,57 +407,57 @@ } }, "@angular/animations": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.2.7.tgz", - "integrity": "sha512-eU/wSkBmukZXCCe/epUl02xsKPauF+deMbncxBE+w/NmmWjJ77Q09iZAcgzM92RVXj2LsVYQXsNEBGT3X0hRZw==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-7.2.15.tgz", + "integrity": "sha512-8oBt3HLgd2+kyJHUgsd7OzKCCss67t2sch15XNoIWlOLfxclqU+EfFE6t/vCzpT8/+lpZS6LU9ZrTnb+UBj5jg==", "requires": { "tslib": "^1.9.0" } }, "@angular/cdk": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.3.3.tgz", - "integrity": "sha512-0M3nwq+c9+d+p0XeU12I9djutlsajRrxcu7AvHQXUs/5grYFsXsX0f468qXDiKmcgqGUBNtN2fBOUhGNlispuQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-7.3.7.tgz", + "integrity": "sha512-xbXxhHHKGkVuW6K7pzPmvpJXIwpl0ykBnvA2g+/7Sgy5Pd35wCC+UtHD9RYczDM/mkygNxMQtagyCErwFnDtQA==", "requires": { "parse5": "^5.0.0", "tslib": "^1.7.1" } }, "@angular/cli": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.4.tgz", - "integrity": "sha512-uGL8xiQf+GvuJvqvMUu/XHcijbq9ocbX487LO2PgJ29etHfI7dC0toJbQ8ob+HnF9e1qwMe+uu45OU4C2p+a1A==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-7.3.9.tgz", + "integrity": "sha512-7oJj7CKDlFUbQav1x1CV4xKKcbt0pnxY4unKcm7Q1tVXhu8bU2bc3cDA0aJnbofcYb6TJcd/C2qHgCt78q7edA==", "dev": true, "requires": { - "@angular-devkit/architect": "0.13.4", - "@angular-devkit/core": "7.3.4", - "@angular-devkit/schematics": "7.3.4", - "@schematics/angular": "7.3.4", - "@schematics/update": "0.13.4", + "@angular-devkit/architect": "0.13.9", + "@angular-devkit/core": "7.3.9", + "@angular-devkit/schematics": "7.3.9", + "@schematics/angular": "7.3.9", + "@schematics/update": "0.13.9", "@yarnpkg/lockfile": "1.1.0", "ini": "1.3.5", "inquirer": "6.2.1", "npm-package-arg": "6.1.0", - "opn": "5.4.0", + "open": "6.0.0", "pacote": "9.4.0", "semver": "5.6.0", "symbol-observable": "1.2.0" }, "dependencies": { "@angular-devkit/architect": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.4.tgz", - "integrity": "sha512-wJF8oz8MurtpFi0ik42bkI2F5gEnuOe79KHPO1i3SYfdhEp5NY8igVKZ6chB/eq4Ml50aHxas8Hh9ke12K+Pxw==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.13.9.tgz", + "integrity": "sha512-EAFtCs9dsGhpMRC45PoYsrkiExpWz9Ax15qXfzwdDRacz5DmdOVt+QpkLW1beUOwiyj/bhFyj23eaONK2RTn/w==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.4", + "@angular-devkit/core": "7.3.9", "rxjs": "6.3.3" } }, "@angular-devkit/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.4.tgz", - "integrity": "sha512-MBfen51iOBKfK4tlg5KwmPxePsF1QoFNUMGLuvUUwPkteonrGcupX1Q7NWTpf+HA+i08mOnZGuepeuQkD12IQw==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { "ajv": "6.9.1", @@ -436,25 +491,25 @@ } }, "@angular/common": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.7.tgz", - "integrity": "sha512-U1l2CIcmpTAJMWcyTXI9qt1E8CxwKNW1vr6XWZo4X5ziCIzf7RvClzK7Ci5KZKkoPJrJqBJu661Q75Yt22dJsg==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-7.2.15.tgz", + "integrity": "sha512-2b5JY2HWVHCf3D1GZjmde7jdAXSTXkYtmjLtA9tQkjOOTr80eHpNSujQqnzb97dk9VT9OjfjqTQd7K3pxZz8jw==", "requires": { "tslib": "^1.9.0" } }, "@angular/compiler": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.2.7.tgz", - "integrity": "sha512-e61YVxW5x4w+X4yjGaptYoJIja7HwH0+8FFEaH6VuPl/DrK8wP4HDMhLo4NzdgeZKLR2jBIQSqLmoM8W7UXcqw==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-7.2.15.tgz", + "integrity": "sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==", "requires": { "tslib": "^1.9.0" } }, "@angular/compiler-cli": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.7.tgz", - "integrity": "sha512-UPWROJzBLejgNf+aqgEUXYts8UiFOl2IavDhS/olA9irszv2lNFj9Yqr8OKdy0jK/lKaipZog3VZEx8g5dNeBA==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-7.2.15.tgz", + "integrity": "sha512-+AsfyKawmj/sa+m4Pz8VSRFbCfx/3IOjAuuEjhopbyr154YpPDSu8NTbcwzq3yfbVcPwK4/4exmbQzpsndaCTg==", "dev": true, "requires": { "canonical-path": "1.0.0", @@ -483,9 +538,9 @@ "dev": true }, "chokidar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.2.tgz", - "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", "dev": true, "requires": { "anymatch": "^2.0.0", @@ -499,7 +554,7 @@ "normalize-path": "^3.0.0", "path-is-absolute": "^1.0.0", "readdirp": "^2.2.1", - "upath": "^1.1.0" + "upath": "^1.1.1" } }, "cross-spawn": { @@ -639,6 +694,12 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -684,79 +745,79 @@ } }, "@angular/core": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-7.2.7.tgz", - "integrity": "sha512-E7qjMQdS77SbRROKu13VsfL+MJN52eTlrU0SzEAFGUOgdvbmDYJOaEwjqrouKpYZ0pul8KOoalvlPB7oVflC7A==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-7.2.15.tgz", + "integrity": "sha512-XsuYm0jEU/mOqwDOk2utThv8J9kESkAerfuCHClE9rB2TtHUOGCfekF7lJWqjjypu6/J9ygoPFo7hdAE058ZGg==", "requires": { "tslib": "^1.9.0" } }, "@angular/flex-layout": { - "version": "7.0.0-beta.23", - "resolved": "https://registry.npmjs.org/@angular/flex-layout/-/flex-layout-7.0.0-beta.23.tgz", - "integrity": "sha512-jH2i3i/M7SbK6scVlj2urVL5OhzwavbQ7KwvUjyc/UwccKnnzuOuWEGCINLja/aoaUO3I35LluCLv6a6VN0olA==", + "version": "7.0.0-beta.24", + "resolved": "https://registry.npmjs.org/@angular/flex-layout/-/flex-layout-7.0.0-beta.24.tgz", + "integrity": "sha512-ll6sK0nLGxqI/f5+z4jbd+pve1QITzgehv2AuGvfSDgIjPMeqUDB5YZqQmIGM/dQRk/vIio5KCW5LQPJWzMMYQ==", "requires": { "tslib": "^1.7.1" } }, "@angular/forms": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.2.7.tgz", - "integrity": "sha512-2gBs+BG2cMPsHq9JVEzmu2Ev539zjfHmr6cna2W38KLXeGbNf42rbbMUXpYD8cndY0QTYcnwfMpRNIl9zKRZnw==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-7.2.15.tgz", + "integrity": "sha512-p0kcIQLtBBC1qeTA6M3nOuXf/k91E80FKquVM9zEsO2kDjI0oZJVfFYL2UMov5samlJOPN+t6lRHEIUa7ApPsw==", "requires": { "tslib": "^1.9.0" } }, "@angular/http": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/http/-/http-7.2.7.tgz", - "integrity": "sha512-HTHYF3qR4S55A+9pyThSOy7++7Makp+klbZTNmpwwJj8yL3qgy9PyDXtf+xhZcUEd8xfXmnz8s4hZr0O9GUy1A==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/http/-/http-7.2.15.tgz", + "integrity": "sha512-TR7PEdmLWNIre3Zn8lvyb4lSrvPUJhKLystLnp4hBMcWsJqq5iK8S3bnlR4viZ9HMlf7bW7+Hm4SI6aB3tdUtw==", "requires": { "tslib": "^1.9.0" } }, "@angular/language-service": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-7.2.7.tgz", - "integrity": "sha512-d3iCBpOfgLNSGMrtqZvN6NHZIEnKD2MV8Hz4WsRLU4WY0RbshZj5dqx2nO3YRT2tACpAvhWBQoYvtLpTCPzsMA==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-7.2.15.tgz", + "integrity": "sha512-Ig5Jr7mnDelaZvSbUd9YhI5am3q1ku9xelAuwvtyDKvQJeKQj3BtTagcOgWrnQBfrJ/FsA/M5Zo48ncSsV0tqQ==", "dev": true }, "@angular/material": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.3.3.tgz", - "integrity": "sha512-DZdJaVpXsd5QlfpN5P871llw8AKh5QvRiyro3QRmEajYN85Xiawqpbt7O60TrwcFM6DzYLI3UeyWq8LFdmi/+Q==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-7.3.7.tgz", + "integrity": "sha512-Eq+7frkeNGkLOfEtmkmJgR+AgoWajOipXZWWfCSamNfpCcPof82DwvGOpAmgGni9FuN2XFQdqP5MoaffQzIvUA==", "requires": { "tslib": "^1.7.1" } }, "@angular/material-moment-adapter": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-7.3.3.tgz", - "integrity": "sha512-Fp2EcFpwdwa5qWWBa7G1mJZuaQ3oD3pohyo04HD2ud8YFP5IPbeoHVc65JC7TIwQFbVKk0lojXK3b2vQXZOapw==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-7.3.7.tgz", + "integrity": "sha512-Nb8hZkF6zcni7Jb+FXcTKKmbp8PhhFAhJSkch9FnKcFs1Py+sCNTLIH/cI53nPrTglkJwlVLwMW7fxj4w9I1CQ==", "requires": { "tslib": "^1.7.1" } }, "@angular/platform-browser": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.2.7.tgz", - "integrity": "sha512-9C3ffZs0ZUw+dYg1oJKiONf64UKTdAzIOaTQXTrVrCa3oN7Jb2tUfmpenmB+ATRxwhL2n7Yi725YWwxY2FwqvQ==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-7.2.15.tgz", + "integrity": "sha512-aYgmPsbC9Tvp9vmKWD8voeAp4crwCay7/D6lM3ClEe2EeK934LuEXq3/uczMrFVbnIX7BBIo8fh03Tl7wbiGPw==", "requires": { "tslib": "^1.9.0" } }, "@angular/platform-browser-dynamic": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.7.tgz", - "integrity": "sha512-3nlcwCZOzlKw/4CMJ4zy1JEVy8Ky4KyLRRePLledOMdsGbuDIoq/kyAnBzg295Xe9ovBxv8cmuSkShci+s/x8g==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-7.2.15.tgz", + "integrity": "sha512-UL2PqhzXMD769NQ6Lh6pxlBDKvN9Qol3XLRFil80lwJ1GRW16ITeYbCamcafIH2GOyd88IhmYcbMfUQ/6q4MMQ==", "requires": { "tslib": "^1.9.0" } }, "@angular/router": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/@angular/router/-/router-7.2.7.tgz", - "integrity": "sha512-59+M8+IH7V2NPPqWw2mwdg+kh/jfwQcXE0tB8iZ5V2ldACPucY/Td6qiT5H6t7EkELtvkKJwS6vKFV22qdRp3w==", + "version": "7.2.15", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-7.2.15.tgz", + "integrity": "sha512-qAubRJRQanguUqJQ76J9GSZ4JFtoyhJKRmX5P23ANZJXpB6YLzF2fJmOGi+E6cV8F0tKBMEq1pjxFTisx0MXwQ==", "requires": { "tslib": "^1.9.0" } @@ -771,14 +832,14 @@ } }, "@babel/generator": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.2.tgz", - "integrity": "sha512-f3QCuPppXxtZOEm5GWPra/uYUjmNQlu9pbAD8D/9jze4pTY83rTtB1igTBSwvkeNlC5gR24zFFkz+2WHLFQhqQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", "dev": true, "requires": { - "@babel/types": "^7.3.2", + "@babel/types": "^7.4.4", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -818,12 +879,12 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.4" } }, "@babel/highlight": { @@ -846,24 +907,24 @@ } }, "@babel/parser": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.2.tgz", - "integrity": "sha512-QzNUC2RO1gadg+fs21fi0Uu0OuGNzRKEmgCxoLNzbCdoprLwjfmZwzUrpUNfJPaVRwBpDY47A17yYEGWyRelnQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", + "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", "dev": true }, "@babel/runtime": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0.tgz", - "integrity": "sha512-7hGhzlcmg01CvH1EHdSPVXYX1aJ8KCEyz6I9xYIi/asDtzBPMyMhVibhM/K6g/5qnKBwjZtp10bNZIEFTRW1MA==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", "dev": true, "requires": { - "regenerator-runtime": "^0.12.0" + "regenerator-runtime": "^0.13.2" }, "dependencies": { "regenerator-runtime": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", - "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", "dev": true } } @@ -887,31 +948,31 @@ } }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" } }, "@babel/traverse": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", - "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", + "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.4.4", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.2.3", - "@babel/types": "^7.2.2", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" }, "dependencies": { "debug": { @@ -924,21 +985,21 @@ } }, "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true } } }, "@babel/types": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.2.tgz", - "integrity": "sha512-3Y6H8xlUlpbGR+XvawiH0UXehqydTmNmEpozWcXymqwcrwYAl5KMvKtQ+TF6f6E08V6Jur7v/ykdDSF+WDEIXQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" }, "dependencies": { @@ -950,74 +1011,6 @@ } } }, - "@iamstarkov/listr-update-renderer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@iamstarkov/listr-update-renderer/-/listr-update-renderer-0.4.1.tgz", - "integrity": "sha512-IJyxQWsYDEkf8C8QthBn5N8tIUR9V9je6j3sMIpAkonaadjbvxmRC6RAhpa3RKxndhNnU2M6iNbtJwd7usQYIA==", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "cli-truncate": "^0.2.1", - "elegant-spinner": "^1.0.1", - "figures": "^1.7.0", - "indent-string": "^3.0.0", - "log-symbols": "^1.0.2", - "log-update": "^2.3.0", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5", - "object-assign": "^4.1.0" - } - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "log-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz", - "integrity": "sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg=", - "dev": true, - "requires": { - "chalk": "^1.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "@mat-datetimepicker/core": { "version": "3.0.0-beta.0", "resolved": "https://registry.npmjs.org/@mat-datetimepicker/core/-/core-3.0.0-beta.0.tgz", @@ -1035,24 +1028,24 @@ } }, "@ngrx/effects": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@ngrx/effects/-/effects-7.3.0.tgz", - "integrity": "sha512-PxZQaKTUmdsTPpd/0vCbYmVn8KtnvlmMDv4GflU7TVhZPe8uibaPN4HNkJMZD2gPe6qk3R7wGwuyXlFWBeQiUw==" + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@ngrx/effects/-/effects-7.4.0.tgz", + "integrity": "sha512-YjgB17WnLCBDPjAkHduKWsLFSGLZryPaTjY3EIvMF+WTRPDlgC5SAv2n7p3YIei6g6IYcEvOwLWBqZHFUXTgBw==" }, "@ngrx/router-store": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-7.3.0.tgz", - "integrity": "sha512-CZJN0r0Te+a9tJtqX6kTeqOx2d5rmBwyjIC1g8GZfPo4rG0oIVATGTEZy/84quAJx3HhjlsqXq27nu34mDHstw==" + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-7.4.0.tgz", + "integrity": "sha512-ZpwTO1/ha3pxO7NV3jIfnwipBN1A719IjAOgrcmI8Ut06VH3HY/7JVFTkwLN/FyuHvl4EOlAVYmMAblmrymUWA==" }, "@ngrx/store": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-7.3.0.tgz", - "integrity": "sha512-cELOO+kHYo100Q2wi1cZqhK9jA/NJs5//0lkphoR/AKxShGmJCkub6L+qnJCrzROu4Bvod4DAlA9VAQSq4EYLg==" + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-7.4.0.tgz", + "integrity": "sha512-kwTUHgfgBeAL4RQBjZO46z9v4Xzg8PXAgY4WwXdt3zUk1tF4ZvijMleFvFRUoiJJfxF/UM6jgIZ/yGrX2dXQuA==" }, "@ngrx/store-devtools": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/@ngrx/store-devtools/-/store-devtools-7.3.0.tgz", - "integrity": "sha512-//zuFcXUEJO3H/KfT3ontsosdF+dBphvoT4NHHZQAewaGUmn/z6OqgJv41n0d8NmAjVmKYYA73jtWwRmfSHTcA==" + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@ngrx/store-devtools/-/store-devtools-7.4.0.tgz", + "integrity": "sha512-ZmPpquprBYUozbLuLMLZzUhI+LnMNGMNg8x1ij9yDxXWQADcJm1Zu7kouYE1r5SoCYxKfwJ3Ia1VQfS3A5S8dw==" }, "@ngtools/json-schema": { "version": "1.1.0", @@ -1061,12 +1054,12 @@ "dev": true }, "@ngtools/webpack": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-7.3.1.tgz", - "integrity": "sha512-EGQRjgDf5XP+Fm1MdZNRFiPd9e1vhl11BhjkwqkAsewic4eoz6fqXfj/Osz1hQy8xU+2dPPf/byQ/+nY3E02Zg==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-7.3.9.tgz", + "integrity": "sha512-+ROpqfCXLdQwfP+UNDLk4p959ZrocpStkdd2Iy9CeOJ8yDkityqpstTwQC3oHzzu/95BiyZ0hrHbM6AsPPIvJg==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.1", + "@angular-devkit/core": "7.3.9", "enhanced-resolve": "4.1.0", "rxjs": "6.3.3", "tree-kill": "1.2.1", @@ -1074,12 +1067,12 @@ }, "dependencies": { "@angular-devkit/core": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.1.tgz", - "integrity": "sha512-56XDWWfIzOAkEk69lBLgmCYybPUA4yjunhmMlCk7vVdb7gbQUyzNjFD04Uj0GjlejatAQ5F76tRwygD9C+3RXQ==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { - "ajv": "6.7.0", + "ajv": "6.9.1", "chokidar": "2.0.4", "fast-json-stable-stringify": "2.0.0", "rxjs": "6.3.3", @@ -1087,9 +1080,9 @@ } }, "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.1.tgz", + "integrity": "sha512-XDN92U311aINL77ieWHmqCcNlwjoP5cHXDxIxbf2MaPYuCXOHS7gHH8jktxeK5omgd52XbSTX6a4Piwd1pQmzA==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -1136,20 +1129,20 @@ } }, "@schematics/angular": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.4.tgz", - "integrity": "sha512-Bb5DZQ8MeP8yhxPe6nVqyQ7sGVNwUx6nXPlrQV45ZycD3nJlqsuxr2DE75HFpn5oU+vlkq9J/Sys4WLJ4E/OMw==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-7.3.9.tgz", + "integrity": "sha512-B3lytFtFeYNLfWdlrIzvy3ulFRccD2/zkoL0734J+DAGfUz7vbysJ50RwYL46sQUcKdZdvb48ktfu1S8yooP6Q==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.4", - "@angular-devkit/schematics": "7.3.4", + "@angular-devkit/core": "7.3.9", + "@angular-devkit/schematics": "7.3.9", "typescript": "3.2.4" }, "dependencies": { "@angular-devkit/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.4.tgz", - "integrity": "sha512-MBfen51iOBKfK4tlg5KwmPxePsF1QoFNUMGLuvUUwPkteonrGcupX1Q7NWTpf+HA+i08mOnZGuepeuQkD12IQw==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { "ajv": "6.9.1", @@ -1183,13 +1176,13 @@ } }, "@schematics/update": { - "version": "0.13.4", - "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.4.tgz", - "integrity": "sha512-YarSCCBSVPVG/MyN5H/FliRwaIDoeercy5Nip+NWZJsDyvtsAekO9s6QwizSvAr3541MmSQFeQICsjyM2dl3Bg==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/@schematics/update/-/update-0.13.9.tgz", + "integrity": "sha512-4MQcaKFxhMzZyE//+DknDh3h3duy3avg2oxSHxdwXlCZ8Q92+4lpegjJcSRiqlEwO4qeJ5XnrjrvzfIiaIZOmA==", "dev": true, "requires": { - "@angular-devkit/core": "7.3.4", - "@angular-devkit/schematics": "7.3.4", + "@angular-devkit/core": "7.3.9", + "@angular-devkit/schematics": "7.3.9", "@yarnpkg/lockfile": "1.1.0", "ini": "1.3.5", "pacote": "9.4.0", @@ -1199,9 +1192,9 @@ }, "dependencies": { "@angular-devkit/core": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.4.tgz", - "integrity": "sha512-MBfen51iOBKfK4tlg5KwmPxePsF1QoFNUMGLuvUUwPkteonrGcupX1Q7NWTpf+HA+i08mOnZGuepeuQkD12IQw==", + "version": "7.3.9", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-7.3.9.tgz", + "integrity": "sha512-SaxD+nKFW3iCBKsxNR7+66J30EexW/y7tm8m5AvUH+GwSAgIj0ZYmRUzFEPggcaLVA4WnE/YWqIXZMJW5dT7gw==", "dev": true, "requires": { "ajv": "6.9.1", @@ -1261,12 +1254,27 @@ "integrity": "sha512-wNBfvNjzsJl4tswIZKXCFQY0lss9nKUyJnG6T94X/eqjRgI2jHZ4evdjhQYBSan/vGtF6XVXPApOmNH2rf0KKw==", "dev": true }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, "@types/q": { "version": "0.0.32", "resolved": "http://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", "dev": true }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", + "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/selenium-webdriver": { "version": "3.0.14", "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.14.tgz", @@ -1279,18 +1287,6 @@ "integrity": "sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==", "dev": true }, - "@types/strip-bom": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-FKjsOVbC6B7bdSB5CuzyHCkK69I=", - "dev": true - }, - "@types/strip-json-comments": { - "version": "0.0.30", - "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", - "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", - "dev": true - }, "@types/webpack-sources": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.5.tgz", @@ -1527,9 +1523,9 @@ } }, "acorn": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", - "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true }, "acorn-dynamic-import": { @@ -1639,9 +1635,9 @@ } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", "dev": true }, "ansi-escapes": { @@ -1718,6 +1714,12 @@ "readable-stream": "^2.0.6" } }, + "arg": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", + "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==", + "dev": true + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1757,12 +1759,6 @@ "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", "dev": true }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -1823,11 +1819,12 @@ } }, "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", "dev": true, "requires": { + "object-assign": "^4.1.1", "util": "0.10.3" }, "dependencies": { @@ -1995,25 +1992,6 @@ "babel-runtime": "^6.22.0" } }, - "babel-polyfill": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "core-js": "^2.4.0", - "regenerator-runtime": "^0.10.0" - }, - "dependencies": { - "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", - "dev": true - } - } - }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -2952,15 +2930,6 @@ "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, - "combine-lists": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", - "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", - "dev": true, - "requires": { - "lodash": "^4.5.0" - } - }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -3014,25 +2983,33 @@ "dev": true }, "compressible": { - "version": "2.0.15", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.15.tgz", - "integrity": "sha512-4aE67DL33dSW9gw4CI2H/yTxqHLNcxp0yS6jB+4h+wr3e43+1z7vm0HU9qXOH8j+qjKuL8+UtkOxYQSMq60Ylw==", + "version": "2.0.17", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", + "integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==", "dev": true, "requires": { - "mime-db": ">= 1.36.0 < 2" + "mime-db": ">= 1.40.0 < 2" + }, + "dependencies": { + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + } } }, "compression": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", - "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", "dev": true, "requires": { "accepts": "~1.3.5", "bytes": "3.0.0", - "compressible": "~2.0.14", + "compressible": "~2.0.16", "debug": "2.6.9", - "on-headers": "~1.0.1", + "on-headers": "~1.0.2", "safe-buffer": "5.1.2", "vary": "~1.1.2" }, @@ -3163,10 +3140,13 @@ "dev": true }, "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", - "dev": true + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } }, "content-type": { "version": "1.0.4", @@ -3364,54 +3344,66 @@ "dev": true }, "cspell": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-3.2.1.tgz", - "integrity": "sha512-VjEcxU+WUfJn1/ShgYVsH4fdT8MaOBmLATKZ2DpsY+zdh5i07NmC8fVlsF56F4rE5Ybz2e9KHMi+HcNN08ruEg==", + "version": "3.2.17", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-3.2.17.tgz", + "integrity": "sha512-ubl9KnYgigK06Qo9tUx0xGSlyNpV1M68HDPnA7UNtL4yloOE6/K1GVw6J9prhV2KZZgBxqa5GATD8T6nS0mxMQ==", "dev": true, "requires": { "chalk": "^2.4.2", - "commander": "^2.19.0", + "commander": "^2.20.0", "comment-json": "^1.1.3", "configstore": "^4.0.0", - "cspell-dict-companies": "^1.0.3", - "cspell-dict-cpp": "^1.1.11", - "cspell-dict-django": "^1.0.7", - "cspell-dict-elixir": "^1.0.4", - "cspell-dict-en-gb": "^1.1.7", - "cspell-dict-en_us": "^1.2.10", - "cspell-dict-fullstack": "^1.0.6", - "cspell-dict-golang": "^1.1.8", - "cspell-dict-java": "^1.0.5", - "cspell-dict-latex": "^1.0.6", - "cspell-dict-lorem-ipsum": "^1.0.4", - "cspell-dict-php": "^1.0.7", - "cspell-dict-python": "^1.0.8", + "cspell-dict-companies": "^1.0.6", + "cspell-dict-cpp": "^1.1.14", + "cspell-dict-django": "^1.0.8", + "cspell-dict-elixir": "^1.0.5", + "cspell-dict-en-gb": "^1.1.8", + "cspell-dict-en_us": "^1.2.12", + "cspell-dict-fullstack": "^1.0.10", + "cspell-dict-golang": "^1.1.9", + "cspell-dict-java": "^1.0.7", + "cspell-dict-latex": "^1.0.8", + "cspell-dict-lorem-ipsum": "^1.0.6", + "cspell-dict-php": "^1.0.8", + "cspell-dict-python": "^1.0.9", "cspell-dict-rust": "^1.0.6", - "cspell-dict-scala": "^1.0.5", - "cspell-lib": "^3.0.5", - "cspell-trie": "^3.0.7", + "cspell-dict-scala": "^1.0.6", + "cspell-lib": "^3.0.8", + "cspell-trie": "^3.0.10", "fs-extra": "^7.0.1", "gensequence": "^2.1.2", - "glob": "^7.1.3", + "get-stdin": "^7.0.0", + "glob": "^7.1.4", "minimatch": "^3.0.4", - "rxjs": "6.3.3", + "rxjs": "^6.5.2", "vscode-uri": "^1.0.6", "xregexp": "^4.2.4" }, "dependencies": { "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, - "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { - "tslib": "^1.9.0" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "xregexp": { @@ -3426,144 +3418,144 @@ } }, "cspell-dict-companies": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/cspell-dict-companies/-/cspell-dict-companies-1.0.3.tgz", - "integrity": "sha512-L4CKmMuI2kSno99tKYHI807y02niwxaFZOsRtmTjb0+zJ8dzyscXvQFmTwynUn3XZf4G+TbYcCOZaSpsx0RlWA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cspell-dict-companies/-/cspell-dict-companies-1.0.7.tgz", + "integrity": "sha512-J78DyrVDKhS7Jqk8TuSStqus4LVRBLN3SYasysTq1IE+VRV0IJYP2lAURBGjBbnqBuh7a41fNHQu3/Y+GoXbuQ==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-cpp": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/cspell-dict-cpp/-/cspell-dict-cpp-1.1.11.tgz", - "integrity": "sha512-FWiOe6nntT1k4r/CkSo8qG6Ib4phu3WXGPqg6txOw+e9wlojzXN7rND2Z8AHt4TUA36h3lHpk/y7gTBgJgR+lw==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/cspell-dict-cpp/-/cspell-dict-cpp-1.1.15.tgz", + "integrity": "sha512-MEjsCg8ubqRX7mNn8ABUVUvwndATZ3P4kOGQks0rBsXsR9cIPo8E1wyFV3VpMY4SUdUhpAAU1X5yzjvBQTcTDg==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-django": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cspell-dict-django/-/cspell-dict-django-1.0.7.tgz", - "integrity": "sha512-Gi7fYuGLEJSH307ywkOIziQYS3hdIBwMesjvEW71ovqjg0CyQKADcU4ZUd5fcMlndxRLpVhG4NXo3tGdsDf3wA==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/cspell-dict-django/-/cspell-dict-django-1.0.9.tgz", + "integrity": "sha512-l5Di7WFfoXzzmXdRsEYpHj9o+OwEmAwVHzS4KQ18NJ6r4lsR4sb4GERFqXM7vaQoKkN0tN/skTqGqYoMl1wARA==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-elixir": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cspell-dict-elixir/-/cspell-dict-elixir-1.0.4.tgz", - "integrity": "sha512-K4W3kmb7ZLbtaoV0Xwd1XGS6DzNah3tygbp7yT4jaq2f6WvG8Uh80tSNog6YIF+DAVk6709RKbIurbHZsx08dg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cspell-dict-elixir/-/cspell-dict-elixir-1.0.6.tgz", + "integrity": "sha512-fXYQwb8lSiJk/26vhZcrzaYbja0ka6IravSU7S+ivt/4guXYlrzoFvnKtwGVhgEJ0VTVh0Dqtmz2N8xDemyalw==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-en-gb": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/cspell-dict-en-gb/-/cspell-dict-en-gb-1.1.7.tgz", - "integrity": "sha512-inEzvckvzzscmRE3zCF3dAtAdSD0xHeIba/KAFuu6/yVNWp0zwqMiW1UQ6lW6kXyueETjHLuZMSAJbC4R1DrOA==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/cspell-dict-en-gb/-/cspell-dict-en-gb-1.1.9.tgz", + "integrity": "sha512-DwCKORzqcU/Ob4U/O/5Gdl6Uw3R0qu8Px9FR3kUskXNYDmzZzDL7niLVZ8E6pnGGB58oOPPGQZqGJy5c8ucATQ==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-en_us": { - "version": "1.2.10", - "resolved": "https://registry.npmjs.org/cspell-dict-en_us/-/cspell-dict-en_us-1.2.10.tgz", - "integrity": "sha512-3unRvF++r1v2kh9C6R6jzIL0J67i8XIQ/RwNWjQ8fRBdchAzpiV9l0hnpXn4V98Icyy3r1aUpVzBIwGogBQiqw==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/cspell-dict-en_us/-/cspell-dict-en_us-1.2.13.tgz", + "integrity": "sha512-Aw8GVw1EHnITloqkpKEIjZOvDKF1ElB7BTqkT6bfTEMG8ddTui9hsNuGGGRZFH2ZL92MH1hNsFcSaY4WLVztOA==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-fullstack": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cspell-dict-fullstack/-/cspell-dict-fullstack-1.0.6.tgz", - "integrity": "sha512-40rQ/6E5erZC4ZS7uQ8Q93M0VrFuqFhcGCup/ZrO2lRHsRPj5+iVeX80VY1jl/gPmG2H/pnJ5+oC5CJkgEBGVw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/cspell-dict-fullstack/-/cspell-dict-fullstack-1.0.11.tgz", + "integrity": "sha512-c1F97bdrt7jvQBfoz8XNq9SBMyyNRl53SlCGWCJr2OJw0PMDYoysOYrgAKSQ86wLOlEgqcaTuYPxghuHiSK8Pg==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-golang": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/cspell-dict-golang/-/cspell-dict-golang-1.1.8.tgz", - "integrity": "sha512-Ux7Qm9P9sWiVHgbsuKQGJWj+iJkcQkLrlKmqsmNxXc9JeGpS6exmhJLNkhTjQwryB+ry5zcsvvobpCGUC+NBPw==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/cspell-dict-golang/-/cspell-dict-golang-1.1.10.tgz", + "integrity": "sha512-R+ovnhScVm3FcIjsQcLFTFnf9CuZM4hjAfl/+s1fDHY2fnSjW2fsplGvTHbH8OXICfDVap0+vjyvxweC7vTWGw==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-java": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/cspell-dict-java/-/cspell-dict-java-1.0.5.tgz", - "integrity": "sha512-kwp3i+JW2LwzYFk0w9cPCGKe80z7V89GOubFTGpudm9E6y46eO+3YAAjVK5PhMIuuDYF69CicaiP6eW8FsbyhA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/cspell-dict-java/-/cspell-dict-java-1.0.8.tgz", + "integrity": "sha512-xb1UR9pllrblxTvIa4wlxiLpTzP/ctsBMAinEATJ1nGboHStZAY7wCNOFDaBCNgdA8yHcQ4QBoKfXmN2jsb61w==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-latex": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cspell-dict-latex/-/cspell-dict-latex-1.0.6.tgz", - "integrity": "sha512-BQJbH1RwOPuIHfKsWKSBxIj2QZydVWPSRruwrMQ15gzcheYBz623QhedvrNMgm29AVoH7Lu7i0GIopOyb4ebPw==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/cspell-dict-latex/-/cspell-dict-latex-1.0.9.tgz", + "integrity": "sha512-2fexq4EYQ5X7Ly8w9EMYarVk9nShIQbivSEhtAuNM5fEe40+r1knuGGPblO/BHS96jR0QC6Q92ztw1uh+u4w/g==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-lorem-ipsum": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cspell-dict-lorem-ipsum/-/cspell-dict-lorem-ipsum-1.0.4.tgz", - "integrity": "sha512-JcYUh671h4eLQ3ZX11fnf9pwcGNdFmuSBSE0T37UMFRWkhTPYzoAqXuoWQ1JPE4r4uq9KIEBzGl/VPOIpw1g7w==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cspell-dict-lorem-ipsum/-/cspell-dict-lorem-ipsum-1.0.7.tgz", + "integrity": "sha512-qL3oenberecxOpbjq8wfg6XdxKW0iAqlvdqLbCBTSX6wA6MBEKDTFbOWYLUF34op/GVVHhtbUbQnhqulIGG0JQ==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-php": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cspell-dict-php/-/cspell-dict-php-1.0.7.tgz", - "integrity": "sha512-D17wWNAAnlzqSzN9xo7tqPlxyXebKKNXaBFpsehyTZy9GBBk4jzCk6tYW6QKPmAm/Z6rATRdaeoRg2u866+87A==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/cspell-dict-php/-/cspell-dict-php-1.0.9.tgz", + "integrity": "sha512-oteYXYDg0uVokEJlmsRx8J/iIc4OW+/+f4mNWsKrcr0ufjm+4JRYzlaRi3Lq2TglFmsnv7pP9NqL3ku3cvX5Sg==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-python": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/cspell-dict-python/-/cspell-dict-python-1.0.8.tgz", - "integrity": "sha512-j89SutsSPefWxjk8UjYVNEEIaFS07ubh2qXCGQyjMe8nKer2244QBrbUtCCDGeePEIOqvSNP1IS26k32a6SEuw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/cspell-dict-python/-/cspell-dict-python-1.0.10.tgz", + "integrity": "sha512-y1bR0EFtxOVV4MJC0D83g2tHpxfZROqOmGwlNPqIcZwARTvF9/FJkV72trnagBWwXBu81ztnHKm1tJqIbTf26A==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-rust": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cspell-dict-rust/-/cspell-dict-rust-1.0.6.tgz", - "integrity": "sha512-dOBSzOwV+HkfLqMq7JKNaxjUa3W0szWa2gKslZMvolwdaV5t2yWion0EfO63JvFZqky/oN2on52CQ3wSgHlT3w==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cspell-dict-rust/-/cspell-dict-rust-1.0.7.tgz", + "integrity": "sha512-1H8SgMUfFg0wQAZX8KI+wuZF3PypO/1aCfJhdSE0c+JL6AxAHkSl0e1Xx7iyQv+5MBcah7BdNCzLa3SGfg63AQ==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-dict-scala": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/cspell-dict-scala/-/cspell-dict-scala-1.0.5.tgz", - "integrity": "sha512-7rAmPo36imNIb6X9wu02SCaF5hW8d6/ECPDixFD/X+yyHNGnZDOKlx1eVd4jDEHbL+m0v6CdHBxM2te8nnfgdA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cspell-dict-scala/-/cspell-dict-scala-1.0.7.tgz", + "integrity": "sha512-bJRjLusww7Dr97OQMXWXVfI6Vcm69v0NwqsQGXl4w+pAUh7yA7tutYZJlXBTwQTMhrdI823Sva6axm3F969f6Q==", "dev": true, "requires": { "configstore": "^4.0.0" } }, "cspell-lib": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-3.0.5.tgz", - "integrity": "sha512-z2f5t4un43qWFYYtEKjdDj1aG2TIdOUUYQpytkDrzWcJxyOkSzxOPItOe9zypQeJrIQ8YeVnrazzKpzeap/Ulw==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-3.0.8.tgz", + "integrity": "sha512-JRuvKQEli2SYYhH0/P4YgOEhZM9hKzKO8Fw1PPkX+nSiYWrdt7xkNd6vBG0t1aGngm7Tw4fBs1V3nl3D9BlvIA==", "dev": true, "requires": { "iconv-lite": "^0.4.24", @@ -3582,24 +3574,25 @@ } }, "cspell-trie": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/cspell-trie/-/cspell-trie-3.0.7.tgz", - "integrity": "sha512-ASunLF5cb9qr8aLw23mcD6150Ipcn3c2pGcbIgN6Qoenk12An3JYZIi9+SLDvsf/LgPFa+EccUiFw1ox+WpvKg==", + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/cspell-trie/-/cspell-trie-3.0.10.tgz", + "integrity": "sha512-70maLAmZTvbUo5qKr2UD3zA9FZ31p2a4bAyJsMdTvVHMj+t5CyuGGgOQ5579FF4MpOWpnSxT5/uzpZtWlkEk1A==", "dev": true, "requires": { - "commander": "^2.18.0", - "cspell-lib": "^3.0.4", - "fs-extra": "^7.0.0", - "gensequence": "^2.1.1", - "hunspell-reader": "^2.0.3", - "rxjs": "^6.3.3", + "commander": "^2.20.0", + "cspell-lib": "^3.0.8", + "fs-extra": "^7.0.1", + "gensequence": "^2.1.2", + "hunspell-reader": "^2.1.2", + "js-xxhash": "^1.0.1", + "rxjs": "^6.5.2", "rxjs-stream": "^3.0.1" }, "dependencies": { "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true } } @@ -3687,9 +3680,9 @@ "dev": true }, "date-format": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz", - "integrity": "sha1-YV6CjiM90aubua4JUODOzPpuytg=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.0.0.tgz", + "integrity": "sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA==", "dev": true }, "date-now": { @@ -4191,13 +4184,13 @@ } }, "es5-ext": { - "version": "0.10.47", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz", - "integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==", + "version": "0.10.50", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.50.tgz", + "integrity": "sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw==", "requires": { "es6-iterator": "~2.0.3", "es6-symbol": "~3.1.1", - "next-tick": "1" + "next-tick": "^1.0.0" } }, "es6-iterator": { @@ -4211,11 +4204,12 @@ }, "dependencies": { "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } } } @@ -4245,11 +4239,12 @@ }, "dependencies": { "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } } } @@ -4267,9 +4262,9 @@ "dev": true }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -4289,14 +4284,6 @@ "dev": true, "requires": { "estraverse": "^4.0.0" - }, - "dependencies": { - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - } } }, "esrecurse": { @@ -4315,9 +4302,9 @@ "dev": true }, "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz", + "integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==", "dev": true }, "esutils": { @@ -4408,56 +4395,6 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, - "expand-braces": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", - "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", - "dev": true, - "requires": { - "array-slice": "^0.2.3", - "array-unique": "^0.2.1", - "braces": "^0.1.2" - }, - "dependencies": { - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", - "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", - "dev": true, - "requires": { - "expand-range": "^0.1.0" - } - }, - "expand-range": { - "version": "0.1.1", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", - "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", - "dev": true, - "requires": { - "is-number": "^0.1.1", - "repeat-string": "^0.2.2" - } - }, - "is-number": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", - "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", - "dev": true - }, - "repeat-string": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", - "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", - "dev": true - } - } - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -4508,101 +4445,90 @@ } } }, - "expand-range": { - "version": "1.8.2", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - }, - "dependencies": { - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "express": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", - "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.0.tgz", + "integrity": "sha512-1Z7/t3Z5ZnBG252gKUPyItc4xdeaA0X934ca2ewckAsVsw9EG71i++ZHZPYnus8g/s5Bty8IMpSVEuRkmwwPRQ==", "dev": true, "requires": { - "accepts": "~1.3.5", + "accepts": "~1.3.7", "array-flatten": "1.1.1", - "body-parser": "1.18.3", - "content-disposition": "0.5.2", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", "content-type": "~1.0.4", - "cookie": "0.3.1", + "cookie": "0.4.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.1.1", + "finalhandler": "~1.1.2", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", + "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.4", - "qs": "6.5.2", - "range-parser": "~1.2.0", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", "safe-buffer": "5.1.2", - "send": "0.16.2", - "serve-static": "1.13.2", - "setprototypeof": "1.1.0", - "statuses": "~1.4.0", - "type-is": "~1.6.16", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "dependencies": { + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -4612,17 +4538,100 @@ "ms": "2.0.0" } }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, + "requires": { + "mime-db": "1.40.0" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } } } }, @@ -4808,12 +4817,6 @@ } } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fileset": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", @@ -4848,17 +4851,17 @@ } }, "finalhandler": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", - "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, "requires": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.4.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", "unpipe": "~1.0.0" }, "dependencies": { @@ -4876,6 +4879,18 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true } } }, @@ -5054,9 +5069,9 @@ } }, "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz", + "integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==", "dev": true, "requires": { "minipass": "^2.2.1" @@ -5629,9 +5644,9 @@ } }, "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -5741,42 +5756,6 @@ "path-is-absolute": "^1.0.0" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } - } - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -5874,6 +5853,26 @@ "integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ==", "dev": true }, + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -6003,15 +6002,6 @@ "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==", "dev": true }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", @@ -6167,9 +6157,239 @@ }, "dependencies": { "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + } + } + }, + "husky": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-2.4.0.tgz", + "integrity": "sha512-3k1wuZU20gFkphNWMjh2ISCFaqfbaLY7R9FST2Mj9HeRhUK9ydj9qQR8qfXlog3EctVGsyeilcZkIT7uBZDDVA==", + "dev": true, + "requires": { + "cosmiconfig": "^5.2.0", + "execa": "^1.0.0", + "find-up": "^3.0.0", + "get-stdin": "^7.0.0", + "is-ci": "^2.0.0", + "pkg-dir": "^4.1.0", + "please-upgrade-node": "^3.1.1", + "read-pkg": "^5.1.1", + "run-node": "^1.0.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.0.0.tgz", + "integrity": "sha512-zoH7ZWPkRdgwYCDVoQTzqjG8JSPANhtvLhh4KVUHyKnaUJJrNeFmWIkTcNuJmR3GLMEmGYEf2S2bjgx26JTF+Q==", + "dev": true, + "requires": { + "locate-path": "^5.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "read-pkg": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.1.1.tgz", + "integrity": "sha512-dFcTLQi6BZ+aFUaICg7er+/usEoqFdQxiEBsEMNGoipenihtxxtdrQuBXvyANCEI8VuUIVYFgeHGx9sLLvim4w==", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^4.0.0", + "type-fest": "^0.4.1" + } + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true } } @@ -6184,9 +6404,9 @@ } }, "ieee754": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", - "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", "dev": true }, "iferr": { @@ -6287,9 +6507,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -6305,9 +6525,9 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pkg-dir": { @@ -6430,18 +6650,18 @@ } }, "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^4.0.0" + "ansi-regex": "^4.1.0" }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true } } @@ -6492,9 +6712,9 @@ "dev": true }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", "dev": true }, "is-accessor-descriptor": { @@ -6601,21 +6821,6 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -6745,18 +6950,6 @@ "isobject": "^3.0.1" } }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -6853,55 +7046,76 @@ "dev": true }, "istanbul-api": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.1.tgz", - "integrity": "sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.7.tgz", + "integrity": "sha512-LYTOa2UrYFyJ/aSczZi/6lBykVMjCCvUmT64gOe+jPZFy4w6FYfPGqFT2IiQ2BxVHHDOvCD7qrIXb0EOh4uGWw==", "dev": true, "requires": { - "async": "^2.6.1", - "compare-versions": "^3.2.1", + "async": "^2.6.2", + "compare-versions": "^3.4.0", "fileset": "^2.0.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.1", - "js-yaml": "^3.12.0", - "make-dir": "^1.3.0", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.5", + "js-yaml": "^3.13.1", + "make-dir": "^2.1.0", "minimatch": "^3.0.4", "once": "^1.4.0" }, "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true }, "istanbul-lib-instrument": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", - "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.3", - "semver": "^5.5.0" + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "dev": true } } }, @@ -6959,9 +7173,9 @@ "dev": true }, "istanbul-lib-hook": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz", - "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", "dev": true, "requires": { "append-transform": "^1.0.0" @@ -6983,34 +7197,50 @@ } }, "istanbul-lib-report": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz", - "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" }, "dependencies": { "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true } } }, "istanbul-lib-source-maps": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", - "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", "source-map": "^0.6.1" }, "dependencies": { @@ -7024,47 +7254,34 @@ } }, "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", - "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", - "dev": true, - "requires": { - "handlebars": "^4.1.0" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "lodash": "^4.17.11" + "pify": "^4.0.1", + "semver": "^5.6.0" } }, - "handlebars": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" + "glob": "^7.1.3" } }, "source-map": { @@ -7075,6 +7292,15 @@ } } }, + "istanbul-reports": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", + "dev": true, + "requires": { + "handlebars": "^4.1.2" + } + }, "jasmine": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", @@ -7140,10 +7366,16 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "js-xxhash": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-xxhash/-/js-xxhash-1.0.1.tgz", + "integrity": "sha512-ociwKjHkCPjqNMmZtD7uUoL+AVhcSZX3WPmirRwXg+PzKD0v5x9K2yLpvkSglbThvbGN/TVA+3XFjPVolQwDpQ==", + "dev": true + }, "js-yaml": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", - "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -7297,28 +7529,27 @@ } }, "karma": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/karma/-/karma-4.0.0.tgz", - "integrity": "sha512-EFoFs3F6G0BcUGPNOn/YloGOb3h09hzTguyXlg6loHlKY76qbJikkcyPk43m2kfRF65TUGda/mig29QQtyhm1g==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-4.0.1.tgz", + "integrity": "sha512-ind+4s03BqIXas7ZmraV3/kc5+mnqwCd+VDX1FndS6jxbt03kQKX2vXrWxNLuCjVYmhMwOZosAEKMM0a2q7w7A==", "dev": true, "requires": { "bluebird": "^3.3.0", "body-parser": "^1.16.1", + "braces": "^2.3.2", "chokidar": "^2.0.3", "colors": "^1.1.0", - "combine-lists": "^1.0.0", "connect": "^3.6.0", "core-js": "^2.2.0", "di": "^0.0.1", "dom-serialize": "^2.2.0", - "expand-braces": "^0.1.1", "flatted": "^2.0.0", "glob": "^7.1.1", "graceful-fs": "^4.1.2", "http-proxy": "^1.13.0", "isbinaryfile": "^3.0.0", - "lodash": "^4.17.5", - "log4js": "^3.0.0", + "lodash": "^4.17.11", + "log4js": "^4.0.0", "mime": "^2.3.1", "minimatch": "^3.0.2", "optimist": "^0.6.1", @@ -7516,24 +7747,23 @@ } }, "lint-staged": { - "version": "8.1.4", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.1.4.tgz", - "integrity": "sha512-oFbbhB/VzN8B3i/sIdb9gMfngGArI6jIfxSn+WPdQb2Ni3GJeS6T4j5VriSbQfxfMuYoQlMHOoFt+lfcWV0HfA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-8.2.0.tgz", + "integrity": "sha512-DxguyxGOIfb67wZ6EOrqzjAbw6ZH9XK3YS74HO+erJf6+SAQeJJPN//GBOG5xhdt2THeuXjVPaHcCYOWGZwRbA==", "dev": true, "requires": { - "@iamstarkov/listr-update-renderer": "0.4.1", "chalk": "^2.3.1", "commander": "^2.14.1", - "cosmiconfig": "^5.0.2", + "cosmiconfig": "^5.2.0", "debug": "^3.1.0", "dedent": "^0.7.0", "del": "^3.0.0", "execa": "^1.0.0", - "find-parent-dir": "^0.3.0", "g-status": "^2.0.2", "is-glob": "^4.0.0", "is-windows": "^1.0.2", "listr": "^0.14.2", + "listr-update-renderer": "^0.5.0", "lodash": "^4.17.11", "log-symbols": "^2.2.0", "micromatch": "^3.1.8", @@ -7545,18 +7775,18 @@ "staged-git-files": "1.1.2", "string-argv": "^0.0.2", "stringify-object": "^3.2.2", - "yup": "^0.26.10" + "yup": "^0.27.0" }, "dependencies": { "cosmiconfig": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.7.tgz", - "integrity": "sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", "dev": true, "requires": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", - "js-yaml": "^3.9.0", + "js-yaml": "^3.13.1", "parse-json": "^4.0.0" } }, @@ -7637,9 +7867,9 @@ }, "dependencies": { "p-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.0.0.tgz", - "integrity": "sha512-GO107XdrSUmtHxVoi60qc9tUl/KkNKm+X2CF4P9amalpGxv5YqVPJNfSb0wcA+syCopkZvYYIzW8OVTQW59x/w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", "dev": true } } @@ -7783,12 +8013,6 @@ "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -7801,12 +8025,6 @@ "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, "lodash.tail": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz", @@ -7877,16 +8095,16 @@ } }, "log4js": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-3.0.6.tgz", - "integrity": "sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.0.2.tgz", + "integrity": "sha512-KE7HjiieVDPPdveA3bJZSuu0n8chMkFl8mIoisBFxwEJ9FmXe4YzNuiqSwYUiR1K8q8/5/8Yd6AClENY1RA9ww==", "dev": true, "requires": { - "circular-json": "^0.5.5", - "date-format": "^1.2.0", + "date-format": "^2.0.0", "debug": "^3.1.0", + "flatted": "^2.0.0", "rfdc": "^1.1.2", - "streamroller": "0.7.0" + "streamroller": "^1.0.1" } }, "loglevel": { @@ -8090,12 +8308,6 @@ "escape-string-regexp": "^1.0.4" } }, - "math-random": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", - "dev": true - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -8114,14 +8326,22 @@ "dev": true }, "mem": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", - "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", + "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + } } }, "memory-fs": { @@ -8435,7 +8655,8 @@ "version": "2.12.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", - "dev": true + "dev": true, + "optional": true }, "nanomatch": { "version": "1.2.13", @@ -8463,9 +8684,9 @@ "dev": true }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, "next-tick": { @@ -8474,9 +8695,9 @@ "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, "ng-packagr": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-4.7.0.tgz", - "integrity": "sha512-FNCe4WpHwBk107pCX0KOnsv+cUaM2bCGAD/oYUl0FIwQXkI+iYjDik9KlqJ/bWDUsiCUxiAH2v5AsTaEF7G4bw==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-4.7.1.tgz", + "integrity": "sha512-MIPKxyrnV22fS3wSfst2XjwWOonFKujVVEnIehYJhiu8GOg37bCdbbr9plsE1jRDmDAUz6M1MvdKibUrJyRp6Q==", "dev": true, "requires": { "@ngtools/json-schema": "^1.1.0", @@ -8493,7 +8714,7 @@ "less-plugin-npm-import": "^2.1.0", "node-sass": "^4.9.3", "node-sass-tilde-importer": "^1.0.0", - "opencollective": "^1.0.3", + "opencollective-postinstall": "^2.0.1", "postcss": "^7.0.0", "postcss-url": "^8.0.0", "read-pkg-up": "^4.0.0", @@ -8541,9 +8762,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -8559,9 +8780,9 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "parse-json": { @@ -8614,16 +8835,6 @@ "resolved": "https://registry.npmjs.org/node-ensure/-/node-ensure-0.0.0.tgz", "integrity": "sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc=" }, - "node-fetch": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", - "integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, "node-fetch-npm": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz", @@ -8718,9 +8929,9 @@ } }, "node-sass": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz", - "integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.12.0.tgz", + "integrity": "sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -8730,12 +8941,10 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.11", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", + "nan": "^2.13.2", "node-gyp": "^3.8.0", "npmlog": "^4.0.0", "request": "^2.88.0", @@ -8763,6 +8972,12 @@ "supports-color": "^2.0.0" } }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -8992,27 +9207,6 @@ "isobject": "^3.0.0" } }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - }, - "dependencies": { - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - } - } - }, "object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -9038,9 +9232,9 @@ } }, "on-headers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", "dev": true }, "once": { @@ -9061,138 +9255,25 @@ "mimic-fn": "^1.0.0" } }, - "opencollective": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", - "integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=", + "open": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.0.0.tgz", + "integrity": "sha512-/yb5mVZBz7mHLySMiSj2DcLtMBbFPJk5JBKEkHVZFxZAPzeg3L026O0T+lbdz1B2nyDnkClRSwRQJdeVUIF7zw==", "dev": true, "requires": { - "babel-polyfill": "6.23.0", - "chalk": "1.1.3", - "inquirer": "3.0.6", - "minimist": "1.2.0", - "node-fetch": "1.6.3", - "opn": "4.0.2" - }, - "dependencies": { - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", - "dev": true - }, - "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", - "dev": true, - "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", - "tmp": "^0.0.33" - } - }, - "inquirer": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", - "integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=", - "dev": true, - "requires": { - "ansi-escapes": "^1.1.0", - "chalk": "^1.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.1", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx": "^4.1.0", - "string-width": "^2.0.0", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "opn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", - "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", - "dev": true, - "requires": { - "object-assign": "^4.0.1", - "pinkie-promise": "^2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } + "is-wsl": "^1.1.0" } }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, "opn": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/opn/-/opn-5.4.0.tgz", - "integrity": "sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", "dev": true, "requires": { "is-wsl": "^1.1.0" @@ -9252,12 +9333,6 @@ "lcid": "^1.0.0" } }, - "os-shim": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", - "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", - "dev": true - }, "os-tmpdir": { "version": "1.0.2", "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -9287,9 +9362,9 @@ "dev": true }, "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { @@ -9492,41 +9567,12 @@ "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", "dev": true, "requires": { - "asn1.js": "^4.0.0", - "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - } + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" } }, "parse-json": { @@ -9538,12 +9584,6 @@ "error-ex": "^1.2.0" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parse5": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", @@ -9824,9 +9864,9 @@ }, "dependencies": { "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz", + "integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw==", "dev": true } } @@ -9837,55 +9877,16 @@ "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, - "pre-commit": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", - "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", - "dev": true, - "requires": { - "cross-spawn": "^5.0.1", - "spawn-sync": "^1.0.15", - "which": "1.2.x" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, "prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "prettier": { - "version": "1.16.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", - "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.1.tgz", + "integrity": "sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg==", "dev": true }, "process": { @@ -10106,13 +10107,13 @@ } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "dev": true, "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "prr": { @@ -10186,9 +10187,9 @@ "dev": true }, "qs": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz", - "integrity": "sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==" + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" }, "querystring": { "version": "0.2.0", @@ -10203,34 +10204,15 @@ "dev": true }, "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", "dev": true }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "requires": { "safe-buffer": "^5.1.0" @@ -10439,15 +10421,6 @@ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -10470,9 +10443,9 @@ } }, "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", "dev": true, "requires": { "rc": "^1.1.6", @@ -10683,21 +10656,21 @@ } }, "rollup-plugin-commonjs": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.2.0.tgz", - "integrity": "sha512-0RM5U4Vd6iHjL6rLvr3lKBwnPsaVml+qxOGaaNUWN1lSq6S33KhITOfHmvxV3z2vy9Mk4t0g4rNlVaJJsNQPWA==", + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.3.4.tgz", + "integrity": "sha512-DTZOvRoiVIHHLFBCL4pFxOaJt8pagxsVldEXBOn6wl3/V21wVaj17HFfyzTsQUuou3sZL3lEJZVWKPFblJfI6w==", "dev": true, "requires": { - "estree-walker": "^0.5.2", - "magic-string": "^0.25.1", - "resolve": "^1.8.1", - "rollup-pluginutils": "^2.3.3" + "estree-walker": "^0.6.0", + "magic-string": "^0.25.2", + "resolve": "^1.10.0", + "rollup-pluginutils": "^2.6.0" }, "dependencies": { "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -10715,26 +10688,27 @@ } }, "rollup-plugin-node-resolve": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.0.0.tgz", - "integrity": "sha512-7Ni+/M5RPSUBfUaP9alwYQiIKnKeXCOHiqBpKUl9kwp3jX5ZJtgXAait1cne6pGEVUUztPD6skIKH9Kq9sNtfw==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.4.tgz", + "integrity": "sha512-t/64I6l7fZ9BxqD3XlX4ZeO6+5RLKyfpwE2CiPNUKa+GocPlQhf/C208ou8y3AwtNsc6bjSk/8/6y/YAyxCIvw==", "dev": true, "requires": { - "builtin-modules": "^3.0.0", + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", "is-module": "^1.0.0", - "resolve": "^1.8.1" + "resolve": "^1.10.0" }, "dependencies": { "builtin-modules": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.0.0.tgz", - "integrity": "sha512-hMIeU4K2ilbXV6Uv93ZZ0Avg/M91RaKXucQ+4me2Do1txxBDyDZWCBa5bJSLqoNTRpXTLwEzIk1KmloenDDjhg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", "dev": true }, "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -10753,104 +10727,13 @@ } }, "rollup-pluginutils": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz", - "integrity": "sha512-2XZwja7b6P5q4RZ5FhyX1+f46xi1Z3qBKigLRZ6VTZjwbN0K1IFGMlwm06Uu0Emcre2Z63l77nq/pzn+KxIEoA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.7.0.tgz", + "integrity": "sha512-FoP6L1YnMYTAR06Dpq5LE3jJtMwPE6H4VEOqFU23yoziZnqNRSiWcVy6YgEY5PdQB4G7278+8c4TvB0JKS1csA==", "dev": true, "requires": { - "estree-walker": "^0.5.2", - "micromatch": "^2.3.11" - }, - "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - } + "estree-walker": "^0.6.0", + "micromatch": "^3.1.10" } }, "run-async": { @@ -10862,6 +10745,12 @@ "is-promise": "^2.1.0" } }, + "run-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", + "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -10878,39 +10767,40 @@ "dev": true }, "rxjs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", - "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", "requires": { "tslib": "^1.9.0" } }, "rxjs-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/rxjs-stream/-/rxjs-stream-3.0.1.tgz", - "integrity": "sha512-KZ+B7MWw2mygAsLJJ+mjYkCXHtSeYRXWhUVQBQRX4NgBmEiAEGAmVz7epY+8Gj0REL22W0T8ZbysFbzI/76ikA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rxjs-stream/-/rxjs-stream-3.0.2.tgz", + "integrity": "sha512-DASSTemCVcghTvUGKd6g2QYQ1Y/tCKwxZ2Xj41+PH0GHRLQLknwLIIHtPfbK1Cb7aorf0jZXAe123oSMHXLn7Q==", "dev": true }, "rxjs-tslint-rules": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/rxjs-tslint-rules/-/rxjs-tslint-rules-4.16.2.tgz", - "integrity": "sha512-yX/rG/aqjIZNTv6Ugq9ST43IV+g2a3JY3YwWTA8Q7VY+jGRhoILLWJbvJlL5gwmeT4HZXybpVGEBsZU4NPx15g==", + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/rxjs-tslint-rules/-/rxjs-tslint-rules-4.19.0.tgz", + "integrity": "sha512-iiSuqzAm6l6LS0HWCccsrrqbZOg+cJ/bcqY3khncKzBWjyg3iHWJZNK7/fU6De4mH69a3Y1YHsG7wgvifnhu+g==", "dev": true, "requires": { "@phenomnomnominal/tsquery": "^3.0.0", - "decamelize": "^2.0.0", + "decamelize": "^3.0.0", "resolve": "^1.4.0", "tslib": "^1.8.0", - "tsutils": "^3.0.0" + "tsutils": "^3.0.0", + "tsutils-etc": "^1.1.0" }, "dependencies": { "decamelize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", - "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-3.1.1.tgz", + "integrity": "sha512-pSJTQCBDZxv8siK5p/M42ZdhThhTtx3JU/OKli0yQSKebfM9q92op6zF7krYrWVKRtsE/RwTDiZLliMV3ECkXQ==", "dev": true, "requires": { - "xregexp": "4.0.0" + "xregexp": "^4.2.4" } }, "resolve": { @@ -10921,6 +10811,15 @@ "requires": { "path-parse": "^1.0.6" } + }, + "xregexp": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.2.4.tgz", + "integrity": "sha512-sO0bYdYeJAJBcJA8g7MJJX7UrOZIfJPd8U2SC7B2Dd/J24U0aQNoGp33shCaBSWeb0rD5rh6VBUIXOkGal1TZA==", + "dev": true, + "requires": { + "@babel/runtime-corejs2": "^7.2.0" + } } } }, @@ -11099,9 +10998,9 @@ } }, "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "dev": true, "requires": { "debug": "2.6.9", @@ -11111,12 +11010,12 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", "on-finished": "~2.3.0", - "range-parser": "~1.2.0", - "statuses": "~1.4.0" + "range-parser": "~1.2.1", + "statuses": "~1.5.0" }, "dependencies": { "debug": { @@ -11126,26 +11025,53 @@ "dev": true, "requires": { "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } } }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true } } }, "serialize-javascript": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", - "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", + "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", "dev": true }, "serve-index": { @@ -11181,15 +11107,23 @@ } }, "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", - "parseurl": "~1.3.2", - "send": "0.16.2" + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "dependencies": { + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + } } }, "set-blocking": { @@ -11295,9 +11229,9 @@ "dev": true }, "simple-git": { - "version": "1.107.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.107.0.tgz", - "integrity": "sha512-t4OK1JRlp4ayKRfcW6owrWcRVLyHRUlhGd0uN6ZZTqfDq8a5XpcUdOKiGRNobHEuMtNqzp0vcJNvhYWwh5PsQA==", + "version": "1.113.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-1.113.0.tgz", + "integrity": "sha512-i9WVsrK2u0G/cASI9nh7voxOk9mhanWY9eGtWBDSYql6m49Yk5/Fan6uZsDr/xmzv8n+eQ8ahKCoEr8cvU3h+g==", "dev": true, "requires": { "debug": "^4.0.1" @@ -11606,9 +11540,9 @@ } }, "socks": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.2.3.tgz", - "integrity": "sha512-+2r83WaRT3PXYoO/1z+RDEBE7Z2f9YcdQnJ0K/ncXXbV5gJ6wYfNAebYFYiiUjM6E4JyXnPY8cimwyvFYHVUUA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.2.tgz", + "integrity": "sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ==", "dev": true, "requires": { "ip": "^1.1.5", @@ -11616,13 +11550,13 @@ } }, "socks-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz", - "integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz", + "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==", "dev": true, "requires": { - "agent-base": "~4.2.0", - "socks": "~2.2.0" + "agent-base": "~4.2.1", + "socks": "~2.3.2" } }, "source-list-map": { @@ -11690,16 +11624,6 @@ "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", "dev": true }, - "spawn-sync": { - "version": "1.0.15", - "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", - "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", - "dev": true, - "requires": { - "concat-stream": "^1.4.7", - "os-shim": "^0.1.2" - } - }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -11780,9 +11704,9 @@ } }, "readable-stream": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz", - "integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", + "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -11793,9 +11717,9 @@ } }, "speed-measure-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-b9Yd0TrzceMVYSbuamM1sFsGM1oVfyFTM22gOoyLhymNvBVApuYpkdFOgYkKJpN/KhTpcCYcTGHg7X+FJ33Vvw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/speed-measure-webpack-plugin/-/speed-measure-webpack-plugin-1.3.1.tgz", + "integrity": "sha512-qVIkJvbtS9j/UeZumbdfz0vg+QfG/zxonAjzefZrqzkr7xOncLVXkeGbTpzd1gjCBM4PmVNkWlkeTVhgskAGSQ==", "dev": true, "requires": { "chalk": "^2.0.1" @@ -11933,15 +11857,16 @@ "dev": true }, "streamroller": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-0.7.0.tgz", - "integrity": "sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.3.tgz", + "integrity": "sha512-P7z9NwP51EltdZ81otaGAN3ob+/F88USJE546joNq7bqRNTe6jc74fTBDyynxP4qpIfKlt/CesEYicuMzI0yJg==", "dev": true, "requires": { - "date-format": "^1.2.0", + "async": "^2.6.1", + "date-format": "^2.0.0", "debug": "^3.1.0", - "mkdirp": "^0.5.1", - "readable-stream": "^2.3.0" + "fs-extra": "^7.0.0", + "lodash": "^4.17.10" } }, "string-argv": { @@ -12125,25 +12050,25 @@ "dev": true }, "synchronous-promise": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.6.tgz", - "integrity": "sha512-TyOuWLwkmtPL49LHCX1caIwHjRzcVd62+GF6h8W/jHOeZUFHpnd2XJDVuUlaTaLPH1nuu2M69mfHr5XbQJnf/g==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.9.tgz", + "integrity": "sha512-LO95GIW16x69LuND1nuuwM4pjgFGupg7pZ/4lU86AmchPKrhk0o2tpMU2unXRrqo81iAFe1YJ0nAGEVwsrZAgg==", "dev": true }, "tapable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", - "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true }, "tar": { - "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { "block-stream": "*", - "fstream": "^1.0.2", + "fstream": "^1.0.12", "inherits": "2" } }, @@ -12185,16 +12110,22 @@ } }, "terser": { - "version": "3.16.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-3.16.1.tgz", - "integrity": "sha512-JDJjgleBROeek2iBcSNzOHLKsB/MdDf+E/BOAJ0Tk9r7p9/fVobfv7LMJ/g/k3v9SXdmjZnIlFd5nfn/Rt0Xow==", + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", + "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "^2.19.0", "source-map": "~0.6.1", - "source-map-support": "~0.5.9" + "source-map-support": "~0.5.10" }, "dependencies": { + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -12242,13 +12173,13 @@ } }, "find-cache-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", - "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^1.0.0", + "make-dir": "^2.0.0", "pkg-dir": "^3.0.0" } }, @@ -12280,6 +12211,16 @@ "yallist": "^3.0.2" } }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, "mississippi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", @@ -12299,9 +12240,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -12317,9 +12258,15 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, "pkg-dir": { @@ -12481,6 +12428,12 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, "topo": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz", @@ -12550,41 +12503,16 @@ } }, "ts-node": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-4.1.0.tgz", - "integrity": "sha512-xcZH12oVg9PShKhy3UHyDmuDLV3y7iKwX25aMVPt1SIXSuAfWkFiGPEkg+th8R4YKW/QCxDoW7lJdb15lx6QWg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.0.3.tgz", + "integrity": "sha512-2qayBA4vdtVRuDo11DEFSsD/SFsBXQBRZZhbRGSIkmYmVkWjULn/GGMdG10KVqkaGndljfaTD8dKjWgcejO8YA==", "dev": true, "requires": { - "arrify": "^1.0.0", - "chalk": "^2.3.0", + "arg": "^4.1.0", "diff": "^3.1.0", "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.5.0", - "tsconfig": "^7.0.0", - "v8flags": "^3.0.0", - "yn": "^2.0.0" - } - }, - "tsconfig": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", - "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", - "dev": true, - "requires": { - "@types/strip-bom": "^3.0.0", - "@types/strip-json-comments": "0.0.30", - "strip-bom": "^3.0.0", - "strip-json-comments": "^2.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } + "source-map-support": "^0.5.6", + "yn": "^3.0.0" } }, "tsickle": { @@ -12644,14 +12572,20 @@ } }, "tsutils": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.8.0.tgz", - "integrity": "sha512-XQdPhgcoTbCD8baXC38PQ0vpTZ8T3YrE+vR66YIj/xvDt1//8iAhafpIT/4DmvzzC1QFapEImERu48Pa01dIUA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.9.1.tgz", + "integrity": "sha512-hrxVtLtPqQr//p8/msPT1X1UYXUjizqSit5d9AQ5k38TcV38NyecL5xODNxa73cLe/5sdiJ+w1FqzDhRBA/anA==", "dev": true, "requires": { "tslib": "^1.8.1" } }, + "tsutils-etc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tsutils-etc/-/tsutils-etc-1.1.0.tgz", + "integrity": "sha512-pJlLtLmQPUyGHqY/Pq6EGnpGmQCnnTDZetQ7eWkeQ5xaw4GtfcR1Zt7HMKFHGDDp53HzQfbqQ+7ps6iJbfa9Hw==", + "dev": true + }, "tty-browserify": { "version": "0.0.0", "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -12673,6 +12607,17 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, + "type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", + "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==" + }, + "type-fest": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.4.1.tgz", + "integrity": "sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw==", + "dev": true + }, "type-is": { "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", @@ -12912,12 +12857,12 @@ } }, "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "dev": true, "requires": { - "querystringify": "^2.0.0", + "querystringify": "^2.1.1", "requires-port": "^1.0.0" } }, @@ -12972,15 +12917,6 @@ "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", "dev": true }, - "v8flags": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.1.2.tgz", - "integrity": "sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw==", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -13176,9 +13112,9 @@ }, "dependencies": { "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz", + "integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw==", "dev": true } } @@ -13342,9 +13278,9 @@ } }, "mime": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", - "integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz", + "integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw==", "dev": true }, "os-locale": { @@ -13359,9 +13295,9 @@ } }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -13377,9 +13313,9 @@ } }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pump": { @@ -13617,9 +13553,9 @@ } }, "worker-farm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", - "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", "dev": true, "requires": { "errno": "~0.1.7" @@ -13806,22 +13742,22 @@ "dev": true }, "yn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.0.0.tgz", + "integrity": "sha512-+Wo/p5VRfxUgBUGy2j/6KX2mj9AYJWOHuhMjMcbBFc3y54o9/4buK1ksBvuiK01C3kby8DH9lSmJdSxw+4G/2Q==", "dev": true }, "yup": { - "version": "0.26.10", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.26.10.tgz", - "integrity": "sha512-keuNEbNSnsOTOuGCt3UJW69jDE3O4P+UHAakO7vSeFMnjaitcmlbij/a3oNb9g1Y1KvSKH/7O1R2PQ4m4TRylw==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.27.0.tgz", + "integrity": "sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ==", "dev": true, "requires": { - "@babel/runtime": "7.0.0", + "@babel/runtime": "^7.0.0", "fn-name": "~2.0.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "property-expr": "^1.5.0", - "synchronous-promise": "^2.0.5", + "synchronous-promise": "^2.0.6", "toposort": "^2.0.2" } }, diff --git a/package.json b/package.json index 3279b484f8..8f9a6a31e7 100644 --- a/package.json +++ b/package.json @@ -1,64 +1,64 @@ { "name": "alfresco-content-app", - "version": "1.7.0", + "version": "1.8.0", "license": "LGPL-3.0", "scripts": { "ng": "ng", - "start": "npm run build.extensions && ng serve --open", + "start": "npm run build.shared && npm run build.extensions && ng serve --open", "start:prod": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open", "build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets", + "build.shared": "ng build aca-shared", "build.extensions": "npm run build:aos-extension", "build.app": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app", - "build": "npm run build.extensions && npm run build.app -- --prod", - "build.e2e": "npm run build.extensions && npm run build.app -- --prod --configuration=e2e", + "build": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod", + "build.e2e": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --configuration=e2e", "test": "ng test app --code-coverage", - "test:ci": "npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false", + "test:ci": "npm run build.shared && npm run build.extensions && ng test adf-office-services-ext --watch=false && ng test app --code-coverage --watch=false", "lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck", "wd:update": "webdriver-manager update --gecko=false", "e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json", - "e2e": "npm run wd:update && protractor --baseUrl=http://localhost:4000", - "e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200", + "e2e": "npm run wd:update && protractor --baseUrl=http://localhost:4000 $SUITE", + "e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE", "wait:app": "wait-on http://localhost:8080 && wait-on http://localhost:4000", "start:docker": "docker-compose up -d --build && npm run wait:app", "stop:docker": "docker-compose stop", "e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker", - "spellcheck": "cspell 'src/**/*.ts' 'e2e/**/*.ts' 'projects/**/*.ts'", + "spellcheck": "cspell '{src,e2e,projects}/**/*.ts'", "inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json", "format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", "format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"", - "build.tomcat": "npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", + "build.tomcat": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .", "build.tomcat.e2e": "./build-tomcat-e2e.sh", - "e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/", + "e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/ $SUITE", "docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app", "docker.tomcat.stop": "cd docker/tomcat && docker-compose stop", - "docker.tomcat.e2e": "npm run docker.tomcat.start && npm run e2e.tomcat", - "lint:staged": "lint-staged" + "docker.tomcat.e2e": "npm run docker.tomcat.start && npm run e2e.tomcat" }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "3.0.0", - "@alfresco/adf-core": "3.0.0", - "@alfresco/adf-extensions": "3.0.0", - "@alfresco/js-api": "3.0.0", - "@angular/animations": "7.2.7", - "@angular/cdk": "^7.3.3", - "@angular/common": "7.2.7", - "@angular/compiler": "7.2.7", - "@angular/core": "7.2.7", - "@angular/flex-layout": "^7.0.0-beta.23", - "@angular/forms": "7.2.7", - "@angular/http": "7.2.7", - "@angular/material": "^7.3.3", - "@angular/material-moment-adapter": "^7.3.3", - "@angular/platform-browser": "7.2.7", - "@angular/platform-browser-dynamic": "7.2.7", - "@angular/router": "7.2.7", + "@alfresco/adf-content-services": "3.3.0", + "@alfresco/adf-core": "3.3.0", + "@alfresco/adf-extensions": "3.3.0", + "@alfresco/js-api": "3.3.0", + "@angular/animations": "7.2.15", + "@angular/cdk": "^7.3.7", + "@angular/common": "7.2.15", + "@angular/compiler": "7.2.15", + "@angular/core": "7.2.15", + "@angular/flex-layout": "^7.0.0-beta.24", + "@angular/forms": "7.2.15", + "@angular/http": "7.2.15", + "@angular/material": "^7.3.7", + "@angular/material-moment-adapter": "^7.3.7", + "@angular/platform-browser": "7.2.15", + "@angular/platform-browser-dynamic": "7.2.15", + "@angular/router": "7.2.15", "@mat-datetimepicker/core": "^3.0.0-beta.0", "@mat-datetimepicker/moment": "^3.0.0-beta.0", - "@ngrx/effects": "^7.3.0", - "@ngrx/router-store": "^7.3.0", - "@ngrx/store": "^7.3.0", - "@ngrx/store-devtools": "^7.3.0", + "@ngrx/effects": "^7.4.0", + "@ngrx/router-store": "^7.4.0", + "@ngrx/store": "^7.4.0", + "@ngrx/store-devtools": "^7.4.0", "@ngx-translate/core": "^11.0.1", "core-js": "^2.5.7", "hammerjs": "2.0.8", @@ -66,15 +66,15 @@ "moment": "^2.24.0", "moment-es6": "1.0.0", "pdfjs-dist": "^2.0.489", - "rxjs": "^6.4.0", + "rxjs": "^6.5.2", "zone.js": "0.8.29" }, "devDependencies": { - "@angular-devkit/build-angular": "~0.13.0", + "@angular-devkit/build-angular": "~0.13.9", "@angular-devkit/build-ng-packagr": "~0.13.0", - "@angular/cli": "^7.3.4", - "@angular/compiler-cli": "7.2.7", - "@angular/language-service": "7.2.7", + "@angular/cli": "^7.3.9", + "@angular/compiler-cli": "7.2.15", + "@angular/language-service": "7.2.15", "@types/jasmine": "^2.5.53", "@types/jasminewd2": "^2.0.2", "@types/node": "9.3.0", @@ -82,28 +82,27 @@ "chrome-remote-interface": "^0.26.1", "codelyzer": "^4.5.0", "cpr": "^3.0.1", - "cspell": "^3.1.3", + "cspell": "^3.2.17", + "husky": "^2.4.0", "jasmine-core": "~2.8.0", "jasmine-reporters": "^2.2.1", "jasmine-spec-reporter": "~4.2.1", "jasminewd2": "^2.2.0", - "karma": "^4.0.0", + "karma": "^4.0.1", "karma-chrome-launcher": "~2.2.0", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^2.0.4", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", - "lint-staged": "^8.1.4", - "ng-packagr": "^4.7.0", + "lint-staged": "^8.2.0", + "ng-packagr": "^4.7.1", "node-stream-zip": "1.8.0", - "pre-commit": "^1.2.2", - "prettier": "^1.16.0", + "prettier": "^1.17.1", "protractor": "^5.4.0", "protractor-screenshoter-plugin": "0.10.3", - "rimraf": "2.6.2", - "rxjs-tslint-rules": "^4.16.1", + "rxjs-tslint-rules": "^4.19.0", "selenium-webdriver": "4.0.0-alpha.1", - "ts-node": "~4.1.0", + "ts-node": "^8.0.3", "tsickle": "0.34.0", "tslib": "^1.9.0", "tslint": "~5.11.0", @@ -112,8 +111,13 @@ }, "lint-staged": { "*.{ts,js,css,scss,html}": [ - "prettier --single-quote --write" + "prettier --single-quote --write", + "git add" ] }, - "pre-commit": "lint:staged" + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + } } diff --git a/projects/aca-shared/README.md b/projects/aca-shared/README.md new file mode 100644 index 0000000000..336cad5cdd --- /dev/null +++ b/projects/aca-shared/README.md @@ -0,0 +1,24 @@ +# AcaShared + +This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0. + +## Code scaffolding + +Run `ng generate component component-name --project aca-shared` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-shared`. +> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file. + +## Build + +Run `ng build aca-shared` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Publishing + +After building your library with `ng build aca-shared`, go to the dist folder `cd dist/aca-shared` and run `npm publish`. + +## Running unit tests + +Run `ng test aca-shared` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/projects/aca-shared/karma.conf.js b/projects/aca-shared/karma.conf.js new file mode 100644 index 0000000000..391854077f --- /dev/null +++ b/projects/aca-shared/karma.conf.js @@ -0,0 +1,32 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function(config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../../coverage/aca-shared'), + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false, + restartOnFileChange: true + }); +}; diff --git a/projects/aca-shared/ng-package.json b/projects/aca-shared/ng-package.json new file mode 100644 index 0000000000..240cc4a74d --- /dev/null +++ b/projects/aca-shared/ng-package.json @@ -0,0 +1,17 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/@alfresco/aca-shared", + "lib": { + "entryFile": "src/public-api.ts", + "umdModuleIds": { + "rxjs": "rxjs", + "@alfresco/js-api": "@alfresco/js-api", + "@alfresco/adf-core": "@alfresco/adf-core", + "@alfresco/adf-extensions": "@alfresco/adf-extensions", + "@ngrx/store": "@ngrx/store", + "@ngrx/effects": "@ngrx/effects", + "@angular/material": "@angular/material", + "@ngx-translate/core": "@ngx-translate/core" + } + } +} diff --git a/projects/aca-shared/package.json b/projects/aca-shared/package.json new file mode 100644 index 0000000000..40c18dcdf8 --- /dev/null +++ b/projects/aca-shared/package.json @@ -0,0 +1,15 @@ +{ + "name": "@alfresco/aca-shared", + "version": "1.8.3", + "peerDependencies": { + "@angular/common": "^7.2.0", + "@angular/core": "^7.2.0", + "@angular/material": "^7.3.7", + "@ngrx/effects": "^7.4.0", + "@ngrx/store": "^7.4.0", + "@alfresco/adf-extensions": "^3.1.0", + "@alfresco/js-api": "^3.1.0", + "rxjs": "^6.4.0", + "@ngx-translate/core": "^11.0.1" + } +} diff --git a/projects/aca-shared/rules/package.json b/projects/aca-shared/rules/package.json new file mode 100644 index 0000000000..4bbd7d0f7b --- /dev/null +++ b/projects/aca-shared/rules/package.json @@ -0,0 +1,3 @@ +{ + "ngPackage": {} +} diff --git a/src/app/extensions/evaluators/app.evaluators.spec.ts b/projects/aca-shared/rules/src/app.rules.spec.ts similarity index 71% rename from src/app/extensions/evaluators/app.evaluators.spec.ts rename to projects/aca-shared/rules/src/app.rules.spec.ts index 93759b038b..3306e147e4 100644 --- a/src/app/extensions/evaluators/app.evaluators.spec.ts +++ b/projects/aca-shared/rules/src/app.rules.spec.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import * as app from './app.evaluators'; +import * as app from './app.rules'; describe('app.evaluators', () => { describe('isWriteLocked', () => { @@ -40,7 +40,7 @@ describe('app.evaluators', () => { } }; - expect(app.isWriteLocked(context, null)).toBe(true); + expect(app.isWriteLocked(context)).toBe(true); }); it('should return [false] if lock type is not set', () => { @@ -54,20 +54,20 @@ describe('app.evaluators', () => { } }; - expect(app.isWriteLocked(context, null)).toBe(false); + expect(app.isWriteLocked(context)).toBe(false); }); it('should return [false] if selection not present', () => { const context: any = {}; - expect(app.isWriteLocked(context, null)).toBe(false); + expect(app.isWriteLocked(context)).toBe(false); }); }); describe('hasLockedFiles', () => { it('should return [false] if selection not present', () => { const context: any = {}; - expect(app.hasLockedFiles(context, null)).toBe(false); + expect(app.hasLockedFiles(context)).toBe(false); }); it('should return [false] if nodes not present', () => { @@ -77,7 +77,7 @@ describe('app.evaluators', () => { } }; - expect(app.hasLockedFiles(context, null)).toBe(false); + expect(app.hasLockedFiles(context)).toBe(false); }); it('should return [false] if no files selected', () => { @@ -98,7 +98,7 @@ describe('app.evaluators', () => { } }; - expect(app.hasLockedFiles(context, null)).toBe(false); + expect(app.hasLockedFiles(context)).toBe(false); }); it('should return [true] when one of files is locked', () => { @@ -121,7 +121,7 @@ describe('app.evaluators', () => { } }; - expect(app.hasLockedFiles(context, null)).toBe(true); + expect(app.hasLockedFiles(context)).toBe(true); }); }); @@ -148,14 +148,14 @@ describe('app.evaluators', () => { } }; - expect(app.hasLockedFiles(context, null)).toBe(true); + expect(app.hasLockedFiles(context)).toBe(true); }); describe('canUpdateSelectedNode', () => { it('should return [false] if selection not preset', () => { const context: any = {}; - expect(app.canUpdateSelectedNode(context, null)).toBe(false); + expect(app.canUpdateSelectedNode(context)).toBe(false); }); it('should return [false] if selection is empty', () => { @@ -165,7 +165,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUpdateSelectedNode(context, null)).toBe(false); + expect(app.canUpdateSelectedNode(context)).toBe(false); }); it('should return [false] if first selection is not a file', () => { @@ -183,7 +183,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUpdateSelectedNode(context, null)).toBe(false); + expect(app.canUpdateSelectedNode(context)).toBe(false); }); it('should return [false] if the file is locked', () => { @@ -210,7 +210,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUpdateSelectedNode(context, null)).toBe(false); + expect(app.canUpdateSelectedNode(context)).toBe(false); }); it('should evaluate allowable operation for the file', () => { @@ -237,7 +237,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUpdateSelectedNode(context, null)).toBe(true); + expect(app.canUpdateSelectedNode(context)).toBe(true); }); }); @@ -264,7 +264,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUploadVersion(context, null)).toBe(true); + expect(app.canUploadVersion(context)).toBe(true); }); it('should return [false] if other user has locked it previously', () => { @@ -289,7 +289,7 @@ describe('app.evaluators', () => { } }; - expect(app.canUploadVersion(context, null)).toBe(false); + expect(app.canUploadVersion(context)).toBe(false); }); it('should check the [update] operation when no write lock present', () => { @@ -302,6 +302,7 @@ describe('app.evaluators', () => { check: () => (checked = true) }, selection: { + file: {}, isEmpty: false, nodes: [ { @@ -318,38 +319,124 @@ describe('app.evaluators', () => { } }; - expect(app.canUploadVersion(context, null)).toBe(true); + expect(app.canUploadVersion(context)).toBe(true); expect(checked).toBe(true); }); it('should return [true] if route is `/favorites`', () => { const context: any = { + selection: { + file: {} + }, navigation: { url: '/favorites' } }; - expect(app.canUploadVersion(context, null)).toBe(true); + expect(app.canUploadVersion(context)).toBe(true); }); it('should return [true] if route is `/favorites`', () => { const context: any = { + selection: { + file: {} + }, navigation: { url: '/favorites' } }; - expect(app.canUploadVersion(context, null)).toBe(true); + expect(app.canUploadVersion(context)).toBe(true); }); it('should return [true] if route is `/shared`', () => { const context: any = { + selection: { + file: {} + }, + navigation: { + url: '/shared' + } + }; + + expect(app.canUploadVersion(context)).toBe(true); + }); + }); + + describe('isShared', () => { + it('should return true if route is shared files and single selection', () => { + const context: any = { + selection: { + file: {} + }, navigation: { url: '/shared' } }; - expect(app.canUploadVersion(context, null)).toBe(true); + expect(app.isShared(context)).toBe(true); + }); + + it('should return false if route is shared files and multiple selection', () => { + const context: any = { + selection: { + file: null + }, + navigation: { + url: '/shared' + } + }; + + expect(app.isShared(context)).toBe(false); + }); + + it('should return false if route is trashcan route', () => { + const context: any = { + selection: { + file: {} + }, + navigation: { + url: '/trashcan' + } + }; + + expect(app.isShared(context)).toBe(false); + }); + + it('should return false if selection is not shared', () => { + const context: any = { + selection: { + file: { + entry: { + properties: {} + } + } + }, + navigation: { + url: '/other' + } + }; + + expect(app.isShared(context)).toBe(false); + }); + + it('should return true if selection is shared', () => { + const context: any = { + selection: { + file: { + entry: { + properties: { + 'qshare:sharedId': 'some-id' + } + } + } + }, + navigation: { + url: '/other' + } + }; + + expect(app.isShared(context)).toBe(true); }); }); }); diff --git a/src/app/extensions/evaluators/app.evaluators.ts b/projects/aca-shared/rules/src/app.rules.ts similarity index 50% rename from src/app/extensions/evaluators/app.evaluators.ts rename to projects/aca-shared/rules/src/app.rules.ts index 476594e7b9..426d49eabd 100644 --- a/src/app/extensions/evaluators/app.evaluators.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -23,32 +23,33 @@ * along with Alfresco. If not, see . */ -import { RuleContext, RuleParameter } from '@alfresco/adf-extensions'; -import { AppRuleContext } from '../app.interface'; -import { - isNotTrashcan, - isNotLibraries, - isFavorites, - isLibraries, - isTrashcan, - isSharedFiles, - isNotSearchResults, - isPreview -} from './navigation.evaluators'; +import { RuleContext } from '@alfresco/adf-extensions'; +import * as navigation from './navigation.rules'; +import * as repository from './repository.rules'; + +/** + * Checks if user can copy selected node. + * JSON ref: `app.canCopyNode` + * @param context Rule execution context + */ +export function canCopyNode(context: RuleContext): boolean { + return [ + hasSelection(context), + navigation.isNotTrashcan(context), + navigation.isNotLibraries(context) + ].every(Boolean); +} /** * Checks if user can mark selected nodes as **Favorite**. * JSON ref: `app.selection.canAddFavorite` */ -export function canAddFavorite( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canAddFavorite(context: RuleContext): boolean { if (!context.selection.isEmpty) { if ( - isFavorites(context, ...args) || - isLibraries(context, ...args) || - isTrashcan(context, ...args) + navigation.isFavorites(context) || + navigation.isLibraries(context) || + navigation.isTrashcan(context) ) { return false; } @@ -61,12 +62,9 @@ export function canAddFavorite( * Checks if user can un-mark selected nodes as **Favorite**. * JSON ref: `app.selection.canRemoveFavorite` */ -export function canRemoveFavorite( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - if (!context.selection.isEmpty && !isTrashcan(context, ...args)) { - if (isFavorites(context, ...args)) { +export function canRemoveFavorite(context: RuleContext): boolean { + if (!context.selection.isEmpty && !navigation.isTrashcan(context)) { + if (navigation.isFavorites(context)) { return true; } return context.selection.nodes.every(node => node.entry.isFavorite); @@ -78,30 +76,50 @@ export function canRemoveFavorite( * Checks if user can share selected file. * JSON ref: `app.selection.file.canShare` */ -export function canShareFile( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - if (isNotTrashcan(context, ...args) && context.selection.file) { - return true; - } - return false; +export function canShareFile(context: RuleContext): boolean { + return [ + context.selection.file, + navigation.isNotTrashcan(context), + repository.hasQuickShareEnabled(context), + !isShared(context) + ].every(Boolean); +} + +/** + * Checks if user can perform "Join" or "Cancel Join Request" on a library. + * JSON ref: `canToggleJoinLibrary` + */ +export function canToggleJoinLibrary(context: RuleContext): boolean { + return [ + hasLibrarySelected(context), + !isPrivateLibrary(context), + hasNoLibraryRole(context) + ].every(Boolean); +} + +/** + * Checks if user can edit the selected folder. + * JSON ref: `canEditFolder` + * @param context Rule execution context + */ +export function canEditFolder(context: RuleContext): boolean { + return [ + canUpdateSelectedFolder(context), + navigation.isNotTrashcan(context) + ].every(Boolean); } /** * Checks if the selected file is already shared. * JSON ref: `app.selection.file.isShared` */ -export function isShared( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - if (isSharedFiles(context, ...args) && !context.selection.isEmpty) { +export function isShared(context: RuleContext): boolean { + if (navigation.isSharedFiles(context) && context.selection.file) { return true; } if ( - (isNotTrashcan(context, ...args), + (navigation.isNotTrashcan(context), !context.selection.isEmpty && context.selection.file) ) { return !!( @@ -118,31 +136,28 @@ export function isShared( * Checks if user can delete selected nodes. * JSON ref: `app.selection.canDelete` */ -export function canDeleteSelection( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canDeleteSelection(context: RuleContext): boolean { if ( - isNotTrashcan(context, ...args) && - isNotLibraries(context, ...args) && - isNotSearchResults(context, ...args) && + navigation.isNotTrashcan(context) && + navigation.isNotLibraries(context) && + navigation.isNotSearchResults(context) && !context.selection.isEmpty ) { - if (hasLockedFiles(context, ...args)) { + if (hasLockedFiles(context)) { return false; } // temp workaround for Search api - if (isFavorites(context, ...args)) { + if (navigation.isFavorites(context)) { return true; } - if (isPreview(context, ...args)) { + if (navigation.isPreview(context)) { return context.permissions.check(context.selection.nodes, ['delete']); } // workaround for Shared Files - if (isSharedFiles(context, ...args)) { + if (navigation.isSharedFiles(context)) { return context.permissions.check(context.selection.nodes, ['delete'], { target: 'allowableOperationsOnTarget' }); @@ -157,10 +172,7 @@ export function canDeleteSelection( * Checks if user can un-share selected nodes. * JSON ref: `app.selection.canUnshare` */ -export function canUnshareNodes( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canUnshareNodes(context: RuleContext): boolean { if (!context.selection.isEmpty) { return context.permissions.check(context.selection.nodes, ['delete'], { target: 'allowableOperationsOnTarget' @@ -173,10 +185,7 @@ export function canUnshareNodes( * Checks if user selected anything. * JSON ref: `app.selection.notEmpty` */ -export function hasSelection( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function hasSelection(context: RuleContext): boolean { return !context.selection.isEmpty; } @@ -184,10 +193,7 @@ export function hasSelection( * Checks if user can create a new folder with current path. * JSON ref: `app.navigation.folder.canCreate` */ -export function canCreateFolder( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canCreateFolder(context: RuleContext): boolean { const { currentFolder } = context.navigation; if (currentFolder) { return context.permissions.check(currentFolder, ['create']); @@ -199,10 +205,7 @@ export function canCreateFolder( * Checks if user can upload content to current folder. * JSON ref: `app.navigation.folder.canUpload` */ -export function canUpload( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canUpload(context: RuleContext): boolean { const { currentFolder } = context.navigation; if (currentFolder) { return context.permissions.check(currentFolder, ['create']); @@ -214,11 +217,8 @@ export function canUpload( * Checks if user can download selected nodes (either files or folders). * JSON ref: `app.selection.canDownload` */ -export function canDownloadSelection( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - if (!context.selection.isEmpty) { +export function canDownloadSelection(context: RuleContext): boolean { + if (!context.selection.isEmpty && navigation.isNotTrashcan(context)) { return context.selection.nodes.every((node: any) => { return ( node.entry && @@ -233,10 +233,7 @@ export function canDownloadSelection( * Checks if user has selected a folder. * JSON ref: `app.selection.folder` */ -export function hasFolderSelected( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function hasFolderSelected(context: RuleContext): boolean { const folder = context.selection.folder; return folder ? true : false; } @@ -245,10 +242,7 @@ export function hasFolderSelected( * Checks if user has selected a library (site). * JSON ref: `app.selection.library` */ -export function hasLibrarySelected( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function hasLibrarySelected(context: RuleContext): boolean { const library = context.selection.library; return library ? true : false; } @@ -257,10 +251,7 @@ export function hasLibrarySelected( * Checks if user has selected a **private** library (site) * JSON ref: `app.selection.isPrivateLibrary` */ -export function isPrivateLibrary( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isPrivateLibrary(context: RuleContext): boolean { const library = context.selection.library; return library ? !!( @@ -275,10 +266,7 @@ export function isPrivateLibrary( * Checks if the selected library has a **role** property defined. * JSON ref: `app.selection.hasLibraryRole` */ -export function hasLibraryRole( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function hasLibraryRole(context: RuleContext): boolean { const library = context.selection.library; return library ? !!(library.entry && library.entry.role) : false; } @@ -287,37 +275,30 @@ export function hasLibraryRole( * Checks if the selected library has no **role** property defined. * JSON ref: `app.selection.hasNoLibraryRole` */ -export function hasNoLibraryRole( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !hasLibraryRole(context, ...args); +export function hasNoLibraryRole(context: RuleContext): boolean { + return !hasLibraryRole(context); } /** * Checks if user has selected a file. * JSON ref: `app.selection.file` */ -export function hasFileSelected( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - const file = context.selection.file; - return file ? true : false; +export function hasFileSelected(context: RuleContext): boolean { + if (context && context.selection && context.selection.file) { + return true; + } + return false; } /** * Checks if user can update the first selected node. * JSON ref: `app.selection.first.canUpdate` */ -export function canUpdateSelectedNode( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canUpdateSelectedNode(context: RuleContext): boolean { if (context.selection && !context.selection.isEmpty) { const node = context.selection.first; - if (node.entry.isFile && hasLockedFiles(context, ...args)) { + if (node.entry.isFile && hasLockedFiles(context)) { return false; } @@ -330,15 +311,12 @@ export function canUpdateSelectedNode( * Checks if user can update the first selected folder. * JSON ref: `app.selection.folder.canUpdate` */ -export function canUpdateSelectedFolder( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function canUpdateSelectedFolder(context: RuleContext): boolean { const { folder } = context.selection; if (folder) { return ( // workaround for Favorites Api - isFavorites(context, ...args) || + navigation.isFavorites(context) || context.permissions.check(folder.entry, ['update']) ); } @@ -349,10 +327,7 @@ export function canUpdateSelectedFolder( * Checks if user has selected a **locked** file node. * JSON ref: `app.selection.file.isLocked` */ -export function hasLockedFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function hasLockedFiles(context: RuleContext): boolean { if (context && context.selection && context.selection.nodes) { return context.selection.nodes.some(node => { if (!node.entry.isFile) { @@ -374,10 +349,7 @@ export function hasLockedFiles( * Checks if the selected file has **write** or **read-only** locks specified. * JSON ref: `app.selection.file.isLocked` */ -export function isWriteLocked( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { +export function isWriteLocked(context: RuleContext): boolean { return !!( context && context.selection && @@ -395,12 +367,9 @@ export function isWriteLocked( * and that current user is the owner of the lock. * JSON ref: `app.selection.file.isLockOwner` */ -export function isUserWriteLockOwner( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { +export function isUserWriteLockOwner(context: RuleContext): boolean { return ( - isWriteLocked(context, ...args) && + isWriteLocked(context) && (context.selection.file.entry.properties['cm:lockOwner'] && context.selection.file.entry.properties['cm:lockOwner'].id === context.profile.id) @@ -411,28 +380,20 @@ export function isUserWriteLockOwner( * Checks if user can lock selected file. * JSON ref: `app.selection.file.canLock` */ -export function canLockFile( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { - return ( - !isWriteLocked(context, ...args) && canUpdateSelectedNode(context, ...args) - ); +export function canLockFile(context: RuleContext): boolean { + return !isWriteLocked(context) && canUpdateSelectedNode(context); } /** * Checks if user can unlock selected file. * JSON ref: `app.selection.file.canLock` */ -export function canUnlockFile( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { +export function canUnlockFile(context: RuleContext): boolean { const { file } = context.selection; return ( - isWriteLocked(context, ...args) && + isWriteLocked(context) && (context.permissions.check(file.entry, ['delete']) || - isUserWriteLockOwner(context, ...args)) + isUserWriteLockOwner(context)) ); } @@ -440,15 +401,128 @@ export function canUnlockFile( * Checks if user can upload a new version of the file. * JSON ref: `app.selection.file.canUploadVersion` */ -export function canUploadVersion( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { - if (isFavorites(context, ...args) || isSharedFiles(context, ...args)) { - return true; +export function canUploadVersion(context: RuleContext): boolean { + if (navigation.isFavorites(context) || navigation.isSharedFiles(context)) { + return hasFileSelected(context); } - return isWriteLocked(context, ...args) - ? isUserWriteLockOwner(context, ...args) - : canUpdateSelectedNode(context, ...args); + return [ + hasFileSelected(context), + navigation.isNotTrashcan(context), + isWriteLocked(context) + ? isUserWriteLockOwner(context) + : canUpdateSelectedNode(context) + ].every(Boolean); +} + +/** + * Checks if user has trashcan item selected. + * JSON ref: `isTrashcanItemSelected` + * @param context Rule execution context + */ +export function isTrashcanItemSelected(context: RuleContext): boolean { + return [navigation.isTrashcan(context), hasSelection(context)].every(Boolean); +} + +/** + * Checks if user can view the file. + * JSON ref: `canViewFile` + * @param context Rule execution context + */ +export function canViewFile(context: RuleContext): boolean { + return [hasFileSelected(context), navigation.isNotTrashcan(context)].every( + Boolean + ); +} + +/** + * Checks if user can **Leave** selected library. + * JSON ref: `canLeaveLibrary` + * @param context Rule execution context + */ +export function canLeaveLibrary(context: RuleContext): boolean { + return [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean); +} + +/** + * Checks if user can toggle shared link mode. + * JSON ref: `canToggleSharedLink` + * @param context Rule execution context + */ +export function canToggleSharedLink(context: RuleContext): boolean { + return [ + hasFileSelected(context), + [canShareFile(context), isShared(context)].some(Boolean) + ].every(Boolean); +} + +/** + * Checks if user can show **Info Drawer** for the selected node. + * JSON ref: `canShowInfoDrawer` + * @param context Rule execution context + */ +export function canShowInfoDrawer(context: RuleContext): boolean { + return [ + hasSelection(context), + navigation.isNotLibraries(context), + navigation.isNotTrashcan(context) + ].every(Boolean); +} + +/** + * Checks if user can manage file versions for the selected node. + * JSON ref: `canManageFileVersions` + * @param context Rule execution context + */ +export function canManageFileVersions(context: RuleContext): boolean { + return [ + hasFileSelected(context), + navigation.isNotTrashcan(context), + !hasLockedFiles(context) + ].every(Boolean); +} + +/** + * Checks if user can manage permissions for the selected node. + * JSON ref: `canManagePermissions` + * @param context Rule execution context + */ +export function canManagePermissions(context: RuleContext): boolean { + return [ + canUpdateSelectedNode(context), + navigation.isNotTrashcan(context) + ].every(Boolean); +} + +/** + * Checks if user can toggle **Edit Offline** mode for selected node. + * JSON ref: `canToggleEditOffline` + * @param context Rule execution context + */ +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); +} + +/** + * @deprecated Uses workarounds for for recent files and search api issues. + * Checks if user can toggle **Favorite** state for a node. + * @param context Rule execution context + */ +export function canToggleFavorite(context: RuleContext): boolean { + return [ + [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean), + [ + navigation.isRecentFiles(context), + navigation.isSharedFiles(context), + navigation.isSearchResults(context), + navigation.isFavorites(context) + ].some(Boolean) + ].every(Boolean); } diff --git a/src/app/extensions/evaluators/navigation.evaluators.spec.ts b/projects/aca-shared/rules/src/navigation.rules.spec.ts similarity index 80% rename from src/app/extensions/evaluators/navigation.evaluators.spec.ts rename to projects/aca-shared/rules/src/navigation.rules.spec.ts index 9a53a5ae9f..c89e6026e1 100644 --- a/src/app/extensions/evaluators/navigation.evaluators.spec.ts +++ b/projects/aca-shared/rules/src/navigation.rules.spec.ts @@ -23,7 +23,7 @@ * along with Alfresco. If not, see . */ -import * as app from './navigation.evaluators'; +import * as app from './navigation.rules'; describe('navigation.evaluators', () => { describe('isPreview', () => { @@ -34,7 +34,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isPreview(context, null)).toBe(true); + expect(app.isPreview(context)).toBe(true); }); }); @@ -46,7 +46,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isFavorites(context, null)).toBe(true); + expect(app.isFavorites(context)).toBe(true); }); it('should return [false] if `/favorites` url contains `/preview/`', () => { @@ -56,7 +56,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isFavorites(context, null)).toBe(false); + expect(app.isFavorites(context)).toBe(false); }); }); @@ -68,7 +68,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotFavorites(context, null)).toBe(true); + expect(app.isNotFavorites(context)).toBe(true); }); it('should return [false] if url starts with `/favorites`', () => { @@ -78,7 +78,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotFavorites(context, null)).toBe(false); + expect(app.isNotFavorites(context)).toBe(false); }); }); @@ -90,7 +90,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedFiles(context, null)).toBe(true); + expect(app.isSharedFiles(context)).toBe(true); }); it('should return [false] if `/shared` url contains `/preview/`', () => { @@ -100,7 +100,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedFiles(context, null)).toBe(false); + expect(app.isSharedFiles(context)).toBe(false); }); }); @@ -112,7 +112,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotSharedFiles(context, null)).toBe(true); + expect(app.isNotSharedFiles(context)).toBe(true); }); it('should return [false] if path contains `/shared`', () => { @@ -122,7 +122,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotSharedFiles(context, null)).toBe(false); + expect(app.isNotSharedFiles(context)).toBe(false); }); }); @@ -134,7 +134,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isTrashcan(context, null)).toBe(true); + expect(app.isTrashcan(context)).toBe(true); }); it('should return [false] if url does not start with `/trashcan`', () => { @@ -144,7 +144,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isTrashcan(context, null)).toBe(false); + expect(app.isTrashcan(context)).toBe(false); }); }); @@ -156,7 +156,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotTrashcan(context, null)).toBe(true); + expect(app.isNotTrashcan(context)).toBe(true); }); it('should return [false] if url does start with `/trashcan`', () => { @@ -166,7 +166,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotTrashcan(context, null)).toBe(false); + expect(app.isNotTrashcan(context)).toBe(false); }); }); @@ -178,7 +178,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isPersonalFiles(context, null)).toBe(true); + expect(app.isPersonalFiles(context)).toBe(true); }); it('should return [false] if url does not start with `/personal-files`', () => { @@ -188,7 +188,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isPersonalFiles(context, null)).toBe(false); + expect(app.isPersonalFiles(context)).toBe(false); }); }); @@ -200,7 +200,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isLibraries(context, null)).toBe(true); + expect(app.isLibraries(context)).toBe(true); }); it('should return [true] if url starts with `/search-libraries`', () => { @@ -210,7 +210,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isLibraries(context, null)).toBe(true); + expect(app.isLibraries(context)).toBe(true); }); }); @@ -222,7 +222,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isNotLibraries(context, null)).toBe(true); + expect(app.isNotLibraries(context)).toBe(true); }); }); @@ -234,7 +234,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isRecentFiles(context, null)).toBe(true); + expect(app.isRecentFiles(context)).toBe(true); }); it('should return [false] if url does not start with `/recent-files`', () => { @@ -244,7 +244,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isRecentFiles(context, null)).toBe(false); + expect(app.isRecentFiles(context)).toBe(false); }); }); @@ -256,7 +256,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSearchResults(context, null)).toBe(true); + expect(app.isSearchResults(context)).toBe(true); }); it('should return [false] if url does not start with `/search`', () => { @@ -266,7 +266,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSearchResults(context, null)).toBe(false); + expect(app.isSearchResults(context)).toBe(false); }); }); @@ -278,7 +278,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedPreview(context, null)).toBe(true); + expect(app.isSharedPreview(context)).toBe(true); }); it('should return [false] if url does not start with `/shared/preview/`', () => { @@ -288,7 +288,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedPreview(context, null)).toBe(false); + expect(app.isSharedPreview(context)).toBe(false); }); }); @@ -300,7 +300,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isFavoritesPreview(context, null)).toBe(true); + expect(app.isFavoritesPreview(context)).toBe(true); }); it('should return [false] if url does not start with `/favorites/preview/`', () => { @@ -310,7 +310,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isFavoritesPreview(context, null)).toBe(false); + expect(app.isFavoritesPreview(context)).toBe(false); }); }); @@ -322,7 +322,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedFileViewer(context, null)).toBe(true); + expect(app.isSharedFileViewer(context)).toBe(true); }); it('should return [false] if url does not start with `/preview/s/`', () => { @@ -332,7 +332,7 @@ describe('navigation.evaluators', () => { } }; - expect(app.isSharedFileViewer(context, null)).toBe(false); + expect(app.isSharedFileViewer(context)).toBe(false); }); }); }); diff --git a/src/app/extensions/evaluators/navigation.evaluators.ts b/projects/aca-shared/rules/src/navigation.rules.ts similarity index 66% rename from src/app/extensions/evaluators/navigation.evaluators.ts rename to projects/aca-shared/rules/src/navigation.rules.ts index adf339dc2b..e08db1cd0d 100644 --- a/src/app/extensions/evaluators/navigation.evaluators.ts +++ b/projects/aca-shared/rules/src/navigation.rules.ts @@ -23,74 +23,56 @@ * along with Alfresco. If not, see . */ -import { RuleContext, RuleParameter } from '@alfresco/adf-extensions'; +import { RuleContext } from '@alfresco/adf-extensions'; /** * Checks if a Preview route is activated. * JSON ref: `app.navigation.isPreview` */ -export function isPreview( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isPreview(context: RuleContext): boolean { const { url } = context.navigation; - return url && url.includes('/preview/'); + return url && (url.includes('/preview/') || url.includes('/view/')); } /** * Checks if a **Favorites** route is activated. * JSON ref: `app.navigation.isFavorites` */ -export function isFavorites( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isFavorites(context: RuleContext): boolean { const { url } = context.navigation; - return url && url.startsWith('/favorites') && !isPreview(context, ...args); + return url && url.startsWith('/favorites') && !isPreview(context); } /** * Checks if the activated route is not **Favorites**. * JSON ref: `app.navigation.isNotFavorites` */ -export function isNotFavorites( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isFavorites(context, ...args); +export function isNotFavorites(context: RuleContext): boolean { + return !isFavorites(context); } /** * Checks if a **Shared Files** route is activated. * JSON ref: `app.navigation.isSharedFiles` */ -export function isSharedFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isSharedFiles(context: RuleContext): boolean { const { url } = context.navigation; - return url && url.startsWith('/shared') && !isPreview(context, ...args); + return url && url.startsWith('/shared') && !isPreview(context); } /** * Checks if the activated route is not **Shared Files**. * JSON ref: `app.navigation.isNotSharedFiles` */ -export function isNotSharedFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isSharedFiles(context, ...args); +export function isNotSharedFiles(context: RuleContext): boolean { + return !isSharedFiles(context); } /** * Checks if a **Trashcan** route is activated. * JSON ref: `app.navigation.isTrashcan` */ -export function isTrashcan( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isTrashcan(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/trashcan'); } @@ -99,21 +81,15 @@ export function isTrashcan( * Checks if the activated route is not **Trashcan**. * JSON ref: `app.navigation.isNotTrashcan` */ -export function isNotTrashcan( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isTrashcan(context, ...args); +export function isNotTrashcan(context: RuleContext): boolean { + return !isTrashcan(context); } /** * Checks if a **Personal Files** route is activated. * JSON ref: `app.navigation.isPersonalFiles` */ -export function isPersonalFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isPersonalFiles(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/personal-files'); } @@ -122,10 +98,7 @@ export function isPersonalFiles( * Checks if a **Library Files** route is activated. * JSON ref: `app.navigation.isLibraryFiles` */ -export function isLibraryFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isLibraryFiles(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/libraries'); } @@ -134,10 +107,7 @@ export function isLibraryFiles( * Checks if a **Library Files** or **Library Search Result** route is activated. * JSON ref: `app.navigation.isLibraryFiles` */ -export function isLibraries( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isLibraries(context: RuleContext): boolean { const { url } = context.navigation; return ( url && (url.endsWith('/libraries') || url.startsWith('/search-libraries')) @@ -148,21 +118,15 @@ export function isLibraries( * Checks if the activated route is neither **Libraries** nor **Library Search Results**. * JSON ref: `app.navigation.isNotLibraries` */ -export function isNotLibraries( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isLibraries(context, ...args); +export function isNotLibraries(context: RuleContext): boolean { + return !isLibraries(context); } /** * Checks if a **Recent Files** route is activated. * JSON ref: `app.navigation.isRecentFiles` */ -export function isRecentFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isRecentFiles(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/recent-files'); } @@ -171,11 +135,8 @@ export function isRecentFiles( * Checks if the activated route is not **Recent Files**. * JSON ref: `app.navigation.isNotRecentFiles` */ -export function isNotRecentFiles( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isRecentFiles(context, ...args); +export function isNotRecentFiles(context: RuleContext): boolean { + return !isRecentFiles(context); } /** @@ -183,8 +144,8 @@ export function isNotRecentFiles( * JSON ref: `app.navigation.isSearchResults` */ export function isSearchResults( - context: RuleContext, - ...args: RuleParameter[] + context: RuleContext /*, + ...args: RuleParameter[]*/ ): boolean { const { url } = context.navigation; return url && url.startsWith('/search'); @@ -194,21 +155,15 @@ export function isSearchResults( * Checks if the activated route is not **Search Results**. * JSON ref: `app.navigation.isNotSearchResults` */ -export function isNotSearchResults( - context: RuleContext, - ...args: RuleParameter[] -): boolean { - return !isSearchResults(context, ...args); +export function isNotSearchResults(context: RuleContext): boolean { + return !isSearchResults(context); } /** * Checks if a **Shared Preview** route is activated. * JSON ref: `app.navigation.isSharedPreview` */ -export function isSharedPreview( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isSharedPreview(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/shared/preview/'); } @@ -217,10 +172,7 @@ export function isSharedPreview( * Checks if a **Favorites Preview** route is activated. * JSON ref: `app.navigation.isFavoritesPreview` */ -export function isFavoritesPreview( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isFavoritesPreview(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/favorites/preview/'); } @@ -229,10 +181,7 @@ export function isFavoritesPreview( * Checks if a **Shared File Preview** route is activated. * JSON ref: `app.navigation.isFavoritesPreview` */ -export function isSharedFileViewer( - context: RuleContext, - ...args: RuleParameter[] -): boolean { +export function isSharedFileViewer(context: RuleContext): boolean { const { url } = context.navigation; return url && url.startsWith('/preview/s/'); } diff --git a/src/app/extensions/icon.extensions.ts b/projects/aca-shared/rules/src/public_api.ts similarity index 89% rename from src/app/extensions/icon.extensions.ts rename to projects/aca-shared/rules/src/public_api.ts index 65323aa482..b83e404759 100644 --- a/src/app/extensions/icon.extensions.ts +++ b/projects/aca-shared/rules/src/public_api.ts @@ -23,8 +23,7 @@ * along with Alfresco. If not, see . */ -import { ExtensionElement } from '@alfresco/adf-extensions'; - -export interface IconRef extends ExtensionElement { - value: string; -} +export * from './app.rules'; +export * from './navigation.rules'; +export * from './repository.rules'; +export * from './user.rules'; diff --git a/src/app/extensions/evaluators/repository.evaluators.ts b/projects/aca-shared/rules/src/repository.rules.ts similarity index 85% rename from src/app/extensions/evaluators/repository.evaluators.ts rename to projects/aca-shared/rules/src/repository.rules.ts index 0e1fde33d6..b7ad66a408 100644 --- a/src/app/extensions/evaluators/repository.evaluators.ts +++ b/projects/aca-shared/rules/src/repository.rules.ts @@ -23,16 +23,12 @@ * along with Alfresco. If not, see . */ -import { RuleParameter } from '@alfresco/adf-extensions'; -import { AppRuleContext } from '../app.interface'; +import { RuleContext } from '@alfresco/adf-extensions'; /** * Checks if the quick share repository option is enabled or not. * JSON ref: `repository.isQuickShareEnabled` */ -export function hasQuickShareEnabled( - context: AppRuleContext, - ...args: RuleParameter[] -): boolean { +export function hasQuickShareEnabled(context: RuleContext): boolean { return context.repository.status.isQuickShareEnabled; } diff --git a/projects/aca-shared/rules/src/user.rules.spec.ts b/projects/aca-shared/rules/src/user.rules.spec.ts new file mode 100644 index 0000000000..47c91d2f29 --- /dev/null +++ b/projects/aca-shared/rules/src/user.rules.spec.ts @@ -0,0 +1,50 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import * as user from './user.rules'; + +describe('evaluators', () => { + describe('isAdmin', () => { + it('should return [true] if user is admin', () => { + const context: any = { + profile: { + isAdmin: true + } + }; + + expect(user.isAdmin(context)).toBe(true); + }); + + it('should return [false] if user is not an admin', () => { + const context: any = { + profile: { + isAdmin: false + } + }; + + expect(user.isAdmin(context)).toBe(false); + }); + }); +}); diff --git a/src/app/store/actions/modals.actions.ts b/projects/aca-shared/rules/src/user.rules.ts similarity index 84% rename from src/app/store/actions/modals.actions.ts rename to projects/aca-shared/rules/src/user.rules.ts index b2c9afc253..62cb67c77b 100644 --- a/src/app/store/actions/modals.actions.ts +++ b/projects/aca-shared/rules/src/user.rules.ts @@ -23,11 +23,12 @@ * along with Alfresco. If not, see . */ -import { Action } from '@ngrx/store'; +import { RuleContext } from '@alfresco/adf-extensions'; -export const CLOSE_MODAL_DIALOGS = 'CLOSE_MODAL_DIALOGS'; - -export class CloseModalDialogsAction implements Action { - readonly type = CLOSE_MODAL_DIALOGS; - constructor() {} +/** + * Checks if user is admin. + * JSON ref: `user.isAdmin` + */ +export function isAdmin(context: RuleContext): boolean { + return context.profile.isAdmin; } diff --git a/projects/aca-shared/src/lib/components/generic-error/generic-error.component.html b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.html new file mode 100644 index 0000000000..457f3475a0 --- /dev/null +++ b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.html @@ -0,0 +1,4 @@ +error +

+ {{ text | translate }} +

diff --git a/projects/aca-shared/src/lib/components/generic-error/generic-error.component.scss b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.scss new file mode 100644 index 0000000000..4081d9b737 --- /dev/null +++ b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.scss @@ -0,0 +1,21 @@ +.aca-generic-error { + color: var(--theme-text-color, rgba(0, 0, 0, 0.54)); + + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 100%; + height: 100%; + + &__title { + font-size: 16px; + } + + mat-icon { + color: var(--theme-warn-color, #f44336); + font-size: 52px; + height: 52px; + width: 52px; + } +} diff --git a/src/app/components/common/generic-error/generic-error.component.spec.ts b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.spec.ts similarity index 100% rename from src/app/components/common/generic-error/generic-error.component.spec.ts rename to projects/aca-shared/src/lib/components/generic-error/generic-error.component.spec.ts diff --git a/src/app/components/common/generic-error/generic-error.component.ts b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts similarity index 88% rename from src/app/components/common/generic-error/generic-error.component.ts rename to projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts index 755cc3df96..bdcfdd912f 100644 --- a/src/app/components/common/generic-error/generic-error.component.ts +++ b/projects/aca-shared/src/lib/components/generic-error/generic-error.component.ts @@ -26,14 +26,19 @@ import { Component, ViewEncapsulation, - ChangeDetectionStrategy + ChangeDetectionStrategy, + Input } from '@angular/core'; @Component({ selector: 'aca-generic-error', templateUrl: './generic-error.component.html', + styleUrls: ['./generic-error.component.scss'], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'aca-generic-error' } }) -export class GenericErrorComponent {} +export class GenericErrorComponent { + @Input() + text = 'APP.MESSAGES.ERRORS.MISSING_CONTENT'; +} diff --git a/src/app/extensions/document-list.extensions.ts b/projects/aca-shared/src/lib/components/generic-error/generic-error.module.ts similarity index 70% rename from src/app/extensions/document-list.extensions.ts rename to projects/aca-shared/src/lib/components/generic-error/generic-error.module.ts index df5d737087..819ade5ba5 100644 --- a/src/app/extensions/document-list.extensions.ts +++ b/projects/aca-shared/src/lib/components/generic-error/generic-error.module.ts @@ -23,15 +23,15 @@ * along with Alfresco. If not, see . */ -import { ExtensionElement } from '@alfresco/adf-extensions'; +import { NgModule } from '@angular/core'; +import { GenericErrorComponent } from './generic-error.component'; +import { MatIconModule } from '@angular/material/icon'; +import { CommonModule } from '@angular/common'; +import { TranslateModule } from '@ngx-translate/core'; -export interface DocumentListPresetRef extends ExtensionElement { - key: string; - type: string; // text|image|date - title?: string; - format?: string; - class?: string; - sortable: boolean; - template: string; - desktopOnly: boolean; -} +@NgModule({ + imports: [CommonModule, MatIconModule, TranslateModule.forChild()], + declarations: [GenericErrorComponent], + exports: [GenericErrorComponent] +}) +export class GenericErrorModule {} diff --git a/src/app/components/layout/page-layout/page-layout-content.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts similarity index 94% rename from src/app/components/layout/page-layout/page-layout-content.component.ts rename to projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts index 48015a48c5..375f2c746d 100644 --- a/src/app/components/layout/page-layout/page-layout-content.component.ts +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-content.component.ts @@ -32,13 +32,13 @@ import { } from '@angular/core'; @Component({ - selector: 'app-page-layout-content', + selector: 'aca-page-layout-content', template: ` `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, - host: { class: 'app-page-layout-content' } + host: { class: 'aca-page-layout-content' } }) export class PageLayoutContentComponent { @Input() diff --git a/src/app/components/layout/page-layout/page-layout-error.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts similarity index 94% rename from src/app/components/layout/page-layout/page-layout-error.component.ts rename to projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts index 7c5f1d0085..a171d52190 100644 --- a/src/app/components/layout/page-layout/page-layout-error.component.ts +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-error.component.ts @@ -30,12 +30,12 @@ import { } from '@angular/core'; @Component({ - selector: 'app-page-layout-error', + selector: 'aca-page-layout-error', template: ` `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, - host: { class: 'app-page-layout-error' } + host: { class: 'aca-page-layout-error' } }) export class PageLayoutErrorComponent {} diff --git a/src/app/components/layout/page-layout/page-layout-header.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts similarity index 94% rename from src/app/components/layout/page-layout/page-layout-header.component.ts rename to projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts index 788a094c4d..2890c40480 100644 --- a/src/app/components/layout/page-layout/page-layout-header.component.ts +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout-header.component.ts @@ -30,10 +30,10 @@ import { } from '@angular/core'; @Component({ - selector: 'app-page-layout-header', + selector: 'aca-page-layout-header', template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, - host: { class: 'app-page-layout-header' } + host: { class: 'aca-page-layout-header' } }) export class PageLayoutHeaderComponent {} diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout.component.html b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.html new file mode 100644 index 0000000000..966402c252 --- /dev/null +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.html @@ -0,0 +1,3 @@ + + + diff --git a/projects/aca-shared/src/lib/components/page-layout/page-layout.component.scss b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.scss new file mode 100644 index 0000000000..e48ec8dd0b --- /dev/null +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.scss @@ -0,0 +1,55 @@ +@import '../../styles/mixins.scss'; + +.aca-page-layout { + @include flex-column; + + .aca-page-layout-header { + display: flex; + align-items: center; + flex: 0 0 65px; + flex-basis: 48px; + background: #fafafa; + border-bottom: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07)); + padding: 0 24px; + } + + .aca-page-layout-content { + @include flex-row; + } + + .aca-page-layout-error { + @include flex-row; + } + + .main-content { + @include flex-column; + } + + .scrollable { + overflow: auto !important; + + .main-content { + overflow: auto !important; + } + } + + .sidebar { + display: block; + height: 100%; + overflow-y: scroll; + max-width: 350px; + width: 350px; + } +} + +[dir='rtl'] .aca-page-layout { + .main-content { + border-left: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07)); + } +} + +[dir='ltr'] .aca-page-layout { + .main-content { + border-right: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07)); + } +} diff --git a/src/app/components/layout/page-layout/page-layout.component.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts similarity index 92% rename from src/app/components/layout/page-layout/page-layout.component.ts rename to projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts index 7919848129..cc378408d7 100644 --- a/src/app/components/layout/page-layout/page-layout.component.ts +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.component.ts @@ -31,10 +31,11 @@ import { } from '@angular/core'; @Component({ - selector: 'app-page-layout', + selector: 'aca-page-layout', templateUrl: 'page-layout.component.html', + styleUrls: ['./page-layout.component.scss'], encapsulation: ViewEncapsulation.None, - host: { class: 'app-page-layout' }, + host: { class: 'aca-page-layout' }, changeDetection: ChangeDetectionStrategy.OnPush }) export class PageLayoutComponent { diff --git a/src/app/components/shared/toggle-shared/toggle-shared.module.ts b/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts similarity index 66% rename from src/app/components/shared/toggle-shared/toggle-shared.module.ts rename to projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts index a9a0e7b76f..defead0234 100644 --- a/src/app/components/shared/toggle-shared/toggle-shared.module.ts +++ b/projects/aca-shared/src/lib/components/page-layout/page-layout.module.ts @@ -24,25 +24,25 @@ */ import { NgModule } from '@angular/core'; +import { PageLayoutContentComponent } from './page-layout-content.component'; +import { PageLayoutErrorComponent } from './page-layout-error.component'; +import { PageLayoutHeaderComponent } from './page-layout-header.component'; +import { PageLayoutComponent } from './page-layout.component'; import { CommonModule } from '@angular/common'; -import { CoreModule } from '@alfresco/adf-core'; -import { ContentNodeShareModule } from '@alfresco/adf-content-services'; -import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { ToggleSharedComponent } from './toggle-shared.component'; - -export function components() { - return [ToggleSharedComponent]; -} @NgModule({ - imports: [ - CommonModule, - CoreModule.forChild(), - ExtensionsModule, - ContentNodeShareModule + imports: [CommonModule], + declarations: [ + PageLayoutContentComponent, + PageLayoutErrorComponent, + PageLayoutHeaderComponent, + PageLayoutComponent ], - declarations: components(), - exports: components(), - entryComponents: components() + exports: [ + PageLayoutContentComponent, + PageLayoutErrorComponent, + PageLayoutHeaderComponent, + PageLayoutComponent + ] }) -export class ToggleSharedModule {} +export class PageLayoutModule {} diff --git a/src/app/app.routes.strategy.spec.ts b/projects/aca-shared/src/lib/routing/app.routes.strategy.spec.ts similarity index 96% rename from src/app/app.routes.strategy.spec.ts rename to projects/aca-shared/src/lib/routing/app.routes.strategy.spec.ts index 674e430a50..cd6fd61efd 100644 --- a/src/app/app.routes.strategy.spec.ts +++ b/projects/aca-shared/src/lib/routing/app.routes.strategy.spec.ts @@ -25,14 +25,12 @@ import { AppRouteReuseStrategy } from './app.routes.strategy'; import { TestBed } from '@angular/core/testing'; -import { AppTestingModule } from './testing/app-testing.module'; describe('AppRouteReuseStrategy', () => { let appRouteReuse: AppRouteReuseStrategy; beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], providers: [AppRouteReuseStrategy] }); diff --git a/src/app/app.routes.strategy.ts b/projects/aca-shared/src/lib/routing/app.routes.strategy.ts similarity index 100% rename from src/app/app.routes.strategy.ts rename to projects/aca-shared/src/lib/routing/app.routes.strategy.ts diff --git a/src/app/guards/shared.guard.ts b/projects/aca-shared/src/lib/routing/shared.guard.ts similarity index 92% rename from src/app/guards/shared.guard.ts rename to projects/aca-shared/src/lib/routing/shared.guard.ts index f035faee54..bb491f7c4a 100644 --- a/src/app/guards/shared.guard.ts +++ b/projects/aca-shared/src/lib/routing/shared.guard.ts @@ -28,8 +28,7 @@ import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { ActivatedRouteSnapshot } from '@angular/router'; import { Store } from '@ngrx/store'; -import { AppStore } from '../store/states/app.state'; -import { isQuickShareEnabled } from '../store/selectors/app.selectors'; +import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store'; @Injectable({ providedIn: 'root' @@ -42,7 +41,7 @@ export class AppSharedRuleGuard implements CanActivate { } canActivate( - route: ActivatedRouteSnapshot + _: ActivatedRouteSnapshot ): Observable | Promise | boolean { return this.isQuickShareEnabled$; } diff --git a/src/app/services/app.service.spec.ts b/projects/aca-shared/src/lib/services/app.service.spec.ts similarity index 94% rename from src/app/services/app.service.spec.ts rename to projects/aca-shared/src/lib/services/app.service.spec.ts index a41aa215d0..440289ee46 100644 --- a/src/app/services/app.service.spec.ts +++ b/projects/aca-shared/src/lib/services/app.service.spec.ts @@ -25,10 +25,10 @@ import { AppService } from './app.service'; import { TestBed } from '@angular/core/testing'; -import { AppTestingModule } from '../testing/app-testing.module'; import { AuthenticationService, AppConfigService } from '@alfresco/adf-core'; -import { AppRouteReuseStrategy } from '../app.routes.strategy'; import { Subject } from 'rxjs'; +import { HttpClientModule } from '@angular/common/http'; +import { AppRouteReuseStrategy } from '../routing/app.routes.strategy'; describe('AppService', () => { let service: AppService; @@ -38,7 +38,7 @@ describe('AppService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule], + imports: [HttpClientModule], providers: [ AppRouteReuseStrategy, { diff --git a/src/app/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts similarity index 96% rename from src/app/services/app.service.ts rename to projects/aca-shared/src/lib/services/app.service.ts index 0b02eb10b2..5c097d937f 100644 --- a/src/app/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -26,8 +26,8 @@ import { Injectable, Inject } from '@angular/core'; import { AuthenticationService, AppConfigService } from '@alfresco/adf-core'; import { Observable, BehaviorSubject } from 'rxjs'; -import { AppRouteReuseStrategy } from '../app.routes.strategy'; import { RouteReuseStrategy } from '@angular/router'; +import { AppRouteReuseStrategy } from '../routing/app.routes.strategy'; @Injectable({ providedIn: 'root' diff --git a/src/app/services/content-api.service.spec.ts b/projects/aca-shared/src/lib/services/content-api.service.spec.ts similarity index 100% rename from src/app/services/content-api.service.spec.ts rename to projects/aca-shared/src/lib/services/content-api.service.spec.ts diff --git a/src/app/services/content-api.service.ts b/projects/aca-shared/src/lib/services/content-api.service.ts similarity index 98% rename from src/app/services/content-api.service.ts rename to projects/aca-shared/src/lib/services/content-api.service.ts index d6a19b6fd1..4180837433 100644 --- a/src/app/services/content-api.service.ts +++ b/projects/aca-shared/src/lib/services/content-api.service.ts @@ -40,7 +40,8 @@ import { ResultSetPaging, SiteBody, SiteEntry, - FavoriteBody + FavoriteBody, + FavoriteEntry } from '@alfresco/js-api'; import { map } from 'rxjs/operators'; @@ -256,7 +257,7 @@ export class ContentApiService { return from(this.api.sitesApi.updateSite(siteId, siteBody)); } - addFavorite(nodes: Array): Observable { + addFavorite(nodes: Array): Observable { const payload: FavoriteBody[] = nodes.map(node => { const { isFolder, nodeId, id } = node.entry; const siteId = node.entry['guid']; @@ -286,7 +287,7 @@ export class ContentApiService { ); } - unlockNode(nodeId: string, opts?) { + unlockNode(nodeId: string, opts?: any) { return this.api.nodesApi.unlockNode(nodeId, opts); } } diff --git a/src/app/services/node-permission.service.spec.ts b/projects/aca-shared/src/lib/services/node-permission.service.spec.ts similarity index 100% rename from src/app/services/node-permission.service.spec.ts rename to projects/aca-shared/src/lib/services/node-permission.service.spec.ts diff --git a/src/app/services/node-permission.service.ts b/projects/aca-shared/src/lib/services/node-permission.service.ts similarity index 100% rename from src/app/services/node-permission.service.ts rename to projects/aca-shared/src/lib/services/node-permission.service.ts diff --git a/projects/aca-shared/src/lib/shared.module.ts b/projects/aca-shared/src/lib/shared.module.ts new file mode 100644 index 0000000000..327fe0b8bd --- /dev/null +++ b/projects/aca-shared/src/lib/shared.module.ts @@ -0,0 +1,39 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { ContentApiService } from './services/content-api.service'; +import { NodePermissionService } from './services/node-permission.service'; +import { AppService } from './services/app.service'; + +@NgModule({}) +export class SharedModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: SharedModule, + providers: [ContentApiService, NodePermissionService, AppService] + }; + } +} diff --git a/projects/aca-shared/src/lib/styles/mixins.scss b/projects/aca-shared/src/lib/styles/mixins.scss new file mode 100644 index 0000000000..946c3b5683 --- /dev/null +++ b/projects/aca-shared/src/lib/styles/mixins.scss @@ -0,0 +1,16 @@ +@mixin flex-column { + display: flex; + flex-direction: column; + flex: 1; + height: 100%; + overflow: hidden; + min-height: 0; +} + +@mixin flex-row { + display: flex; + flex-direction: row; + flex: 1; + height: 100%; + overflow: hidden; +} diff --git a/projects/aca-shared/src/public-api.ts b/projects/aca-shared/src/public-api.ts new file mode 100644 index 0000000000..0d87b45024 --- /dev/null +++ b/projects/aca-shared/src/public-api.ts @@ -0,0 +1,42 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +export * from './lib/components/page-layout/page-layout-content.component'; +export * from './lib/components/page-layout/page-layout-error.component'; +export * from './lib/components/page-layout/page-layout-header.component'; +export * from './lib/components/page-layout/page-layout.component'; +export * from './lib/components/page-layout/page-layout.module'; + +export * from './lib/routing/app.routes.strategy'; +export * from './lib/routing/shared.guard'; + +export * from './lib/services/app.service'; +export * from './lib/services/content-api.service'; +export * from './lib/services/node-permission.service'; + +export * from './lib/components/generic-error/generic-error.component'; +export * from './lib/components/generic-error/generic-error.module'; + +export * from './lib/shared.module'; diff --git a/projects/aca-shared/store/package.json b/projects/aca-shared/store/package.json new file mode 100644 index 0000000000..4bbd7d0f7b --- /dev/null +++ b/projects/aca-shared/store/package.json @@ -0,0 +1,3 @@ +{ + "ngPackage": {} +} diff --git a/src/app/store/actions/app.actions.ts b/projects/aca-shared/store/src/actions/app.actions.ts similarity index 52% rename from src/app/store/actions/app.actions.ts rename to projects/aca-shared/store/src/actions/app.actions.ts index a9b573750c..8ccfcc4a1e 100644 --- a/src/app/store/actions/app.actions.ts +++ b/projects/aca-shared/store/src/actions/app.actions.ts @@ -24,60 +24,85 @@ */ import { Action } from '@ngrx/store'; -import { Node, Person } from '@alfresco/js-api'; -import { AppState } from '../states'; - -export const SET_INITIAL_STATE = 'SET_INITIAL_STATE'; -export const SET_LANGUAGE_PICKER = 'SET_LANGUAGE_PICKER'; -export const SET_CURRENT_FOLDER = 'SET_CURRENT_FOLDER'; -export const SET_CURRENT_URL = 'SET_CURRENT_URL'; -export const SET_USER_PROFILE = 'SET_USER_PROFILE'; -export const TOGGLE_INFO_DRAWER = 'TOGGLE_INFO_DRAWER'; -export const TOGGLE_DOCUMENT_DISPLAY_MODE = 'TOGGLE_DOCUMENT_DISPLAY_MODE'; -export const LOGOUT = 'LOGOUT'; -export const RELOAD_DOCUMENT_LIST = 'RELOAD_DOCUMENT_LIST'; +import { Node, Person, Group, RepositoryInfo } from '@alfresco/js-api'; +import { AppState } from '../states/app.state'; + +export enum AppActionTypes { + SetInitialState = 'SET_INITIAL_STATE', + SetLanguagePicker = 'SET_LANGUAGE_PICKER', + SetCurrentFolder = 'SET_CURRENT_FOLDER', + SetCurrentUrl = 'SET_CURRENT_URL', + SetUserProfile = 'SET_USER_PROFILE', + SetRepositoryInfo = 'SET_REPOSITORY_INFO', + ToggleInfoDrawer = 'TOGGLE_INFO_DRAWER', + ToggleDocumentDisplayMode = 'TOGGLE_DOCUMENT_DISPLAY_MODE', + Logout = 'LOGOUT', + ReloadDocumentList = 'RELOAD_DOCUMENT_LIST', + SetInfoDrawerState = 'SET_INFO_DRAWER_STATE', + SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT', + CloseModalDialogs = 'CLOSE_MODAL_DIALOGS' +} export class SetInitialStateAction implements Action { - readonly type = SET_INITIAL_STATE; + readonly type = AppActionTypes.SetInitialState; + constructor(public payload: AppState) {} } export class SetLanguagePickerAction implements Action { - readonly type = SET_LANGUAGE_PICKER; + readonly type = AppActionTypes.SetLanguagePicker; + constructor(public payload: boolean) {} } export class SetCurrentFolderAction implements Action { - readonly type = SET_CURRENT_FOLDER; + readonly type = AppActionTypes.SetCurrentFolder; + constructor(public payload: Node) {} } export class SetCurrentUrlAction implements Action { - readonly type = SET_CURRENT_URL; + readonly type = AppActionTypes.SetCurrentUrl; + constructor(public payload: string) {} } export class SetUserProfileAction implements Action { - readonly type = SET_USER_PROFILE; - constructor(public payload: Person) {} + readonly type = AppActionTypes.SetUserProfile; + + constructor(public payload: { person: Person; groups: Group[] }) {} } export class ToggleInfoDrawerAction implements Action { - readonly type = TOGGLE_INFO_DRAWER; - constructor(public payload?: any) {} + readonly type = AppActionTypes.ToggleInfoDrawer; } export class ToggleDocumentDisplayMode implements Action { - readonly type = TOGGLE_DOCUMENT_DISPLAY_MODE; - constructor(public payload?: any) {} + readonly type = AppActionTypes.ToggleDocumentDisplayMode; } export class LogoutAction implements Action { - readonly type = LOGOUT; - constructor(public payload?: any) {} + readonly type = AppActionTypes.Logout; } export class ReloadDocumentListAction implements Action { - readonly type = RELOAD_DOCUMENT_LIST; + readonly type = AppActionTypes.ReloadDocumentList; + constructor(public payload?: any) {} } + +export class SetInfoDrawerStateAction implements Action { + readonly type = AppActionTypes.SetInfoDrawerState; + + constructor(public payload: boolean) {} +} + +export class CloseModalDialogsAction implements Action { + readonly type = AppActionTypes.CloseModalDialogs; +} + +export class SetRepositoryInfoAction implements Action { + readonly type = AppActionTypes.SetRepositoryInfo; + + constructor(public payload: RepositoryInfo) {} +} diff --git a/src/app/store/actions/library.actions.ts b/projects/aca-shared/store/src/actions/library.actions.ts similarity index 79% rename from src/app/store/actions/library.actions.ts rename to projects/aca-shared/store/src/actions/library.actions.ts index 9801f13a15..fc3e34c9b7 100644 --- a/src/app/store/actions/library.actions.ts +++ b/projects/aca-shared/store/src/actions/library.actions.ts @@ -26,33 +26,38 @@ import { Action } from '@ngrx/store'; import { SiteBody } from '@alfresco/js-api'; -export const DELETE_LIBRARY = 'DELETE_LIBRARY'; -export const CREATE_LIBRARY = 'CREATE_LIBRARY'; -export const NAVIGATE_LIBRARY = 'NAVIGATE_LIBRARY'; -export const UPDATE_LIBRARY = 'UPDATE_LIBRARY'; -export const LEAVE_LIBRARY = 'LEAVE_LIBRARY'; +export enum LibraryActionTypes { + Delete = 'DELETE_LIBRARY', + Create = 'CREATE_LIBRARY', + Navigate = 'NAVIGATE_LIBRARY', + Update = 'UPDATE_LIBRARY', + Leave = 'LEAVE_LIBRARY' +} export class DeleteLibraryAction implements Action { - readonly type = DELETE_LIBRARY; + readonly type = LibraryActionTypes.Delete; + constructor(public payload?: string) {} } export class CreateLibraryAction implements Action { - readonly type = CREATE_LIBRARY; - constructor() {} + readonly type = LibraryActionTypes.Create; } export class NavigateLibraryAction implements Action { - readonly type = NAVIGATE_LIBRARY; + readonly type = LibraryActionTypes.Navigate; + constructor(public payload?: string) {} } export class UpdateLibraryAction implements Action { - readonly type = UPDATE_LIBRARY; + readonly type = LibraryActionTypes.Update; + constructor(public payload?: SiteBody) {} } export class LeaveLibraryAction implements Action { - readonly type = LEAVE_LIBRARY; + readonly type = LibraryActionTypes.Leave; + constructor(public payload?: string) {} } diff --git a/src/app/store/actions/info-drawer.actions.ts b/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts similarity index 82% rename from src/app/store/actions/info-drawer.actions.ts rename to projects/aca-shared/store/src/actions/metadata-aspect.actions.ts index 9db0e7e13f..1668b89c53 100644 --- a/src/app/store/actions/info-drawer.actions.ts +++ b/projects/aca-shared/store/src/actions/metadata-aspect.actions.ts @@ -25,9 +25,10 @@ import { Action } from '@ngrx/store'; -export const SET_INFO_DRAWER_STATE = 'SET_INFO_DRAWER_STATE'; +export const SET_INFO_DRAWER_METADATA_ASPECT = + 'SET_INFO_DRAWER_METADATA_ASPECT'; -export class SetInfoDrawerStateAction implements Action { - readonly type = SET_INFO_DRAWER_STATE; - constructor(public payload: boolean) {} +export class SetInfoDrawerMetadataAspectAction implements Action { + readonly type = SET_INFO_DRAWER_METADATA_ASPECT; + constructor(public payload: string) {} } diff --git a/src/app/store/actions/node.actions.ts b/projects/aca-shared/store/src/actions/node.actions.ts similarity index 63% rename from src/app/store/actions/node.actions.ts rename to projects/aca-shared/store/src/actions/node.actions.ts index bd03557ae4..7fdf132c3f 100644 --- a/src/app/store/actions/node.actions.ts +++ b/projects/aca-shared/store/src/actions/node.actions.ts @@ -26,111 +26,138 @@ import { Action } from '@ngrx/store'; import { MinimalNodeEntity } from '@alfresco/js-api'; -export const SET_SELECTED_NODES = 'SET_SELECTED_NODES'; -export const DELETE_NODES = 'DELETE_NODES'; -export const UNDO_DELETE_NODES = 'UNDO_DELETE_NODES'; -export const RESTORE_DELETED_NODES = 'RESTORE_DELETED_NODES'; -export const PURGE_DELETED_NODES = 'PURGE_DELETED_NODES'; -export const DOWNLOAD_NODES = 'DOWNLOAD_NODES'; -export const CREATE_FOLDER = 'CREATE_FOLDER'; -export const EDIT_FOLDER = 'EDIT_FOLDER'; -export const SHARE_NODE = 'SHARE_NODE'; -export const UNSHARE_NODES = 'UNSHARE_NODES'; -export const COPY_NODES = 'COPY_NODES'; -export const MOVE_NODES = 'MOVE_NODES'; -export const MANAGE_PERMISSIONS = 'MANAGE_PERMISSIONS'; -export const PRINT_FILE = 'PRINT_FILE'; -export const FULLSCREEN_VIEWER = 'FULLSCREEN_VIEWER'; -export const MANAGE_VERSIONS = 'MANAGE_VERSIONS'; -export const EDIT_OFFLINE = 'EDIT_OFFLINE'; -export const UNLOCK_WRITE = 'UNLOCK_WRITE_LOCK'; +export enum NodeActionTypes { + SetSelection = 'SET_SELECTED_NODES', + Delete = 'DELETE_NODES', + UndoDelete = 'UNDO_DELETE_NODES', + RestoreDeleted = 'RESTORE_DELETED_NODES', + PurgeDeleted = 'PURGE_DELETED_NODES', + Download = 'DOWNLOAD_NODES', + CreateFolder = 'CREATE_FOLDER', + EditFolder = 'EDIT_FOLDER', + Share = 'SHARE_NODE', + Unshare = 'UNSHARE_NODES', + Copy = 'COPY_NODES', + Move = 'MOVE_NODES', + ManagePermissions = 'MANAGE_PERMISSIONS', + PrintFile = 'PRINT_FILE', + ManageVersions = 'MANAGE_VERSIONS', + EditOffline = 'EDIT_OFFLINE', + UnlockForWriting = 'UNLOCK_WRITE_LOCK', + AddFavorite = 'ADD_FAVORITE', + RemoveFavorite = 'REMOVE_FAVORITE' +} export class SetSelectedNodesAction implements Action { - readonly type = SET_SELECTED_NODES; + readonly type = NodeActionTypes.SetSelection; + constructor(public payload: MinimalNodeEntity[] = []) {} } export class DeleteNodesAction implements Action { - readonly type = DELETE_NODES; + readonly type = NodeActionTypes.Delete; + constructor(public payload: MinimalNodeEntity[] = []) {} } export class UndoDeleteNodesAction implements Action { - readonly type = UNDO_DELETE_NODES; + readonly type = NodeActionTypes.UndoDelete; + constructor(public payload: any[] = []) {} } export class RestoreDeletedNodesAction implements Action { - readonly type = RESTORE_DELETED_NODES; + readonly type = NodeActionTypes.RestoreDeleted; + constructor(public payload: Array) {} } export class PurgeDeletedNodesAction implements Action { - readonly type = PURGE_DELETED_NODES; + readonly type = NodeActionTypes.PurgeDeleted; + constructor(public payload: Array) {} } export class DownloadNodesAction implements Action { - readonly type = DOWNLOAD_NODES; + readonly type = NodeActionTypes.Download; + constructor(public payload: MinimalNodeEntity[] = []) {} } export class CreateFolderAction implements Action { - readonly type = CREATE_FOLDER; + readonly type = NodeActionTypes.CreateFolder; + constructor(public payload: string) {} } export class EditFolderAction implements Action { - readonly type = EDIT_FOLDER; + readonly type = NodeActionTypes.EditFolder; + constructor(public payload: MinimalNodeEntity) {} } export class ShareNodeAction implements Action { - readonly type = SHARE_NODE; + readonly type = NodeActionTypes.Share; + constructor(public payload: MinimalNodeEntity) {} } export class UnshareNodesAction implements Action { - readonly type = UNSHARE_NODES; + readonly type = NodeActionTypes.Unshare; + constructor(public payload: Array) {} } export class CopyNodesAction implements Action { - readonly type = COPY_NODES; + readonly type = NodeActionTypes.Copy; + constructor(public payload: Array) {} } export class MoveNodesAction implements Action { - readonly type = MOVE_NODES; + readonly type = NodeActionTypes.Move; + constructor(public payload: Array) {} } export class ManagePermissionsAction implements Action { - readonly type = MANAGE_PERMISSIONS; + readonly type = NodeActionTypes.ManagePermissions; + constructor(public payload: MinimalNodeEntity) {} } export class PrintFileAction implements Action { - readonly type = PRINT_FILE; - constructor(public payload: MinimalNodeEntity) {} -} + readonly type = NodeActionTypes.PrintFile; -export class FullscreenViewerAction implements Action { - readonly type = FULLSCREEN_VIEWER; constructor(public payload: MinimalNodeEntity) {} } export class ManageVersionsAction implements Action { - readonly type = MANAGE_VERSIONS; + readonly type = NodeActionTypes.ManageVersions; + constructor(public payload: MinimalNodeEntity) {} } export class EditOfflineAction implements Action { - readonly type = EDIT_OFFLINE; + readonly type = NodeActionTypes.EditOffline; + constructor(public payload: any) {} } export class UnlockWriteAction implements Action { - readonly type = UNLOCK_WRITE; + readonly type = NodeActionTypes.UnlockForWriting; + constructor(public payload: any) {} } + +export class AddFavoriteAction implements Action { + readonly type = NodeActionTypes.AddFavorite; + + constructor(public payload: Array) {} +} + +export class RemoveFavoriteAction implements Action { + readonly type = NodeActionTypes.RemoveFavorite; + + constructor(public payload: Array) {} +} diff --git a/src/app/store/actions/router.actions.ts b/projects/aca-shared/store/src/actions/router.actions.ts similarity index 80% rename from src/app/store/actions/router.actions.ts rename to projects/aca-shared/store/src/actions/router.actions.ts index a29575c762..0bf984ddd4 100644 --- a/src/app/store/actions/router.actions.ts +++ b/projects/aca-shared/store/src/actions/router.actions.ts @@ -26,27 +26,33 @@ import { Action } from '@ngrx/store'; import { MinimalNodeEntity } from '@alfresco/js-api'; -export const NAVIGATE_URL = 'NAVIGATE_URL'; -export const NAVIGATE_ROUTE = 'NAVIGATE_ROUTE'; -export const NAVIGATE_FOLDER = 'NAVIGATE_FOLDER'; -export const NAVIGATE_PARENT_FOLDER = 'NAVIGATE_PARENT_FOLDER'; +export enum RouterActionTypes { + NavigateUrl = 'NAVIGATE_URL', + NavigateRoute = 'NAVIGATE_ROUTE', + NavigateFolder = 'NAVIGATE_FOLDER', + NavigateParentFolder = 'NAVIGATE_PARENT_FOLDER' +} export class NavigateUrlAction implements Action { - readonly type = NAVIGATE_URL; + readonly type = RouterActionTypes.NavigateUrl; + constructor(public payload: string) {} } export class NavigateRouteAction implements Action { - readonly type = NAVIGATE_ROUTE; + readonly type = RouterActionTypes.NavigateRoute; + constructor(public payload: any[]) {} } export class NavigateToFolder implements Action { - readonly type = NAVIGATE_FOLDER; + readonly type = RouterActionTypes.NavigateFolder; + constructor(public payload: MinimalNodeEntity) {} } export class NavigateToParentFolder implements Action { - readonly type = NAVIGATE_PARENT_FOLDER; + readonly type = RouterActionTypes.NavigateParentFolder; + constructor(public payload: MinimalNodeEntity) {} } diff --git a/src/app/store/actions/search.actions.ts b/projects/aca-shared/store/src/actions/search.actions.ts similarity index 71% rename from src/app/store/actions/search.actions.ts rename to projects/aca-shared/store/src/actions/search.actions.ts index 61901aaf82..0f9fbf5f6c 100644 --- a/src/app/store/actions/search.actions.ts +++ b/projects/aca-shared/store/src/actions/search.actions.ts @@ -24,25 +24,31 @@ */ import { Action } from '@ngrx/store'; +import { SearchOptionModel } from '../models/search-option.model'; -export const SEARCH_BY_TERM = 'SEARCH_BY_TERM'; -export const TOGGLE_SEARCH_FILTER = 'TOGGLE_SEARCH_FILTER'; -export const SHOW_SEARCH_FILTER = 'SHOW_SEARCH_FILTER'; -export const HIDE_SEARCH_FILTER = 'HIDE_SEARCH_FILTER'; +export enum SearchActionTypes { + SearchByTerm = 'SEARCH_BY_TERM', + ToggleFilter = 'TOGGLE_SEARCH_FILTER', + ShowFilter = 'SHOW_SEARCH_FILTER', + HideFilter = 'HIDE_SEARCH_FILTER' +} export class SearchByTermAction implements Action { - readonly type = SEARCH_BY_TERM; - constructor(public payload: string, public searchOptions?: any) {} + readonly type = SearchActionTypes.SearchByTerm; + constructor( + public payload: string, + public searchOptions?: SearchOptionModel[] + ) {} } export class ToggleSearchFilterAction implements Action { - readonly type = TOGGLE_SEARCH_FILTER; + readonly type = SearchActionTypes.ToggleFilter; } export class ShowSearchFilterAction implements Action { - readonly type = SHOW_SEARCH_FILTER; + readonly type = SearchActionTypes.ShowFilter; } export class HideSearchFilterAction implements Action { - readonly type = HIDE_SEARCH_FILTER; + readonly type = SearchActionTypes.HideFilter; } diff --git a/src/app/store/actions/snackbar.actions.ts b/projects/aca-shared/store/src/actions/snackbar.actions.ts similarity index 88% rename from src/app/store/actions/snackbar.actions.ts rename to projects/aca-shared/store/src/actions/snackbar.actions.ts index 8e95c7f99b..4a65997af8 100644 --- a/src/app/store/actions/snackbar.actions.ts +++ b/projects/aca-shared/store/src/actions/snackbar.actions.ts @@ -25,9 +25,11 @@ import { Action } from '@ngrx/store'; -export const SNACKBAR_INFO = 'SNACKBAR_INFO'; -export const SNACKBAR_WARNING = 'SNACKBAR_WARNING'; -export const SNACKBAR_ERROR = 'SNACKBAR_ERROR'; +export enum SnackbarActionTypes { + Info = 'SNACKBAR_INFO', + Warning = 'SNACKBAR_WARNING', + Error = 'SNACKBAR_ERROR' +} export interface SnackbarAction extends Action { payload: string; @@ -41,7 +43,7 @@ export class SnackbarUserAction { } export class SnackbarInfoAction implements SnackbarAction { - readonly type = SNACKBAR_INFO; + readonly type = SnackbarActionTypes.Info; userAction?: SnackbarUserAction; duration = 4000; @@ -50,7 +52,7 @@ export class SnackbarInfoAction implements SnackbarAction { } export class SnackbarWarningAction implements SnackbarAction { - readonly type = SNACKBAR_WARNING; + readonly type = SnackbarActionTypes.Warning; userAction?: SnackbarUserAction; duration = 4000; @@ -59,7 +61,7 @@ export class SnackbarWarningAction implements SnackbarAction { } export class SnackbarErrorAction implements SnackbarAction { - readonly type = SNACKBAR_ERROR; + readonly type = SnackbarActionTypes.Error; userAction?: SnackbarUserAction; duration = 4000; diff --git a/src/app/store/actions/upload.actions.ts b/projects/aca-shared/store/src/actions/upload.actions.ts similarity index 82% rename from src/app/store/actions/upload.actions.ts rename to projects/aca-shared/store/src/actions/upload.actions.ts index 061c824c22..6d8780b831 100644 --- a/src/app/store/actions/upload.actions.ts +++ b/projects/aca-shared/store/src/actions/upload.actions.ts @@ -25,20 +25,24 @@ import { Action } from '@ngrx/store'; -export const UPLOAD_FILES = 'UPLOAD_FILES'; -export const UPLOAD_FOLDER = 'UPLOAD_FOLDER'; -export const UPLOAD_FILE_VERSION = 'UPLOAD_FILE_VERSION'; +export enum UploadActionTypes { + UploadFiles = 'UPLOAD_FILES', + UploadFolder = 'UPLOAD_FOLDER', + UploadFileVersion = 'UPLOAD_FILE_VERSION' +} export class UploadFilesAction implements Action { - readonly type = UPLOAD_FILES; + readonly type = UploadActionTypes.UploadFiles; + constructor(public payload: any) {} } export class UploadFolderAction implements Action { - readonly type = UPLOAD_FOLDER; + readonly type = UploadActionTypes.UploadFolder; + constructor(public payload: any) {} } export class UploadFileVersionAction implements Action { - readonly type = UPLOAD_FILE_VERSION; + readonly type = UploadActionTypes.UploadFileVersion; } diff --git a/src/app/store/actions/viewer.actions.ts b/projects/aca-shared/store/src/actions/viewer.actions.ts similarity index 66% rename from src/app/store/actions/viewer.actions.ts rename to projects/aca-shared/store/src/actions/viewer.actions.ts index 75bbb257cf..0dae7f87ea 100644 --- a/src/app/store/actions/viewer.actions.ts +++ b/projects/aca-shared/store/src/actions/viewer.actions.ts @@ -26,9 +26,32 @@ import { Action } from '@ngrx/store'; import { MinimalNodeEntity } from '@alfresco/js-api'; -export const VIEW_FILE = 'VIEW_FILE'; +export enum ViewerActionTypes { + ViewFile = 'VIEW_FILE', + ViewNode = 'VIEW_NODE', + FullScreen = 'FULLSCREEN_VIEWER', + ClosePreview = 'CLOSE_PREVIEW' +} export class ViewFileAction implements Action { - readonly type = VIEW_FILE; + readonly type = ViewerActionTypes.ViewFile; + constructor(public payload: MinimalNodeEntity, public parentId?: string) {} } + +export class ViewNodeAction implements Action { + readonly type = ViewerActionTypes.ViewNode; + + constructor(public nodeId: string, public location?: string) {} +} + +export class FullscreenViewerAction implements Action { + readonly type = ViewerActionTypes.FullScreen; + + constructor(public payload: MinimalNodeEntity) {} +} + +export class ClosePreviewAction implements Action { + readonly type = ViewerActionTypes.ClosePreview; + constructor(public payload?: MinimalNodeEntity) {} +} diff --git a/src/app/store/effects/modals.effects.ts b/projects/aca-shared/store/src/effects/dialog.effects.ts similarity index 85% rename from src/app/store/effects/modals.effects.ts rename to projects/aca-shared/store/src/effects/dialog.effects.ts index 9eb338181f..64ef99ef73 100644 --- a/src/app/store/effects/modals.effects.ts +++ b/projects/aca-shared/store/src/effects/dialog.effects.ts @@ -26,16 +26,19 @@ import { Effect, Actions, ofType } from '@ngrx/effects'; import { Injectable } from '@angular/core'; import { map } from 'rxjs/operators'; -import { CloseModalDialogsAction, CLOSE_MODAL_DIALOGS } from '../actions'; -import { MatDialog } from '@angular/material'; +import { MatDialog } from '@angular/material/dialog'; +import { + CloseModalDialogsAction, + AppActionTypes +} from '../actions/app.actions'; @Injectable() -export class ModalsEffects { +export class DialogEffects { constructor(private actions$: Actions, private matDialog: MatDialog) {} @Effect({ dispatch: false }) closeAll$ = this.actions$.pipe( - ofType(CLOSE_MODAL_DIALOGS), + ofType(AppActionTypes.CloseModalDialogs), map(() => this.matDialog.closeAll()) ); } diff --git a/src/app/store/effects/router.effects.ts b/projects/aca-shared/store/src/effects/router.effects.ts similarity index 89% rename from src/app/store/effects/router.effects.ts rename to projects/aca-shared/store/src/effects/router.effects.ts index 3c4322ca25..f39f36985e 100644 --- a/src/app/store/effects/router.effects.ts +++ b/projects/aca-shared/store/src/effects/router.effects.ts @@ -28,19 +28,16 @@ import { Router } from '@angular/router'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { MinimalNodeEntryEntity, PathInfoEntity } from '@alfresco/js-api'; import { map } from 'rxjs/operators'; +import { Store } from '@ngrx/store'; +import { AppStore } from '../states/app.state'; import { + NavigateUrlAction, + RouterActionTypes, NavigateRouteAction, - NavigateToParentFolder, - NAVIGATE_PARENT_FOLDER, - NAVIGATE_ROUTE, NavigateToFolder, - NAVIGATE_FOLDER, - NavigateUrlAction, - NAVIGATE_URL, - SnackbarErrorAction -} from '../actions'; -import { AppStore } from '../states/app.state'; -import { Store } from '@ngrx/store'; + NavigateToParentFolder +} from '../actions/router.actions'; +import { SnackbarErrorAction } from '../actions/snackbar.actions'; @Injectable() export class RouterEffects { @@ -52,7 +49,7 @@ export class RouterEffects { @Effect({ dispatch: false }) navigateUrl$ = this.actions$.pipe( - ofType(NAVIGATE_URL), + ofType(RouterActionTypes.NavigateUrl), map(action => { if (action.payload) { this.router.navigateByUrl(action.payload); @@ -62,7 +59,7 @@ export class RouterEffects { @Effect({ dispatch: false }) navigateRoute$ = this.actions$.pipe( - ofType(NAVIGATE_ROUTE), + ofType(RouterActionTypes.NavigateRoute), map(action => { this.router.navigate(action.payload); }) @@ -70,7 +67,7 @@ export class RouterEffects { @Effect({ dispatch: false }) navigateToFolder$ = this.actions$.pipe( - ofType(NAVIGATE_FOLDER), + ofType(RouterActionTypes.NavigateFolder), map(action => { if (action.payload && action.payload.entry) { this.navigateToFolder(action.payload.entry); @@ -80,7 +77,7 @@ export class RouterEffects { @Effect({ dispatch: false }) navigateToParentFolder$ = this.actions$.pipe( - ofType(NAVIGATE_PARENT_FOLDER), + ofType(RouterActionTypes.NavigateParentFolder), map(action => { if (action.payload && action.payload.entry) { this.navigateToParentFolder(action.payload.entry); @@ -89,7 +86,7 @@ export class RouterEffects { ); private navigateToFolder(node: MinimalNodeEntryEntity) { - let link = null; + let link: any[] = null; const { path, id } = node; if (path && path.name && path.elements) { @@ -114,7 +111,7 @@ export class RouterEffects { } private navigateToParentFolder(node: MinimalNodeEntryEntity) { - let link = null; + let link: any[] = null; const { path } = node; if (path && path.name && path.elements) { diff --git a/src/app/store/effects/snackbar.effects.ts b/projects/aca-shared/store/src/effects/snackbar.effects.ts similarity index 90% rename from src/app/store/effects/snackbar.effects.ts rename to projects/aca-shared/store/src/effects/snackbar.effects.ts index 4f9e476f68..e81fd42cfa 100644 --- a/src/app/store/effects/snackbar.effects.ts +++ b/projects/aca-shared/store/src/effects/snackbar.effects.ts @@ -25,20 +25,18 @@ import { TranslationService } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; -import { MatSnackBar } from '@angular/material'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Actions, Effect, ofType } from '@ngrx/effects'; import { Store } from '@ngrx/store'; import { map } from 'rxjs/operators'; +import { AppStore } from '../states/app.state'; import { - SnackbarAction, - SnackbarErrorAction, SnackbarInfoAction, + SnackbarActionTypes, SnackbarWarningAction, - SNACKBAR_ERROR, - SNACKBAR_INFO, - SNACKBAR_WARNING -} from '../actions'; -import { AppStore } from '../states/app.state'; + SnackbarErrorAction, + SnackbarAction +} from '../actions/snackbar.actions'; @Injectable() export class SnackbarEffects { @@ -51,7 +49,7 @@ export class SnackbarEffects { @Effect({ dispatch: false }) infoEffect = this.actions$.pipe( - ofType(SNACKBAR_INFO), + ofType(SnackbarActionTypes.Info), map((action: SnackbarInfoAction) => { this.showSnackBar(action, 'info-snackbar'); }) @@ -59,7 +57,7 @@ export class SnackbarEffects { @Effect({ dispatch: false }) warningEffect = this.actions$.pipe( - ofType(SNACKBAR_WARNING), + ofType(SnackbarActionTypes.Warning), map((action: SnackbarWarningAction) => { this.showSnackBar(action, 'warning-snackbar'); }) @@ -67,7 +65,7 @@ export class SnackbarEffects { @Effect({ dispatch: false }) errorEffect = this.actions$.pipe( - ofType(SNACKBAR_ERROR), + ofType(SnackbarActionTypes.Error), map((action: SnackbarErrorAction) => { this.showSnackBar(action, 'error-snackbar'); }) diff --git a/src/app/store/models/delete-status.model.ts b/projects/aca-shared/store/src/models/delete-status.model.ts similarity index 100% rename from src/app/store/models/delete-status.model.ts rename to projects/aca-shared/store/src/models/delete-status.model.ts diff --git a/src/app/store/models/deleted-node-info.model.ts b/projects/aca-shared/store/src/models/deleted-node-info.model.ts similarity index 100% rename from src/app/store/models/deleted-node-info.model.ts rename to projects/aca-shared/store/src/models/deleted-node-info.model.ts diff --git a/src/app/store/models/node-info.model.ts b/projects/aca-shared/store/src/models/node-info.model.ts similarity index 100% rename from src/app/store/models/node-info.model.ts rename to projects/aca-shared/store/src/models/node-info.model.ts diff --git a/src/app/components/preview/preview-extension.component.spec.ts b/projects/aca-shared/store/src/models/search-option.model.ts similarity index 83% rename from src/app/components/preview/preview-extension.component.spec.ts rename to projects/aca-shared/store/src/models/search-option.model.ts index 217b283595..3882bde408 100644 --- a/src/app/components/preview/preview-extension.component.spec.ts +++ b/projects/aca-shared/store/src/models/search-option.model.ts @@ -23,10 +23,15 @@ * along with Alfresco. If not, see . */ -import { PreviewExtensionComponent } from './preview-extension.component'; +export enum SearchOptionIds { + Files = 'content', + Folders = 'folder', + Libraries = 'libraries' +} -describe('PreviewExtensionComponent', () => { - it('should be defined', () => { - expect(PreviewExtensionComponent).toBeDefined(); - }); -}); +export interface SearchOptionModel { + id: SearchOptionIds; + key: string; + value: boolean; + shouldDisable(): boolean; +} diff --git a/src/app/store/actions.ts b/projects/aca-shared/store/src/public_api.ts similarity index 75% rename from src/app/store/actions.ts rename to projects/aca-shared/store/src/public_api.ts index 07a23b8dae..c7695c5b91 100644 --- a/src/app/store/actions.ts +++ b/projects/aca-shared/store/src/public_api.ts @@ -24,15 +24,26 @@ */ export * from './actions/app.actions'; -export * from './actions/favorite.actions'; +export * from './actions/library.actions'; export * from './actions/node.actions'; -export * from './actions/snackbar.actions'; export * from './actions/router.actions'; -export * from './actions/viewer.actions'; export * from './actions/search.actions'; -export * from './actions/library.actions'; -export * from './actions/upload.actions'; -export * from './actions/modals.actions'; -export * from './actions/repository.actions'; -export * from './actions/info-drawer.actions'; +export * from './actions/snackbar.actions'; export * from './actions/upload.actions'; +export * from './actions/viewer.actions'; +export * from './actions/metadata-aspect.actions'; + +export * from './effects/dialog.effects'; +export * from './effects/router.effects'; +export * from './effects/snackbar.effects'; + +export * from './models/delete-status.model'; +export * from './models/deleted-node-info.model'; +export * from './models/node-info.model'; +export * from './models/search-option.model'; + +export * from './selectors/app.selectors'; + +export * from './states/app.state'; + +export * from './store.module'; diff --git a/src/app/store/selectors/app.selectors.ts b/projects/aca-shared/store/src/selectors/app.selectors.ts similarity index 68% rename from src/app/store/selectors/app.selectors.ts rename to projects/aca-shared/store/src/selectors/app.selectors.ts index d7d0c241ab..378ca20d48 100644 --- a/src/app/store/selectors/app.selectors.ts +++ b/projects/aca-shared/store/src/selectors/app.selectors.ts @@ -23,57 +23,57 @@ * along with Alfresco. If not, see . */ -import { createSelector } from '@ngrx/store'; import { AppStore } from '../states/app.state'; +import { createSelector } from '@ngrx/store'; export const selectApp = (state: AppStore) => state.app; -export const selectHeaderColor = createSelector( +export const getHeaderColor = createSelector( selectApp, state => state.headerColor ); -export const selectAppName = createSelector( +export const getAppName = createSelector( selectApp, state => state.appName ); -export const selectLogoPath = createSelector( +export const getLogoPath = createSelector( selectApp, state => state.logoPath ); -export const appSelection = createSelector( +export const getLanguagePickerState = createSelector( selectApp, - state => state.selection + state => state.languagePicker ); -export const appLanguagePicker = createSelector( +export const getUserProfile = createSelector( selectApp, - state => state.languagePicker + state => state.user ); -export const selectUser = createSelector( +export const getCurrentFolder = createSelector( selectApp, - state => state.user + state => state.navigation.currentFolder ); -export const sharedUrl = createSelector( +export const getAppSelection = createSelector( selectApp, - state => state.sharedUrl + state => state.selection ); -export const appNavigation = createSelector( +export const getSharedUrl = createSelector( selectApp, - state => state.navigation + state => state.sharedUrl ); -export const currentFolder = createSelector( +export const getNavigationState = createSelector( selectApp, - state => state.navigation.currentFolder + state => state.navigation ); -export const infoDrawerOpened = createSelector( +export const isInfoDrawerOpened = createSelector( selectApp, state => state.infoDrawerOpened ); @@ -83,18 +83,18 @@ export const showFacetFilter = createSelector( state => state.showFacetFilter ); -export const documentDisplayMode = createSelector( +export const getDocumentDisplayMode = createSelector( selectApp, state => state.documentDisplayMode ); -export const repositoryStatus = createSelector( +export const getRepositoryStatus = createSelector( selectApp, state => state.repository ); export const isQuickShareEnabled = createSelector( - repositoryStatus, + getRepositoryStatus, info => info.status.isQuickShareEnabled ); @@ -103,11 +103,22 @@ export const isAdmin = createSelector( state => state.user.isAdmin ); -export const ruleContext = createSelector( - appSelection, - appNavigation, - selectUser, - repositoryStatus, +export const getSideNavState = createSelector( + getAppSelection, + getNavigationState, + (selection, navigation) => { + return { + selection, + navigation + }; + } +); + +export const getRuleContext = createSelector( + getAppSelection, + getNavigationState, + getUserProfile, + getRepositoryStatus, (selection, navigation, profile, repository) => { return { selection, @@ -117,3 +128,8 @@ export const ruleContext = createSelector( }; } ); + +export const infoDrawerMetadataAspect = createSelector( + selectApp, + state => state.infoDrawerMetadataAspect +); diff --git a/src/app/store/actions/repository.actions.ts b/projects/aca-shared/store/src/states/app.state.ts similarity index 69% rename from src/app/store/actions/repository.actions.ts rename to projects/aca-shared/store/src/states/app.state.ts index cc32083410..a0509c1ff5 100644 --- a/src/app/store/actions/repository.actions.ts +++ b/projects/aca-shared/store/src/states/app.state.ts @@ -23,12 +23,29 @@ * along with Alfresco. If not, see . */ -import { Action } from '@ngrx/store'; +import { + SelectionState, + ProfileState, + NavigationState +} from '@alfresco/adf-extensions'; import { RepositoryInfo } from '@alfresco/js-api'; -export const SET_REPOSITORY_INFO = 'SET_REPOSITORY_INFO'; +export interface AppState { + appName: string; + headerColor: string; + logoPath: string; + languagePicker: boolean; + sharedUrl: string; + selection: SelectionState; + user: ProfileState; + navigation: NavigationState; + infoDrawerOpened: boolean; + infoDrawerMetadataAspect: string; + showFacetFilter: boolean; + documentDisplayMode: string; + repository: RepositoryInfo; +} -export class SetRepositoryInfoAction implements Action { - readonly type = SET_REPOSITORY_INFO; - constructor(public payload: RepositoryInfo) {} +export interface AppStore { + app: AppState; } diff --git a/src/app/extensions/app.interface.ts b/projects/aca-shared/store/src/store.module.ts similarity index 73% rename from src/app/extensions/app.interface.ts rename to projects/aca-shared/store/src/store.module.ts index a792c78f8f..9e49250699 100644 --- a/src/app/extensions/app.interface.ts +++ b/projects/aca-shared/store/src/store.module.ts @@ -23,11 +23,15 @@ * along with Alfresco. If not, see . */ -import { RuleContext } from '@alfresco/adf-extensions'; -import { AuthenticationService } from '@alfresco/adf-core'; -import { RepositoryInfo } from '@alfresco/js-api'; +import { NgModule } from '@angular/core'; +import { EffectsModule } from '@ngrx/effects'; +import { SnackbarEffects } from './effects/snackbar.effects'; +import { DialogEffects } from './effects/dialog.effects'; +import { RouterEffects } from './effects/router.effects'; -export interface AppRuleContext extends RuleContext { - repository: RepositoryInfo; - auth: AuthenticationService; -} +@NgModule({ + imports: [ + EffectsModule.forFeature([SnackbarEffects, DialogEffects, RouterEffects]) + ] +}) +export class SharedStoreModule {} diff --git a/projects/aca-shared/test.ts b/projects/aca-shared/test.ts new file mode 100644 index 0000000000..e11ff1c97b --- /dev/null +++ b/projects/aca-shared/test.ts @@ -0,0 +1,22 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'core-js/es7/reflect'; +import 'zone.js/dist/zone'; +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: any; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/projects/aca-shared/tsconfig.lib.json b/projects/aca-shared/tsconfig.lib.json new file mode 100644 index 0000000000..f407ef6a41 --- /dev/null +++ b/projects/aca-shared/tsconfig.lib.json @@ -0,0 +1,29 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "target": "es2015", + "module": "es2015", + "moduleResolution": "node", + "declaration": true, + "sourceMap": true, + "inlineSources": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "types": [], + "lib": ["dom", "es2018"], + "paths": { + "@alfresco/aca-shared/*": ["./*"] + } + }, + "angularCompilerOptions": { + "annotateForClosureCompiler": true, + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true, + "enableResourceInlining": true + }, + "exclude": ["test.ts", "**/*.spec.ts"] +} diff --git a/projects/aca-shared/tsconfig.spec.json b/projects/aca-shared/tsconfig.spec.json new file mode 100644 index 0000000000..c1d29e83b6 --- /dev/null +++ b/projects/aca-shared/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": ["jasmine", "node"] + }, + "files": ["test.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts"] +} diff --git a/projects/aca-shared/tslint.json b/projects/aca-shared/tslint.json new file mode 100644 index 0000000000..fdc7ace612 --- /dev/null +++ b/projects/aca-shared/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tslint.json", + "rules": { + "directive-selector": [true, "attribute", "aca", "camelCase"], + "component-selector": [true, "element", "aca", "kebab-case"] + } +} diff --git a/projects/adf-office-services-ext/assets/aos.plugin.json b/projects/adf-office-services-ext/assets/aos.plugin.json index 3a903057cc..ee56e6ed23 100644 --- a/projects/adf-office-services-ext/assets/aos.plugin.json +++ b/projects/adf-office-services-ext/assets/aos.plugin.json @@ -39,7 +39,7 @@ "contextMenu": [ { "id": "aos.context.openWith.office", - "order": 90, + "order": 450, "icon": "edit", "title": "AOS.ACTION_TITLE", "actions": { diff --git a/projects/adf-office-services-ext/package.json b/projects/adf-office-services-ext/package.json index 849fd06b6e..2d4e11c5ff 100644 --- a/projects/adf-office-services-ext/package.json +++ b/projects/adf-office-services-ext/package.json @@ -2,17 +2,6 @@ "name": "@alfresco/adf-office-services-ext", "version": "0.0.6", "license": "Apache-2.0", - "author": { - "name": "Keensoft", - "url": "http://www.keensoft.es/en/" - }, - "contributors": [ - { - "name": "Denys Vuika", - "email": "denys.vuka@gmail.com", - "url": "https://medium.com/@denysvuika" - } - ], "homepage": "https://github.com/Alfresco/alfresco-content-app", "keywords": ["Alfresco", "ADF", "ACA", "Content Application"], "peerDependencies": { diff --git a/projects/adf-office-services-ext/src/lib/aos-extension.service.ts b/projects/adf-office-services-ext/src/lib/aos-extension.service.ts index 04ff47135a..e3af64b935 100644 --- a/projects/adf-office-services-ext/src/lib/aos-extension.service.ts +++ b/projects/adf-office-services-ext/src/lib/aos-extension.service.ts @@ -2,8 +2,7 @@ import { AppConfigService, AuthenticationService, - NotificationService, - AlfrescoApiService + NotificationService } from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; import { MinimalNodeEntryEntity } from '@alfresco/js-api'; @@ -16,8 +15,7 @@ export class AosEditOnlineService { constructor( private alfrescoAuthenticationService: AuthenticationService, private appConfigService: AppConfigService, - private notificationService: NotificationService, - private apiService: AlfrescoApiService + private notificationService: NotificationService ) {} onActionEditOnlineAos(node: MinimalNodeEntryEntity): void { @@ -89,22 +87,7 @@ export class AosEditOnlineService { 3000 ); } else { - this.apiService.nodesApi - .lockNode(node.id, { - type: 'ALLOW_OWNER_CHANGES', - lifetime: 'PERSISTENT' - }) - .then( - () => { - this.aos_tryToLaunchOfficeByMsProtocolHandler(protocolHandler, url); - }, - () => { - this.notificationService.openSnackMessage( - 'Cannot lock the node for editing.', - 3000 - ); - } - ); + this.aos_tryToLaunchOfficeByMsProtocolHandler(protocolHandler, url); } } diff --git a/projects/adf-office-services-ext/src/lib/evaluators.ts b/projects/adf-office-services-ext/src/lib/evaluators.ts index 037df58511..10aa26aa6d 100644 --- a/projects/adf-office-services-ext/src/lib/evaluators.ts +++ b/projects/adf-office-services-ext/src/lib/evaluators.ts @@ -1,5 +1,4 @@ import { RuleContext, RuleParameter } from '@alfresco/adf-extensions'; -import { AuthenticationService } from '@alfresco/adf-core'; import { getFileExtension, supportedExtensions } from './utils'; export function canOpenWithOffice( @@ -14,12 +13,6 @@ export function canOpenWithOffice( return false; } - // todo: needs to have typed access via SDK (1.8) - const auth: AuthenticationService = (context).auth; - if (auth && auth.isOauth()) { - return false; - } - if (!context || !context.selection) { return false; } diff --git a/protractor.conf.js b/protractor.conf.js index 91c0e5d325..3dbec5141a 100755 --- a/protractor.conf.js +++ b/protractor.conf.js @@ -43,13 +43,51 @@ exports.config = { './e2e/suites/navigation/*.test.ts', './e2e/suites/pagination/*.test.ts', './e2e/suites/search/*.test.ts', + './e2e/suites/actions-available/**/*.test.ts', './e2e/suites/actions/*.test.ts', './e2e/suites/viewer/*.test.ts', './e2e/suites/info-drawer/*.test.ts', './e2e/suites/extensions/*.test.ts' ], - SELENIUM_PROMISE_MANAGER: true, + suites: { + authentication: './e2e/suites/authentication/*.test.ts', + listViews: './e2e/suites/list-views/*.test.ts', + application: './e2e/suites/application/*.test.ts', + navigation: './e2e/suites/navigation/*.test.ts', + pagination: './e2e/suites/pagination/*.test.ts', + search: './e2e/suites/search/*.test.ts', + actionsAvailable: './e2e/suites/actions-available/**/*.test.ts', + addRemoveContent: [ + './e2e/suites/actions/new-menu.test.ts', + './e2e/suites/actions/create-folder.test.ts', + './e2e/suites/actions/create-library.test.ts', + './e2e/suites/actions/upload-file.test.ts', + './e2e/suites/actions/upload-new-version.test.ts', + './e2e/suites/actions/delete-undo-delete.test.ts', + './e2e/suites/actions/permanently-delete.test.ts', + './e2e/suites/actions/restore.test.ts', + './e2e/suites/actions/download.test.ts' + ], + manageContent: [ + './e2e/suites/actions/copy.test.ts', + './e2e/suites/actions/move.test.ts', + './e2e/suites/actions/library-actions.test.ts', + './e2e/suites/actions/edit-folder.test.ts', + './e2e/suites/actions/edit-offline.test.ts' + ], + sharingContent: [ + './e2e/suites/actions/mark-favorite.test.ts', + './e2e/suites/actions/share-file.test.ts', + './e2e/suites/actions/unshare-file-search-results.test.ts', + './e2e/suites/actions/unshare-file.test.ts' + ], + viewer: './e2e/suites/viewer/*.test.ts', + infoDrawer: './e2e/suites/info-drawer/*.test.ts', + extensions: './e2e/suites/extensions/*.test.ts' + }, + + SELENIUM_PROMISE_MANAGER: false, capabilities: { browserName: 'chrome', @@ -79,7 +117,7 @@ exports.config = { framework: 'jasmine', jasmineNodeOpts: { showColors: true, - defaultTimeoutInterval: 60000, + defaultTimeoutInterval: 100000, print: function() {} }, diff --git a/proxy.conf.js b/proxy.conf.js index 5bea784f0b..26a361bd35 100644 --- a/proxy.conf.js +++ b/proxy.conf.js @@ -1,14 +1,14 @@ module.exports = { - "/alfresco": { - "target": "http://0.0.0.0:8080", - "secure": false, - "changeOrigin": true, - // workaround for REPO-2260 - onProxyRes: function (proxyRes, req, res) { - const header = proxyRes.headers['www-authenticate']; - if (header && header.startsWith('Basic')) { - proxyRes.headers['www-authenticate'] = 'x' + header; - } - } + '/alfresco': { + target: 'http://0.0.0.0:8080', + secure: false, + changeOrigin: true, + // workaround for REPO-2260 + onProxyRes: function(proxyRes, req, res) { + const header = proxyRes.headers['www-authenticate']; + if (header && header.startsWith('Basic')) { + proxyRes.headers['www-authenticate'] = 'x' + header; + } } + } }; diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 22d0762c30..a0946bfadf 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -eval GNU=false eval libs=( "@alfresco/adf-core" "@alfresco/adf-content-services" @@ -15,11 +14,6 @@ show_help() { echo "Usage: update-version.sh -v latest" echo "" echo "-v or -version the new version of the libraries, can also be alpha|beta|latest" - echo "-gnu for gnu" -} - -set_gnu_mode() { - GNU=true } set_version() { @@ -39,17 +33,10 @@ while [[ $1 == -* ]]; do case "$1" in -h|--help|-\?) show_help; exit 0;; -v|version) set_version $2; shift 2;; - -gnu) set_gnu_mode; shift;; -*) shift;; esac done -if $GNU; then - sedi='-i' -else - sedi=('-i' '') -fi - if [[ "${VERSION}" == "" ]] then echo "Error: version number is required" diff --git a/src/app.config.json b/src/app.config.json index e090e2371b..2c101f7ed9 100644 --- a/src/app.config.json +++ b/src/app.config.json @@ -17,11 +17,13 @@ }, "application": { "name": "Alfresco Content Application", + "version": "1.8.0", "logo": "assets/images/alfresco-logo-flower.svg", - "copyright": "© 2017 - 2019 Alfresco Software, Inc. All rights reserved." + "copyright": "APP.COPYRIGHT" }, + "sharedLinkDateTimePickerType": "date", "headerColor": "#2196F3", - "languagePicker": false, + "languagePicker": true, "pagination": { "size": 25, "supportedPageSizes": [25, 50, 100] @@ -32,6 +34,11 @@ "nocase": true } }, + "dateValues": { + "defaultDateFormat": "mediumDate", + "defaultDateTimeFormat": "MMM d, y, h:mm", + "defaultLocale": "en-US" + }, "adf-version-manager": { "allowComments": true, "allowDownload": true @@ -84,11 +91,61 @@ { "key": "zh-CN", "label": "中文简体" + }, + { + "key": "cs", + "label": "Čeština" + }, + { + "key": "da", + "label": "Dansk" + }, + { + "key": "fi", + "label": "Suomi" + }, + { + "key": "pl", + "label": "Polski" + }, + { + "key": "sv", + "label": "Svenska" + }, + { + "key": "ar", + "label": "العربية", + "direction": "rtl" } ], "content-metadata": { "presets": { "custom": [ + { + "includeAll": true, + "exclude": [ + "rn:renditioned", + "cm:versionable", + "cm:auditable", + "cm:thumbnailModification", + "cm:content", + "cm:author", + "cm:titled", + "cm:generalclassifiable", + "cm:taggable", + "dp:restrictable", + "fm:commentsRollup", + "qshare:shared", + + "exif:exif", + "cm:effectivity", + + "cm:emailed", + "cm:likesRatingSchemeRollups", + "cm:lockable", + "cm:ownable" + ] + }, { "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", "items": [ @@ -110,18 +167,25 @@ ] } ] + }, + { + "title": "APP.CONTENT_METADATA.EFFECTIVITY_GROUP_TITLE", + "items": [ + { + "aspect": "cm:effectivity", + "properties": [ + "cm:from", + "cm:to" + ] + } + ] } ] } }, "search": { - "aca:fields": [ - "cm:name", - "cm:title", - "cm:description", - "TEXT", - "TAG" - ], + "filterWithContains": true, + "aca:fields": ["cm:name", "cm:title", "cm:description", "TEXT", "TAG"], "include": ["path", "allowableOperations", "properties"], "sorting": { "options": [ @@ -192,6 +256,7 @@ ] }, "aca:triggeredOnChange": false, + "resetButton": true, "filterQueries": [ { "query": "+TYPE:'cm:folder' OR +TYPE:'cm:content'" }, { @@ -213,22 +278,18 @@ "fields": [ { "field": "content.mimetype", - "mincount": 0, "label": "SEARCH.FACET_FIELDS.FILE_TYPE" }, { "field": "creator", - "mincount": 0, "label": "SEARCH.FACET_FIELDS.CREATOR" }, { "field": "modifier", - "mincount": 0, "label": "SEARCH.FACET_FIELDS.MODIFIER" }, { "field": "SITE", - "mincount": 0, "label": "SEARCH.FACET_FIELDS.LOCATION" } ] @@ -236,23 +297,25 @@ "facetQueries": { "label": "SEARCH.CATEGORIES.MODIFIED_DATE", "expanded": true, - "mincount": 0, "queries": [ - { "label": "Today", "query": "cm:modified:[TODAY to TODAY]" }, { - "label": "This week", + "label": "SEARCH.FACET_QUERIES.TODAY", + "query": "cm:modified:[TODAY to TODAY]" + }, + { + "label": "SEARCH.FACET_QUERIES.THIS_WEEK", "query": "cm:modified:[NOW/DAY-7DAYS TO NOW/DAY+1DAY]" }, { - "label": "This month", + "label": "SEARCH.FACET_QUERIES.THIS_MONTH", "query": "cm:modified:[NOW/DAY-1MONTH TO NOW/DAY+1DAY]" }, { - "label": "In the last 6 months", + "label": "SEARCH.FACET_QUERIES.LAST_6_MONTHS", "query": "cm:modified:[NOW/DAY-6MONTHS TO NOW/DAY+1DAY]" }, { - "label": "This year", + "label": "SEARCH.FACET_QUERIES.THIS_YEAR", "query": "cm:modified:[NOW/DAY-1YEAR TO NOW/DAY+1DAY]" } ] @@ -266,16 +329,22 @@ "selector": "check-list", "settings": { "options": [ - { "name": "Small", "value": "content.size:[0 TO 1048576>" }, { - "name": "Medium", + "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.SMALL", + "value": "content.size:[0 TO 1048576>" + }, + { + "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.MEDIUM", "value": "content.size:[1048576 TO 52428800]" }, { - "name": "Large", + "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.LARGE", "value": "content.size:<52428800 TO 524288000]" }, - { "name": "Huge", "value": "content.size:<524288000 TO MAX]" } + { + "name": "SEARCH.CATEGORIES.SIZE_OPTIONS.HUGE", + "value": "content.size:<524288000 TO MAX]" + } ] } } diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 368016e760..11c2e77d73 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -24,7 +24,7 @@ */ import { AppComponent } from './app.component'; -import { SetInitialStateAction } from './store/actions'; +import { SetInitialStateAction } from '@alfresco/aca-shared/store'; describe('AppComponent', () => { let component: AppComponent; @@ -54,6 +54,7 @@ describe('AppComponent', () => { null, null, null, + null, null ); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index ad62ac19fd..4f7ead6ddf 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -29,30 +29,28 @@ import { AuthenticationService, FileUploadErrorEvent, PageTitleService, - UploadService + UploadService, + SharedLinksApiService } from '@alfresco/adf-core'; import { Component, OnInit, OnDestroy } from '@angular/core'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { AppExtensionService } from './extensions/extension.service'; import { - SnackbarErrorAction, + AppStore, + AppState, SetCurrentUrlAction, SetInitialStateAction, + SetUserProfileAction, + SnackbarErrorAction, CloseModalDialogsAction, - SetRepositoryInfoAction, - SetUserProfileAction -} from './store/actions'; -import { - AppStore, - AppState, - INITIAL_APP_STATE -} from './store/states/app.state'; + SetRepositoryInfoAction +} from '@alfresco/aca-shared/store'; import { filter, takeUntil } from 'rxjs/operators'; -import { ContentApiService } from './services/content-api.service'; -import { DiscoveryEntry } from '@alfresco/js-api'; -import { AppService } from './services/app.service'; +import { AppService, ContentApiService } from '@alfresco/aca-shared'; +import { DiscoveryEntry, GroupsApi, Group } from '@alfresco/js-api'; import { Subject } from 'rxjs'; +import { INITIAL_APP_STATE } from './store/initial-state'; @Component({ selector: 'app-root', @@ -73,26 +71,29 @@ export class AppComponent implements OnInit, OnDestroy { private uploadService: UploadService, private extensions: AppExtensionService, private contentApi: ContentApiService, - private appService: AppService + private appService: AppService, + private sharedLinksApiService: SharedLinksApiService ) {} ngOnInit() { - this.alfrescoApiService.getInstance().on('error', error => { - if (error.status === 401) { - if (!this.authenticationService.isLoggedIn()) { - this.store.dispatch(new CloseModalDialogsAction()); - - let redirectUrl = this.route.snapshot.queryParams['redirectUrl']; - if (!redirectUrl) { - redirectUrl = this.router.url; + this.alfrescoApiService + .getInstance() + .on('error', (error: { status: number }) => { + if (error.status === 401) { + if (!this.authenticationService.isLoggedIn()) { + this.store.dispatch(new CloseModalDialogsAction()); + + let redirectUrl = this.route.snapshot.queryParams['redirectUrl']; + if (!redirectUrl) { + redirectUrl = this.router.url; + } + + this.router.navigate(['/login'], { + queryParams: { redirectUrl: redirectUrl } + }); } - - this.router.navigate(['/login'], { - queryParams: { redirectUrl: redirectUrl } - }); } - } - }); + }); this.loadAppSettings(); @@ -121,13 +122,18 @@ export class AppComponent implements OnInit, OnDestroy { this.onFileUploadedError(error) ); + this.sharedLinksApiService.error + .pipe(takeUntil(this.onDestroy$)) + .subscribe((err: { message: string }) => { + this.store.dispatch(new SnackbarErrorAction(err.message)); + }); + this.appService.ready$ .pipe(takeUntil(this.onDestroy$)) .subscribe(isReady => { if (isReady) { this.loadRepositoryStatus(); this.loadUserProfile(); - // todo: load external auth-enabled plugins here } }); } @@ -147,9 +153,19 @@ export class AppComponent implements OnInit, OnDestroy { }); } - private loadUserProfile() { + private async loadUserProfile() { + const groupsApi = new GroupsApi(this.alfrescoApiService.getInstance()); + const paging = await groupsApi.listGroupMembershipsForPerson('-me-'); + const groups: Group[] = []; + + if (paging && paging.list && paging.list.entries) { + groups.push(...paging.list.entries.map(obj => obj.entry)); + } + this.contentApi.getPerson('-me-').subscribe(person => { - this.store.dispatch(new SetUserProfileAction(person.entry)); + this.store.dispatch( + new SetUserProfileAction({ person: person.entry, groups }) + ); }); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 639f0ccc74..bdb487aff8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -39,9 +39,9 @@ import { } from '@alfresco/adf-core'; import { LibraryDialogComponent, - ContentModule, - CustomResourcesService + ContentModule } from '@alfresco/adf-content-services'; +import { AppRouteReuseStrategy, SharedModule } from '@alfresco/aca-shared'; import { AppComponent } from './app.component'; import { APP_ROUTES } from './app.routes'; @@ -56,13 +56,11 @@ import { AppStoreModule } from './store/app-store.module'; import { MaterialModule } from './material.module'; import { AppExtensionsModule } from './extensions.module'; import { CoreExtensionsModule } from './extensions/core.extensions.module'; -import { AppRouteReuseStrategy } from './app.routes.strategy'; import { AppInfoDrawerModule } from './components/info-drawer/info.drawer.module'; import { DirectivesModule } from './directives/directives.module'; import { ContextMenuModule } from './components/context-menu/context-menu.module'; import { ExtensionsModule } from '@alfresco/adf-extensions'; import { AppToolbarModule } from './components/toolbar/toolbar.module'; -import { AppSharedModule } from './components/shared/shared.module'; import { AppCreateMenuModule } from './components/create-menu/create-menu.module'; import { AppSidenavModule } from './components/sidenav/sidenav.module'; import { AppPermissionsModule } from './components/permissions/permissions.module'; @@ -76,7 +74,41 @@ import { AppLoginModule } from './components/login/login.module'; import { AppHeaderModule } from './components/header/header.module'; import { AppNodeVersionModule } from './components/node-version/node-version.module'; import { environment } from '../environments/environment'; -import { AppDataService } from './services/data.service'; + +import { registerLocaleData } from '@angular/common'; +import localeFr from '@angular/common/locales/fr'; +import localeDe from '@angular/common/locales/de'; +import localeIt from '@angular/common/locales/it'; +import localeEs from '@angular/common/locales/es'; +import localeJa from '@angular/common/locales/ja'; +import localeNl from '@angular/common/locales/nl'; +import localePt from '@angular/common/locales/pt'; +import localeNb from '@angular/common/locales/nb'; +import localeRu from '@angular/common/locales/ru'; +import localeCh from '@angular/common/locales/zh'; +import localeAr from '@angular/common/locales/ar'; +import localeCs from '@angular/common/locales/cs'; +import localePl from '@angular/common/locales/pl'; +import localeFi from '@angular/common/locales/fi'; +import localeDa from '@angular/common/locales/da'; +import localeSv from '@angular/common/locales/sv'; + +registerLocaleData(localeFr); +registerLocaleData(localeDe); +registerLocaleData(localeIt); +registerLocaleData(localeEs); +registerLocaleData(localeJa); +registerLocaleData(localeNl); +registerLocaleData(localePt); +registerLocaleData(localeNb); +registerLocaleData(localeRu); +registerLocaleData(localeCh); +registerLocaleData(localeAr); +registerLocaleData(localeCs); +registerLocaleData(localePl); +registerLocaleData(localeFi); +registerLocaleData(localeDa); +registerLocaleData(localeSv); @NgModule({ imports: [ @@ -91,6 +123,7 @@ import { AppDataService } from './services/data.service'; MaterialModule, CoreModule.forRoot(), ContentModule.forRoot(), + SharedModule.forRoot(), AppStoreModule, CoreExtensionsModule.forRoot(), ExtensionsModule, @@ -103,7 +136,6 @@ import { AppDataService } from './services/data.service'; ContextMenuModule, AppInfoDrawerModule, AppToolbarModule, - AppSharedModule, AppSidenavModule, AppCreateMenuModule, DocumentListCustomComponentsModule, @@ -124,7 +156,6 @@ import { AppDataService } from './services/data.service'; providers: [ { provide: RouteReuseStrategy, useClass: AppRouteReuseStrategy }, { provide: AppConfigService, useClass: DebugAppConfigService }, - { provide: CustomResourcesService, useClass: AppDataService }, { provide: TRANSLATION_PROVIDER, multi: true, diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 9e2ca69076..92da4e42f4 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -28,12 +28,14 @@ import { AppLayoutComponent } from './components/layout/app-layout/app-layout.co import { FilesComponent } from './components/files/files.component'; import { LibrariesComponent } from './components/libraries/libraries.component'; import { FavoriteLibrariesComponent } from './components/favorite-libraries/favorite-libraries.component'; -import { GenericErrorComponent } from './components/common/generic-error/generic-error.component'; import { SearchResultsComponent } from './components/search/search-results/search-results.component'; import { SearchLibrariesResultsComponent } from './components/search/search-libraries-results/search-libraries-results.component'; import { LoginComponent } from './components/login/login.component'; -import { AppAuthGuard } from './guards/auth.guard'; -import { AppSharedRuleGuard } from './guards/shared.guard'; +import { + AppSharedRuleGuard, + GenericErrorComponent +} from '@alfresco/aca-shared'; +import { AuthGuardEcm } from '@alfresco/adf-core'; export const APP_ROUTES: Routes = [ { @@ -52,6 +54,22 @@ export const APP_ROUTES: Routes = [ loadChildren: './components/shared-link-view/shared-link-view.module#AppSharedLinkViewModule' }, + { + path: 'view', + component: AppLayoutComponent, + children: [ + { + path: ':nodeId', + outlet: 'viewer', + children: [ + { + path: '', + loadChildren: './components/viewer/viewer.module#AppViewerModule' + } + ] + } + ] + }, { path: '', component: AppLayoutComponent, @@ -85,7 +103,7 @@ export const APP_ROUTES: Routes = [ path: '', component: LibrariesComponent, data: { - title: 'APP.BROWSE.LIBRARIES.TITLE', + title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', sortingPreferenceKey: 'libraries' } }, @@ -93,7 +111,7 @@ export const APP_ROUTES: Routes = [ path: ':folderId', component: FilesComponent, data: { - title: 'APP.BROWSE.LIBRARIES.TITLE', + title: 'APP.BROWSE.LIBRARIES.MENU.MY_LIBRARIES.TITLE', sortingPreferenceKey: 'libraries-files' } }, @@ -149,6 +167,18 @@ export const APP_ROUTES: Routes = [ navigateSource: 'personal-files' } } + // Do not remove, will be enabled in future iterations + // { + // path: 'view/:nodeId', + // outlet: 'viewer', + // children: [ + // { + // path: '', + // loadChildren: + // './components/viewer/viewer.module#AppViewerModule' + // } + // ] + // } ] }, { @@ -242,7 +272,7 @@ export const APP_ROUTES: Routes = [ component: GenericErrorComponent } ], - canActivateChild: [AppAuthGuard], - canActivate: [AppAuthGuard] + canActivateChild: [AuthGuardEcm], + canActivate: [AuthGuardEcm] } ]; diff --git a/src/app/components/about/about.component.html b/src/app/components/about/about.component.html index 80891c6d25..54019bc02c 100644 --- a/src/app/components/about/about.component.html +++ b/src/app/components/about/about.component.html @@ -1,12 +1,15 @@ - - + +
{{ 'application.name' | adfAppConfig }}
-

{{ 'APP.ABOUT.VERSION' | translate }} {{ releaseVersion }}

+

+ {{ 'APP.ABOUT.VERSION' | translate }} + {{ 'application.version' | adfAppConfig }} +

- +
{{ 'APP.ABOUT.PLUGINS.TITLE' | translate }}
@@ -43,5 +46,5 @@
-
-
+ + diff --git a/src/app/components/about/about.component.scss b/src/app/components/about/about.component.scss new file mode 100644 index 0000000000..bcaae901e0 --- /dev/null +++ b/src/app/components/about/about.component.scss @@ -0,0 +1,25 @@ +.app-about { + .main-content { + padding: 10px; + + article { + color: var(--theme-text-color); + padding: 25px 0 25px 0; + + & > header { + line-height: 24px; + font-size: 14px; + font-weight: 800; + letter-spacing: -0.2px; + } + } + + article:first-of-type { + padding-bottom: 0; + } + + article:last-of-type { + margin-bottom: 50px; + } + } +} diff --git a/src/app/components/about/about.component.theme.scss b/src/app/components/about/about.component.theme.scss deleted file mode 100644 index beb373af3f..0000000000 --- a/src/app/components/about/about.component.theme.scss +++ /dev/null @@ -1,29 +0,0 @@ -@mixin aca-about-component-theme($theme) { - $foreground: map-get($theme, foreground); - - .app-about { - .main-content { - padding: 10px; - - article { - color: mat-color($foreground, text, 0.54); - padding: 25px 0 25px 0; - - & > header { - line-height: 24px; - font-size: 14px; - font-weight: 800; - letter-spacing: -0.2px; - } - } - - article:first-of-type { - padding-bottom: 0; - } - - article:last-of-type { - margin-bottom: 50px; - } - } - } -} diff --git a/src/app/components/about/about.component.ts b/src/app/components/about/about.component.ts index c6e1720991..9cf1890a5d 100644 --- a/src/app/components/about/about.component.ts +++ b/src/app/components/about/about.component.ts @@ -29,17 +29,17 @@ import { RepositoryInfo } from '@alfresco/js-api'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { AppExtensionService } from '../../extensions/extension.service'; -import { ContentApiService } from '../../services/content-api.service'; -import { version, dependencies } from '../../../../package.json'; +import { ContentApiService } from '@alfresco/aca-shared'; +import { dependencies } from '../../../../package.json'; @Component({ selector: 'app-about', templateUrl: './about.component.html', + styleUrls: ['about.component.scss'], encapsulation: ViewEncapsulation.None, host: { class: 'app-about' } }) export class AboutComponent implements OnInit { repository: RepositoryInfo; - releaseVersion = version; extensions$: Observable; dependencyEntries: Array<{ name: string; version: string }>; statusEntries: Array<{ property: string; value: string }>; diff --git a/src/app/components/about/about.module.ts b/src/app/components/about/about.module.ts index aa2fd1beac..2af7d50871 100644 --- a/src/app/components/about/about.module.ts +++ b/src/app/components/about/about.module.ts @@ -29,7 +29,7 @@ import { AboutComponent } from './about.component'; import { CommonModule } from '@angular/common'; import { CoreModule } from '@alfresco/adf-core'; import { AppLayoutModule } from '../layout/layout.module'; -import { MatTableModule } from '@angular/material'; +import { MatTableModule } from '@angular/material/table'; import { PackageListComponent } from './package-list/package-list.component'; import { ExtensionListComponent } from './extension-list/extension-list.component'; import { StatusListComponent } from './status-list/status-list.component'; diff --git a/src/app/components/common/common.module.ts b/src/app/components/common/common.module.ts index c1a0973e76..17ac4f12f6 100644 --- a/src/app/components/common/common.module.ts +++ b/src/app/components/common/common.module.ts @@ -23,23 +23,28 @@ * along with Alfresco. If not, see . */ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { GenericErrorComponent } from './generic-error/generic-error.component'; import { CoreModule } from '@alfresco/adf-core'; -import { LocationLinkComponent } from './location-link/location-link.component'; -import { MatIconModule } from '@angular/material'; import { ExtensionsModule } from '@alfresco/adf-extensions'; +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { GenericErrorModule } from '@alfresco/aca-shared'; +import { LocationLinkComponent } from './location-link/location-link.component'; +import { ToggleSharedComponent } from './toggle-shared/toggle-shared.component'; @NgModule({ imports: [ CommonModule, CoreModule.forChild(), - MatIconModule, - ExtensionsModule + ExtensionsModule, + GenericErrorModule + ], + declarations: [LocationLinkComponent, ToggleSharedComponent], + exports: [ + ExtensionsModule, + LocationLinkComponent, + GenericErrorModule, + ToggleSharedComponent ], - declarations: [GenericErrorComponent, LocationLinkComponent], - exports: [ExtensionsModule, GenericErrorComponent, LocationLinkComponent], - entryComponents: [LocationLinkComponent] + entryComponents: [LocationLinkComponent, ToggleSharedComponent] }) export class AppCommonModule {} diff --git a/src/app/components/common/generic-error/generic-error.component.html b/src/app/components/common/generic-error/generic-error.component.html deleted file mode 100644 index 8b0419bc1b..0000000000 --- a/src/app/components/common/generic-error/generic-error.component.html +++ /dev/null @@ -1,4 +0,0 @@ -ic_error -

- {{ 'APP.MESSAGES.ERRORS.MISSING_CONTENT' | translate }} -

diff --git a/src/app/components/common/generic-error/generic-error.component.theme.scss b/src/app/components/common/generic-error/generic-error.component.theme.scss deleted file mode 100644 index d921cc072a..0000000000 --- a/src/app/components/common/generic-error/generic-error.component.theme.scss +++ /dev/null @@ -1,27 +0,0 @@ -@mixin aca-generic-error-theme($theme) { - $warn: map-get($theme, warn); - $foreground: map-get($theme, foreground); - - .aca-generic-error { - color: mat-color($foreground, text, 0.54); - - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - width: 100%; - height: 100%; - - &__title { - font-size: 16px; - } - - mat-icon { - color: mat-color($warn); - direction: rtl; - font-size: 52px; - height: 52px; - width: 52px; - } - } -} diff --git a/src/app/components/common/location-link/location-link.component.ts b/src/app/components/common/location-link/location-link.component.ts index 6a0280d99b..147dca68ea 100644 --- a/src/app/components/common/location-link/location-link.component.ts +++ b/src/app/components/common/location-link/location-link.component.ts @@ -35,20 +35,27 @@ import { PathInfo, MinimalNodeEntity } from '@alfresco/js-api'; import { Observable, BehaviorSubject, of } from 'rxjs'; import { Store } from '@ngrx/store'; -import { AppStore } from '../../../store/states/app.state'; -import { NavigateToParentFolder } from '../../../store/actions'; -import { ContentApiService } from '../../../services/content-api.service'; +import { AppStore, NavigateToParentFolder } from '@alfresco/aca-shared/store'; +import { ContentApiService } from '@alfresco/aca-shared'; +import { TranslationService } from '@alfresco/adf-core'; @Component({ selector: 'aca-location-link', template: ` - + {{ displayText | async | translate }} `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, - host: { class: 'aca-location-link adf-location-cell' } + host: { + class: 'aca-location-link adf-location-cell adf-datatable-content-cell' + } }) export class LocationLinkComponent implements OnInit { private _path: PathInfo; @@ -74,7 +81,8 @@ export class LocationLinkComponent implements OnInit { constructor( private store: Store, - private contentApi: ContentApiService + private contentApi: ContentApiService, + private translationService: TranslationService ) {} goToLocation() { @@ -106,7 +114,7 @@ export class LocationLinkComponent implements OnInit { // for admin users if (elements.length === 1 && elements[0] === 'Company Home') { - return of('Personal Files'); + return of('APP.BROWSE.PERSONAL.TITLE'); } // for non-admin users @@ -115,7 +123,7 @@ export class LocationLinkComponent implements OnInit { elements[0] === 'Company Home' && elements[1] === 'User Homes' ) { - return of('Personal Files'); + return of('APP.BROWSE.PERSONAL.TITLE'); } const result = elements[elements.length - 1]; @@ -151,9 +159,15 @@ export class LocationLinkComponent implements OnInit { let result: string = null; const elements = path.elements.map(e => Object.assign({}, e)); + const personalFiles = this.translationService.instant( + 'APP.BROWSE.PERSONAL.TITLE' + ); + const fileLibraries = this.translationService.instant( + 'APP.BROWSE.LIBRARIES.TITLE' + ); if (elements[0].name === 'Company Home') { - elements[0].name = 'Personal Files'; + elements[0].name = personalFiles; if (elements.length > 2) { if (elements[1].name === 'Sites') { @@ -164,14 +178,14 @@ export class LocationLinkComponent implements OnInit { elements[0].name = node.properties['cm:title'] || node.name || fragment.name; elements.splice(1, 1); - elements.unshift({ id: null, name: 'File Libraries' }); + elements.unshift({ id: null, name: fileLibraries }); result = elements.map(e => e.name).join('/'); this.nodeLocation$.next(result); }, () => { elements.splice(0, 2); - elements.unshift({ id: null, name: 'File Libraries' }); + elements.unshift({ id: null, name: fileLibraries }); elements.splice(2, 1); result = elements.map(e => e.name).join('/'); @@ -182,7 +196,7 @@ export class LocationLinkComponent implements OnInit { if (elements[1].name === 'User Homes') { elements.splice(0, 3); - elements.unshift({ id: null, name: 'Personal Files' }); + elements.unshift({ id: null, name: personalFiles }); } } } diff --git a/src/app/components/shared/toggle-shared/toggle-shared.component.html b/src/app/components/common/toggle-shared/toggle-shared.component.html similarity index 87% rename from src/app/components/shared/toggle-shared/toggle-shared.component.html rename to src/app/components/common/toggle-shared/toggle-shared.component.html index 173148a1f0..e21e736eb3 100644 --- a/src/app/components/shared/toggle-shared/toggle-shared.component.html +++ b/src/app/components/common/toggle-shared/toggle-shared.component.html @@ -1,4 +1,4 @@ - + +
+ - - - - - + + + + - - - + + + - - + + - - - - - - + + + + + + - - + + + - - + +
diff --git a/src/app/components/context-menu/context-menu.component.ts b/src/app/components/context-menu/context-menu.component.ts index fa98615ab9..f720468718 100644 --- a/src/app/components/context-menu/context-menu.component.ts +++ b/src/app/components/context-menu/context-menu.component.ts @@ -30,18 +30,19 @@ import { OnDestroy, HostListener, ViewChild, - AfterViewInit + AfterViewInit, + Inject } from '@angular/core'; -import { MatMenuTrigger } from '@angular/material'; - +import { MatMenuTrigger } from '@angular/material/menu'; import { AppExtensionService } from '../../extensions/extension.service'; -import { AppStore } from '../../store/states'; -import { appSelection } from '../../store/selectors/app.selectors'; +import { AppStore, getAppSelection } from '@alfresco/aca-shared/store'; import { Store } from '@ngrx/store'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ContentActionRef } from '@alfresco/adf-extensions'; import { ContextMenuOverlayRef } from './context-menu-overlay'; +import { CONTEXT_MENU_DIRECTION } from './direction.token'; +import { Directionality } from '@angular/cdk/bidi'; @Component({ selector: 'aca-context-menu', @@ -71,7 +72,8 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit { constructor( private contextMenuOverlayRef: ContextMenuOverlayRef, private extensions: AppExtensionService, - private store: Store + private store: Store, + @Inject(CONTEXT_MENU_DIRECTION) public direction: Directionality ) {} onClickOutsideEvent() { @@ -91,7 +93,7 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit { ngOnInit() { this.store - .select(appSelection) + .select(getAppSelection) .pipe(takeUntil(this.onDestroy$)) .subscribe(selection => { if (selection.count) { @@ -104,7 +106,7 @@ export class ContextMenuComponent implements OnInit, OnDestroy, AfterViewInit { setTimeout(() => this.trigger.openMenu(), 0); } - trackById(index: number, obj: { id: string }) { + trackById(_: number, obj: { id: string }) { return obj.id; } } diff --git a/src/app/components/context-menu/context-menu.directive.ts b/src/app/components/context-menu/context-menu.directive.ts index 8c33226d3e..dd1dbafbe8 100644 --- a/src/app/components/context-menu/context-menu.directive.ts +++ b/src/app/components/context-menu/context-menu.directive.ts @@ -100,10 +100,10 @@ export class ContextActionsDirective implements OnInit, OnDestroy { } private getTarget(event: MouseEvent): Element { - return this.findAncestor(event.target, 'adf-datatable-table-cell'); + return this.findAncestor(event.target, 'adf-datatable-cell'); } - private isSelected(target): boolean { + private isSelected(target: Element): boolean { if (!target) { return false; } diff --git a/src/app/components/context-menu/context-menu.directives.spec.ts b/src/app/components/context-menu/context-menu.directives.spec.ts index bea806d9ff..3add678bd0 100644 --- a/src/app/components/context-menu/context-menu.directives.spec.ts +++ b/src/app/components/context-menu/context-menu.directives.spec.ts @@ -46,7 +46,7 @@ describe('ContextActionsDirective', () => { it('should call service to render context menu', fakeAsync(() => { const el = document.createElement('div'); el.className = - 'adf-data-table-cell adf-datatable-table-cell adf-datatable-row'; + 'adf-datatable-cell adf-datatable-cell--text adf-datatable-row'; const fragment = document.createDocumentFragment(); fragment.appendChild(el); diff --git a/src/app/components/context-menu/context-menu.module.ts b/src/app/components/context-menu/context-menu.module.ts index 90b203d424..a6f298bd92 100644 --- a/src/app/components/context-menu/context-menu.module.ts +++ b/src/app/components/context-menu/context-menu.module.ts @@ -23,22 +23,19 @@ * along with Alfresco. If not, see . */ -import { NgModule } from '@angular/core'; -import { - MatMenuModule, - MatListModule, - MatIconModule, - MatButtonModule -} from '@angular/material'; import { CoreModule } from '@alfresco/adf-core'; -import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; - -import { ContextActionsDirective } from './context-menu.directive'; -import { ContextMenuComponent } from './context-menu.component'; import { ExtensionsModule } from '@alfresco/adf-extensions'; -import { OutsideEventDirective } from './context-menu-outside-event.directive'; -import { ContextMenuItemComponent } from './context-menu-item.component'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; import { AppCommonModule } from '../common/common.module'; +import { ContextMenuItemComponent } from './context-menu-item.component'; +import { OutsideEventDirective } from './context-menu-outside-event.directive'; +import { ContextMenuComponent } from './context-menu.component'; +import { ContextActionsDirective } from './context-menu.directive'; @NgModule({ imports: [ diff --git a/src/app/components/context-menu/context-menu.service.spec.ts b/src/app/components/context-menu/context-menu.service.spec.ts index 5ac488db65..a21d19e396 100644 --- a/src/app/components/context-menu/context-menu.service.spec.ts +++ b/src/app/components/context-menu/context-menu.service.spec.ts @@ -31,36 +31,85 @@ import { of } from 'rxjs'; import { CoreModule } from '@alfresco/adf-core'; import { ContextMenuService } from './context-menu.service'; import { ContextMenuModule } from './context-menu.module'; +import { UserPreferencesService } from '@alfresco/adf-core'; describe('ContextMenuService', () => { let contextMenuService; + let overlay; + let injector; + let userPreferencesService; const overlayConfig = { hasBackdrop: false, backdropClass: '', - panelClass: 'test-panel' + panelClass: 'test-panel', + source: { + x: 1, + y: 1 + } }; beforeEach(() => { TestBed.configureTestingModule({ imports: [CoreModule.forRoot(), ContextMenuModule], - providers: [Overlay, { provide: Store, useValue: { select: () => of() } }] + providers: [ + Overlay, + { provide: Store, useValue: { select: () => of() } }, + UserPreferencesService + ] }); - const injector = TestBed.get(Injector); - const overlay = TestBed.get(Overlay); - - contextMenuService = new ContextMenuService(injector, overlay); + injector = TestBed.get(Injector); + overlay = TestBed.get(Overlay); + userPreferencesService = TestBed.get(UserPreferencesService); }); it('should create a custom overlay', () => { + contextMenuService = new ContextMenuService( + injector, + overlay, + userPreferencesService + ); + contextMenuService.open(overlayConfig); expect(document.querySelector('.test-panel')).not.toBe(null); }); it('should render component', () => { + contextMenuService = new ContextMenuService( + injector, + overlay, + userPreferencesService + ); + contextMenuService.open(overlayConfig); expect(document.querySelector('aca-context-menu')).not.toBe(null); }); + + it('should have default LTR direction value', () => { + contextMenuService = new ContextMenuService( + injector, + overlay, + userPreferencesService + ); + + contextMenuService.open(overlayConfig); + + expect(document.body.querySelector('div[dir="ltr"]')).not.toBe(null); + }); + + it('should change direction on textOrientation event', () => { + spyOn(userPreferencesService, 'select').and.returnValue(of('rtl')); + + contextMenuService = new ContextMenuService( + injector, + overlay, + userPreferencesService + ); + + contextMenuService.open(overlayConfig); + + expect(document.body.querySelector('div[dir="rtl"]')).not.toBe(null); + }); }); diff --git a/src/app/components/context-menu/context-menu.service.ts b/src/app/components/context-menu/context-menu.service.ts index 561b5ffff9..4787e43e90 100644 --- a/src/app/components/context-menu/context-menu.service.ts +++ b/src/app/components/context-menu/context-menu.service.ts @@ -1,22 +1,61 @@ -import { Injectable, Injector, ComponentRef, ElementRef } from '@angular/core'; +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { Injectable, Injector, ComponentRef } from '@angular/core'; import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ComponentPortal, PortalInjector } from '@angular/cdk/portal'; import { ContextMenuOverlayRef } from './context-menu-overlay'; import { ContextMenuComponent } from './context-menu.component'; import { ContextmenuOverlayConfig } from './interfaces'; +import { UserPreferencesService } from '@alfresco/adf-core'; +import { Directionality } from '@angular/cdk/bidi'; +import { CONTEXT_MENU_DIRECTION } from './direction.token'; @Injectable({ providedIn: 'root' }) export class ContextMenuService { - constructor(private injector: Injector, private overlay: Overlay) {} + private direction: Directionality; + + constructor( + private injector: Injector, + private overlay: Overlay, + private userPreferenceService: UserPreferencesService + ) { + this.userPreferenceService + .select('textOrientation') + .subscribe(textOrientation => { + this.direction = textOrientation; + }); + } open(config: ContextmenuOverlayConfig) { const overlay = this.createOverlay(config); - const overlayRef = new ContextMenuOverlayRef(overlay); - this.attachDialogContainer(overlay, config, overlayRef); + this.attachDialogContainer(overlay, overlayRef); return overlayRef; } @@ -28,10 +67,9 @@ export class ContextMenuService { private attachDialogContainer( overlay: OverlayRef, - config: ContextmenuOverlayConfig, contextmenuOverlayRef: ContextMenuOverlayRef ) { - const injector = this.createInjector(config, contextmenuOverlayRef); + const injector = this.createInjector(contextmenuOverlayRef); const containerPortal = new ComponentPortal( ContextMenuComponent, @@ -46,62 +84,38 @@ export class ContextMenuService { } private createInjector( - config: ContextmenuOverlayConfig, contextmenuOverlayRef: ContextMenuOverlayRef ): PortalInjector { const injectionTokens = new WeakMap(); injectionTokens.set(ContextMenuOverlayRef, contextmenuOverlayRef); + injectionTokens.set(CONTEXT_MENU_DIRECTION, this.direction); return new PortalInjector(this.injector, injectionTokens); } private getOverlayConfig(config: ContextmenuOverlayConfig): OverlayConfig { - const fakeElement: any = { - getBoundingClientRect: (): ClientRect => ({ - bottom: config.source.clientY, - height: 0, - left: config.source.clientX, - right: config.source.clientX, - top: config.source.clientY, - width: 0 - }) - }; + const { x, y } = config.source; const positionStrategy = this.overlay .position() - .connectedTo( - new ElementRef(fakeElement), - { originX: 'start', originY: 'bottom' }, - { overlayX: 'start', overlayY: 'top' } - ) - .withFallbackPosition( - { originX: 'start', originY: 'top' }, - { overlayX: 'start', overlayY: 'bottom' } - ) - .withFallbackPosition( - { originX: 'end', originY: 'top' }, - { overlayX: 'start', overlayY: 'top' } - ) - .withFallbackPosition( - { originX: 'start', originY: 'top' }, - { overlayX: 'end', overlayY: 'top' } - ) - .withFallbackPosition( - { originX: 'end', originY: 'center' }, - { overlayX: 'start', overlayY: 'center' } - ) - .withFallbackPosition( - { originX: 'start', originY: 'center' }, - { overlayX: 'end', overlayY: 'center' } - ); + .flexibleConnectedTo({ x, y }) + .withPositions([ + { + originX: 'end', + originY: 'bottom', + overlayX: 'end', + overlayY: 'top' + } + ]); const overlayConfig = new OverlayConfig({ hasBackdrop: config.hasBackdrop, backdropClass: config.backdropClass, panelClass: config.panelClass, scrollStrategy: this.overlay.scrollStrategies.close(), - positionStrategy + positionStrategy, + direction: this.direction }); return overlayConfig; diff --git a/src/app/components/context-menu/direction.token.ts b/src/app/components/context-menu/direction.token.ts new file mode 100644 index 0000000000..07eca2e5ce --- /dev/null +++ b/src/app/components/context-menu/direction.token.ts @@ -0,0 +1,34 @@ +/*! + * @license + * Alfresco Example Content Application + * + * Copyright (C) 2005 - 2019 Alfresco Software Limited + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { InjectionToken } from '@angular/core'; + +export const CONTEXT_MENU_DIRECTION = new InjectionToken( + 'CONTEXT_MENU_DIRECTION', + { + providedIn: 'root', + factory: () => 'ltr' + } +); diff --git a/src/app/components/create-menu/create-menu.component.html b/src/app/components/create-menu/create-menu.component.html index bf21d132a9..26515c61ef 100644 --- a/src/app/components/create-menu/create-menu.component.html +++ b/src/app/components/create-menu/create-menu.component.html @@ -16,7 +16,6 @@ - diff --git a/src/app/components/permissions/permission-manager/permission-manager.component.theme.scss b/src/app/components/permissions/permission-manager/permission-manager.component.theme.scss index 9b94eb5590..9f4d43b324 100644 --- a/src/app/components/permissions/permission-manager/permission-manager.component.theme.scss +++ b/src/app/components/permissions/permission-manager/permission-manager.component.theme.scss @@ -12,7 +12,7 @@ flex: 1; .adf-datatable-permission { - .adf-data-table-cell--icon { + .adf-datatable-cell--icon { width: auto; } } diff --git a/src/app/components/permissions/permission-manager/permission-manager.component.ts b/src/app/components/permissions/permission-manager/permission-manager.component.ts index fb05e9a1ae..90586a6cf3 100644 --- a/src/app/components/permissions/permission-manager/permission-manager.component.ts +++ b/src/app/components/permissions/permission-manager/permission-manager.component.ts @@ -23,17 +23,16 @@ * along with Alfresco. If not, see . */ +import { AppStore, SnackbarErrorAction } from '@alfresco/aca-shared/store'; import { NodePermissionDialogService, PermissionListComponent } from '@alfresco/adf-content-services'; +import { MinimalNodeEntryEntity } from '@alfresco/js-api'; import { Component, Input, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material'; +import { MatDialog } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; -import { MinimalNodeEntryEntity } from '@alfresco/js-api'; -import { ContentApiService } from '../../../services/content-api.service'; -import { SnackbarErrorAction } from '../../../store/actions/snackbar.actions'; -import { AppStore } from '../../../store/states/app.state'; +import { ContentApiService } from '@alfresco/aca-shared'; import { NodePermissionsDialogComponent } from '../permission-dialog/node-permissions.dialog'; @Component({ @@ -77,7 +76,7 @@ export class PermissionsManagerComponent implements OnInit { this.permissionList.reload(); } - openAddPermissionDialog(event: Event) { + openAddPermissionDialog() { this.nodePermissionDialogService .updateNodePermissionByDialog(this.nodeId) .subscribe( diff --git a/src/app/components/preview/preview-extension.component.ts b/src/app/components/preview/preview-extension.component.ts deleted file mode 100644 index a2c9b3b882..0000000000 --- a/src/app/components/preview/preview-extension.component.ts +++ /dev/null @@ -1,107 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2019 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { - Component, - Input, - ComponentRef, - OnInit, - ComponentFactoryResolver, - ViewChild, - ViewContainerRef, - OnDestroy, - OnChanges -} from '@angular/core'; -import { AppExtensionService } from '../../extensions/extension.service'; -import { MinimalNodeEntryEntity } from '@alfresco/js-api'; - -@Component({ - selector: 'app-preview-extension', - template: ` -
- ` -}) -export class PreviewExtensionComponent implements OnInit, OnChanges, OnDestroy { - @ViewChild('content', { read: ViewContainerRef }) - content: ViewContainerRef; - - @Input() - id: string; - - @Input() - url: string; - - @Input() - extension: string; - - @Input() - node: MinimalNodeEntryEntity; - - private componentRef: ComponentRef; - - constructor( - private extensions: AppExtensionService, - private componentFactoryResolver: ComponentFactoryResolver - ) {} - - ngOnInit() { - if (!this.id) { - return; - } - - const componentType = this.extensions.getComponentById(this.id); - if (componentType) { - const factory = this.componentFactoryResolver.resolveComponentFactory( - componentType - ); - if (factory) { - this.content.clear(); - this.componentRef = this.content.createComponent(factory, 0); - this.updateInstance(); - } - } - } - - ngOnChanges() { - this.updateInstance(); - } - - ngOnDestroy() { - if (this.componentRef) { - this.componentRef.destroy(); - this.componentRef = null; - } - } - - private updateInstance() { - if (this.componentRef && this.componentRef.instance) { - const instance = this.componentRef.instance; - - instance.node = this.node; - instance.url = this.url; - instance.extension = this.extension; - } - } -} diff --git a/src/app/components/preview/preview.component.html b/src/app/components/preview/preview.component.html index 60684561ec..8430ee1711 100644 --- a/src/app/components/preview/preview.component.html +++ b/src/app/components/preview/preview.component.html @@ -1,10 +1,13 @@ - + @@ -32,20 +34,5 @@ - - - - - - - - -
diff --git a/src/app/components/preview/preview.component.scss b/src/app/components/preview/preview.component.scss index e01c8d3f48..9ed90613c0 100644 --- a/src/app/components/preview/preview.component.scss +++ b/src/app/components/preview/preview.component.scss @@ -21,3 +21,7 @@ .adf-viewer-toolbar .mat-toolbar > button:last-child { display: none; } + +.adf-viewer.right_side--hide .adf-viewer__sidebar__right { + width: 0; +} diff --git a/src/app/components/preview/preview.component.spec.ts b/src/app/components/preview/preview.component.spec.ts index 3812d12056..544eda545c 100644 --- a/src/app/components/preview/preview.component.spec.ts +++ b/src/app/components/preview/preview.component.spec.ts @@ -39,13 +39,15 @@ import { UploadService, AlfrescoApiService } from '@alfresco/adf-core'; +import { ClosePreviewAction } from '@alfresco/aca-shared/store'; import { PreviewComponent } from './preview.component'; import { of, throwError } from 'rxjs'; import { EffectsModule } from '@ngrx/effects'; import { NodeEffects } from '../../store/effects/node.effects'; import { AppTestingModule } from '../../testing/app-testing.module'; -import { ContentApiService } from '../../services/content-api.service'; +import { ContentApiService } from '@alfresco/aca-shared'; import { ContentManagementService } from '../../services/content-management.service'; +import { Store } from '@ngrx/store'; describe('PreviewComponent', () => { let fixture: ComponentFixture; @@ -57,6 +59,7 @@ describe('PreviewComponent', () => { let uploadService: UploadService; let alfrescoApiService: AlfrescoApiService; let contentManagementService: ContentManagementService; + let store: Store; beforeEach(() => { TestBed.configureTestingModule({ @@ -76,6 +79,7 @@ describe('PreviewComponent', () => { uploadService = TestBed.get(UploadService); alfrescoApiService = TestBed.get(AlfrescoApiService); contentManagementService = TestBed.get(ContentManagementService); + store = TestBed.get(Store); }); it('should extract the property path root', () => { @@ -732,4 +736,11 @@ describe('PreviewComponent', () => { expect(alfrescoApiService.nodeUpdated.next).toHaveBeenCalled(); })); + + it('should return to parent folder when event emitted from extension', async(() => { + spyOn(component, 'navigateToFileLocation'); + fixture.detectChanges(); + store.dispatch(new ClosePreviewAction()); + expect(component.navigateToFileLocation).toHaveBeenCalled(); + })); }); diff --git a/src/app/components/preview/preview.component.ts b/src/app/components/preview/preview.component.ts index a3076bc6b0..3a451aa3fd 100644 --- a/src/app/components/preview/preview.component.ts +++ b/src/app/components/preview/preview.component.ts @@ -38,7 +38,7 @@ import { UrlSegment, PRIMARY_OUTLET } from '@angular/router'; -import { debounceTime, takeUntil } from 'rxjs/operators'; +import { debounceTime, map, takeUntil } from 'rxjs/operators'; import { UserPreferencesService, ObjectUtils, @@ -46,16 +46,20 @@ import { AlfrescoApiService } from '@alfresco/adf-core'; import { Store } from '@ngrx/store'; -import { AppStore } from '../../store/states/app.state'; -import { SetSelectedNodesAction } from '../../store/actions'; +import { + AppStore, + ClosePreviewAction, + ViewerActionTypes +} from '@alfresco/aca-shared/store'; +import { SetSelectedNodesAction } from '@alfresco/aca-shared/store'; import { PageComponent } from '../page.component'; -import { ContentApiService } from '../../services/content-api.service'; +import { ContentApiService } from '@alfresco/aca-shared'; import { AppExtensionService } from '../../extensions/extension.service'; import { ContentManagementService } from '../../services/content-management.service'; import { ContentActionRef, ViewerExtensionRef } from '@alfresco/adf-extensions'; import { SearchRequest } from '@alfresco/js-api'; -import { AppDataService } from '../../services/data.service'; import { from } from 'rxjs'; +import { Actions, ofType } from '@ngrx/effects'; @Component({ selector: 'app-preview', @@ -85,14 +89,38 @@ export class PreviewComponent extends PageComponent contentExtensions: Array = []; showRightSide = false; + recentFileFilters = [ + 'TYPE:"content"', + '-PNAME:"0/wiki"', + '-TYPE:"app:filelink"', + '-TYPE:"fm:post"', + '-TYPE:"cm:thumbnail"', + '-TYPE:"cm:failedThumbnail"', + '-TYPE:"cm:rating"', + '-TYPE:"dl:dataList"', + '-TYPE:"dl:todoList"', + '-TYPE:"dl:issue"', + '-TYPE:"dl:contact"', + '-TYPE:"dl:eventAgenda"', + '-TYPE:"dl:event"', + '-TYPE:"dl:task"', + '-TYPE:"dl:simpletask"', + '-TYPE:"dl:meetingAgenda"', + '-TYPE:"dl:location"', + '-TYPE:"fm:topic"', + '-TYPE:"fm:post"', + '-TYPE:"ia:calendarEvent"', + '-TYPE:"lnk:link"' + ]; + constructor( private contentApi: ContentApiService, private preferences: UserPreferencesService, - private appDataService: AppDataService, private route: ActivatedRoute, private router: Router, private apiService: AlfrescoApiService, private uploadService: UploadService, + private actions$: Actions, store: Store, extensions: AppExtensionService, content: ContentManagementService @@ -145,11 +173,17 @@ export class PreviewComponent extends PageComponent this.uploadService.fileUploadComplete .pipe(debounceTime(300)) - .subscribe(file => this.apiService.nodeUpdated.next(file.data.entry)) + .subscribe(file => this.apiService.nodeUpdated.next(file.data.entry)), + + this.actions$ + .pipe( + ofType(ViewerActionTypes.ClosePreview), + map(() => this.navigateToFileLocation(true)) + ) + .subscribe(() => {}) ]); this.openWith = this.extensions.openWithActions; - this.contentExtensions = this.extensions.viewerContentExtensions; } ngOnDestroy() { @@ -371,7 +405,7 @@ export class PreviewComponent extends PageComponent { query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` }, { query: `cm:modifier:${username} OR cm:creator:${username}` }, { - query: this.appDataService.recentFileFilters.join(' AND ') + query: this.recentFileFilters.join(' AND ') } ], fields: ['id', this.getRootField(sortingKey)], diff --git a/src/app/components/preview/preview.module.ts b/src/app/components/preview/preview.module.ts index be00e38b2b..de14caae63 100644 --- a/src/app/components/preview/preview.module.ts +++ b/src/app/components/preview/preview.module.ts @@ -32,7 +32,6 @@ import { CoreExtensionsModule } from '../../extensions/core.extensions.module'; import { DirectivesModule } from '../../directives/directives.module'; import { AppInfoDrawerModule } from '../info-drawer/info.drawer.module'; import { PreviewComponent } from './preview.component'; -import { PreviewExtensionComponent } from './preview-extension.component'; import { AppToolbarModule } from '../toolbar/toolbar.module'; const routes: Routes = [ @@ -57,7 +56,7 @@ const routes: Routes = [ CoreExtensionsModule.forChild(), AppToolbarModule ], - declarations: [PreviewComponent, PreviewExtensionComponent], + declarations: [PreviewComponent], exports: [PreviewComponent] }) export class PreviewModule {} diff --git a/src/app/components/recent-files/recent-files.component.html b/src/app/components/recent-files/recent-files.component.html index 05a224afc3..a075dff881 100644 --- a/src/app/components/recent-files/recent-files.component.html +++ b/src/app/components/recent-files/recent-files.component.html @@ -1,15 +1,15 @@ - - + + - + - + - +
-