mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5106] fix stencil registration (#5694)
* customize services on the module level * improved service registration
This commit is contained in:
@@ -29,10 +29,13 @@ import { GroupCloudWidgetComponent } from './widgets/group/group-cloud.widget';
|
||||
export class CloudFormRenderingService extends FormRenderingService {
|
||||
constructor() {
|
||||
super();
|
||||
this.setComponentTypeResolver('upload', () => AttachFileCloudWidgetComponent, true);
|
||||
this.setComponentTypeResolver('dropdown', () => DropdownCloudWidgetComponent, true);
|
||||
this.setComponentTypeResolver('date', () => DateCloudWidgetComponent, true);
|
||||
this.setComponentTypeResolver('people', () => PeopleCloudWidgetComponent, true);
|
||||
this.setComponentTypeResolver('functional-group', () => GroupCloudWidgetComponent, true);
|
||||
|
||||
this.register({
|
||||
'upload': () => AttachFileCloudWidgetComponent,
|
||||
'dropdown': () => DropdownCloudWidgetComponent,
|
||||
'date': () => DateCloudWidgetComponent,
|
||||
'people': () => PeopleCloudWidgetComponent,
|
||||
'functional-group': () => GroupCloudWidgetComponent
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,6 @@ import {
|
||||
WidgetVisibilityService,
|
||||
FormService,
|
||||
NotificationService,
|
||||
FormRenderingService,
|
||||
FORM_FIELD_VALIDATORS,
|
||||
FormFieldValidator,
|
||||
FormValues,
|
||||
@@ -40,14 +39,10 @@ import {
|
||||
import { FormCloudService } from '../services/form-cloud.service';
|
||||
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
|
||||
import { TaskDetailsCloudModel } from '../../task/start-task/models/task-details-cloud.model';
|
||||
import { CloudFormRenderingService } from './cloud-form-rendering.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-cloud-form',
|
||||
templateUrl: './form-cloud.component.html',
|
||||
providers: [
|
||||
{ provide: FormRenderingService, useClass: CloudFormRenderingService }
|
||||
]
|
||||
templateUrl: './form-cloud.component.html'
|
||||
})
|
||||
export class FormCloudComponent extends FormBaseComponent implements OnChanges, OnDestroy {
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { TemplateModule, FormBaseModule, PipeModule, CoreModule, FormRenderingService } from '@alfresco/adf-core';
|
||||
import { TemplateModule, FormBaseModule, PipeModule, CoreModule } from '@alfresco/adf-core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { FormCloudComponent } from './components/form-cloud.component';
|
||||
@@ -64,8 +64,7 @@ import { GroupCloudModule } from '../group/group-cloud.module';
|
||||
GroupCloudWidgetComponent
|
||||
],
|
||||
providers: [
|
||||
FormDefinitionSelectorCloudService,
|
||||
FormRenderingService
|
||||
FormDefinitionSelectorCloudService
|
||||
],
|
||||
entryComponents: [
|
||||
UploadCloudWidgetComponent,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TRANSLATION_PROVIDER, CoreModule } from '@alfresco/adf-core';
|
||||
import { TRANSLATION_PROVIDER, CoreModule, FormRenderingService } from '@alfresco/adf-core';
|
||||
import { AppListCloudModule } from './app/app-list-cloud.module';
|
||||
import { TaskCloudModule } from './task/task-cloud.module';
|
||||
import { ProcessCloudModule } from './process/process-cloud.module';
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
TASK_FILTERS_SERVICE_TOKEN
|
||||
} from './services/public-api';
|
||||
import { PeopleCloudModule } from './people/people-cloud.module';
|
||||
import { CloudFormRenderingService } from './form/components/cloud-form-rendering.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -54,7 +55,9 @@ import { PeopleCloudModule } from './people/people-cloud.module';
|
||||
UserPreferenceCloudService,
|
||||
LocalPreferenceCloudService,
|
||||
{ provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }
|
||||
{ provide: TASK_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService },
|
||||
FormRenderingService,
|
||||
{ provide: FormRenderingService, useClass: CloudFormRenderingService }
|
||||
],
|
||||
exports: [
|
||||
AppListCloudModule,
|
||||
|
Reference in New Issue
Block a user