mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
migrate cloud components
This commit is contained in:
@@ -40,7 +40,7 @@ import { RadioButtonsCloudWidgetComponent } from './components/widgets/radio-but
|
||||
import { FilePropertiesTableCloudComponent } from './components/widgets/attach-file/file-properties-table-cloud.component';
|
||||
import { FileViewerWidgetComponent } from './components/widgets/file-viewer/file-viewer.widget';
|
||||
import { DisplayRichTextWidgetComponent } from './components/widgets/display-rich-text/display-rich-text.widget';
|
||||
import { RichTextEditorModule } from '../rich-text-editor';
|
||||
import { RichTextEditorComponent } from '../rich-text-editor';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { OverlayModule } from '@angular/cdk/overlay';
|
||||
import { FormSpinnerComponent } from './components/spinner/form-spinner.component';
|
||||
@@ -57,7 +57,7 @@ import { PeopleCloudComponent } from '../people/components/people-cloud.componen
|
||||
ContentNodeSelectorModule,
|
||||
PeopleCloudComponent,
|
||||
GroupCloudModule,
|
||||
RichTextEditorModule,
|
||||
RichTextEditorComponent,
|
||||
...TOOLBAR_DIRECTIVES,
|
||||
A11yModule,
|
||||
FormatSpacePipe,
|
||||
|
@@ -19,7 +19,6 @@ import { PeopleCloudComponent } from './people-cloud.component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { ProcessServiceCloudTestingModule } from '../../testing/process-service-cloud.testing.module';
|
||||
import { PeopleCloudModule } from '../people-cloud.module';
|
||||
import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { of } from 'rxjs';
|
||||
@@ -83,13 +82,13 @@ describe('PeopleCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ProcessServiceCloudTestingModule, PeopleCloudModule, PeopleCloudComponent]
|
||||
imports: [CoreTestingModule, ProcessServiceCloudTestingModule, PeopleCloudComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(PeopleCloudComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
identityUserService = TestBed.inject(IDENTITY_USER_SERVICE_TOKEN);
|
||||
identityUserService = fixture.debugElement.injector.get(IDENTITY_USER_SERVICE_TOKEN);
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
});
|
||||
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { PeopleCloudComponent } from './people-cloud.component';
|
||||
import { PeopleCloudModule } from '../people-cloud.module';
|
||||
import { ProcessServicesCloudStoryModule } from '../../testing/process-services-cloud-story.module';
|
||||
import { IdentityUserService } from '../services/identity-user.service';
|
||||
import { IdentityUserServiceMock, mockFoodUsers, mockKielbasaSausage, mockShepherdsPie, mockYorkshirePudding } from '../mock/people-cloud.mock';
|
||||
@@ -28,13 +27,10 @@ export default {
|
||||
title: 'Process Services Cloud/People Cloud/People Cloud',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [PeopleCloudModule]
|
||||
imports: [PeopleCloudComponent]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [
|
||||
{ provide: IdentityUserService, useClass: IdentityUserServiceMock },
|
||||
importProvidersFrom(ProcessServicesCloudStoryModule)
|
||||
]
|
||||
providers: [{ provide: IdentityUserService, useClass: IdentityUserServiceMock }, importProvidersFrom(ProcessServicesCloudStoryModule)]
|
||||
})
|
||||
],
|
||||
argTypes: {
|
||||
@@ -119,7 +115,7 @@ export default {
|
||||
description: 'FormControl to list of users.',
|
||||
table: {
|
||||
type: { summary: 'FormControl' },
|
||||
defaultValue: { summary: 'new FormControl({ value: \'\', disabled: false })' },
|
||||
defaultValue: { summary: `new FormControl({ value: '', disabled: false })` },
|
||||
category: 'Form Controls'
|
||||
}
|
||||
},
|
||||
@@ -128,7 +124,7 @@ export default {
|
||||
description: 'FormControl to search the user.',
|
||||
table: {
|
||||
type: { summary: 'FormControl' },
|
||||
defaultValue: { summary: 'new FormControl({ value: \'\', disabled: false })' },
|
||||
defaultValue: { summary: `new FormControl({ value: '', disabled: false })` },
|
||||
category: 'Form Controls'
|
||||
}
|
||||
},
|
||||
@@ -173,7 +169,7 @@ export default {
|
||||
}
|
||||
} as Meta<PeopleCloudComponent>;
|
||||
|
||||
const template: StoryFn<PeopleCloudComponent> = args => ({
|
||||
const template: StoryFn<PeopleCloudComponent> = (args) => ({
|
||||
props: args
|
||||
});
|
||||
|
||||
|
@@ -17,13 +17,10 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { PeopleCloudComponent } from './components/people-cloud.component';
|
||||
import { IdentityUserService } from './services/identity-user.service';
|
||||
import { IDENTITY_USER_SERVICE_TOKEN } from './services/identity-user-service.token';
|
||||
|
||||
/** @deprecated Use `PeopleCloudComponent` instead */
|
||||
@NgModule({
|
||||
imports: [PeopleCloudComponent],
|
||||
exports: [PeopleCloudComponent],
|
||||
providers: [{ provide: IDENTITY_USER_SERVICE_TOKEN, useExisting: IdentityUserService }]
|
||||
exports: [PeopleCloudComponent]
|
||||
})
|
||||
export class PeopleCloudModule {}
|
||||
|
@@ -33,9 +33,9 @@ import {
|
||||
} from './services/public-api';
|
||||
import { CloudFormRenderingService } from './form/components/cloud-form-rendering.service';
|
||||
import { ApolloModule } from 'apollo-angular';
|
||||
import { RichTextEditorModule } from './rich-text-editor/rich-text-editor.module';
|
||||
import { ProcessNameCloudPipe } from './pipes/process-name-cloud.pipe';
|
||||
import { PeopleCloudComponent } from './people/components/people-cloud.component';
|
||||
import { RichTextEditorComponent } from './rich-text-editor';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -49,7 +49,7 @@ import { PeopleCloudComponent } from './people/components/people-cloud.component
|
||||
TaskFormModule,
|
||||
ProcessNameCloudPipe,
|
||||
ApolloModule,
|
||||
RichTextEditorModule
|
||||
RichTextEditorComponent
|
||||
],
|
||||
providers: [provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud')],
|
||||
exports: [
|
||||
@@ -61,7 +61,7 @@ import { PeopleCloudComponent } from './people/components/people-cloud.component
|
||||
TaskFormModule,
|
||||
PeopleCloudComponent,
|
||||
ProcessNameCloudPipe,
|
||||
RichTextEditorModule
|
||||
RichTextEditorComponent
|
||||
]
|
||||
})
|
||||
export class ProcessServicesCloudModule {
|
||||
|
@@ -25,8 +25,8 @@ import { HttpClientModule } from '@angular/common/http';
|
||||
import { EditProcessFilterCloudComponent } from './components/edit-process-filter-cloud.component';
|
||||
import { ProcessFilterDialogCloudComponent } from './components/process-filter-dialog-cloud.component';
|
||||
import { APP_LIST_CLOUD_DIRECTIVES } from './../../app/app-list-cloud.module';
|
||||
import { PeopleCloudModule } from '../../people/people-cloud.module';
|
||||
import { DateRangeFilterComponent } from '../../common/date-range-filter/date-range-filter.component';
|
||||
import { PeopleCloudComponent } from '../../people/components/people-cloud.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -38,7 +38,7 @@ import { DateRangeFilterComponent } from '../../common/date-range-filter/date-ra
|
||||
...APP_LIST_CLOUD_DIRECTIVES,
|
||||
CoreModule,
|
||||
DateRangeFilterComponent,
|
||||
PeopleCloudModule
|
||||
PeopleCloudComponent
|
||||
],
|
||||
declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent],
|
||||
exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent]
|
||||
|
@@ -51,10 +51,10 @@ describe('RichTextEditorComponent', () => {
|
||||
await fixture.whenStable();
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [RichTextEditorComponent]
|
||||
}).compileComponents();
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [RichTextEditorComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(RichTextEditorComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { RichTextEditorModule } from './rich-text-editor.module';
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { ProcessServicesCloudStoryModule } from '../testing/process-services-cloud-story.module';
|
||||
import { RichTextEditorComponent } from './rich-text-editor.component';
|
||||
@@ -26,7 +25,7 @@ export default {
|
||||
title: 'Process Services Cloud/Rich Text Editor',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [RichTextEditorModule]
|
||||
imports: [RichTextEditorComponent]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(ProcessServicesCloudStoryModule)]
|
||||
|
@@ -20,9 +20,12 @@ import { AfterViewInit, Component, Input, OnDestroy, OnInit, ViewEncapsulation }
|
||||
import EditorJS, { OutputData } from '@editorjs/editorjs';
|
||||
import { Subject } from 'rxjs';
|
||||
import { editorJsConfig } from './editorjs-config';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-cloud-rich-text-editor',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
templateUrl: './rich-text-editor.component.html',
|
||||
styleUrls: ['./rich-text-editor.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
@@ -16,15 +16,11 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RichTextEditorComponent } from './rich-text-editor.component';
|
||||
|
||||
|
||||
/** @deprecated use RichTextEditorComponent instead */
|
||||
@NgModule({
|
||||
declarations: [RichTextEditorComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
imports: [RichTextEditorComponent],
|
||||
exports: [RichTextEditorComponent]
|
||||
})
|
||||
export class RichTextEditorModule { }
|
||||
export class RichTextEditorModule {}
|
||||
|
@@ -32,9 +32,7 @@ import { TaskCloudService } from '../../../services/task-cloud.service';
|
||||
import { fakeFilter } from '../../mock/task-filters-cloud.mock';
|
||||
import { DateCloudFilterType } from '../../../../models/date-cloud-filter.model';
|
||||
import { AssignmentType, TaskFilterCloudModel, TaskStatusFilter } from '../../models/filter-cloud.model';
|
||||
import { PeopleCloudModule } from '../../../../people/people-cloud.module';
|
||||
import { ProcessDefinitionCloud } from '../../../../models/process-definition-cloud.model';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
import {
|
||||
mockAlfrescoApi,
|
||||
mockCompletedDateFilter,
|
||||
@@ -57,6 +55,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatSelectHarness } from '@angular/material/select/testing';
|
||||
import { MatExpansionPanelHarness } from '@angular/material/expansion/testing';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { PeopleCloudComponent } from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
describe('EditTaskFilterCloudComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
@@ -74,7 +73,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ProcessServiceCloudTestingModule, TaskFiltersCloudModule, PeopleCloudModule, MatIconTestingModule],
|
||||
imports: [ProcessServiceCloudTestingModule, TaskFiltersCloudModule, PeopleCloudComponent],
|
||||
providers: [MatDialog, { provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }]
|
||||
});
|
||||
fixture = TestBed.createComponent(EditTaskFilterCloudComponent);
|
||||
|
@@ -18,18 +18,12 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import {
|
||||
AppConfigService,
|
||||
AppConfigServiceMock,
|
||||
TranslationService,
|
||||
TranslationMock,
|
||||
CoreModule,
|
||||
AuthModule
|
||||
} from '@alfresco/adf-core';
|
||||
import { AppConfigService, AppConfigServiceMock, TranslationService, TranslationMock, CoreModule, AuthModule } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ProcessServicesCloudModule } from '../process-services-cloud.module';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -39,7 +33,8 @@ import { RouterTestingModule } from '@angular/router/testing';
|
||||
RouterTestingModule,
|
||||
TranslateModule.forRoot(),
|
||||
CoreModule.forRoot(),
|
||||
ProcessServicesCloudModule.forRoot()
|
||||
ProcessServicesCloudModule.forRoot(),
|
||||
MatIconTestingModule
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
|
Reference in New Issue
Block a user