mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[MIGRATION] - Migrating to NG18
This commit is contained in:
@@ -4,9 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular"
|
||||
],
|
||||
"extends": ["plugin:@nx/angular"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
@@ -17,7 +15,12 @@
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "warn",
|
||||
"@typescript-eslint/member-ordering": "off",
|
||||
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
|
||||
"no-underscore-dangle": [
|
||||
"error",
|
||||
{
|
||||
"allowAfterThis": true
|
||||
}
|
||||
],
|
||||
"no-shadow": "warn",
|
||||
"quote-props": "warn",
|
||||
"object-shorthand": "warn",
|
||||
@@ -25,7 +28,6 @@
|
||||
"arrow-body-style": "warn",
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
"space-before-function-paren": "warn",
|
||||
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
@@ -78,7 +80,7 @@
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/process-services-cloud/tsconfig.lib.json", "lib/process-services-cloud/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
|
@@ -17,11 +17,5 @@ module.exports = {
|
||||
options: {}
|
||||
},
|
||||
|
||||
docs: {
|
||||
autodocs: true
|
||||
},
|
||||
|
||||
core: {
|
||||
builder: '@storybook/builder-webpack5'
|
||||
}
|
||||
docs: {}
|
||||
};
|
||||
|
@@ -2,3 +2,4 @@ export const parameters = {
|
||||
docs: { inlineStories: true },
|
||||
controls: { expanded: true }
|
||||
};
|
||||
export const tags = ["autodocs"];
|
||||
|
@@ -26,7 +26,8 @@ import {
|
||||
} from '../mock/identity-group.service.mock';
|
||||
import { mockFoodGroups } from '../mock/group-cloud.mock';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('IdentityGroupService', () => {
|
||||
let service: IdentityGroupService;
|
||||
@@ -35,9 +36,9 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule],
|
||||
providers: [IdentityGroupService]
|
||||
});
|
||||
imports: [TranslateModule.forRoot()],
|
||||
providers: [IdentityGroupService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
service = TestBed.inject(IdentityGroupService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
requestSpy = spyOn(adfHttpClient, 'request');
|
||||
|
@@ -21,26 +21,20 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { ProcessFiltersCloudComponent } from './components/process-filters-cloud.component';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { EditProcessFilterCloudComponent } from './components/edit-process-filter-cloud.component';
|
||||
import { ProcessFilterDialogCloudComponent } from './components/process-filter-dialog-cloud.component';
|
||||
import { AppListCloudModule } from './../../app/app-list-cloud.module';
|
||||
import { ProcessCommonModule } from '../../common/process-common.module';
|
||||
import { PeopleCloudModule } from '../../people/people-cloud.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
FormsModule,
|
||||
@NgModule({ declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
|
||||
exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent], imports: [FormsModule,
|
||||
ReactiveFormsModule,
|
||||
HttpClientModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
AppListCloudModule,
|
||||
CoreModule,
|
||||
ProcessCommonModule,
|
||||
PeopleCloudModule
|
||||
],
|
||||
declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
|
||||
exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent]
|
||||
})
|
||||
PeopleCloudModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||
export class ProcessFiltersCloudModule { }
|
||||
|
@@ -20,7 +20,7 @@ import { of, throwError } from 'rxjs';
|
||||
import { StartProcessCloudService } from './start-process-cloud.service';
|
||||
import { fakeProcessPayload } from '../mock/start-process.component.mock';
|
||||
import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud.model';
|
||||
import { HttpErrorResponse, HttpClientModule } from '@angular/common/http';
|
||||
import { HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
|
||||
describe('StartProcessCloudService', () => {
|
||||
@@ -30,8 +30,9 @@ describe('StartProcessCloudService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientModule]
|
||||
});
|
||||
imports: [],
|
||||
providers: [provideHttpClient(withInterceptorsFromDi())]
|
||||
});
|
||||
service = TestBed.inject(StartProcessCloudService);
|
||||
adfHttpClient = TestBed.inject(AdfHttpClient);
|
||||
});
|
||||
|
@@ -30,12 +30,13 @@ import {
|
||||
} from '../mock/task-filters-cloud.mock';
|
||||
import { UserPreferenceCloudService } from '../../../services/user-preference-cloud.service';
|
||||
import { PreferenceCloudServiceInterface } from '../../../services/preference-cloud.interface';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||
import { NotificationCloudService } from '../../../services/notification-cloud.service';
|
||||
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
|
||||
import { IdentityUserService } from '../../../people/services/identity-user.service';
|
||||
import { ApolloModule } from 'apollo-angular';
|
||||
import { StorageService } from '@alfresco/adf-core';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
|
||||
describe('TaskFilterCloudService', () => {
|
||||
let service: TaskFilterCloudService;
|
||||
@@ -50,15 +51,14 @@ describe('TaskFilterCloudService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
ProcessServiceCloudTestingModule,
|
||||
ApolloModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService }
|
||||
]
|
||||
});
|
||||
imports: [ProcessServiceCloudTestingModule,
|
||||
ApolloModule],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: UserPreferenceCloudService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TaskFilterCloudService);
|
||||
notificationCloudService = TestBed.inject(NotificationCloudService);
|
||||
|
||||
@@ -249,11 +249,13 @@ describe('Inject [LocalPreferenceCloudService] into the TaskFilterCloudService',
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule, ProcessServiceCloudTestingModule, ApolloModule],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
|
||||
]
|
||||
});
|
||||
imports: [ProcessServiceCloudTestingModule, ApolloModule],
|
||||
providers: [
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting()
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(TaskFilterCloudService);
|
||||
preferenceCloudService = service.preferenceService;
|
||||
identityUserService = TestBed.inject(IdentityUserService);
|
||||
|
@@ -21,7 +21,7 @@ import { CommonModule } from '@angular/common';
|
||||
import { TaskFiltersCloudComponent } from './components/task-filters-cloud.component';
|
||||
import { MaterialModule } from '../../material.module';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import { AppListCloudModule } from './../../app/app-list-cloud.module';
|
||||
import { ProcessCommonModule } from '../../common/process-common.module';
|
||||
import { PeopleCloudModule } from '../../people/people-cloud.module';
|
||||
@@ -33,21 +33,7 @@ import { TaskAssignmentFilterCloudComponent } from './components/task-assignment
|
||||
import { GroupCloudModule } from '../../group/group-cloud.module';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
HttpClientModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
AppListCloudModule,
|
||||
CoreModule,
|
||||
GroupCloudModule,
|
||||
ProcessCommonModule,
|
||||
PeopleCloudModule,
|
||||
MatProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
@NgModule({ declarations: [
|
||||
TaskFiltersCloudComponent,
|
||||
ServiceTaskFiltersCloudComponent,
|
||||
EditTaskFilterCloudComponent,
|
||||
@@ -55,6 +41,14 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
TaskFilterDialogCloudComponent,
|
||||
TaskAssignmentFilterCloudComponent
|
||||
],
|
||||
exports: [TaskFiltersCloudComponent, ServiceTaskFiltersCloudComponent, EditTaskFilterCloudComponent, EditServiceTaskFilterCloudComponent]
|
||||
})
|
||||
exports: [TaskFiltersCloudComponent, ServiceTaskFiltersCloudComponent, EditTaskFilterCloudComponent, EditServiceTaskFilterCloudComponent], imports: [FormsModule,
|
||||
ReactiveFormsModule,
|
||||
CommonModule,
|
||||
MaterialModule,
|
||||
AppListCloudModule,
|
||||
CoreModule,
|
||||
GroupCloudModule,
|
||||
ProcessCommonModule,
|
||||
PeopleCloudModule,
|
||||
MatProgressSpinnerModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||
export class TaskFiltersCloudModule {}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
AlfrescoApiServiceMock,
|
||||
@@ -31,26 +31,20 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ProcessServicesCloudModule } from '../process-services-cloud.module';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
AuthModule.forRoot({ useHash: true }),
|
||||
HttpClientModule,
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ProcessServicesCloudModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock }
|
||||
],
|
||||
exports: [
|
||||
@NgModule({ exports: [
|
||||
NoopAnimationsModule,
|
||||
TranslateModule,
|
||||
CoreModule,
|
||||
ProcessServicesCloudModule
|
||||
]
|
||||
})
|
||||
], imports: [AuthModule.forRoot({ useHash: true }),
|
||||
NoopAnimationsModule,
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ProcessServicesCloudModule.forRoot()], providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{ provide: TranslationService, useClass: TranslationMock },
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
] })
|
||||
export class ProcessServiceCloudTestingModule {}
|
||||
|
Reference in New Issue
Block a user