[AAE-20109] Move alfresco js-API and alfrescoapi service out from the core (#9317)

* AAE-20109 Remove alfrescoapiservice from core

* fix after rebase

* [AAe-12502] Post-rebase fix

* [AAE-12502] Add unit test fix

---------

Co-authored-by: Bartosz Sekula <Bartosz.Sekula@hyland.com>
Co-authored-by: MichalKinas <michal.kinas@hyland.com>
This commit is contained in:
Eugenio Romano
2024-09-06 18:43:33 +02:00
committed by GitHub
parent b60797e3b1
commit e617333f00
167 changed files with 1430 additions and 589 deletions

View File

@@ -194,7 +194,7 @@ A collection of Angular components for generic use.
| Name | Description | Source link |
| ---- | ----------- | -------- |
| [APS Alfresco Content Service](core/services/activiti-alfresco.service.md) | Gets Alfresco Repository folder content based on a Repository account configured in Alfresco Process Services (APS). | [Source](../lib/process-services/src/lib/form/services/activiti-alfresco.service.ts) |
| [Alfresco Api Service](core/services/alfresco-api.service.md) | Provides access to an initialized AlfrescoJSApi instance. | [Source](../lib/core/src/lib/services/alfresco-api.service.ts) |
| [Alfresco Api Service](core/services/alfresco-api.service.md) | Provides access to an initialized AlfrescoJSApi instance. | [Source](lib/content-services/src/lib/services/alfresco-api.service.ts) |
| [App Config service](core/services/app-config.service.md) | Supports app configuration settings, stored server side. | [Source](../lib/core/src/lib/app-config/app-config.service.ts) |
| [Apps Process service](core/services/apps-process.service.md) | Gets details of the Process Services apps that are deployed for the user. | [Source](../lib/process-services/src/lib/services/apps-process.service.ts) |
| [Auth Guard Bpm service](core/services/auth-guard-bpm.service.md) | Adds authentication with Process Services to a route within the app. | [Source](../lib/core/src/lib/auth/guard/auth-guard-bpm.service.ts) |

View File

@@ -0,0 +1,24 @@
---
Title: Breaking changes, 6.10.0 -> 7.0.0
---
# Breaking changes, 6.10.0 -> 7.0.0
This document lists all the deprecated ADF v2.x components that were removed for v3.0.0:
- [PR-9317](https://github.com/Alfresco/alfresco-ng2-components/pull/9317) Move alfresco js-API and AlfrescoApi service out from the core
Move `AlfrescoApiServiceMock` and `AlfrescoApiServiceMock` from `core` library to `content-services`, These libraries are content related therefore should not live in `core`
To mitigate this change, we can run migration:
```
npx nx migrate @alfresco/adf-core@7.0.0
npx nx migrate --run-migrations
```
Or for pure angular repository:
```
npx ng update @alfresco/adf-core@7.0.0
```

View File

@@ -66,7 +66,7 @@ Displays the documents from a repository.
| contentActionsPosition | `string` | "right" | Position of the content actions dropdown menu. Can be set to "left" or "right". |
| contextMenuActions | `boolean` | false | Toggles context menus for each row |
| currentFolderId | `string` | null | The ID of the folder node to display or a reserved string alias for special sources |
| displayCheckboxesOnHover | `boolean` | false | Enables checkboxes in datatable rows being displayed on hover only. |
| displayCheckboxesOnHover | `boolean` | false | Enables checkboxes in datatable rows being displayed on hover only. |
| emptyFolderImageUrl | `string` | | Custom image for empty folder. Default value: './assets/images/empty_doc_lib.svg' |
| filterValue | `any` | | Initial value for filter. |
| headerFilters | `boolean` | false | Toggles the header filters mode. |
@@ -152,7 +152,7 @@ the other DOM events that the [Document List component](document-list.component.
Below is a basic example of handling DOM events in the parent elements.
```html
<div (node-click)="onNodeClicked($event)"
<div (node-click)="onNodeClicked($event)"
(node-dblclick)="onNodeDblClicked($event)">
<div>
<adf-upload-drag-area ...>
@@ -195,7 +195,7 @@ The Document List by default supports 2 types of pagination: [Pagination compon
```html
<adf-document-list #documentList ...></adf-document-list>
<adf-infinite-pagination
<adf-infinite-pagination
[target]="documentList"
[loading]="documentList.infiniteLoading">
</adf-infinite-pagination>
@@ -363,7 +363,7 @@ points you should pay attention to:
```ts
import { ChangeDetectorRef } from '@angular/core';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '@alfresco/adf-content-services';
export class FilesComponent implements OnInit {
@@ -408,7 +408,7 @@ It is useful for examining other information that you can access if necessary:
Typically you will bind Document List properties to your application/component class properties:
```html
<adf-document-list
<adf-document-list
[currentFolderId]="myStartFolder">
</adf-document-list>
```
@@ -420,7 +420,7 @@ Typically you will bind Document List properties to your application/component c
export class MyAppComponent {
myStartFolder: string = '-my-';
}
```
@@ -432,7 +432,7 @@ section of the Angular docs for more information.
Below is an example of getting a reference:
```html
<adf-document-list
<adf-document-list
#documentList
[currentFolderId]="myStartFolder">
</adf-document-list>
@@ -448,7 +448,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
export class MyAppComponent implements AfterViewInit {
myStartFolder: string = '-my-';
@ViewChild(DocumentListComponent)
documentList: DocumentListComponent;
@@ -498,7 +498,7 @@ Here's a short example:
<data-column key="$thumbnail" type="image"></data-column>
<data-column title="Name" key="name" class="full-width ellipsis-cell"></data-column>
<data-column
title="Created By"
title="Created By"
key="createdByUser.displayName">
</data-column>
</data-columns>
@@ -517,21 +517,21 @@ A custom set of columns might look like the following:
<data-columns>
<data-column key="$thumbnail" type="image"></data-column>
<data-column
title="Name"
key="name"
title="Name"
key="name"
sortable="true"
class="full-width ellipsis-cell">
</data-column>
<data-column
title="Created By"
title="Created By"
key="createdByUser.displayName"
sortable="true"
class="desktop-only">
</data-column>
<data-column
title="Created On"
key="createdAt"
type="date"
title="Created On"
key="createdAt"
type="date"
format="medium"
sortable="true"
class="desktop-only">
@@ -692,7 +692,7 @@ may be sometimes be useful.
The following example switches navigation to single clicks:
```html
<adf-document-list
<adf-document-list
[navigationMode]="'click'">
</adf-document-list>
```
@@ -702,8 +702,8 @@ The following example switches navigation to single clicks:
You can enable Header filters in your document list simply setting to true its `headerFilters` input.
```html
<adf-document-list
currentFolderId="-my-"
<adf-document-list
currentFolderId="-my-"
[headerFilters]="true">
</adf-document-list>
```
@@ -788,11 +788,11 @@ This will give the following output:
### File Auto downloading
In case of files exceeding a predefined file size, the [document list component](../../content-services/components/document-list.component.md) can be configured to automatically download those file when trying to preview them.
In case of files exceeding a predefined file size, the [document list component](../../content-services/components/document-list.component.md) can be configured to automatically download those file when trying to preview them.
This can help in reducing server load, and ensuring quick access to such files. After turning this feature on, whenever the user tries to preview a file with a large
file size, the [Document List component](../../content-services/components/document-list.component.md) will first preview a dialog, asking for confirmation from the user on whether they want to download the file, or cancel the preview altogether.
In order to configure the Document List to automatically download the files, the following environment variables would need to be set up in app.config.json -
In order to configure the Document List to automatically download the files, the following environment variables would need to be set up in app.config.json -
```
"viewer": {

View File

@@ -25,7 +25,7 @@ Converts a date to a given format and locale.
## Details
The pipe takes a date and formats it and localizes it so the date is displayed in the proper format for the region. It uses the [Angular Date Pipe](https://angular.io/api/common/DatePipe#custom-format-options) so all the pre-defined and custom formats can be used.
The pipe takes a date and formats it and localizes it so the date is displayed in the proper format for the region. It uses the [Angular Date Pipe](https://angular.io/api/common/DatePipe#custom-format-options) so all the pre-defined and custom formats can be used.
To localize the dates in your application, you will need to add the specific locale file for your region in order to use it. Read more about internationalization [here](https://angular.io/guide/i18n#i18n-pipes).
@@ -58,4 +58,4 @@ You can overwrite the default values of this pipe by adding these properties to
| defaultDateTimeFormat | string | The format to apply to date-time values |
| defaultLocale | string | The locale id to apply |
This configuration overwrites the values in the [localized date pipe](../../core/pipes/localized-date.pipe.md) as well as other components to have more consistency across your app. However, you can still overwrite these values any time by using the pipe in your code.
This configuration overwrites the values in the [localized date pipe](../../core/pipes/localized-date.pipe.md) as well as other components to have more consistency across your app. However, you can still overwrite these values any time by using the pipe in your code.

View File

@@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-17
---
# [Alfresco Api Service](../../../lib/core/src/lib/services/alfresco-api.service.ts "Defined in alfresco-api.service.ts")
# [Alfresco Api Service](lib/content-services/src/lib/services/alfresco-api.service.ts "Defined in alfresco-api.service.ts")
Provides access to an initialized **AlfrescoJSApi** instance.

View File

@@ -111,21 +111,21 @@ the source code below to the `mydatatable` component, just before the constructo
data = new ObjectDataTableAdapter(
[
{
id: 1,
firstName: 'Name #1',
lastName: 'Lastname #1',
id: 1,
firstName: 'Name #1',
lastName: 'Lastname #1',
icon: 'material-icons://folder_open'
},
{
id: 2,
firstName: 'Name #2',
lastName: 'Lastname #2',
id: 2,
firstName: 'Name #2',
lastName: 'Lastname #2',
icon: 'material-icons://accessibility'
},
{
id: 3,
firstName: 'Name #3',
lastName: 'Lastname #3',
id: 3,
firstName: 'Name #3',
lastName: 'Lastname #3',
icon: 'material-icons://alarm'
}
]
@@ -137,21 +137,21 @@ configure the columns. Open the `src/app/mydatatable/mydatatable.component.html`
with the following:
```html
<adf-datatable
<adf-datatable
[data]="data">
<data-columns>
<data-column
key="icon"
type="image"
<data-column
key="icon"
type="image"
[sortable]="false">
</data-column>
<data-column
key="firstName"
<data-column
key="firstName"
title="First Name">
</data-column>
<data-column
key="lastName"
title="Last Name"
<data-column
key="lastName"
title="Last Name"
class="full-width name-column">
</data-column>
</data-columns>
@@ -179,7 +179,7 @@ As a simple example, we'll add a `click` event to display an alert when a row is
`src/app/mydatatable/mydatatable.component.html` and add the following:
```html
<adf-datatable
<adf-datatable
(rowClick)="onRowClick($event)"
[data]="data">
.......
@@ -205,9 +205,9 @@ Let's dig a bit deeper into the different options for rendering columns within t
is quite in-depth and has lots of examples. We highly recommend checking it out.
From the documentation we can see that the [Data Column component](../core/components/data-column.component.md) has quite a few properties but the
most important ones are `key`, `type`, `sortable`, `title` and `class`.
most important ones are `key`, `type`, `sortable`, `title` and `class`.
- `key` is the name of the corresponding property in the [`ObjectDataTableAdapter`](lib/core/src/lib/datatable/data/object-datatable-adapter.ts) object.
- `key` is the name of the corresponding property in the [`ObjectDataTableAdapter`](lib/core/src/lib/datatable/data/object-datatable-adapter.ts) object.
- `type` indicates how to render. By default it will take the `text` from the matching key in the data,
but other modes are also available:
\- `image` will take a URI for a Material Icon or a URL for any image and display it.
@@ -231,24 +231,24 @@ Open `src/app/mydatatable/mydatatable.component.ts` and change the data to the f
data = new ObjectDataTableAdapter(
[
{
id: 1,
name: 'Name #1',
createdBy: 'User #1',
status: 'green',
id: 1,
name: 'Name #1',
createdBy: 'User #1',
status: 'green',
icon: 'material-icons://folder_open'
},
{
id: 2,
name: 'Name #2',
createdBy: 'User #2',
status: 'red',
id: 2,
name: 'Name #2',
createdBy: 'User #2',
status: 'red',
icon: 'material-icons://accessibility'
},
{
id: 3,
name: 'Name #3',
createdBy: 'User #3',
status: 'green',
id: 3,
name: 'Name #3',
createdBy: 'User #3',
status: 'green',
icon: 'material-icons://alarm'
}
]
@@ -286,7 +286,7 @@ file and replace the content with the following:
```ts
import { Component, OnInit } from '@angular/core';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '@alfresco/adf-content-services';
import { ObjectDataTableAdapter, ObjectDataRow } from '@alfresco/adf-core';
@Component({
@@ -356,7 +356,7 @@ Make the changes shown below to the `src/app/mydatatable/mydatatable.component.h
</adf-datatable>
```
Also update `src/app/mydatatable/mydatatable.component.ts` as follows:
Also update `src/app/mydatatable/mydatatable.component.ts` as follows:
```ts
import { DataCellEvent, DataRowActionEvent } from '@alfresco/adf-core';