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:
@@ -22,7 +22,6 @@ import { TaskCloudModule } from './task/task-cloud.module';
|
|||||||
import { ProcessCloudModule } from './process/process-cloud.module';
|
import { ProcessCloudModule } from './process/process-cloud.module';
|
||||||
import { GroupCloudModule } from './group/group-cloud.module';
|
import { GroupCloudModule } from './group/group-cloud.module';
|
||||||
import { FormCloudModule } from './form/form-cloud.module';
|
import { FormCloudModule } from './form/form-cloud.module';
|
||||||
import { TaskFormModule } from './task/task-form/task-form.module';
|
|
||||||
import {
|
import {
|
||||||
LocalPreferenceCloudService,
|
LocalPreferenceCloudService,
|
||||||
PreferenceCloudServiceInterface,
|
PreferenceCloudServiceInterface,
|
||||||
@@ -36,6 +35,7 @@ import { ApolloModule } from 'apollo-angular';
|
|||||||
import { ProcessNameCloudPipe } from './pipes/process-name-cloud.pipe';
|
import { ProcessNameCloudPipe } from './pipes/process-name-cloud.pipe';
|
||||||
import { PeopleCloudComponent } from './people/components/people-cloud.component';
|
import { PeopleCloudComponent } from './people/components/people-cloud.component';
|
||||||
import { RichTextEditorComponent } from './rich-text-editor';
|
import { RichTextEditorComponent } from './rich-text-editor';
|
||||||
|
import { TaskFormCloudComponent } from './task/task-form/components/task-form-cloud.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -46,7 +46,7 @@ import { RichTextEditorComponent } from './rich-text-editor';
|
|||||||
GroupCloudModule,
|
GroupCloudModule,
|
||||||
PeopleCloudComponent,
|
PeopleCloudComponent,
|
||||||
FormCloudModule,
|
FormCloudModule,
|
||||||
TaskFormModule,
|
TaskFormCloudComponent,
|
||||||
ProcessNameCloudPipe,
|
ProcessNameCloudPipe,
|
||||||
ApolloModule,
|
ApolloModule,
|
||||||
RichTextEditorComponent
|
RichTextEditorComponent
|
||||||
@@ -58,7 +58,7 @@ import { RichTextEditorComponent } from './rich-text-editor';
|
|||||||
TaskCloudModule,
|
TaskCloudModule,
|
||||||
GroupCloudModule,
|
GroupCloudModule,
|
||||||
FormCloudModule,
|
FormCloudModule,
|
||||||
TaskFormModule,
|
TaskFormCloudComponent,
|
||||||
PeopleCloudComponent,
|
PeopleCloudComponent,
|
||||||
ProcessNameCloudPipe,
|
ProcessNameCloudPipe,
|
||||||
RichTextEditorComponent
|
RichTextEditorComponent
|
||||||
|
@@ -20,11 +20,11 @@ import { IdentityUserService } from '../../people/services/identity-user.service
|
|||||||
import { TaskCloudService } from '../services/task-cloud.service';
|
import { TaskCloudService } from '../services/task-cloud.service';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
|
standalone: true,
|
||||||
// eslint-disable-next-line @angular-eslint/directive-selector
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
||||||
selector: '[adf-cloud-claim-task]'
|
selector: '[adf-cloud-claim-task]'
|
||||||
})
|
})
|
||||||
export class ClaimTaskCloudDirective implements OnInit {
|
export class ClaimTaskCloudDirective implements OnInit {
|
||||||
|
|
||||||
/** (Required) The id of the task. */
|
/** (Required) The id of the task. */
|
||||||
@Input()
|
@Input()
|
||||||
taskId: string;
|
taskId: string;
|
||||||
@@ -47,14 +47,14 @@ export class ClaimTaskCloudDirective implements OnInit {
|
|||||||
private readonly el: ElementRef,
|
private readonly el: ElementRef,
|
||||||
private readonly renderer: Renderer2,
|
private readonly renderer: Renderer2,
|
||||||
private taskListService: TaskCloudService,
|
private taskListService: TaskCloudService,
|
||||||
private identityUserService: IdentityUserService) { }
|
private identityUserService: IdentityUserService
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.validateInputs();
|
this.validateInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
validateInputs() {
|
validateInputs() {
|
||||||
|
|
||||||
if (!this.isTaskValid()) {
|
if (!this.isTaskValid()) {
|
||||||
this.invalidParams.push('taskId');
|
this.invalidParams.push('taskId');
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,6 @@ export class ClaimTaskCloudDirective implements OnInit {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.error.emit(error);
|
this.error.emit(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async claimTask() {
|
private async claimTask() {
|
||||||
|
@@ -19,11 +19,11 @@ import { Directive, Input, HostListener, Output, EventEmitter, OnInit, ElementRe
|
|||||||
import { TaskCloudService } from '../services/task-cloud.service';
|
import { TaskCloudService } from '../services/task-cloud.service';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
|
standalone: true,
|
||||||
// eslint-disable-next-line @angular-eslint/directive-selector
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
||||||
selector: '[adf-cloud-complete-task]'
|
selector: '[adf-cloud-complete-task]'
|
||||||
})
|
})
|
||||||
export class CompleteTaskDirective implements OnInit {
|
export class CompleteTaskDirective implements OnInit {
|
||||||
|
|
||||||
/** (Required) The id of the task. */
|
/** (Required) The id of the task. */
|
||||||
@Input()
|
@Input()
|
||||||
taskId: string;
|
taskId: string;
|
||||||
@@ -42,18 +42,13 @@ export class CompleteTaskDirective implements OnInit {
|
|||||||
|
|
||||||
invalidParams: string[] = [];
|
invalidParams: string[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(private readonly el: ElementRef, private readonly renderer: Renderer2, private readonly taskListService: TaskCloudService) {}
|
||||||
private readonly el: ElementRef,
|
|
||||||
private readonly renderer: Renderer2,
|
|
||||||
private readonly taskListService: TaskCloudService
|
|
||||||
) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.validateInputs();
|
this.validateInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
validateInputs() {
|
validateInputs() {
|
||||||
|
|
||||||
if (!this.isTaskValid()) {
|
if (!this.isTaskValid()) {
|
||||||
this.invalidParams.push('taskId');
|
this.invalidParams.push('taskId');
|
||||||
}
|
}
|
||||||
@@ -85,6 +80,5 @@ export class CompleteTaskDirective implements OnInit {
|
|||||||
this.renderer.removeAttribute(this.el.nativeElement, 'disabled');
|
this.renderer.removeAttribute(this.el.nativeElement, 'disabled');
|
||||||
this.error.emit(error);
|
this.error.emit(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,15 +21,7 @@ import { ClaimTaskCloudDirective } from './claim-task-cloud.directive';
|
|||||||
import { UnClaimTaskCloudDirective } from './unclaim-task-cloud.directive';
|
import { UnClaimTaskCloudDirective } from './unclaim-task-cloud.directive';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
imports: [CompleteTaskDirective, ClaimTaskCloudDirective, UnClaimTaskCloudDirective],
|
||||||
CompleteTaskDirective,
|
exports: [CompleteTaskDirective, ClaimTaskCloudDirective, UnClaimTaskCloudDirective]
|
||||||
ClaimTaskCloudDirective,
|
|
||||||
UnClaimTaskCloudDirective
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
CompleteTaskDirective,
|
|
||||||
ClaimTaskCloudDirective,
|
|
||||||
UnClaimTaskCloudDirective
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class TaskDirectiveModule {}
|
export class TaskDirectiveModule {}
|
||||||
|
@@ -19,11 +19,11 @@ import { Directive, Input, HostListener, Output, EventEmitter, OnInit, ElementRe
|
|||||||
import { TaskCloudService } from '../services/task-cloud.service';
|
import { TaskCloudService } from '../services/task-cloud.service';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
|
standalone: true,
|
||||||
// eslint-disable-next-line @angular-eslint/directive-selector
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
||||||
selector: '[adf-cloud-unclaim-task]'
|
selector: '[adf-cloud-unclaim-task]'
|
||||||
})
|
})
|
||||||
export class UnClaimTaskCloudDirective implements OnInit {
|
export class UnClaimTaskCloudDirective implements OnInit {
|
||||||
|
|
||||||
/** (Required) The id of the task. */
|
/** (Required) The id of the task. */
|
||||||
@Input()
|
@Input()
|
||||||
taskId: string;
|
taskId: string;
|
||||||
@@ -42,17 +42,13 @@ export class UnClaimTaskCloudDirective implements OnInit {
|
|||||||
|
|
||||||
invalidParams: string[] = [];
|
invalidParams: string[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(private readonly el: ElementRef, private readonly renderer: Renderer2, private taskListService: TaskCloudService) {}
|
||||||
private readonly el: ElementRef,
|
|
||||||
private readonly renderer: Renderer2,
|
|
||||||
private taskListService: TaskCloudService) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.validateInputs();
|
this.validateInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
validateInputs() {
|
validateInputs() {
|
||||||
|
|
||||||
if (!this.isTaskValid()) {
|
if (!this.isTaskValid()) {
|
||||||
this.invalidParams.push('taskId');
|
this.invalidParams.push('taskId');
|
||||||
}
|
}
|
||||||
|
@@ -21,24 +21,10 @@ import { TaskFiltersCloudModule } from './task-filters/task-filters-cloud.module
|
|||||||
import { StartTaskCloudModule } from './start-task/start-task-cloud.module';
|
import { StartTaskCloudModule } from './start-task/start-task-cloud.module';
|
||||||
import { TaskHeaderCloudModule } from './task-header/task-header-cloud.module';
|
import { TaskHeaderCloudModule } from './task-header/task-header-cloud.module';
|
||||||
import { TaskDirectiveModule } from './directives/task-directive.module';
|
import { TaskDirectiveModule } from './directives/task-directive.module';
|
||||||
import { TaskFormModule } from './task-form/task-form.module';
|
import { TaskFormCloudComponent } from './task-form/components/task-form-cloud.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [TaskListCloudModule, TaskFiltersCloudModule, StartTaskCloudModule, TaskHeaderCloudModule, TaskDirectiveModule, TaskFormCloudComponent],
|
||||||
TaskListCloudModule,
|
exports: [TaskListCloudModule, TaskFiltersCloudModule, StartTaskCloudModule, TaskHeaderCloudModule, TaskDirectiveModule, TaskFormCloudComponent]
|
||||||
TaskFiltersCloudModule,
|
|
||||||
StartTaskCloudModule,
|
|
||||||
TaskHeaderCloudModule,
|
|
||||||
TaskDirectiveModule,
|
|
||||||
TaskFormModule
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
TaskListCloudModule,
|
|
||||||
TaskFiltersCloudModule,
|
|
||||||
StartTaskCloudModule,
|
|
||||||
TaskHeaderCloudModule,
|
|
||||||
TaskDirectiveModule,
|
|
||||||
TaskFormModule
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class TaskCloudModule {}
|
export class TaskCloudModule {}
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||||
import { FormCloudService } from '../../../form/public-api';
|
import { FormCloudService } from '../../../form/public-api';
|
||||||
import { TaskCloudService } from '../../services/task-cloud.service';
|
import { TaskCloudService } from '../../services/task-cloud.service';
|
||||||
import { TaskFormModule } from '../task-form.module';
|
|
||||||
import { TaskFormCloudComponent } from './task-form-cloud.component';
|
import { TaskFormCloudComponent } from './task-form-cloud.component';
|
||||||
import { TaskCloudServiceMock } from '../../mock/task-cloud.service.mock';
|
import { TaskCloudServiceMock } from '../../mock/task-cloud.service.mock';
|
||||||
import { FormCloudServiceMock } from '../../../form/mocks/form-cloud.service.mock';
|
import { FormCloudServiceMock } from '../../../form/mocks/form-cloud.service.mock';
|
||||||
@@ -30,16 +29,14 @@ export default {
|
|||||||
title: 'Process Services Cloud/Task Cloud/Task Form/Task Form Cloud',
|
title: 'Process Services Cloud/Task Cloud/Task Form/Task Form Cloud',
|
||||||
decorators: [
|
decorators: [
|
||||||
moduleMetadata({
|
moduleMetadata({
|
||||||
imports: [TaskFormModule],
|
imports: [TaskFormCloudComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: TaskCloudService, useClass: TaskCloudServiceMock },
|
{ provide: TaskCloudService, useClass: TaskCloudServiceMock },
|
||||||
{ provide: FormCloudService, useClass: FormCloudServiceMock }
|
{ provide: FormCloudService, useClass: FormCloudServiceMock }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
applicationConfig({
|
applicationConfig({
|
||||||
providers: [
|
providers: [importProvidersFrom(ProcessServicesCloudStoryModule)]
|
||||||
importProvidersFrom(ProcessServicesCloudStoryModule)
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
|
@@ -18,7 +18,15 @@
|
|||||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, OnInit, ViewEncapsulation, OnDestroy, ViewChild } from '@angular/core';
|
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, OnInit, ViewEncapsulation, OnDestroy, ViewChild } from '@angular/core';
|
||||||
import { TaskDetailsCloudModel } from '../../start-task/models/task-details-cloud.model';
|
import { TaskDetailsCloudModel } from '../../start-task/models/task-details-cloud.model';
|
||||||
import { TaskCloudService } from '../../services/task-cloud.service';
|
import { TaskCloudService } from '../../services/task-cloud.service';
|
||||||
import { FormRenderingService, FormModel, ContentLinkModel, FormOutcomeEvent, FormFieldValidator, FORM_FIELD_VALIDATORS } from '@alfresco/adf-core';
|
import {
|
||||||
|
FormRenderingService,
|
||||||
|
FormModel,
|
||||||
|
ContentLinkModel,
|
||||||
|
FormOutcomeEvent,
|
||||||
|
FormFieldValidator,
|
||||||
|
FORM_FIELD_VALIDATORS,
|
||||||
|
EmptyContentComponent
|
||||||
|
} from '@alfresco/adf-core';
|
||||||
import { AttachFileCloudWidgetComponent } from '../../../form/components/widgets/attach-file/attach-file-cloud-widget.component';
|
import { AttachFileCloudWidgetComponent } from '../../../form/components/widgets/attach-file/attach-file-cloud-widget.component';
|
||||||
import { DropdownCloudWidgetComponent } from '../../../form/components/widgets/dropdown/dropdown-cloud.widget';
|
import { DropdownCloudWidgetComponent } from '../../../form/components/widgets/dropdown/dropdown-cloud.widget';
|
||||||
import { DateCloudWidgetComponent } from '../../../form/components/widgets/date/date-cloud.widget';
|
import { DateCloudWidgetComponent } from '../../../form/components/widgets/date/date-cloud.widget';
|
||||||
@@ -26,9 +34,32 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { FormCloudDisplayModeConfiguration } from '../../../services/form-fields.interfaces';
|
import { FormCloudDisplayModeConfiguration } from '../../../services/form-fields.interfaces';
|
||||||
import { FormCloudComponent } from '../../../form/components/form-cloud.component';
|
import { FormCloudComponent } from '../../../form/components/form-cloud.component';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { ClaimTaskCloudDirective } from '../../directives/claim-task-cloud.directive';
|
||||||
|
import { UnClaimTaskCloudDirective } from '../../directives/unclaim-task-cloud.directive';
|
||||||
|
import { CompleteTaskDirective } from '../../directives/complete-task.directive';
|
||||||
|
import { MatCardModule } from '@angular/material/card';
|
||||||
|
import { FormCustomOutcomesComponent } from '../../../form/components/form-cloud-custom-outcomes.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-cloud-task-form',
|
selector: 'adf-cloud-task-form',
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
TranslateModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatProgressSpinnerModule,
|
||||||
|
ClaimTaskCloudDirective,
|
||||||
|
UnClaimTaskCloudDirective,
|
||||||
|
CompleteTaskDirective,
|
||||||
|
EmptyContentComponent,
|
||||||
|
MatCardModule,
|
||||||
|
FormCustomOutcomesComponent,
|
||||||
|
FormCloudComponent
|
||||||
|
],
|
||||||
templateUrl: './task-form-cloud.component.html',
|
templateUrl: './task-form-cloud.component.html',
|
||||||
styleUrls: ['./task-form-cloud.component.scss'],
|
styleUrls: ['./task-form-cloud.component.scss'],
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
|
@@ -16,27 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { MaterialModule } from '../../material.module';
|
|
||||||
import { FormCloudModule } from '../../form/form-cloud.module';
|
|
||||||
import { TaskDirectiveModule } from '../directives/task-directive.module';
|
|
||||||
|
|
||||||
import { TaskFormCloudComponent } from './components/task-form-cloud.component';
|
import { TaskFormCloudComponent } from './components/task-form-cloud.component';
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
|
||||||
|
|
||||||
|
/** @deprecated use TaskFormCloudComponent instead */
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [TaskFormCloudComponent],
|
||||||
CoreModule,
|
exports: [TaskFormCloudComponent]
|
||||||
CommonModule,
|
|
||||||
MaterialModule,
|
|
||||||
FormCloudModule,
|
|
||||||
TaskDirectiveModule
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
TaskFormCloudComponent
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
TaskFormCloudComponent
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class TaskFormModule {}
|
export class TaskFormModule {}
|
||||||
|
Reference in New Issue
Block a user