Skip to content

Commit

Permalink
AAE-20109 Remove alfrescoapiservice from core
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano authored and BSekula committed Aug 6, 2024
1 parent c9b8059 commit 3105bc8
Show file tree
Hide file tree
Showing 155 changed files with 2,051 additions and 1,052 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
3 changes: 2 additions & 1 deletion demo-shell/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ import { CoreAutomationService } from '../testing/automation.service';
SearchFilterChipsComponent
],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
{provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
CoreAutomationService,
provideTranslations('app', 'resources')
],
bootstrap: [AppComponent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

import { Component, ViewEncapsulation } from '@angular/core';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '@alfresco/adf-content-services';

@Component({
templateUrl: './app-layout.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const routes: Routes = [
CoreModule,
ContentModule,
InfoDrawerModule,
ContentModule,
ContentDirectiveModule,
ContentMetadataModule,
VersionManagerModule
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
} from '@alfresco/adf-core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

import { Component, EventEmitter, Output, ViewEncapsulation, OnInit, Input } from '@angular/core';
import { Validators, UntypedFormGroup, UntypedFormBuilder, UntypedFormControl } 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 } from '@angular/material/form-field';
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]
```
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
*/

import { AdfHttpClient } from '@alfresco/adf-core/api';
import { StorageService } from '../common/services/storage.service';
import { StorageService, AppConfigService } from '@alfresco/adf-core';
import { AlfrescoApi, AlfrescoApiConfig } from '@alfresco/js-api';
import { Injectable } from '@angular/core';
import { AppConfigService } from '../app-config';
import { AlfrescoApiService } from '../services/alfresco-api.service';

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

import { AlfrescoApiConfig } from '@alfresco/js-api';
import { Injectable } from '@angular/core';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
import { AlfrescoApiService } from '../services/alfresco-api.service';
import { StorageService } from '../common/services/storage.service';
import { AppConfigService, AppConfigValues, StorageService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '../services/alfresco-api.service';

/**
* Create a factory to resolve an api service instance
Expand Down
34 changes: 34 additions & 0 deletions lib/content-services/src/lib/api-factories/alfresco-api.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { APP_INITIALIZER, NgModule } from '@angular/core';
import { AlfrescoApiNoAuthService } from './alfresco-api-no-auth.service';
import { AlfrescoApiLoaderService, createAlfrescoApiInstance } from '../api-factories/alfresco-api-v2-loader.service';
import { AlfrescoApiService } from '../services';

@NgModule({
providers :[
{ provide: AlfrescoApiService, useClass: AlfrescoApiNoAuthService },
{
provide: APP_INITIALIZER,
useFactory: createAlfrescoApiInstance,
deps: [ AlfrescoApiLoaderService ],
multi: true
}
]
})
export class AlfrescoApiModule { }
File renamed without changes.
21 changes: 21 additions & 0 deletions lib/content-services/src/lib/api-factories/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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.
*/

export * from './alfresco-api-no-auth.service';
export * from './alfresco-api-v2-loader.service';

export * from './alfresco-api.module';
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/

import { TestBed } from '@angular/core/testing';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AspectListService } from './aspect-list.service';
import { AspectPaging, AspectsApi, AspectEntry } from '@alfresco/js-api';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { AlfrescoApiService } from '../../services';

const stdAspect1: AspectEntry = { entry: { id: 'std:standardAspectOne', description: 'Standard Aspect One', title: 'StandardAspectOne' } };
const stdAspect2: AspectEntry = { entry: { id: 'std:standardAspectTwo', description: 'Standard Aspect Two', title: 'StandardAspectTwo' } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { Injectable } from '@angular/core';
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { AppConfigService } from '@alfresco/adf-core';
import { from, Observable, of, zip } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { AspectEntry, AspectPaging, AspectsApi } from '@alfresco/js-api';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ContentTestingModule } from '../../testing/content.testing.module';
import { NodeAspectService } from './node-aspect.service';
import { DialogAspectListService } from './dialog-aspect-list.service';
import { CardViewContentUpdateService } from '../../common/services/card-view-content-update.service';
import { TagService } from '@alfresco/adf-content-services';
import { TagService } from '../../tag';

describe('NodeAspectService', () => {
let dialogAspectListService: DialogAspectListService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

import { fakeAsync, TestBed } from '@angular/core/testing';
import { CategoryService } from '../services/category.service';
import { CategoryNode, CategoryTreeDatasourceService } from '@alfresco/adf-content-services';
import { CategoryServiceMock } from '../mock/category-mock.service';
import { TreeNodeType, TreeResponse } from '../../tree';
import { EMPTY, of } from 'rxjs';
import { Pagination } from '@alfresco/js-api';
import { CategoryTreeDatasourceService } from './category-tree-datasource.service';
import { CategoryNode } from '../models/category-node.interface';

describe('CategoryTreeDatasourceService', () => {
let categoryTreeDatasourceService: CategoryTreeDatasourceService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/

import { Injectable } from '@angular/core';
import { AlfrescoApiService, AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
import { CategoriesApi, CategoryBody, CategoryEntry, CategoryLinkBody, CategoryPaging, ResultSetPaging, SearchApi } from '@alfresco/js-api';
import { from, Observable } from 'rxjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
import { Injectable } from '@angular/core';
import { ContentApi, Node, NodeEntry } from '@alfresco/js-api';
import { Subject } from 'rxjs';
import { AlfrescoApiService, AuthenticationService, ThumbnailService } from '@alfresco/adf-core';
import { AuthenticationService, ThumbnailService } from '@alfresco/adf-core';
import { PermissionsEnum } from '../models/permissions.enum';
import { AllowableOperationsEnum } from '../models/allowable-operations.enum';
import { AlfrescoApiService } from '../../services/alfresco-api.service';

export interface FolderCreatedEvent {
name: string;
Expand Down
Loading

0 comments on commit 3105bc8

Please sign in to comment.