From 7d061b2c11ce8c5a43c8ed7203d32bbcd2e961b2 Mon Sep 17 00:00:00 2001
From: Eugenio Romano
Date: Tue, 15 Jan 2019 15:36:01 +0000
Subject: [PATCH] [ADF-1873] Remove all deprecated code from ADF (#4145)
* remove deprecated code part 1
* remove deprecation step 2
* fix spellcheck
* fix
* fix lint
* fix not used import
* remove deprecation
* fix test first part after remove deprecation
* fix test
* fix sidebar demo shell
---
.../file-view/file-view.component.html | 12 +-
.../file-view/file-view.component.ts | 6 +-
.../app/components/login/login.component.html | 1 -
.../process-attachments.component.html | 8 +-
.../process-service.component.html | 6 +-
.../task-attachments.component.html | 2 +-
.../search/search-extended.component.html | 6 -
.../search/search-extended.component.ts | 20 +--
.../document-list.component.md | 35 +++--
.../content-services/document-list.service.md | 5 -
.../file-draggable.directive.md | 1 -
.../search-control.component.md | 1 -
docs/content-services/search.component.md | 3 +-
.../upload-drag-area.component.md | 3 +-
.../version-list.component.md | 1 -
docs/core/context-menu.directive.md | 2 +-
docs/core/form.component.md | 2 +-
docs/core/form.service.md | 3 -
docs/core/host-settings.component.md | 2 -
docs/core/infinite-pagination.component.md | 1 -
docs/core/login.component.md | 2 -
docs/core/node-permission.directive.md | 2 +-
docs/core/node-restore.directive.md | 2 -
docs/core/renditions.service.md | 5 +-
docs/core/start-form.component.md | 2 +-
docs/core/upload.service.md | 2 +-
docs/core/viewer.component.md | 16 +--
.../process-attachment-list.component.md | 2 +-
.../process-list.component.md | 3 +-
.../task-attachment-list.component.md | 2 +-
docs/process-services/task-list.component.md | 1 -
.../documentlist/documentlist.component.html | 2 +-
.../content-node-selector.component.html | 12 +-
.../content-node-selector.component.ts | 48 +------
.../content-node-share.dialog.spec.ts | 6 +-
.../document-list.component.spec.ts | 48 ++-----
.../components/document-list.component.ts | 46 +------
.../data/share-data-row.model.ts | 9 +-
.../data/share-datatable-adapter.spec.ts | 123 +++++++++---------
.../data/share-datatable-adapter.ts | 5 +-
.../services/document-list.service.ts | 14 +-
.../mock/document-list.service.mock.ts | 57 --------
lib/content-services/mock/public-api.ts | 1 -
.../mock/search.component.mock.ts | 2 +-
.../components/search-control.component.html | 3 +-
.../components/search-control.component.ts | 6 +-
.../components/search.component.spec.ts | 64 +--------
.../search/components/search.component.ts | 29 +----
.../components/base-upload/upload-base.ts | 7 -
.../file-uploading-dialog.component.ts | 3 +-
.../upload-drag-area.component.spec.ts | 53 +-------
.../components/upload-drag-area.component.ts | 26 +---
.../directives/file-draggable.directive.ts | 7 -
.../version-manager/version-list.component.ts | 4 -
.../card-view-dateitem.component.ts | 7 +-
.../context-menu-holder.component.ts | 5 +-
.../context-menu/context-menu.directive.ts | 3 +-
lib/core/directives/node-restore.directive.ts | 7 -
lib/core/form/components/form.component.ts | 5 +-
.../widgets/date-time/date-time.widget.ts | 7 +-
.../components/widgets/date/date.widget.ts | 7 +-
.../dynamic-table/editors/date/date.editor.ts | 7 +-
.../editors/datetime/datetime.editor.ts | 7 +-
.../components/widgets/widget.component.ts | 3 -
lib/core/form/services/form.service.spec.ts | 20 ---
lib/core/form/services/form.service.ts | 17 +--
.../login/components/login.component.spec.ts | 15 +--
lib/core/login/components/login.component.ts | 25 +---
lib/core/models/comment-process.model.ts | 41 ------
lib/core/models/public-api.ts | 1 -
.../infinite-pagination.component.html | 1 +
.../infinite-pagination.component.spec.ts | 81 ++++++++----
.../infinite-pagination.component.ts | 14 +-
.../paginated-component.interface.ts | 5 -
lib/core/services/alfresco-api.service.ts | 21 +--
.../services/auth-guard-bpm.service.spec.ts | 8 +-
.../services/auth-guard-ecm.service.spec.ts | 8 +-
.../services/authentication.service.spec.ts | 20 +--
lib/core/services/authentication.service.ts | 4 +-
lib/core/services/content.service.spec.ts | 10 +-
lib/core/services/public-api.ts | 1 -
lib/core/services/renditions.service.ts | 8 --
lib/core/services/settings.service.spec.ts | 38 ------
lib/core/services/settings.service.ts | 82 ------------
lib/core/services/translation.service.ts | 9 +-
lib/core/services/upload.service.ts | 4 +-
lib/core/services/user-preferences.service.ts | 13 +-
lib/core/settings/host-settings.component.ts | 12 --
.../viewer/components/viewer.component.html | 16 +--
.../components/viewer.component.spec.ts | 8 +-
.../viewer/components/viewer.component.ts | 41 ++----
.../analytics-report-list.component.ts | 3 +-
.../analytics-report-parameters.component.ts | 3 +-
.../components/analytics.component.html | 4 +-
.../widgets/date-range/date-range.widget.ts | 7 +-
...diagram-alfresco-publish-task.component.ts | 3 +-
.../diagram-sequence-flow.component.ts | 3 +-
.../diagram.component.flows.spec.ts | 4 +-
.../diagram/components/diagram.component.html | 2 +-
.../components/start-task-cloud.component.ts | 8 +-
lib/process-services/index.ts | 7 -
.../components/process-list.component.spec.ts | 52 --------
.../components/process-list.component.ts | 11 +-
.../process-list/services/process.service.ts | 2 +-
.../components/start-task.component.ts | 6 +-
.../components/task-filters.component.ts | 5 +-
.../components/task-list.component.ts | 8 --
package-lock.json | 12 +-
package.json | 2 +-
109 files changed, 351 insertions(+), 1106 deletions(-)
delete mode 100644 lib/content-services/mock/document-list.service.mock.ts
delete mode 100644 lib/core/models/comment-process.model.ts
delete mode 100644 lib/core/services/settings.service.spec.ts
delete mode 100644 lib/core/services/settings.service.ts
diff --git a/demo-shell/src/app/components/file-view/file-view.component.html b/demo-shell/src/app/components/file-view/file-view.component.html
index 78aeeee989..d4ec8af7ca 100644
--- a/demo-shell/src/app/components/file-view/file-view.component.html
+++ b/demo-shell/src/app/components/file-view/file-view.component.html
@@ -212,8 +212,8 @@
@@ -255,22 +255,20 @@
- My info
-
+ [sidebarRightTemplate]="sidebarRightTemplate">
My custom toolbar
diff --git a/demo-shell/src/app/components/file-view/file-view.component.ts b/demo-shell/src/app/components/file-view/file-view.component.ts
index d544c5811f..06982d7e6e 100644
--- a/demo-shell/src/app/components/file-view/file-view.component.ts
+++ b/demo-shell/src/app/components/file-view/file-view.component.ts
@@ -43,7 +43,7 @@ export class FileViewComponent implements OnInit {
openWith = false;
allowDownload = true;
allowPrint = true;
- allowSidebar = true;
+ allowRightSidebar = true;
allowLeftSidebar = true;
moreActions = true;
customName = false;
@@ -131,8 +131,8 @@ export class FileViewComponent implements OnInit {
this.showLeftSidebar = false;
}
- toggleAllowSidebar() {
- this.allowSidebar = !this.allowSidebar;
+ toggleAllowRightSidebar() {
+ this.allowRightSidebar = !this.allowRightSidebar;
}
toggleAllowLeftSidebar() {
diff --git a/demo-shell/src/app/components/login/login.component.html b/demo-shell/src/app/components/login/login.component.html
index a09f1a51f2..dd3b072cdb 100644
--- a/demo-shell/src/app/components/login/login.component.html
+++ b/demo-shell/src/app/components/login/login.component.html
@@ -81,7 +81,6 @@
[successRoute]="customSuccessRouteURI"
[logoImageUrl]="customLogoImageURL"
[fieldsValidation]="customValidation"
- [disableCsrf]="disableCsrf"
[showLoginActions]="showFooter"
[showRememberMe]="showFooter && showRememberMe"
(executeSubmit)="checkForm($event)"
diff --git a/demo-shell/src/app/components/process-service/process-attachments.component.html b/demo-shell/src/app/components/process-service/process-attachments.component.html
index c1c8d94691..217d2aa51f 100644
--- a/demo-shell/src/app/components/process-service/process-attachments.component.html
+++ b/demo-shell/src/app/components/process-service/process-attachments.component.html
@@ -2,7 +2,7 @@
-
\ No newline at end of file
+
diff --git a/demo-shell/src/app/components/process-service/process-service.component.html b/demo-shell/src/app/components/process-service/process-service.component.html
index b4f9dfecba..d8b78c391c 100644
--- a/demo-shell/src/app/components/process-service/process-service.component.html
+++ b/demo-shell/src/app/components/process-service/process-service.component.html
@@ -42,7 +42,6 @@
[page]="taskPage"
[size]="paginationPageSize"
[selectionMode]="selectionMode"
- [processDefinitionKey]="taskFilter?.filter?.processDefinitionKey"
[name]="taskFilter?.filter?.name"
[assignment]="taskFilter?.filter?.assignment"
[state]="taskFilter?.filter?.state"
@@ -157,7 +156,6 @@
#processList
*ngIf="processFilter?.filter" [appId]="processFilter?.appId"
[selectionMode]="selectionMode"
- [processDefinitionKey]="processFilter?.filter?.processDefinitionKey"
[presetColumn]="presetColumn"
[state]="processFilter?.filter?.state"
[page]="processPage"
@@ -231,12 +229,12 @@
+ [rootFolderId]="taskId">
- {{'APP_LAYOUT.EXTENDED_SEARCH_QUERY_BODY' | translate}}
-
- {{'APP_LAYOUT.SEARCH_SERVICE_APPROACH' | translate}}
-
-
{{'APP_LAYOUT.WORD_TO_SEARCH' | translate}}
@@ -13,7 +8,6 @@
+
+
+
+```
+
+#### Infinite pagination component
+
+```html
+
+
+
+
+```
### Data Sources
@@ -447,7 +460,7 @@ Now you can access Document List properties or call methods directly:
```ts
// print currently displayed folder node object to console
-console.log(documentList.folderNode);
+console.log(documentList.currentFolderId);
```
**Important note**:
@@ -660,7 +673,7 @@ actions you have defined in a context menu:
selector: 'my-view',
template: `
...
-
+
`
})
export class MyView {
diff --git a/docs/content-services/document-list.service.md b/docs/content-services/document-list.service.md
index ff83f2c577..e5a4791cca 100644
--- a/docs/content-services/document-list.service.md
+++ b/docs/content-services/document-list.service.md
@@ -54,11 +54,6 @@ Implements node operations used by the [Document List component](../content-serv
- _nodeId:_ `string` - ID of the target node
- _includeFields:_ `string[]` - Extra information to include (available options are "aspectNames", "isLink" and "association")
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md)`>` - Details of the folder
-- **hasPermission**(node: `any`, permission: [`PermissionsEnum`](../../lib/core/models/permissions.enum.ts)`|string`): `boolean`
- (**Deprecated:** 2.3.0 - use the equivalent in the content service) Checks if a node has the specified permission.
- - _node:_ `any` - Target node
- - _permission:_ [`PermissionsEnum`](../../lib/core/models/permissions.enum.ts)`|string` - Permission level to query
- - **Returns** `boolean` - True if the node has the permission, false otherwise
- **moveNode**(nodeId: `string`, targetParentId: `string`): `any`
Moves a node to destination node.
- _nodeId:_ `string` - The id of the node to be moved
diff --git a/docs/content-services/file-draggable.directive.md b/docs/content-services/file-draggable.directive.md
index 5d16dab3ad..fc91a680af 100644
--- a/docs/content-services/file-draggable.directive.md
+++ b/docs/content-services/file-draggable.directive.md
@@ -47,7 +47,6 @@ Some sample CSS to show the drag and drop area:
| Name | Type | Description |
| ---- | ---- | ----------- |
| filesDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when one or more files are dragged and dropped onto the draggable element. |
-| filesEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** in 2.4.0: use `filesDropped` instead) Emitted when one or more files are dragged and dropped onto the draggable element. |
| folderEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when a directory is dragged and dropped onto the draggable element. |
## Details
diff --git a/docs/content-services/search-control.component.md b/docs/content-services/search-control.component.md
index 95d5867f38..b21a5b4e3d 100644
--- a/docs/content-services/search-control.component.md
+++ b/docs/content-services/search-control.component.md
@@ -43,7 +43,6 @@ You can show your own custom template when no results are found for the search:
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| autocomplete | `boolean` | false | Toggles auto-completion of the search input field. |
-| customQueryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
| expandable | `boolean` | true | Toggles whether to use an expanding search control. If false then a regular input is used. |
| highlight | `boolean` | false | Toggles highlighting of the search term in the results. |
| inputType | `string` | "text" | Type of the input field to render, e.g. "search" or "text" (default). |
diff --git a/docs/content-services/search.component.md b/docs/content-services/search.component.md
index d16cab5be1..e4166dc8bc 100644
--- a/docs/content-services/search.component.md
+++ b/docs/content-services/search.component.md
@@ -38,7 +38,6 @@ Searches items for supplied search terms.
| ---- | ---- | ------------- | ----------- |
| displayWith | `Function \| null` | null | Function that maps an option's value to its display value in the trigger. |
| maxResults | `number` | 20 | Maximum number of results to show in the search. |
-| queryBody | `QueryBody` | | (**Deprecated:** in 2.1.0) |
| searchTerm | `string` | "" | Search term to use when executing the search. Updating this value will run a new search and update the results. |
| skipResults | `number` | 0 | Number of results to skip from the results pagination. |
@@ -153,7 +152,7 @@ By doing this, you can get the results as the user types into the input text.
You can get finer control over the parameters of a search by defining them in a custom
[QueryBody](https://github.com/Alfresco/alfresco-js-api/blob/1.6.0/src/alfresco-search-rest-api/docs/QueryBody.md)
object. The recommended way to do this is with a custom implementation of the
-[Search Configuration interface](../core/search-configuration.interface.md) (the `queryBody` parameter of the [`Search component`](../content-services/search.component.md) is now deprecated). The ADF source provides a standard implementation of this
+. The ADF source provides a standard implementation of this
interface, [`SearchConfigurationService`](../core/search-configuration.service.md) that you can use as a base to adapt to your needs. See the
[Search Configuration interface](../core/search-configuration.interface.md) page for full details of how to
customize your search.
diff --git a/docs/content-services/upload-drag-area.component.md b/docs/content-services/upload-drag-area.component.md
index 374ab12055..f2f108f3d0 100644
--- a/docs/content-services/upload-drag-area.component.md
+++ b/docs/content-services/upload-drag-area.component.md
@@ -68,14 +68,13 @@ as the drag/drop target:
| nodeType | `string` | "cm:content" | Custom node type for uploaded file |
| rootFolderId | `string` | "-root-" | The ID of the root. Use the nodeId for Content Services or the taskId/processId for Process Services. |
| versioning | `boolean` | false | Toggles versioning. |
-| parentId | `void` | | (**Deprecated:** 2.4.0 - use rootFolderId ID of parent folder node) ID of parent folder node |
+
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| beginUpload | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`UploadFilesEvent`](../../lib/content-services/upload/components/upload-files.event.ts)`>` | Emitted when the upload begins. |
-| createFolder | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** 2.4.0 No longer used by the framework) Emitted when a folder is created. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when an error occurs. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the file is uploaded successfully. |
diff --git a/docs/content-services/version-list.component.md b/docs/content-services/version-list.component.md
index 52b8223e65..ce789e965c 100644
--- a/docs/content-services/version-list.component.md
+++ b/docs/content-services/version-list.component.md
@@ -22,7 +22,6 @@ Displays the version history of a node in a [Version Manager component](../conte
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| allowDownload | `boolean` | true | Enable/disable downloading a version of the current node. |
-| id | `string` | | (**Deprecated:** in 2.3.0) |
| node | [`MinimalNodeEntryEntity`](../content-services/document-library.model.md) | | The target node. |
| showActions | `boolean` | true | Toggles showing/hiding of version actions |
| showComments | `boolean` | true | Toggles showing/hiding of comments |
diff --git a/docs/core/context-menu.directive.md b/docs/core/context-menu.directive.md
index 7824322aad..bc02d3c827 100644
--- a/docs/core/context-menu.directive.md
+++ b/docs/core/context-menu.directive.md
@@ -13,7 +13,7 @@ Adds a context menu to a component.
```html
-
+
```
```ts
diff --git a/docs/core/form.component.md b/docs/core/form.component.md
index ce9577a5be..378826c076 100644
--- a/docs/core/form.component.md
+++ b/docs/core/form.component.md
@@ -84,7 +84,7 @@ Any content in the body of `` will be shown when no form definition is
| formError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormFieldModel`](../core/form-field.model.md)`[]>` | Emitted when the supplied form values have a validation error. |
| formLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormModel`](../../lib/core/form/components/widgets/core/form.model.ts)`>` | Emitted when the form is loaded or reloaded. |
| formSaved | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormModel`](../../lib/core/form/components/widgets/core/form.model.ts)`>` | Emitted when the form is submitted with the `Save` or custom outcomes. |
-| onError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** in 2.4.0, will be renamed as "error" in 3.x.x) Emitted when any error occurs. |
+| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when any error occurs. |
## Details
diff --git a/docs/core/form.service.md b/docs/core/form.service.md
index 4569dfeb1e..cf088d3fc7 100644
--- a/docs/core/form.service.md
+++ b/docs/core/form.service.md
@@ -67,9 +67,6 @@ class MyComponent {
Saves a form.
- `formId` - ID of the form to save
- `formModel` - Model data for the form
-- `addFieldsToAForm(formId: string, formModel: FormDefinitionModel):`[`Observable`](http://reactivex.io/documentation/observable.html)``
- - `formId` - ID of the form
- - `formModel` - [`Form`](../../lib/process-services/task-list/models/form.model.ts) definition
- `searchFrom(name: string):`[`Observable`](http://reactivex.io/documentation/observable.html)``
Search for a form by name.
- `name` - The form name to search for
diff --git a/docs/core/host-settings.component.md b/docs/core/host-settings.component.md
index 90fbf6b903..de7906e5bd 100644
--- a/docs/core/host-settings.component.md
+++ b/docs/core/host-settings.component.md
@@ -40,8 +40,6 @@ Validates the URLs for ACS and APS and saves them in the user's local storage
| Name | Type | Description |
| ---- | ---- | ----------- |
-| bpmHostChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** in 2.4.0) Emitted when the bpm host URL is changed. |
| cancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the user cancels the changes. |
-| ecmHostChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** in 2.4.0) Emitted when the ecm host URL is changed. |
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the URL is invalid. |
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the changes are successfully applied. |
diff --git a/docs/core/infinite-pagination.component.md b/docs/core/infinite-pagination.component.md
index 282b1e0e69..aaa8577dd8 100644
--- a/docs/core/infinite-pagination.component.md
+++ b/docs/core/infinite-pagination.component.md
@@ -40,7 +40,6 @@ Adds "infinite" pagination to the component it is used with.
| ---- | ---- | ------------- | ----------- |
| isLoading | `boolean` | false | Is a new page loading? |
| pageSize | `number` | | Number of items that are added with each "load more" event. |
-| pagination | [`PaginationModel`](../../lib/core/models/pagination.model.ts) | | (**Deprecated:** 2.3.0) [Pagination](../../lib/content-services/document-list/models/document-library.model.ts) object. |
| target | [`PaginatedComponent`](../../lib/core/pagination/paginated-component.interface.ts) | | Component that provides custom pagination support. |
### Events
diff --git a/docs/core/login.component.md b/docs/core/login.component.md
index f772023f43..bd0c798f8b 100644
--- a/docs/core/login.component.md
+++ b/docs/core/login.component.md
@@ -78,11 +78,9 @@ with custom input fields handled by your application or parent component:
| ---- | ---- | ------------- | ----------- |
| backgroundImageUrl | `string` | | Path to a custom background image. |
| copyrightText | `string` | | The copyright text below the login box. |
-| disableCsrf | `boolean` | | (**Deprecated:** 3.0.0) Prevents the CSRF Token from being submitted. Only valid for Alfresco Process Services. |
| fieldsValidation | `any` | | Custom validation rules for the login form. |
| logoImageUrl | `string` | | Path to a custom logo image. |
| needHelpLink | `string` | "" | Sets the URL of the NEED HELP link in the footer. |
-| providers | `string` | | (**Deprecated:** 3.0.0 - use the providers property in the the app.config.json) Possible valid values are ECM, BPM or ALL. |
| registerLink | `string` | "" | Sets the URL of the REGISTER link in the footer. |
| showLoginActions | `boolean` | true | Should the extra actions (`Need Help`, `Register`, etc) be shown? |
| showRememberMe | `boolean` | true | Should the `Remember me` checkbox be shown? When selected, this option will remember the logged-in user after the browser is closed to avoid logging in repeatedly. |
diff --git a/docs/core/node-permission.directive.md b/docs/core/node-permission.directive.md
index 147ac984d7..91df62725d 100644
--- a/docs/core/node-permission.directive.md
+++ b/docs/core/node-permission.directive.md
@@ -87,7 +87,7 @@ for example). You can also use it in much the same way as you would with an HTML
```html
diff --git a/docs/core/node-restore.directive.md b/docs/core/node-restore.directive.md
index c3e0544895..c6e388ad7d 100644
--- a/docs/core/node-restore.directive.md
+++ b/docs/core/node-restore.directive.md
@@ -14,7 +14,6 @@ Restores deleted nodes to their original location.
```html
restore
@@ -51,7 +50,6 @@ Restores deleted nodes to their original location.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
-| location | `string` | "" | (**Deprecated:** 2.4.0) Path to restored node. |
| selection | `DeletedNodeEntry[]` | | Array of deleted nodes to restore. |
### Events
diff --git a/docs/core/renditions.service.md b/docs/core/renditions.service.md
index 78505d222c..839af4f23a 100644
--- a/docs/core/renditions.service.md
+++ b/docs/core/renditions.service.md
@@ -1,7 +1,7 @@
---
Title: Renditions service
Added: v2.0.0
-Status: Deprecated
+Status: Active
---
# [Renditions service](../../lib/core/services/renditions.service.ts "Defined in renditions.service.ts")
@@ -27,9 +27,6 @@ Performs a format conversion on an item directly.
## Details
-**Note:** This service is deprecated from v2.2.0 and may be removed in a future
-version of ADF.
-
ACS allows content items to be converted to other formats for display or delivery.
For example, a raw text file might be converted to HTML to enable better formatting
in a web browser or a PDF might be converted to an equivalent bitmap image. A
diff --git a/docs/core/start-form.component.md b/docs/core/start-form.component.md
index 2e68730ea9..37dd9c9ab8 100644
--- a/docs/core/start-form.component.md
+++ b/docs/core/start-form.component.md
@@ -61,7 +61,7 @@ Displays the Start [`Form`](../../lib/process-services/task-list/models/form.mod
| formError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormFieldModel`](../core/form-field.model.md)`[]>` | Emitted when the supplied form values have a validation error. |
| formLoaded | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormModel`](../../lib/core/form/components/widgets/core/form.model.ts)`>` | Emitted when the form is loaded or reloaded. |
| formSaved | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormModel`](../../lib/core/form/components/widgets/core/form.model.ts)`>` | Emitted when the form is submitted with the `Save` or custom outcomes. |
-| onError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | (**Deprecated:** in 2.4.0, will be renamed as "error" in 3.x.x) Emitted when any error occurs. |
+| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when any error occurs. |
| outcomeClick | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the user clicks one of the outcome buttons that completes the form. |
## Details
diff --git a/docs/core/upload.service.md b/docs/core/upload.service.md
index 14d5c9d361..bedcfc4aec 100644
--- a/docs/core/upload.service.md
+++ b/docs/core/upload.service.md
@@ -34,7 +34,7 @@ Provides access to various APIs related to file upload features.
- **Returns** `boolean` - True if a file is uploading, false otherwise
- **uploadFilesInTheQueue**(emitter?: [`EventEmitter`](https://angular.io/api/core/EventEmitter)``)
Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder.
- - _emitter:_ [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` - (Optional) (Deprecated) Emitter to invoke on file status change
+ - _emitter:_ [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` - (Optional) Emitter to invoke on file status change
## Events
diff --git a/docs/core/viewer.component.md b/docs/core/viewer.component.md
index 0c9f527feb..a904877a00 100644
--- a/docs/core/viewer.component.md
+++ b/docs/core/viewer.component.md
@@ -80,10 +80,9 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
| allowFullScreen | `boolean` | true | Toggles the 'Full Screen' feature. |
| allowGoBack | `boolean` | true | Allows `back` navigation |
| allowLeftSidebar | `boolean` | false | Allow the left the sidebar. |
+| allowRightSidebar | `boolean` | false | Allow the right sidebar. |
| allowNavigate | `boolean` | false | Toggles before/next navigation. You can use the arrow buttons to navigate between documents in the collection. |
| allowPrint | `boolean` | false | Toggles printing. |
-| allowShare | `boolean` | false | (**Deprecated:** 2.5.0 - inject the share button directive as custom button) Toggles sharing. |
-| allowSidebar | `boolean` | false | (**Deprecated:** 2.5.0 - will be renamed allowRightSidebar in 3.0.0) Allow the right sidebar. |
| allowThumbnails | `boolean` | true | Toggles PDF thumbnails. |
| blobFile | [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) | | Loads a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) File |
| canNavigateBefore | `boolean` | true | Toggles the "before" ("<") button. Requires `allowNavigate` to be enabled. |
@@ -96,13 +95,12 @@ See the [Custom layout](#custom-layout) section for full details of all availabl
| nodeId | `string` | null | Node Id of the file to load. |
| overlayMode | `boolean` | false | If `true` then show the Viewer as a full page over the current content. Otherwise fit inside the parent div. |
| sharedLinkId | `string` | null | Shared link id (to display shared file). |
-| showLeftSidebar | `boolean` | false | Toggles left sidebar visibility. Requires `allowSidebar` to be set to `true`. |
-| showSidebar | `boolean` | false | (**Deprecated:** 2.5.0 - will be renamed showRightSidebar in 3.0.0) Toggles sidebar visibility. Requires `allowSidebar` to be set to `true`. |
+| showLeftSidebar | `boolean` | false | Toggles left sidebar visibility. Requires `allowLeftSidebar` to be set to `true`. |
+| showRightSidebar | `boolean` | false |Toggles Right sidebar visibility. Requires `allowRightSidebar` to be set to `true`. |
| showToolbar | `boolean` | true | Hide or show the toolbar |
| showViewer | `boolean` | true | Hide or show the viewer |
| sidebarLeftTemplate | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`` | null | The template for the left sidebar. The template context contains the loaded node data. |
-| sidebarPosition | `string` | "right" | (**Deprecated:** 2.5.0 use sidebarTemplateLeft) The position of the sidebar. Can be `left` or `right`. |
-| sidebarTemplate | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`` | null | (**Deprecated:** 2.5.0 renamed as sidebarRight) The template for the sidebar. The template context contains the loaded node data. |
+| sidebarRightTemplate | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`` | null | The template for right sidebar. The template context contains the loaded node data. |
| thumbnailsTemplate | [`TemplateRef`](https://angular.io/api/core/TemplateRef)`` | null | The template for the pdf thumbnails. |
| urlFile | `string` | "" | If you want to load an external file that does not come from ACS you can use this URL to specify where to load the file from. |
| urlFileViewer | `string` | null | Viewer to use with the `urlFile` address (`pdf`, `image`, `media`, `text`). Used when `urlFile` has no filename and extension. |
@@ -362,13 +360,13 @@ The result should look like this:
#### Custom sidebar
The [Viewer component](../core/viewer.component.md) also supports custom sidebar components and layouts.
-Set the `allowSidebar` property to `true` to enable this feature.
+Set the `allowRightSidebar` property to `true` to enable this feature.
The custom sidebar can be injected in two different ways. The first way is to use
transclusion, which will display all content placed inside the `` element:
```html
-
+
My info
@@ -382,7 +380,7 @@ when using the viewer with `nodeId`.
-
+
```
#### Custom thumbnails
diff --git a/docs/process-services/process-attachment-list.component.md b/docs/process-services/process-attachment-list.component.md
index da8814bcaf..eb80134a1f 100644
--- a/docs/process-services/process-attachment-list.component.md
+++ b/docs/process-services/process-attachment-list.component.md
@@ -84,7 +84,7 @@ a custom _no content template_ (using <adf-empty-list>) to invite the user to
```html
-
+
diff --git a/lib/content-services/content-node-selector/content-node-selector.component.html b/lib/content-services/content-node-selector/content-node-selector.component.html
index b6e045b4e3..3ab6e7037a 100644
--- a/lib/content-services/content-node-selector/content-node-selector.component.html
+++ b/lib/content-services/content-node-selector/content-node-selector.component.html
@@ -1,15 +1,15 @@
{{title || data?.title}}
+ data-automation-id="content-node-selector-title">{{data?.title}}
{
it('should open a confirmation dialog when unshare button is triggered', () => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(false) });
- spyOn(sharedLinksApiService, 'deleteSharedLink');
+ spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
node.entry.properties['qshare:sharedId'] = 'sharedId';
component.data = {
@@ -167,7 +167,7 @@ describe('ShareDialogComponent', () => {
it('should unshare file when confirmation dialog returns true', fakeAsync(() => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(true) });
- spyOn(sharedLinksApiService, 'deleteSharedLink');
+ spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
node.entry.properties['qshare:sharedId'] = 'sharedId';
component.data = {
@@ -187,7 +187,7 @@ describe('ShareDialogComponent', () => {
it('should not unshare file when confirmation dialog returns false', fakeAsync(() => {
spyOn(matDialog, 'open').and.returnValue({ beforeClose: () => of(false) });
- spyOn(sharedLinksApiService, 'deleteSharedLink');
+ spyOn(sharedLinksApiService, 'deleteSharedLink').and.callThrough();
node.entry.properties['qshare:sharedId'] = 'sharedId';
component.data = {
diff --git a/lib/content-services/document-list/components/document-list.component.spec.ts b/lib/content-services/document-list/components/document-list.component.spec.ts
index 5a6c55ff39..5adf51e864 100644
--- a/lib/content-services/document-list/components/document-list.component.spec.ts
+++ b/lib/content-services/document-list/components/document-list.component.spec.ts
@@ -72,6 +72,7 @@ describe('DocumentList', () => {
customResourcesService = TestBed.get(CustomResourcesService);
documentList.ngOnInit();
+ documentList.currentFolderId = 'no-node';
spyGetSites = spyOn(apiService.sitesApi, 'getSites').and.returnValue(Promise.resolve(fakeGetSitesAnswer));
spyFavorite = spyOn(apiService.favoritesApi, 'getFavorites').and.returnValue(Promise.resolve({ list: [] }));
@@ -246,20 +247,17 @@ describe('DocumentList', () => {
expect(documentList.dataTable.resetSelection).toHaveBeenCalled();
});
- it('should empty template be present when no element are present', (done) => {
- fixture.detectChanges();
- documentList.folderNode = new NodeMinimal();
- documentList.folderNode.id = '1d26e465-dea3-42f3-b415-faa8364b9692';
-
+ it('should empty template be present when no element are present', () => {
+ spyOn(documentList, 'loadFolderNodesByFolderNodeId').and.returnValue(Promise.resolve(''));
+ spyOn(documentList, 'loadFolder').and.callThrough();
+ spyOn(documentListService, 'getFolderNode').and.returnValue(of({ entry: { id: 'fake-node' } }));
spyOn(documentListService, 'getFolder').and.returnValue(of(fakeNodeAnswerWithNOEntries));
- let disposableReady = documentList.ready.subscribe(() => {
- expect(element.querySelector('#adf-document-list-empty')).toBeDefined();
- disposableReady.unsubscribe();
- done();
- });
+ documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692';
+ fixture.detectChanges();
documentList.reload();
+ expect(element.querySelector('#adf-document-list-empty')).toBeDefined();
});
it('should not execute action without node provided', () => {
@@ -959,10 +957,9 @@ describe('DocumentList', () => {
});
it('should load folder by ID on init', () => {
- documentList.currentFolderId = '1d26e465-dea3-42f3-b415-faa8364b9692';
spyOn(documentList, 'loadFolder').and.returnValue(Promise.resolve());
- documentList.ngOnChanges({ folderNode: new SimpleChange(null, documentList.currentFolderId, true) });
+ documentList.ngOnChanges({ currentFolderId: new SimpleChange(null, '1d26e465-dea3-42f3-b415-faa8364b9692', true) });
expect(documentList.loadFolder).toHaveBeenCalled();
});
@@ -1294,7 +1291,6 @@ describe('DocumentList', () => {
spyOn(documentList, 'reload').and.stub();
documentList.maxItems = 0;
- documentList.skipCount = 0;
documentList.updatePagination({
maxItems: 10,
@@ -1313,32 +1309,6 @@ describe('DocumentList', () => {
expect(documentList.reload).not.toHaveBeenCalled();
});
- it('should NOT reload data on ngOnChanges upon reset of skipCount to 0', () => {
- spyOn(documentList, 'reload').and.stub();
-
- documentList.maxItems = 10;
- documentList.skipCount = 10;
-
- const firstChange = true;
- documentList.ngOnChanges({ skipCount: new SimpleChange(undefined, 0, !firstChange) });
-
- expect(documentList.reload).not.toHaveBeenCalled();
- });
-
- it('should reload data upon changing pagination setting skipCount to 0', () => {
- spyOn(documentList, 'reload').and.stub();
-
- documentList.maxItems = 5;
- documentList.skipCount = 5;
-
- documentList.updatePagination({
- maxItems: 5,
- skipCount: 0
- });
-
- expect(documentList.reload).toHaveBeenCalled();
- });
-
it('should add includeFields in the server request when present', () => {
fixture.detectChanges();
documentList.currentFolderId = 'fake-id';
diff --git a/lib/content-services/document-list/components/document-list.component.ts b/lib/content-services/document-list/components/document-list.component.ts
index c99960a4ed..896874694f 100644
--- a/lib/content-services/document-list/components/document-list.component.ts
+++ b/lib/content-services/document-list/components/document-list.component.ts
@@ -173,13 +173,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
@Input()
currentFolderId: string = null;
- /**
- * Currently displayed folder node
- * @deprecated 2.3.0 - use currentFolderId or node
- */
- @Input()
- folderNode: Node = null;
-
/** The Document list will show all the nodes contained in the NodePaging entity */
@Input()
node: NodePaging = null;
@@ -188,20 +181,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
@Input()
maxItems: number;
- /**
- * Number of elements to skip over for pagination purposes
- * @deprecated 2.3.0 - define it in pagination
- */
- @Input()
- skipCount: number = 0;
-
- /**
- * Set document list to work in infinite scrolling mode
- * @deprecated 2.3.0
- */
- @Input()
- enableInfiniteScrolling: boolean = false;
-
/** Emitted when the user clicks a list node */
@Output()
nodeClick: EventEmitter = new EventEmitter();
@@ -239,6 +218,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
data: ShareDataTableAdapter;
noPermission: boolean = false;
selection = new Array();
+ folderNode: Node = null;
private _pagination: BehaviorSubject;
private layoutPresets = {};
@@ -272,11 +252,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
return null;
}
- /** @deprecated 2.3.0 define it in pagination */
- get supportedPageSizes(): number[] {
- return this.preferences.getDefaultPageSizes();
- }
-
get hasCustomLayout(): boolean {
return this.columnList && this.columnList.columns && this.columnList.columns.length > 0;
}
@@ -296,7 +271,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
get pagination(): BehaviorSubject {
if (!this._pagination) {
- let maxItems = this.maxItems || this.preferences.paginationSize;
+ let maxItems = this.maxItems || this.preferences.paginationSize;
let defaultPagination = {
maxItems: maxItems,
skipCount: 0,
@@ -337,7 +312,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
ngOnInit() {
this.rowMenuCache = {};
this.loadLayoutPresets();
- this.data = new ShareDataTableAdapter(this.documentListService, this.thumbnailService, null, this.getDefaultSorting(), this.sortingMode);
+ this.data = new ShareDataTableAdapter(this.documentListService, this.thumbnailService, this.contentService, null, this.getDefaultSorting(), this.sortingMode);
this.data.thumbnails = this.thumbnails;
this.data.permissionsStyle = this.permissionsStyle;
@@ -375,7 +350,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
if (!this.data) {
- this.data = new ShareDataTableAdapter(this.documentListService, this.thumbnailService, schema, this.getDefaultSorting(), this.sortingMode);
+ this.data = new ShareDataTableAdapter(this.documentListService, this.thumbnailService, this.contentService, schema, this.getDefaultSorting(), this.sortingMode);
} else if (schema && schema.length > 0) {
this.data.setColumns(schema);
}
@@ -404,11 +379,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
}
- if (changes.folderNode && changes.folderNode.currentValue) {
- this.currentFolderId = changes.folderNode.currentValue.id;
- this.resetNewFolderPagination();
- this.loadFolder();
- } else if (changes.currentFolderId &&
+ if (changes.currentFolderId &&
changes.currentFolderId.currentValue &&
changes.currentFolderId.currentValue !== changes.currentFolderId.previousValue) {
this.resetNewFolderPagination();
@@ -600,12 +571,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
this.setupDefaultColumns(this.currentFolderId);
}
- if (this.folderNode) {
- return this.loadFolderNodesByFolderNodeId(this.folderNode.id, this.pagination.getValue())
- .catch((err) => this.handleError(err));
- } else {
- this.loadFolderByNodeId(this.currentFolderId);
- }
+ this.loadFolderByNodeId(this.currentFolderId);
}
loadFolderByNodeId(nodeId: string) {
diff --git a/lib/content-services/document-list/data/share-data-row.model.ts b/lib/content-services/document-list/data/share-data-row.model.ts
index 7193b5e359..dda4bf83d3 100644
--- a/lib/content-services/document-list/data/share-data-row.model.ts
+++ b/lib/content-services/document-list/data/share-data-row.model.ts
@@ -15,10 +15,9 @@
* limitations under the License.
*/
-import { DataRow, ObjectUtils, ThumbnailService } from '@alfresco/adf-core';
+import { DataRow, ObjectUtils, ThumbnailService, ContentService } from '@alfresco/adf-core';
import { MinimalNode, NodeEntry } from '@alfresco/js-api';
import { PermissionStyleModel } from './../models/permissions-style.model';
-import { DocumentListService } from './../services/document-list.service';
export class ShareDataRow implements DataRow {
@@ -34,7 +33,7 @@ export class ShareDataRow implements DataRow {
}
constructor(private obj: NodeEntry,
- private documentListService: DocumentListService,
+ private contentService: ContentService,
private permissionsStyle: PermissionStyleModel[],
private thumbnailService?: ThumbnailService) {
if (!obj) {
@@ -55,7 +54,7 @@ export class ShareDataRow implements DataRow {
if (this.applyPermissionStyleToFolder(nodeEntity.entry, currentPermissionsStyle) || this.applyPermissionStyleToFile(nodeEntity.entry, currentPermissionsStyle)) {
- if (this.documentListService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
+ if (this.contentService.hasPermission(nodeEntity.entry, currentPermissionsStyle.permission)) {
permissionsClasses += ` ${currentPermissionsStyle.css}`;
}
}
@@ -74,7 +73,7 @@ export class ShareDataRow implements DataRow {
}
isFolderAndHasPermissionToUpload(nodeEntry: NodeEntry): boolean {
- return this.isFolder(nodeEntry) && this.documentListService.hasPermission(nodeEntry.entry, 'create');
+ return this.isFolder(nodeEntry) && this.contentService.hasPermission(nodeEntry.entry, 'create');
}
isFolder(nodeEntry: NodeEntry): boolean {
diff --git a/lib/content-services/document-list/data/share-datatable-adapter.spec.ts b/lib/content-services/document-list/data/share-datatable-adapter.spec.ts
index 3c17a55394..601e9fefe6 100644
--- a/lib/content-services/document-list/data/share-datatable-adapter.spec.ts
+++ b/lib/content-services/document-list/data/share-datatable-adapter.spec.ts
@@ -24,21 +24,22 @@ import { ShareDataTableAdapter } from './share-datatable-adapter';
describe('ShareDataTableAdapter', () => {
let documentListService: DocumentListService;
+ let contentService: ContentService;
beforeEach(() => {
let imageUrl: string = 'http://';
- let contentService = new ContentService(null, null, null, null);
+ contentService = new ContentService(null, null, null, null);
documentListService = new DocumentListService(null, contentService, null, null, null);
spyOn(documentListService, 'getDocumentThumbnailUrl').and.returnValue(imageUrl);
});
it('should use client sorting by default', () => {
- const adapter = new ShareDataTableAdapter(documentListService, null, []);
+ const adapter = new ShareDataTableAdapter(documentListService, null, contentService, []);
expect(adapter.sortingMode).toBe('client');
});
it('should not be case sensitive for sorting mode value', () => {
- const adapter = new ShareDataTableAdapter(documentListService, null, []);
+ const adapter = new ShareDataTableAdapter(documentListService, null, contentService, []);
adapter.sortingMode = 'CLIENT';
expect(adapter.sortingMode).toBe('client');
@@ -48,7 +49,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should fallback to client sorting for unknown values', () => {
- const adapter = new ShareDataTableAdapter(documentListService, null, []);
+ const adapter = new ShareDataTableAdapter(documentListService, null, contentService, []);
adapter.sortingMode = 'SeRvEr';
expect(adapter.sortingMode).toBe('server');
@@ -59,27 +60,27 @@ describe('ShareDataTableAdapter', () => {
it('should setup rows and columns with constructor', () => {
let schema = [ {}];
- let adapter = new ShareDataTableAdapter(documentListService, null, schema);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, schema);
expect(adapter.getRows()).toEqual([]);
expect(adapter.getColumns()).toEqual(schema);
});
it('should setup columns when constructor is missing schema', () => {
- const adapter = new ShareDataTableAdapter(documentListService, null, null);
+ const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
expect(adapter.getColumns()).toEqual([]);
});
it('should set new columns', () => {
let columns = [ {}, {}];
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
adapter.setColumns(columns);
expect(adapter.getColumns()).toEqual(columns);
});
it('should reset columns', () => {
let columns = [ {}, {}];
- let adapter = new ShareDataTableAdapter(documentListService, null, columns);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, columns);
expect(adapter.getColumns()).toEqual(columns);
adapter.setColumns(null);
@@ -88,7 +89,7 @@ describe('ShareDataTableAdapter', () => {
it('should set new rows', () => {
let rows = [ {}, {}];
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
expect(adapter.getRows()).toEqual([]);
adapter.setRows(rows);
@@ -97,7 +98,7 @@ describe('ShareDataTableAdapter', () => {
it('should reset rows', () => {
let rows = [ {}, {}];
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
adapter.setRows(rows);
expect(adapter.getRows()).toEqual(rows);
@@ -107,7 +108,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should sort new rows', () => {
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
spyOn(adapter, 'sort').and.callThrough();
let rows = [ {}];
@@ -117,7 +118,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should fail when getting value for missing row', () => {
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let check = () => {
return adapter.getValue(null, {});
};
@@ -125,7 +126,7 @@ describe('ShareDataTableAdapter', () => {
});
it('should fail when getting value for missing column', () => {
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let check = () => {
return adapter.getValue( {}, null);
};
@@ -143,8 +144,8 @@ describe('ShareDataTableAdapter', () => {
type: 'string'
};
- let row = new ShareDataRow(file, documentListService, null);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let row = new ShareDataRow(file, contentService, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let value = adapter.getValue(row, col);
expect(value).toBe(rawValue);
@@ -153,12 +154,12 @@ describe('ShareDataTableAdapter', () => {
it('should generate fallback icon for a file thumbnail with missing mime type', () => {
spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let file = new FileNode();
file.entry.content.mimeType = null;
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -169,12 +170,12 @@ describe('ShareDataTableAdapter', () => {
it('should generate fallback icon for a file with no content entry', () => {
spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let file = new FileNode();
file.entry.content = null;
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -188,8 +189,8 @@ describe('ShareDataTableAdapter', () => {
let file = new FileNode();
file.entry['icon'] = imageUrl;
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
- let row = new ShareDataRow(file, documentListService, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: 'icon' };
let value = adapter.getValue(row, col);
@@ -199,9 +200,9 @@ describe('ShareDataTableAdapter', () => {
it('should resolve folder icon', () => {
spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
- let row = new ShareDataRow(new FolderNode(), documentListService, null);
+ let row = new ShareDataRow(new FolderNode(), contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -212,9 +213,9 @@ describe('ShareDataTableAdapter', () => {
it('should resolve smart folder icon', () => {
spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_smart_folder.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
- let row = new ShareDataRow(new SmartFolderNode(), documentListService, null);
+ let row = new ShareDataRow(new SmartFolderNode(), contentService, null);
let col = { type: 'folder', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -225,9 +226,9 @@ describe('ShareDataTableAdapter', () => {
it('should resolve link folder icon', () => {
spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder_shortcut_link.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
- let row = new ShareDataRow(new LinkFolderNode(), documentListService, null);
+ let row = new ShareDataRow(new LinkFolderNode(), contentService, null);
let col = { type: 'folder', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -238,9 +239,9 @@ describe('ShareDataTableAdapter', () => {
it('should resolve rule folder icon', () => {
spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder_rule.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
- let row = new ShareDataRow(new RuleFolderNode(), documentListService, null);
+ let row = new ShareDataRow(new RuleFolderNode(), contentService, null);
let col = { type: 'folder', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -250,11 +251,11 @@ describe('ShareDataTableAdapter', () => {
it('should resolve file thumbnail', () => {
let imageUrl = 'http://';
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
adapter.thumbnails = true;
let file = new FileNode();
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -265,14 +266,14 @@ describe('ShareDataTableAdapter', () => {
it('should resolve fallback file icon for unknown node', () => {
spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let file = new FileNode();
file.entry.isFile = false;
file.entry.isFolder = false;
file.entry.content = null;
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -282,14 +283,14 @@ describe('ShareDataTableAdapter', () => {
it('should resolve file icon for content type', () => {
spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_raster_image.svg`);
- let adapter = new ShareDataTableAdapter(documentListService, null, null);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null);
let file = new FileNode();
file.entry.isFile = false;
file.entry.isFolder = false;
file.entry.content.mimeType = 'image/png';
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
let col = { type: 'image', key: '$thumbnail' };
let value = adapter.getValue(row, col);
@@ -303,13 +304,13 @@ describe('ShareDataTableAdapter', () => {
let folder = new FolderNode();
let col = { key: 'name' };
- let adapter = new ShareDataTableAdapter(documentListService, null, [col]);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]);
adapter.setSorting(new DataSorting('name', 'asc'));
adapter.setRows([
- new ShareDataRow(file2, documentListService, null),
- new ShareDataRow(file1, documentListService, null),
- new ShareDataRow(folder, documentListService, null)
+ new ShareDataRow(file2, contentService, null),
+ new ShareDataRow(file1, contentService, null),
+ new ShareDataRow(folder, contentService, null)
]);
let sorted = adapter.getRows();
@@ -326,11 +327,11 @@ describe('ShareDataTableAdapter', () => {
file2.entry['dateProp'] = new Date(2016, 6, 30, 13, 14, 2);
let col = { key: 'dateProp' };
- let adapter = new ShareDataTableAdapter(documentListService, null, [col]);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]);
adapter.setRows([
- new ShareDataRow(file2, documentListService, null),
- new ShareDataRow(file1, documentListService, null)
+ new ShareDataRow(file2, contentService, null),
+ new ShareDataRow(file1, contentService, null)
]);
adapter.sort('dateProp', 'asc');
@@ -356,13 +357,13 @@ describe('ShareDataTableAdapter', () => {
file4.entry.content.sizeInBytes = 2852791665; // 2.66 GB
let col = { key: 'content.sizeInBytes' };
- let adapter = new ShareDataTableAdapter(documentListService, null, [col]);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]);
adapter.setRows([
- new ShareDataRow(file3, documentListService, null),
- new ShareDataRow(file4, documentListService, null),
- new ShareDataRow(file1, documentListService, null),
- new ShareDataRow(file2, documentListService, null)
+ new ShareDataRow(file3, contentService, null),
+ new ShareDataRow(file4, contentService, null),
+ new ShareDataRow(file1, contentService, null),
+ new ShareDataRow(file2, contentService, null)
]);
adapter.sort('content.sizeInBytes', 'asc');
@@ -389,15 +390,15 @@ describe('ShareDataTableAdapter', () => {
let file6 = new FileNode('b');
let col = { key: 'name' };
- let adapter = new ShareDataTableAdapter(documentListService, null, [col]);
+ let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]);
adapter.setRows([
- new ShareDataRow(file4, documentListService, null),
- new ShareDataRow(file6, documentListService, null),
- new ShareDataRow(file3, documentListService, null),
- new ShareDataRow(file1, documentListService, null),
- new ShareDataRow(file2, documentListService, null),
- new ShareDataRow(file5, documentListService, null)
+ new ShareDataRow(file4, contentService, null),
+ new ShareDataRow(file6, contentService, null),
+ new ShareDataRow(file3, contentService, null),
+ new ShareDataRow(file1, contentService, null),
+ new ShareDataRow(file2, contentService, null),
+ new ShareDataRow(file5, contentService, null)
]);
adapter.sort('name', 'asc');
@@ -423,25 +424,25 @@ describe('ShareDataTableAdapter', () => {
it('should wrap node', () => {
let file = new FileNode();
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.node).toBe(file);
});
it('should require object source', () => {
expect(() => {
- return new ShareDataRow(null, documentListService, null);
+ return new ShareDataRow(null, contentService, null);
}).toThrowError(ShareDataRow.ERR_OBJECT_NOT_FOUND);
});
it('should resolve value from node entry', () => {
let file = new FileNode('test');
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.getValue('name')).toBe('test');
});
it('should check value', () => {
let file = new FileNode('test');
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.hasValue('name')).toBeTruthy();
expect(row.hasValue('missing')).toBeFalsy();
@@ -450,21 +451,21 @@ describe('ShareDataTableAdapter', () => {
it('should be set as drop target when user has permission for that node', () => {
let file = new FolderNode('test');
file.entry['allowableOperations'] = ['create'];
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.isDropTarget).toBeTruthy();
});
it('should not be set as drop target when user has permission for that node', () => {
let file = new FolderNode('test');
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.isDropTarget).toBeFalsy();
});
it('should not be set as drop target when element is not a Folder', () => {
let file = new FileNode('test');
- let row = new ShareDataRow(file, documentListService, null);
+ let row = new ShareDataRow(file, contentService, null);
expect(row.isDropTarget).toBeFalsy();
});
diff --git a/lib/content-services/document-list/data/share-datatable-adapter.ts b/lib/content-services/document-list/data/share-datatable-adapter.ts
index e94909493c..9e3a8412e0 100644
--- a/lib/content-services/document-list/data/share-datatable-adapter.ts
+++ b/lib/content-services/document-list/data/share-datatable-adapter.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { DataColumn, DataRow, DataSorting, DataTableAdapter, ThumbnailService } from '@alfresco/adf-core';
+import { DataColumn, DataRow, DataSorting, DataTableAdapter, ThumbnailService, ContentService } from '@alfresco/adf-core';
import { NodePaging } from '@alfresco/js-api';
import { PermissionStyleModel } from './../models/permissions-style.model';
import { DocumentListService } from './../services/document-list.service';
@@ -52,6 +52,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
constructor(private documentListService: DocumentListService,
private thumbnailService: ThumbnailService,
+ private contentService: ContentService,
schema: DataColumn[] = [],
sorting?: DataSorting,
sortingMode: string = 'client') {
@@ -241,7 +242,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
if (page && page.list) {
let data = page.list.entries;
if (data && data.length > 0) {
- rows = data.map((item) => new ShareDataRow(item, this.documentListService, this.permissionsStyle, this.thumbnailService));
+ rows = data.map((item) => new ShareDataRow(item, this.contentService, this.permissionsStyle, this.thumbnailService));
if (this.filter) {
rows = rows.filter(this.filter);
diff --git a/lib/content-services/document-list/services/document-list.service.ts b/lib/content-services/document-list/services/document-list.service.ts
index 51406ec5a9..eaacb8c6a3 100644
--- a/lib/content-services/document-list/services/document-list.service.ts
+++ b/lib/content-services/document-list/services/document-list.service.ts
@@ -16,8 +16,7 @@
*/
import {
- AlfrescoApiService, AuthenticationService, ContentService, LogService,
- PermissionsEnum, ThumbnailService
+ AlfrescoApiService, AuthenticationService, ContentService, LogService, ThumbnailService
} from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
@@ -179,17 +178,6 @@ export class DocumentListService {
return this.thumbnailService.getDefaultMimeTypeIcon();
}
- /**
- * Checks if a node has the specified permission.
- * @deprecated 2.3.0 - use the equivalent in the content service
- * @param node Target node
- * @param permission Permission level to query
- * @returns True if the node has the permission, false otherwise
- */
- hasPermission(node: any, permission: PermissionsEnum | string): boolean {
- return this.contentService.hasPermission(node, permission);
- }
-
private handleError(error: any) {
this.logService.error(error);
return throwError(error || 'Server error');
diff --git a/lib/content-services/mock/document-list.service.mock.ts b/lib/content-services/mock/document-list.service.mock.ts
deleted file mode 100644
index d0344427c3..0000000000
--- a/lib/content-services/mock/document-list.service.mock.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-/*!
- * @license
- * Copyright 2016 Alfresco Software, Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import {
- AlfrescoApiService, AuthenticationService, ContentService,
- SettingsService, LogService, ThumbnailService
-} from '@alfresco/adf-core';
-import { Observable, throwError } from 'rxjs';
-import { NodePaging, DocumentListService } from '../document-list';
-import { PageNode } from './document-library.model.mock';
-
-export class DocumentListServiceMock extends DocumentListService {
-
- getFolderResult: NodePaging = new PageNode();
- getFolderReject: boolean = false;
- getFolderRejectError: string = 'Error';
-
- constructor(settings?: SettingsService,
- authService?: AuthenticationService,
- contentService?: ContentService,
- apiService?: AlfrescoApiService,
- logService?: LogService,
- thumbnailService?: ThumbnailService) {
- super(authService, contentService, apiService, logService, thumbnailService);
- }
-
- getFolder(folder: string) {
- if (this.getFolderReject) {
- return throwError(this.getFolderRejectError);
- }
- return new Observable((observer) => {
- observer.next(this.getFolderResult);
- observer.complete();
- });
- }
-
- deleteNode(nodeId: string) {
- return new Observable((observer) => {
- observer.next();
- observer.complete();
- });
- }
-}
diff --git a/lib/content-services/mock/public-api.ts b/lib/content-services/mock/public-api.ts
index c84c947e57..f6ab897273 100644
--- a/lib/content-services/mock/public-api.ts
+++ b/lib/content-services/mock/public-api.ts
@@ -17,6 +17,5 @@
export * from './document-library.model.mock';
export * from './document-list.component.mock';
-export * from './document-list.service.mock';
export * from './search.component.mock';
export * from './search.service.mock';
diff --git a/lib/content-services/mock/search.component.mock.ts b/lib/content-services/mock/search.component.mock.ts
index bd303b017f..766b834f99 100644
--- a/lib/content-services/mock/search.component.mock.ts
+++ b/lib/content-services/mock/search.component.mock.ts
@@ -118,7 +118,7 @@ export let errorJson = {
@Component({
template: `
-
diff --git a/lib/content-services/search/components/search-control.component.html b/lib/content-services/search/components/search-control.component.html
index 3c84080c52..6ff83bab2f 100644
--- a/lib/content-services/search/components/search-control.component.html
+++ b/lib/content-services/search/components/search-control.component.html
@@ -32,8 +32,7 @@
+ [maxResults]="liveSearchMaxResults">
{
- if (searchNode && searchNode.query.query === 'FAKE_SEARCH_EXMPL') {
- return of(differentResult);
- }
- if (searchNode && searchNode.filterQueries.length === 1 &&
- searchNode.filterQueries[0].query === "TYPE:'cm:folder'") {
- return of(folderResult);
- }
- return of(result);
-}
-
describe('SearchComponent', () => {
let fixture: ComponentFixture, element: HTMLElement;
@@ -131,30 +119,6 @@ describe('SearchComponent', () => {
describe('search node', () => {
- it('should perform a search based on the query node given', (done) => {
- spyOn(searchService, 'searchByQueryBody')
- .and.callFake((searchObj) => fakeNodeResultSearch(searchObj));
- let fakeSearchNode: QueryBody = {
- query: {
- query: 'TEST-FAKE-NODE'
- },
- filterQueries: [
- { 'query': "TYPE:'cm:folder'" }
- ]
- };
- component.setSearchWordTo('searchTerm');
- component.setSearchNodeTo(fakeSearchNode);
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- let optionShowed = element.querySelectorAll('#autocomplete-search-result-list > li').length;
- expect(optionShowed).toBe(1);
- let folderOption: HTMLElement = element.querySelector('#result_option_0');
- expect(folderOption.textContent.trim()).toBe('MyFolder');
- done();
- });
- });
-
it('should perform a search with a defaultNode if no search node is given', (done) => {
spyOn(searchService, 'search').and.returnValue(of(result));
component.setSearchWordTo('searchTerm');
@@ -168,29 +132,5 @@ describe('SearchComponent', () => {
done();
});
});
-
- it('should perform a search with the searchNode given', (done) => {
- spyOn(searchService, 'searchByQueryBody')
- .and.callFake((searchObj) => fakeNodeResultSearch(searchObj));
- let fakeSearchNode: QueryBody = {
- query: {
- query: 'FAKE_SEARCH_EXMPL'
- },
- filterQueries: [
- { 'query': "TYPE:'cm:folder'" }
- ]
- };
- component.setSearchWordTo('searchTerm');
- component.setSearchNodeTo(fakeSearchNode);
- fixture.detectChanges();
- fixture.whenStable().then(() => {
- fixture.detectChanges();
- let optionShowed = element.querySelectorAll('#autocomplete-search-result-list > li').length;
- expect(optionShowed).toBe(1);
- let folderOption: HTMLElement = element.querySelector('#result_option_0');
- expect(folderOption.textContent.trim()).toBe('TEST_DOC');
- done();
- });
- });
});
});
diff --git a/lib/content-services/search/components/search.component.ts b/lib/content-services/search/components/search.component.ts
index 38a143b821..ca33d5cacd 100644
--- a/lib/content-services/search/components/search.component.ts
+++ b/lib/content-services/search/components/search.component.ts
@@ -29,7 +29,7 @@ import {
ViewChild,
ViewEncapsulation
} from '@angular/core';
-import { NodePaging, QueryBody } from '@alfresco/js-api';
+import { NodePaging } from '@alfresco/js-api';
import { Subject } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
@@ -64,10 +64,6 @@ export class SearchComponent implements AfterContentInit, OnChanges {
@Input()
skipResults: number = 0;
- /** @deprecated in 2.1.0 */
- @Input()
- queryBody: QueryBody;
-
/** Search term to use when executing the search. Updating this value will
* run a new search and update the results.
*/
@@ -129,10 +125,6 @@ export class SearchComponent implements AfterContentInit, OnChanges {
}
ngOnChanges(changes) {
- if (changes.queryBody &&
- this.hasDifferentQueryBody(changes.queryBody.previousValue, changes.queryBody.currentValue)) {
- this.loadSearchResults();
- }
if (changes.searchTerm && changes.searchTerm.currentValue) {
this.loadSearchResults(changes.searchTerm.currentValue);
}
@@ -147,10 +139,6 @@ export class SearchComponent implements AfterContentInit, OnChanges {
this.loadSearchResults(this.searchTerm);
}
- private hasDifferentQueryBody(previousQueryBody: QueryBody, currentQueryBody: QueryBody) {
- return JSON.stringify(previousQueryBody) !== JSON.stringify(currentQueryBody);
- }
-
private cleanResults() {
if (this.results) {
this.results = {};
@@ -160,17 +148,10 @@ export class SearchComponent implements AfterContentInit, OnChanges {
private loadSearchResults(searchTerm?: string) {
this.resetResults();
if (searchTerm) {
- if (this.queryBody) {
- this.searchService.searchByQueryBody(this.queryBody).subscribe(
- (result) => this.onSearchDataLoaded(result),
- (err) => this.onSearchDataError(err)
- );
- } else {
- this.searchService.search(searchTerm, this.maxResults, this.skipResults).subscribe(
- (result) => this.onSearchDataLoaded(result),
- (err) => this.onSearchDataError(err)
- );
- }
+ this.searchService.search(searchTerm, this.maxResults, this.skipResults).subscribe(
+ (result) => this.onSearchDataLoaded(result),
+ (err) => this.onSearchDataError(err)
+ );
} else {
this.cleanResults();
}
diff --git a/lib/content-services/upload/components/base-upload/upload-base.ts b/lib/content-services/upload/components/base-upload/upload-base.ts
index 477e95a85e..4225c046dd 100644
--- a/lib/content-services/upload/components/base-upload/upload-base.ts
+++ b/lib/content-services/upload/components/base-upload/upload-base.ts
@@ -63,13 +63,6 @@ export abstract class UploadBase implements OnInit, OnDestroy {
@Output()
success = new EventEmitter();
- /**
- * Emitted when a folder is created.
- * @deprecated 2.4.0 No longer used by the framework
- */
- @Output()
- createFolder = new EventEmitter();
-
/** Emitted when an error occurs. */
@Output()
error = new EventEmitter();
diff --git a/lib/content-services/upload/components/file-uploading-dialog.component.ts b/lib/content-services/upload/components/file-uploading-dialog.component.ts
index ca7720bfdc..a84e6e29d3 100644
--- a/lib/content-services/upload/components/file-uploading-dialog.component.ts
+++ b/lib/content-services/upload/components/file-uploading-dialog.component.ts
@@ -23,9 +23,8 @@ import { ChangeDetectorRef, Component, Input, Output, EventEmitter, OnDestroy, O
import { Subscription, merge } from 'rxjs';
import { FileUploadingListComponent } from './file-uploading-list.component';
-// @deprecated file-uploading-dialog TODO remove in 3.0.0
@Component({
- selector: 'adf-file-uploading-dialog, file-uploading-dialog',
+ selector: 'adf-file-uploading-dialog',
templateUrl: './file-uploading-dialog.component.html',
styleUrls: ['./file-uploading-dialog.component.scss']
})
diff --git a/lib/content-services/upload/components/upload-drag-area.component.spec.ts b/lib/content-services/upload/components/upload-drag-area.component.spec.ts
index 32808af6d2..a5cfd068c9 100644
--- a/lib/content-services/upload/components/upload-drag-area.component.spec.ts
+++ b/lib/content-services/upload/components/upload-drag-area.component.spec.ts
@@ -151,18 +151,7 @@ describe('UploadDragAreaComponent', () => {
spyOn(uploadService, 'uploadFilesInTheQueue');
fixture.detectChanges();
- let itemEntity = {
- fullPath: '/folder-fake/file-fake.png',
- isDirectory: false,
- isFile: true,
- relativeFolder: '/',
- name: 'file-fake.png',
- file: (callbackFile) => {
- let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
- callbackFile(fileFake);
- }
- };
- component.onFilesEntityDropped(itemEntity);
+ component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
expect(uploadService.addToQueue).not.toHaveBeenCalled();
expect(uploadService.uploadFilesInTheQueue).not.toHaveBeenCalled();
@@ -270,19 +259,9 @@ describe('UploadDragAreaComponent', () => {
component.success = null;
component.acceptedFilesType = '.png';
fixture.detectChanges();
- let itemEntity = {
- fullPath: '/folder-fake/file-fake.png',
- isDirectory: false,
- isFile: true,
- name: 'file-fake.png',
- relativeFolder: '/',
- file: (callbackFile) => {
- let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
- callbackFile(fileFake);
- }
- };
+
fixture.whenStable().then(() => {
- component.onFilesEntityDropped(itemEntity);
+ component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
expect(uploadService.uploadFilesInTheQueue).toHaveBeenCalledWith(null);
});
}));
@@ -293,19 +272,8 @@ describe('UploadDragAreaComponent', () => {
fixture.detectChanges();
spyOn(uploadService, 'uploadFilesInTheQueue');
- let itemEntity = {
- fullPath: '/folder-fake/file-fake.png',
- isDirectory: false,
- isFile: true,
- relativeFolder: '/',
- name: 'file-fake.png',
- file: (callbackFile) => {
- let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
- callbackFile(fileFake);
- }
- };
fixture.whenStable().then(() => {
- component.onFilesEntityDropped(itemEntity);
+ component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
expect(uploadService.uploadFilesInTheQueue).not.toHaveBeenCalledWith(null);
});
}));
@@ -315,18 +283,7 @@ describe('UploadDragAreaComponent', () => {
fixture.detectChanges();
spyOn(uploadService, 'uploadFilesInTheQueue');
- let itemEntity = {
- fullPath: '/folder-fake/file-fake.png',
- isDirectory: false,
- isFile: true,
- name: 'file-fake.png',
- relativeFolder: '/',
- file: (callbackFile) => {
- let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' });
- callbackFile(fileFake);
- }
- };
- component.onFilesEntityDropped(itemEntity);
+ component.onFilesDropped([new File(['fakefake'], 'file-fake.png', { type: 'image/png' })]);
expect(uploadService.uploadFilesInTheQueue).toHaveBeenCalledWith(null);
}));
diff --git a/lib/content-services/upload/components/upload-drag-area.component.ts b/lib/content-services/upload/components/upload-drag-area.component.ts
index 67039876c6..132d471059 100644
--- a/lib/content-services/upload/components/upload-drag-area.component.ts
+++ b/lib/content-services/upload/components/upload-drag-area.component.ts
@@ -19,7 +19,7 @@ import {
EXTENDIBLE_COMPONENT, FileInfo, FileModel, FileUtils, NodePermissionSubject,
NotificationService, TranslationService, UploadService, ContentService, PermissionsEnum
} from '@alfresco/adf-core';
-import { Component, forwardRef, Input, ViewEncapsulation, NgZone } from '@angular/core';
+import { Component, forwardRef, ViewEncapsulation, NgZone } from '@angular/core';
import { UploadBase } from './base-upload/upload-base';
@Component({
@@ -34,15 +34,6 @@ import { UploadBase } from './base-upload/upload-base';
})
export class UploadDragAreaComponent extends UploadBase implements NodePermissionSubject {
- /**
- * ID of parent folder node
- * @deprecated 2.4.0 - use rootFolderId ID of parent folder node
- */
- @Input()
- set parentId(nodeId: string) {
- this.rootFolderId = nodeId;
- }
-
constructor(protected uploadService: UploadService,
protected translationService: TranslationService,
private notificationService: NotificationService,
@@ -62,21 +53,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodePermissio
}
}
- /**
- * Called when the file are dropped in the drag area.
- * @deprecated in 2.4.0: use `onFilesDropped` instead
- * @param item - FileEntity
- */
- onFilesEntityDropped(item: any): void {
- if (!this.disabled) {
- item.file((file: File) => {
- // const fileModel = this.createFileModel(file, this.rootFolderId, item.fullPath.replace(item.name, ''));
-
- this.uploadFiles([file]);
- });
- }
- }
-
/**
* Called when a folder are dropped in the drag area
*
diff --git a/lib/content-services/upload/directives/file-draggable.directive.ts b/lib/content-services/upload/directives/file-draggable.directive.ts
index 6f76dc2faa..624114bd6f 100644
--- a/lib/content-services/upload/directives/file-draggable.directive.ts
+++ b/lib/content-services/upload/directives/file-draggable.directive.ts
@@ -35,13 +35,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy {
@Output()
filesDropped: EventEmitter = new EventEmitter();
- /**
- * Emitted when one or more files are dragged and dropped onto the draggable element.
- * @deprecated in 2.4.0: use `filesDropped` instead
- */
- @Output()
- filesEntityDropped: EventEmitter = new EventEmitter();
-
/** Emitted when a directory is dragged and dropped onto the draggable element. */
@Output()
folderEntityDropped: EventEmitter = new EventEmitter();
diff --git a/lib/content-services/version-manager/version-list.component.ts b/lib/content-services/version-manager/version-list.component.ts
index 887bfa12b4..6d422a06ca 100644
--- a/lib/content-services/version-manager/version-list.component.ts
+++ b/lib/content-services/version-manager/version-list.component.ts
@@ -36,10 +36,6 @@ export class VersionListComponent implements OnChanges {
versions: VersionEntry[] = [];
isLoading = true;
- /** @deprecated in 2.3.0 */
- @Input()
- id: string;
-
/** The target node. */
@Input()
node: Node;
diff --git a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
index 4c251a886b..69dc60a9ce 100644
--- a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
+++ b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts
@@ -23,7 +23,7 @@ import moment from 'moment-es6';
import { Moment } from 'moment';
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
import { CardViewUpdateService } from '../../services/card-view-update.service';
-import { UserPreferencesService } from '../../../services/user-preferences.service';
+import { UserPreferencesService, UserPreferenceValues } from '../../../services/user-preferences.service';
import { MomentDateAdapter } from '../../../utils/momentDateAdapter';
import { MOMENT_DATE_FORMATS } from '../../../utils/moment-date-formats.model';
@@ -58,13 +58,14 @@ export class CardViewDateItemComponent implements OnInit {
constructor(private cardViewUpdateService: CardViewUpdateService,
private dateAdapter: DateAdapter,
- private preferences: UserPreferencesService) {
+ private userPreferencesService: UserPreferencesService) {
}
ngOnInit() {
- this.preferences.locale$.subscribe((locale) => {
+ this.userPreferencesService.select(UserPreferenceValues.Locale).subscribe((locale) => {
this.dateAdapter.setLocale(locale);
});
+
( this.dateAdapter).overrideDisplayFormat = this.SHOW_FORMAT;
if (this.property.value) {
diff --git a/lib/core/context-menu/context-menu-holder.component.ts b/lib/core/context-menu/context-menu-holder.component.ts
index c8fc2e759a..d319784ba7 100644
--- a/lib/core/context-menu/context-menu-holder.component.ts
+++ b/lib/core/context-menu/context-menu-holder.component.ts
@@ -22,11 +22,8 @@ import { MatMenuTrigger } from '@angular/material';
import { Subscription } from 'rxjs';
import { ContextMenuService } from './context-menu.service';
-/**
- * @deprecated: context-menu-holder is deprecated, use adf-context-menu-holder instead.
- */
@Component({
- selector: 'adf-context-menu-holder, context-menu-holder',
+ selector: 'adf-context-menu-holder',
template: `