Skip to content

Commit

Permalink
[AAE-20109] Move alfresco js-API and alfrescoapi service out from the…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
Co-authored-by: MichalKinas <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent b60797e commit e617333
Show file tree
Hide file tree
Showing 167 changed files with 1,428 additions and 587 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,21 @@ jobs:
with:
dry-run-flag: ${{ inputs.dry-run-flag }}
- uses: ./.github/actions/download-node-modules-and-artifacts
- name: build libraries
- name: Set libraries versions
run: |
set -u;
./scripts/update-version.sh -gnu || exit 1;
- name: Set migrations
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const setMigrations = require('./scripts/github/release/set-migrations.js');
setMigrations();
- name: Build libraries
run: |
npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
npx nx affected $NX_CALCULATION_FLAGS --target=build-schematics
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
name: release libraries GH registry
with:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,21 @@ jobs:
with:
dry-run-flag: ${{ inputs.dry-run-flag }}
- uses: ./.github/actions/download-node-modules-and-artifacts
- name: build libraries
- name: Set libraries versions
run: |
set -u;
./scripts/github/build/bumpversion.sh
- name: Set migrations
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const setMigrations = require('./scripts/github/release/set-migrations.js');
setMigrations();
- name: build libraries
run: |
npx nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache
npx nx affected $NX_CALCULATION_FLAGS --target=pretheme
npx nx affected $NX_CALCULATION_FLAGS --target=build-schematics
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
name: release libraries GH registry
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import { Component, ViewEncapsulation } from '@angular/core';
import {
AlfrescoApiService,
AvatarComponent,
HeaderLayoutComponent,
LogoutDirective,
Expand All @@ -35,7 +34,7 @@ import { MatIconModule } from '@angular/material/icon';
import { MatLineModule } from '@angular/material/core';
import { CommonModule } from '@angular/common';
import { RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
import { FileUploadingDialogComponent } from '@alfresco/adf-content-services';
import { AlfrescoApiService, FileUploadingDialogComponent } from '@alfresco/adf-content-services';

@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// eslint-disable-next-line
import { AfterViewInit, Component, ElementRef, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { AlfrescoApiService } from '@alfresco/adf-content-services';
import { Pagination, UserProcessInstanceFilterRepresentation, ScriptFilesApi, UserTaskFilterRepresentation } from '@alfresco/js-api';
import {
FORM_FIELD_VALIDATORS,
Expand All @@ -26,7 +27,6 @@ import {
AppConfigService,
PaginationComponent,
UserPreferenceValues,
AlfrescoApiService,
UserPreferencesService,
NotificationService,
SidebarActionMenuComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { Component, EventEmitter, Output, ViewEncapsulation, OnInit, Input } from '@angular/core';
import { Validators, UntypedFormGroup, UntypedFormBuilder, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
import { AppConfigService, AppConfigValues, StorageService, AlfrescoApiService, AuthenticationService } from '@alfresco/adf-core';
import { AppConfigService, AppConfigValues, StorageService, AuthenticationService } from '@alfresco/adf-core';
import { ENTER } from '@angular/cdk/keycodes';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule } from '@angular/material/form-field';
import { CommonModule } from '@angular/common';
Expand All @@ -26,6 +26,7 @@ import { MatRadioModule } from '@angular/material/radio';
import { MatInputModule } from '@angular/material/input';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatButtonModule } from '@angular/material/button';
import { AlfrescoApiService } from '@alfresco/adf-content-services';

export const HOST_REGEX = '^(http|https)://.*[^/]$';

Expand Down
3 changes: 2 additions & 1 deletion demo-shell/src/testing/automation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
* limitations under the License.
*/

import { AppConfigService, UserPreferencesService, StorageService, AuthenticationService } from '@alfresco/adf-core';
import { Injectable } from '@angular/core';
import { AppConfigService, AlfrescoApiService, StorageService, UserPreferencesService, AuthenticationService } from '@alfresco/adf-core';
import { DemoForm } from './demo-form.mock';
import { AlfrescoApiService } from '@alfresco/adf-content-services';

@Injectable({
providedIn: 'root'
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
24 changes: 24 additions & 0 deletions docs/breaking-changes/breaking-change-6.10.0-7.0.0.md
Original file line number Diff line number Diff line change
@@ -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/[email protected]
npx nx migrate --run-migrations
```
Or for pure angular repository:
```
npx ng update @alfresco/[email protected]
```
40 changes: 20 additions & 20 deletions docs/content-services/components/document-list.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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 ...>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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>
```
Expand All @@ -420,7 +420,7 @@ Typically you will bind Document List properties to your application/component c
export class MyAppComponent {
myStartFolder: string = '-my-';
}
```
Expand All @@ -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>
Expand All @@ -448,7 +448,7 @@ import { DocumentListComponent } from '@alfresco/adf-content-services';
export class MyAppComponent implements AfterViewInit {
myStartFolder: string = '-my-';
@ViewChild(DocumentListComponent)
documentList: DocumentListComponent;
Expand Down Expand Up @@ -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>
Expand All @@ -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">
Expand Down Expand Up @@ -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>
```
Expand All @@ -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>
```
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions docs/core/pipes/localized-date.pipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion docs/core/services/alfresco-api.service.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading

0 comments on commit e617333

Please sign in to comment.