Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AAE-22098] Update AlfrescoApiService imports #4015

Merged
merged 9 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/tutorials/file-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ As first step we can create our custom component in our extension:
```typescript
import { NameColumnComponent } from '@alfresco/adf-content-services';
import { Component, ChangeDetectionStrategy, ViewEncapsulation, ElementRef, OnInit, OnDestroy } from '@angular/core';
import { AlfrescoApiService } from '@alfresco/adf-core';
import { AlfrescoApiService } from '@alfresco/adf-content-services';

@Component({
selector: 'custom-template-column',
Expand Down
11 changes: 11 additions & 0 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"migrations": [
{
"description": "Update alfresco-api imports",
"version": "6.10.0-10366268804",
"factory": "./7_0_0/index#updateAlfrescoApiImports",
"package": "@alfresco/adf-core",
"name": "move-out-alfresco-api"
}
]
}
152 changes: 121 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
},
"private": true,
"dependencies": {
"@alfresco/adf-content-services": "7.0.0-alpha.2-10705302287",
"@alfresco/adf-core": "7.0.0-alpha.2-10705302287",
"@alfresco/adf-extensions": "7.0.0-alpha.2-10705302287",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.2-10705302287",
"@alfresco/js-api": "8.0.0-alpha.2-10705302287",
"@alfresco/adf-content-services": "7.0.0-alpha.2-10742047850",
"@alfresco/adf-core": "7.0.0-alpha.2-10742047850",
"@alfresco/adf-extensions": "7.0.0-alpha.2-10742047850",
"@alfresco/eslint-plugin-eslint-angular": "7.0.0-alpha.2-10742047850",
"@alfresco/js-api": "8.0.0-alpha.2-10742047850",
"@angular/animations": "15.2.10",
"@angular/cdk": "15.2.9",
"@angular/common": "15.2.10",
Expand Down Expand Up @@ -62,7 +62,7 @@
"zone.js": "0.11.8"
},
"devDependencies": {
"@alfresco/adf-cli": "7.0.0-alpha.2-10705302287",
"@alfresco/adf-cli": "7.0.0-alpha.2-10742047850",
"@angular-devkit/build-angular": "15.2.10",
"@angular-devkit/core": "15.2.10",
"@angular-devkit/schematics": "15.2.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatProgressBarHarness } from '@angular/material/progress-bar/testing';
import { MatSlideToggleHarness } from '@angular/material/slide-toggle/testing';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';

describe('ManageRulesSmartComponent', () => {
let fixture: ComponentFixture<ManageRulesSmartComponent>;
Expand All @@ -71,6 +72,7 @@ describe('ManageRulesSmartComponent', () => {
toggleAppNavBar$: new Subject()
}
},
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: Store, useValue: { dispatch: () => {} } },
{ provide: ActivatedRoute, useValue: { params: of({ nodeId: owningFolderIdMock }) } }
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { RuleActionListUiComponent } from './rule-action-list.ui-component';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { RuleActionUiComponent } from './rule-action.ui-component';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';

describe('RuleActionListUiComponent', () => {
let fixture: ComponentFixture<RuleActionListUiComponent>;
Expand All @@ -38,7 +39,8 @@ describe('RuleActionListUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule]
imports: [CoreTestingModule],
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should not be needed at all, we have this configured in the CoreTestingModule

Copy link
Contributor

@BSekula BSekula Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we moved AlfrescoApiService from core to @alfresco/adf-content-service in ADF, therefore it is not in CoreTestingModule anymore

});

fixture = TestBed.createComponent(RuleActionListUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
import { By } from '@angular/platform-browser';
import { dummyCategoriesConstraints, dummyConstraints, dummyTagsConstraints } from '../../mock/action-parameter-constraints.mock';
import { securityMarksResponseMock, updateNotificationMock } from '../../mock/security-marks.mock';
import { CategoryService, NodeAction, TagService } from '@alfresco/adf-content-services';
import { AlfrescoApiService, AlfrescoApiServiceMock, CategoryService, NodeAction, TagService } from '@alfresco/adf-content-services';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
Expand Down Expand Up @@ -63,7 +63,8 @@ describe('RuleActionUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule, RuleActionUiComponent]
imports: [CoreTestingModule, RuleActionUiComponent],
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe in every place you have CoreTestingModule this line is not needed... we can cleanup the tests even before the refactoring, so that it takes less changes in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved AlfrescoApiService from core to @alfresco/adf-content-service in ADF

});

fixture = TestBed.createComponent(RuleActionUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ import {
compositeConditionWithThreeConditionMock
} from '../../mock/conditions.mock';
import { RuleSimpleConditionUiComponent } from './rule-simple-condition.ui-component';
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';

describe('RuleCompositeConditionUiComponent', () => {
let fixture: ComponentFixture<RuleCompositeConditionUiComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule, RuleCompositeConditionUiComponent, RuleSimpleConditionUiComponent]
imports: [CoreTestingModule, RuleCompositeConditionUiComponent, RuleSimpleConditionUiComponent],
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
});

fixture = TestBed.createComponent(RuleCompositeConditionUiComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { CoreTestingModule } from '@alfresco/adf-core';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { tagMock, mimeTypeMock, simpleConditionUnknownFieldMock, categoriesListMock } from '../../mock/conditions.mock';
import { CategoryService, TagService } from '@alfresco/adf-content-services';
import { AlfrescoApiService, AlfrescoApiServiceMock, CategoryService, TagService } from '@alfresco/adf-content-services';
import { of } from 'rxjs';
import { RuleSimpleCondition } from '../../model/rule-simple-condition.model';
import { delay } from 'rxjs/operators';
Expand Down Expand Up @@ -83,7 +83,8 @@ describe('RuleSimpleConditionUiComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule, RuleSimpleConditionUiComponent]
imports: [CoreTestingModule, RuleSimpleConditionUiComponent],
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
});

fixture = TestBed.createComponent(RuleSimpleConditionUiComponent);
Expand Down
Loading
Loading