From 4c6234b544dcdfacfe6fe5b74ae8906fe0924260 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 12:05:27 -0500 Subject: [PATCH 01/10] remove deprecated directive --- .../components/task-details.component.md | 21 ---------- .../no-task-detail-template.directive.spec.ts | 36 ----------------- .../no-task-detail-template.directive.ts | 39 ------------------- .../src/lib/task-list/public-api.ts | 3 -- 4 files changed, 99 deletions(-) delete mode 100644 lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.spec.ts delete mode 100644 lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.ts diff --git a/docs/process-services/components/task-details.component.md b/docs/process-services/components/task-details.component.md index 4f21be779fa..b0b24e14a10 100644 --- a/docs/process-services/components/task-details.component.md +++ b/docs/process-services/components/task-details.component.md @@ -53,24 +53,3 @@ Shows the details of the task ID passed in as input. | taskCreated | `EventEmitter` | Emitted when a checklist task is created. | | taskDeleted | `EventEmitter` | Emitted when a checklist task is deleted. | | unClaimedTask | `EventEmitter` | Emitted when a task is unclaimed. | - -## Details - -### Custom 'empty Task Details' template - -By default, the [Task Details component](task-details.component.md) shows "No Tasks" message when there are -no details. You can change this by adding a custom HTML template as in the following -example: - -```html - - - -

Sorry, no tasks here

- example -
-
-
-``` - -Note that you can use any HTML content in the template, including other Angular components. diff --git a/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.spec.ts b/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.spec.ts deleted file mode 100644 index 2903324e7d3..00000000000 --- a/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.spec.ts +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { NoTaskDetailsTemplateDirective } from './no-task-detail-template.directive'; -import { TaskDetailsComponent } from '../task-details/task-details.component'; - -describe('NoTaskDetailsTemplateDirective', () => { - let component: NoTaskDetailsTemplateDirective; - let detailsComponent: TaskDetailsComponent; - - beforeEach(() => { - detailsComponent = new TaskDetailsComponent(null, null, null, null, null); - component = new NoTaskDetailsTemplateDirective(detailsComponent); - }); - - it('should set "no task details" template on task details component', () => { - const testTemplate: any = 'test template'; - component.template = testTemplate; - component.ngAfterContentInit(); - expect(detailsComponent.noTaskDetailsTemplateComponent).toBe(testTemplate); - }); -}); diff --git a/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.ts b/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.ts deleted file mode 100644 index 7cd132dfbca..00000000000 --- a/lib/process-services/src/lib/task-list/components/no-task-details/no-task-detail-template.directive.ts +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { AfterContentInit, ContentChild, Directive, TemplateRef } from '@angular/core'; -import { TaskDetailsComponent } from '../task-details/task-details.component'; - -/** - * @deprecated no longer used anywhere, and can be safely removed - * Directive selectors without adf- prefix will be deprecated on 3.0.0 - */ -@Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: 'adf-no-task-details-template, no-task-details-template', - standalone: true -}) -export class NoTaskDetailsTemplateDirective implements AfterContentInit { - @ContentChild(TemplateRef) - template: any; - - constructor(private activitiTaskDetails: TaskDetailsComponent) {} - - ngAfterContentInit() { - this.activitiTaskDetails.noTaskDetailsTemplateComponent = this.template; - } -} diff --git a/lib/process-services/src/lib/task-list/public-api.ts b/lib/process-services/src/lib/task-list/public-api.ts index f0f331f7792..f937e715478 100644 --- a/lib/process-services/src/lib/task-list/public-api.ts +++ b/lib/process-services/src/lib/task-list/public-api.ts @@ -20,7 +20,6 @@ import { UnclaimTaskDirective } from './components/task-form/unclaim-task.direct import { TaskFormComponent } from './components/task-form/task-form.component'; import { AttachFormComponent } from './components/attach-form/attach-form.component'; import { ChecklistComponent } from './components/checklist/checklist.component'; -import { NoTaskDetailsTemplateDirective } from './components/no-task-details/no-task-detail-template.directive'; import { TaskAuditDirective } from './components/task-audit/task-audit.directive'; import { TaskFiltersComponent } from './components/task-filters/task-filters.component'; import { TaskListComponent } from './components/task-list/task-list.component'; @@ -32,7 +31,6 @@ import { TaskStandaloneComponent } from './components/task-standalone/task-stand export * from './components/task-list/task-list.component'; export * from './components/checklist/checklist.component'; export * from './components/task-header/task-header.component'; -export * from './components/no-task-details/no-task-detail-template.directive'; export * from './components/task-filters/task-filters.component'; export * from './components/task-form/task-form.component'; export * from './components/task-form/claim-task.directive'; @@ -65,6 +63,5 @@ export const TASK_LIST_DIRECTIVES = [ TaskStandaloneComponent, ClaimTaskDirective, UnclaimTaskDirective, - NoTaskDetailsTemplateDirective, TaskAuditDirective ] as const; From 561a5c49705d072611741375844cd8d00e0116e7 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 12:11:01 -0500 Subject: [PATCH 02/10] remove deprecated task audit directive --- docs/README.md | 1 - .../images/adf-task-audit-directive.png | Bin 7050 -> 0 bytes .../directives/task-audit.directive.md | 42 ----- .../task-audit/task-audit.directive.spec.ts | 155 ------------------ .../task-audit/task-audit.directive.ts | 121 -------------- .../src/lib/task-list/public-api.ts | 5 +- 6 files changed, 1 insertion(+), 323 deletions(-) delete mode 100644 docs/docassets/images/adf-task-audit-directive.png delete mode 100644 docs/process-services/directives/task-audit.directive.md delete mode 100644 lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.spec.ts delete mode 100644 lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts diff --git a/docs/README.md b/docs/README.md index 0b42a6d5e19..fd8f1dd4135 100644 --- a/docs/README.md +++ b/docs/README.md @@ -445,7 +445,6 @@ for more information about installing and using the source code. | ---- | ----------- | ----------- | | [Claim Task Directive](process-services/directives/claim-task.directive.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Claims a task | [Source](../lib/process-services/src/lib/task-list/components/task-form/claim-task.directive.ts) | | [Process Audit Directive](process-services/directives/process-audit.directive.md) | Fetches the Process Audit information in PDF or JSON format. | [Source](../lib/process-services/src/lib/process-list/components/process-audit/process-audit.directive.ts) | -| [Task Audit Directive](process-services/directives/task-audit.directive.md) | Fetches the Task Audit information in PDF or JSON format. | [Source](../lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts) | | [Unclaim Task Directive](process-services/directives/unclaim-task.directive.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Unclaims a task | [Source](../lib/process-services/src/lib/task-list/components/task-form/unclaim-task.directive.ts) | ### Services diff --git a/docs/docassets/images/adf-task-audit-directive.png b/docs/docassets/images/adf-task-audit-directive.png deleted file mode 100644 index 770e27c33b2909628392ca25d0c2648e589cf985..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7050 zcmaiX2Q-{ryY?s{1QETrC<$V8(Fr0%?_Hv1w23i>VU!R=FA+pdM3iVTi0Bd}$mkIn z4AFxz7$(RlN8a*%@Bg3gob#+T&)R$6_jTQS-_NYQt}EWeNSBtHgBkz;(CXdMHUj`i zO3ud_7fH|GF(KDI000^$kd~H-o|YD$2?Xo`@^J?M?!-UKrnGoE!18HL?E2%!EKedc zM?<&y+V4K2lfT8lmq|~m*_$FE`W|NbA)zM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-j^_IPDl=WHOh3qNA@ZG8kZd2$_Ck8Drj|K zZwsgp04+IrO(3Hkp2Ie3wliKE(O3s1xJk1&s3C6VHM;yQ zOH+B(3zM-u@%_GTl#&WPvfqK7$M_CI5hMS^>x1W-yA-Qj*Fo4DQFm^k)NT-f7{vWg z>i%4Y|7XemFZ1xf+JbY>@u$i7&m?@x|ED+kPxRthSSTPehVoDL7wnh*b|+n^BVI02 WW?h3HMmfLTu%3>QcFnDOQU3)qe?yi4 diff --git a/docs/process-services/directives/task-audit.directive.md b/docs/process-services/directives/task-audit.directive.md deleted file mode 100644 index 87a1f0e5cc1..00000000000 --- a/docs/process-services/directives/task-audit.directive.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -Title: Task Audit Directive -Added: v2.0.0 -Status: Active -Last reviewed: 2019-01-14 ---- - -# [Task Audit Directive](../../../lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts "Defined in task-audit.directive.ts") - -Fetches the Task Audit information in PDF or JSON format. - -![adf-task-audit-directive](../../docassets/images/adf-task-audit-directive.png) - -## Basic Usage - -```html - -``` - -## Class members - -### Properties - -| Name | Type | Default value | Description | -| ---- | ---- | ------------- | ----------- | -| download | `boolean` | true | Enables downloading of the audit when the decorated element is clicked. | -| fileName | `string` | "Audit" | Name of the downloaded file (for PDF downloads). | -| format | `string` | "pdf" | Format of the audit information. Can be "pdf" or "json". | -| taskId | `string` | | (**required**) The id of the task. | - -### Events - -| Name | Type | Description | -| ---- | ---- | ----------- | -| clicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the decorated element is clicked. | -| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when an error occurs. | diff --git a/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.spec.ts b/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.spec.ts deleted file mode 100644 index 4318038d9db..00000000000 --- a/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.spec.ts +++ /dev/null @@ -1,155 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Component } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing'; -import { of } from 'rxjs'; -import { TaskListService } from '../../services/tasklist.service'; -import { ProcessTestingModule } from '../../../testing/process.testing.module'; -import { TaskAuditDirective } from '@alfresco/adf-process-services'; - -declare let jasmine: any; - -describe('TaskAuditDirective', () => { - @Component({ - selector: 'adf-basic-button', - standalone: true, - imports: [TaskAuditDirective], - template: ` ` - }) - class BasicButtonComponent { - download: boolean = false; - fileName: string; - format: string; - - onAuditClick() {} - } - - let fixture: ComponentFixture; - let component: BasicButtonComponent; - let service: TaskListService; - - const createFakePdfBlob = (): Blob => { - const pdfData = atob( - 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' + - 'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' + - 'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' + - 'Pj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAg' + - 'L1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+' + - 'PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9u' + - 'dAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2Jq' + - 'Cgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJU' + - 'CjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVu' + - 'ZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4g' + - 'CjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAw' + - 'MDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9v' + - 'dCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G' - ); - return new Blob([pdfData], { type: 'application/pdf' }); - }; - - beforeEach(() => { - TestBed.configureTestingModule({ - imports: [ProcessTestingModule, BasicButtonComponent] - }); - fixture = TestBed.createComponent(BasicButtonComponent); - component = fixture.componentInstance; - service = TestBed.inject(TaskListService); - - jasmine.Ajax.install(); - }); - - afterEach(() => { - jasmine.Ajax.uninstall(); - }); - - it('should fetch the pdf Blob when the format is pdf', fakeAsync(() => { - component.fileName = 'FakeAuditName'; - component.format = 'pdf'; - const blob = createFakePdfBlob(); - spyOn(service, 'fetchTaskAuditPdfById').and.returnValue(of(blob)); - spyOn(component, 'onAuditClick').and.callThrough(); - - fixture.detectChanges(); - - const button = fixture.nativeElement.querySelector('#auditButton'); - - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(component.onAuditClick).toHaveBeenCalledWith({ format: 'pdf', value: blob, fileName: 'FakeAuditName' }); - }); - - button.click(); - })); - - it('should fetch the json info when the format is json', fakeAsync(() => { - component.fileName = 'FakeAuditName'; - component.format = 'json'; - component.download = true; - - const auditJson = { - taskId: '77', - taskName: 'Fake Task Name', - assignee: 'FirstName LastName', - formData: [], - selectedOutcome: null, - comments: [] - }; - spyOn(service, 'fetchTaskAuditJsonById').and.returnValue(of(auditJson)); - spyOn(component, 'onAuditClick').and.callThrough(); - - fixture.detectChanges(); - - const button = fixture.nativeElement.querySelector('#auditButton'); - - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(component.onAuditClick).toHaveBeenCalledWith({ format: 'json', value: auditJson, fileName: 'FakeAuditName' }); - }); - - button.click(); - })); - - it('should fetch the pdf Blob as default when the format is UNKNOWN', fakeAsync(() => { - component.fileName = 'FakeAuditName'; - component.format = 'fakeFormat'; - const blob = createFakePdfBlob(); - spyOn(service, 'fetchTaskAuditPdfById').and.returnValue(of(blob)); - spyOn(component, 'onAuditClick').and.callThrough(); - - fixture.detectChanges(); - - const button = fixture.nativeElement.querySelector('#auditButton'); - - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(component.onAuditClick).toHaveBeenCalledWith({ format: 'pdf', value: blob, fileName: 'FakeAuditName' }); - }); - - button.click(); - })); -}); diff --git a/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts b/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts deleted file mode 100644 index aa5ec711982..00000000000 --- a/lib/process-services/src/lib/task-list/components/task-audit/task-audit.directive.ts +++ /dev/null @@ -1,121 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* eslint-disable @angular-eslint/no-input-rename */ - -import { DownloadService } from '@alfresco/adf-core'; -import { Directive, EventEmitter, Input, OnChanges, Output } from '@angular/core'; -import { TaskListService } from '../../services/tasklist.service'; - -const JSON_FORMAT: string = 'json'; -const PDF_FORMAT: string = 'pdf'; - -/** @deprecated no longer used anywhere, and can be safely removed */ -@Directive({ - // eslint-disable-next-line @angular-eslint/directive-selector - selector: 'button[adf-task-audit]', - standalone: true, - host: { - role: 'button', - '(click)': 'onClickAudit()' - } -}) -export class TaskAuditDirective implements OnChanges { - /** (**required**) The id of the task. */ - @Input('task-id') - taskId: string; - - /** Name of the downloaded file (for PDF downloads). */ - @Input() - fileName: string = 'Audit'; - - /** Format of the audit information. Can be "pdf" or "json". */ - @Input() - format: string = 'pdf'; - - /** Enables downloading of the audit when the decorated element is clicked. */ - @Input() - download: boolean = true; - - /** Emitted when the decorated element is clicked. */ - @Output() - clicked: EventEmitter = new EventEmitter(); - - /** Emitted when an error occurs. */ - @Output() - error: EventEmitter = new EventEmitter(); - - public audit: any; - - constructor(private downloadService: DownloadService, private taskListService: TaskListService) {} - - ngOnChanges(): void { - if (!this.isValidType()) { - this.setDefaultFormatType(); - } - } - - isValidType(): boolean { - return this.format && (this.isJsonFormat() || this.isPdfFormat()); - } - - setDefaultFormatType(): void { - this.format = PDF_FORMAT; - } - - /** - * fetch the audit information in the requested format - */ - fetchAuditInfo(): void { - if (this.isPdfFormat()) { - this.taskListService.fetchTaskAuditPdfById(this.taskId).subscribe( - (blob: Blob) => { - this.audit = blob; - if (this.download) { - this.downloadService.downloadBlob(this.audit, this.fileName + '.pdf'); - } - this.clicked.emit({ format: this.format, value: this.audit, fileName: this.fileName }); - }, - (err) => { - this.error.emit(err); - } - ); - } else { - this.taskListService.fetchTaskAuditJsonById(this.taskId).subscribe( - (res) => { - this.audit = res; - this.clicked.emit({ format: this.format, value: this.audit, fileName: this.fileName }); - }, - (err) => { - this.error.emit(err); - } - ); - } - } - - onClickAudit() { - this.fetchAuditInfo(); - } - - isJsonFormat() { - return this.format === JSON_FORMAT; - } - - isPdfFormat() { - return this.format === PDF_FORMAT; - } -} diff --git a/lib/process-services/src/lib/task-list/public-api.ts b/lib/process-services/src/lib/task-list/public-api.ts index f937e715478..bce8c340643 100644 --- a/lib/process-services/src/lib/task-list/public-api.ts +++ b/lib/process-services/src/lib/task-list/public-api.ts @@ -20,7 +20,6 @@ import { UnclaimTaskDirective } from './components/task-form/unclaim-task.direct import { TaskFormComponent } from './components/task-form/task-form.component'; import { AttachFormComponent } from './components/attach-form/attach-form.component'; import { ChecklistComponent } from './components/checklist/checklist.component'; -import { TaskAuditDirective } from './components/task-audit/task-audit.directive'; import { TaskFiltersComponent } from './components/task-filters/task-filters.component'; import { TaskListComponent } from './components/task-list/task-list.component'; import { TaskDetailsComponent } from './components/task-details/task-details.component'; @@ -36,7 +35,6 @@ export * from './components/task-form/task-form.component'; export * from './components/task-form/claim-task.directive'; export * from './components/task-form/unclaim-task.directive'; export * from './components/task-details/task-details.component'; -export * from './components/task-audit/task-audit.directive'; export * from './components/start-task/start-task.component'; export * from './components/task-standalone/task-standalone.component'; export * from './components/attach-form/attach-form.component'; @@ -62,6 +60,5 @@ export const TASK_LIST_DIRECTIVES = [ StartTaskComponent, TaskStandaloneComponent, ClaimTaskDirective, - UnclaimTaskDirective, - TaskAuditDirective + UnclaimTaskDirective ] as const; From 5854faf10c9f4463805112294ca166908f567570 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 12:41:26 -0500 Subject: [PATCH 03/10] move mocks to proper places, fix tests --- .../process-list-cloud.component.html | 2 +- .../process-list-cloud.component.spec.ts | 163 +++++++++++++++++- .../process-list-cloud.component.ts | 129 ++++++++------ .../mock/process-list-service.mock.ts | 163 ------------------ .../process-list/process-list-cloud.module.ts | 6 +- .../mock/start-process.component.mock.ts | 11 -- 6 files changed, 230 insertions(+), 244 deletions(-) delete mode 100644 lib/process-services-cloud/src/lib/process/process-list/mock/process-list-service.mock.ts diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.html index e916022465b..33baffb2915 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.html +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.html @@ -1,4 +1,4 @@ -({ + key: 'fakeName', + type: 'text', + title: 'ADF_CLOUD_TASK_LIST.PROPERTIES.FAKE', + sortable: true + }), + new ObjectDataColumn({ + key: 'fakeTaskName', + type: 'text', + title: 'ADF_CLOUD_TASK_LIST.PROPERTIES.TASK_FAKE', + sortable: true + }) +]; + +const fakeProcessCloudList = { + list: { + entries: [ + { + entry: { + appName: 'easy-peasy-japanesey', + appVersion: 1, + id: '69eddfa7-d781-11e8-ae24-0a58646001fa', + name: 'starring', + processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', + processDefinitionKey: 'BasicProcess', + initiator: 'devopsuser', + startDate: 1540381146275, + businessKey: 'MyBusinessKey', + status: 'RUNNING', + lastModified: 1540381146276, + lastModifiedTo: null, + lastModifiedFrom: null, + variables: [{ id: 'variableId', value: 'variableValue' }] + } + }, + { + entry: { + appName: 'easy-peasy-japanesey', + appVersion: 1, + id: '8b3f625f-d781-11e8-ae24-0a58646001fa', + name: null, + processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', + processDefinitionKey: 'BasicProcess', + initiator: 'devopsuser', + startDate: 1540381202174, + businessKey: 'MyBusinessKey', + status: 'RUNNING', + lastModified: 1540381202174, + lastModifiedTo: null, + lastModifiedFrom: null + } + }, + { + entry: { + appName: 'easy-peasy-japanesey', + appVersion: 2, + id: '87c12637-d783-11e8-ae24-0a58646001fa', + name: null, + processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', + processDefinitionKey: 'BasicProcess', + initiator: 'superadminuser', + startDate: 1540382055307, + businessKey: 'MyBusinessKey', + status: 'RUNNING', + lastModified: 1540382055308, + lastModifiedTo: null, + lastModifiedFrom: null + } + } + ], + pagination: { + skipCount: 0, + maxItems: 100, + count: 3, + hasMoreItems: false, + totalItems: 3 + } + } +}; + @Component({ + standalone: true, + imports: [DataColumnComponent, DataColumnListComponent, ProcessListCloudComponent], template: ` @@ -66,6 +151,62 @@ class CustomTaskListComponent { } } +const processListSchemaMock = { + presets: { + default: [ + { + key: 'id', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID' + }, + { + key: 'name', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME' + }, + { + key: 'status', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS' + }, + { + key: 'startDate', + type: 'date', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE', + format: 'timeAgo' + }, + { + key: 'appName', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME' + }, + { + key: 'businessKey', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY' + }, + { + key: 'initiator', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR' + }, + { + key: 'lastModified', + type: 'date', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED' + }, + { + key: 'processDefinitionId', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEF_ID' + }, + { + key: 'processDefinitionKey', + title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEF_KEY' + } + ].map((column: { key: string; type: string; title: string; sortable: boolean; format: string }) => { + column.sortable = true; + if (!column.type) { + column.type = 'text'; + } + return column; + }) + } +}; + describe('ProcessListCloudComponent', () => { let loader: HarnessLoader; let component: ProcessListCloudComponent; @@ -78,7 +219,7 @@ describe('ProcessListCloudComponent', () => { const configureTestingModule = (searchApiMethod: 'GET' | 'POST') => { TestBed.configureTestingModule({ - imports: [ProcessServiceCloudTestingModule] + imports: [ProcessServiceCloudTestingModule, ProcessListCloudComponent] }); appConfig = TestBed.inject(AppConfigService); processListCloudService = TestBed.inject(ProcessListCloudService); @@ -904,8 +1045,7 @@ describe('ProcessListCloudComponent: Injecting custom columns for task list - Cu beforeEach(() => { TestBed.configureTestingModule({ - imports: [ProcessServiceCloudTestingModule], - declarations: [CustomTaskListComponent] + imports: [ProcessServiceCloudTestingModule, CustomTaskListComponent] }); fixtureCustom = TestBed.createComponent(CustomTaskListComponent); fixtureCustom.detectChanges(); @@ -928,6 +1068,8 @@ describe('ProcessListCloudComponent: Injecting custom columns for task list - Cu describe('ProcessListCloudComponent: Creating an empty custom template - EmptyTemplateComponent', () => { @Component({ + standalone: true, + imports: [CustomEmptyContentTemplateDirective, ProcessListCloudComponent], template: ` @@ -949,9 +1091,14 @@ describe('ProcessListCloudComponent: Creating an empty custom template - EmptyTe beforeEach(() => { TestBed.configureTestingModule({ - imports: [ProcessServiceCloudTestingModule, MatProgressSpinnerModule, CustomEmptyContentTemplateDirective], - providers: [{ provide: PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, useValue: preferencesService }], - declarations: [EmptyTemplateComponent, ProcessListCloudComponent] + imports: [ + ProcessServiceCloudTestingModule, + MatProgressSpinnerModule, + CustomEmptyContentTemplateDirective, + ProcessListCloudComponent, + EmptyTemplateComponent + ], + providers: [{ provide: PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, useValue: preferencesService }] }); fixtureEmpty = TestBed.createComponent(EmptyTemplateComponent); fixtureEmpty.detectChanges(); diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts index 887a22730eb..56c1543e7f5 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts @@ -30,6 +30,7 @@ import { } from '@angular/core'; import { AppConfigService, + ColumnsSelectorComponent, CustomEmptyContentTemplateDirective, CustomLoadingContentTemplateDirective, DataCellEvent, @@ -38,6 +39,10 @@ import { DataRowEvent, DataTableComponent, DataTableSchema, + EmptyContentComponent, + LoadingContentTemplateDirective, + MainMenuDataTableTemplateDirective, + NoContentTemplateDirective, PaginatedComponent, PaginationModel, UserPreferencesService, @@ -53,26 +58,40 @@ import { PreferenceCloudServiceInterface } from '../../../services/preference-cl import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../../services/cloud-token.service'; import { ProcessListCloudPreferences } from '../models/process-cloud-preferences'; import { ProcessListDatatableAdapter } from '../datatable/process-list-datatable-adapter'; -import { - PROCESS_LIST_CUSTOM_VARIABLE_COLUMN, - ProcessListDataColumnCustomData -} from '../../../models/data-column-custom-data'; +import { PROCESS_LIST_CUSTOM_VARIABLE_COLUMN, ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data'; import { VariableMapperService } from '../../../services/variable-mapper.sevice'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ProcessVariableFilterModel } from '../../../models/process-variable-filter.model'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgIf } from '@angular/common'; const PRESET_KEY = 'adf-cloud-process-list.presets'; +/* eslint-disable @typescript-eslint/brace-style */ + @Component({ selector: 'adf-cloud-process-list', + standalone: true, + imports: [ + DataTableComponent, + MatProgressSpinnerModule, + TranslateModule, + ColumnsSelectorComponent, + MainMenuDataTableTemplateDirective, + EmptyContentComponent, + NoContentTemplateDirective, + LoadingContentTemplateDirective, + NgIf + ], templateUrl: './process-list-cloud.component.html', styleUrls: ['./process-list-cloud.component.scss'], encapsulation: ViewEncapsulation.None }) export class ProcessListCloudComponent extends DataTableSchema - implements OnChanges, AfterContentInit, PaginatedComponent { - + implements OnChanges, AfterContentInit, PaginatedComponent +{ @ViewChild(DataTableComponent) dataTable: DataTableComponent; @ContentChild(CustomEmptyContentTemplateDirective) @@ -244,24 +263,24 @@ export class ProcessListCloudComponent @Input() processDefinitionNames: string[] = []; - /** - * Filter the processes. Display only processes started by any of the users whose usernames are present in the array. - * This input will be used only if searchApiMethod input is provided with 'POST' value. - */ + /** + * Filter the processes. Display only processes started by any of the users whose usernames are present in the array. + * This input will be used only if searchApiMethod input is provided with 'POST' value. + */ @Input() initiators: string[] = []; - /** - * Filter the processes. Display only processes present in any of the specified app versions. - * This input will be used only if searchApiMethod input is provided with 'POST' value. - */ + /** + * Filter the processes. Display only processes present in any of the specified app versions. + * This input will be used only if searchApiMethod input is provided with 'POST' value. + */ @Input() appVersions: string[] = []; - /** - * Filter the processes. Display only processes with provided statuses. - * This input will be used only if searchApiMethod input is provided with 'POST' value. - */ + /** + * Filter the processes. Display only processes with provided statuses. + * This input will be used only if searchApiMethod input is provided with 'POST' value. + */ @Input() statuses: string[] = []; @@ -278,7 +297,7 @@ export class ProcessListCloudComponent /** Emitted when rows are selected/unselected. */ @Output() - rowsSelected: EventEmitter = new EventEmitter(); + rowsSelected = new EventEmitter(); /** Emitted before the context menu is displayed for a row. */ @Output() @@ -294,11 +313,11 @@ export class ProcessListCloudComponent /** Emitted when an error occurs while loading the list of process instances from the server. */ @Output() - error: EventEmitter = new EventEmitter(); + error = new EventEmitter(); /** Emitted when the list of process instances has been loaded successfully from the server. */ @Output() - success: EventEmitter = new EventEmitter(); + success = new EventEmitter(); pagination: BehaviorSubject; size: number; @@ -335,40 +354,39 @@ export class ProcessListCloudComponent totalItems: 0 }); - combineLatest([ - this.isColumnSchemaCreated$, - this.fetchProcessesTrigger$ - ]).pipe( - tap(() => this.isLoading = true), - filter(([isColumnSchemaCreated]) => isColumnSchemaCreated), - switchMap(() => { - if (this.searchApiMethod === 'POST') { - const requestNode = this.createProcessListRequestNode(); - this.processListRequestNode = requestNode; - return this.processListCloudService.fetchProcessList(requestNode).pipe(take(1)); - } else { - const requestNode = this.createRequestNode(); - this.requestNode = requestNode; - return this.processListCloudService.getProcessByRequest(requestNode).pipe(take(1)); + combineLatest([this.isColumnSchemaCreated$, this.fetchProcessesTrigger$]) + .pipe( + tap(() => (this.isLoading = true)), + filter(([isColumnSchemaCreated]) => isColumnSchemaCreated), + switchMap(() => { + if (this.searchApiMethod === 'POST') { + const requestNode = this.createProcessListRequestNode(); + this.processListRequestNode = requestNode; + return this.processListCloudService.fetchProcessList(requestNode).pipe(take(1)); + } else { + const requestNode = this.createRequestNode(); + this.requestNode = requestNode; + return this.processListCloudService.getProcessByRequest(requestNode).pipe(take(1)); + } + }), + takeUntilDestroyed() + ) + .subscribe({ + next: (processes) => { + this.rows = this.variableMapperService.mapVariablesByColumnTitle(processes.list.entries, this.columns); + + this.dataAdapter = new ProcessListDatatableAdapter(this.rows, this.columns); + + this.success.emit(processes); + this.isLoading = false; + this.pagination.next(processes.list.pagination); + }, + error: (error) => { + console.error(error); + this.error.emit(error); + this.isLoading = false; } - }), - takeUntilDestroyed() - ).subscribe({ - next: (processes) => { - this.rows = this.variableMapperService.mapVariablesByColumnTitle(processes.list.entries, this.columns); - - this.dataAdapter = new ProcessListDatatableAdapter(this.rows, this.columns); - - this.success.emit(processes); - this.isLoading = false; - this.pagination.next(processes.list.pagination); - }, - error: (error) => { - console.error(error); - this.error.emit(error); - this.isLoading = false; - } - }); + }); } ngAfterContentInit() { @@ -429,7 +447,6 @@ export class ProcessListCloudComponent } } - private isAnyPropertyChanged(changes: SimpleChanges): boolean { for (const property in changes) { if (this.isPropertyChanged(changes, property)) { @@ -613,7 +630,7 @@ export class ProcessListCloudComponent } }); } else { - return new ProcessListRequestSortingModel({orderBy, direction, isFieldProcessVariable: false}); + return new ProcessListRequestSortingModel({ orderBy, direction, isFieldProcessVariable: false }); } } diff --git a/lib/process-services-cloud/src/lib/process/process-list/mock/process-list-service.mock.ts b/lib/process-services-cloud/src/lib/process/process-list/mock/process-list-service.mock.ts deleted file mode 100644 index a0ae3e6ee30..00000000000 --- a/lib/process-services-cloud/src/lib/process/process-list/mock/process-list-service.mock.ts +++ /dev/null @@ -1,163 +0,0 @@ -/*! - * @license - * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { ObjectDataColumn } from '@alfresco/adf-core'; -import { ProcessListDataColumnCustomData } from '../../../models/data-column-custom-data'; - -export const fakeProcessCloudList = { - list: { - entries: [ - { - entry: { - appName: 'easy-peasy-japanesey', - appVersion: 1, - id: '69eddfa7-d781-11e8-ae24-0a58646001fa', - name: 'starring', - processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', - processDefinitionKey: 'BasicProcess', - initiator: 'devopsuser', - startDate: 1540381146275, - businessKey: 'MyBusinessKey', - status: 'RUNNING', - lastModified: 1540381146276, - lastModifiedTo: null, - lastModifiedFrom: null, - variables: [{ id: 'variableId', value: 'variableValue'}] - } - }, - { - entry: { - appName: 'easy-peasy-japanesey', - appVersion: 1, - id: '8b3f625f-d781-11e8-ae24-0a58646001fa', - name: null, - processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', - processDefinitionKey: 'BasicProcess', - initiator: 'devopsuser', - startDate: 1540381202174, - businessKey: 'MyBusinessKey', - status: 'RUNNING', - lastModified: 1540381202174, - lastModifiedTo: null, - lastModifiedFrom: null - } - }, - { - entry: { - appName: 'easy-peasy-japanesey', - appVersion: 2, - id: '87c12637-d783-11e8-ae24-0a58646001fa', - name: null, - processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', - processDefinitionKey: 'BasicProcess', - initiator: 'superadminuser', - startDate: 1540382055307, - businessKey: 'MyBusinessKey', - status: 'RUNNING', - lastModified: 1540382055308, - lastModifiedTo: null, - lastModifiedFrom: null - } - } - ], - pagination: { - skipCount: 0, - maxItems: 100, - count: 3, - hasMoreItems: false, - totalItems: 3 - } - } -}; - -export const fakeCustomSchema = - [ - new ObjectDataColumn({ - key: 'fakeName', - type: 'text', - title: 'ADF_CLOUD_TASK_LIST.PROPERTIES.FAKE', - sortable: true - }), - new ObjectDataColumn({ - key: 'fakeTaskName', - type: 'text', - title: 'ADF_CLOUD_TASK_LIST.PROPERTIES.TASK_FAKE', - sortable: true - }) - ]; - -export const processListSchemaMock = { - presets: { - default: [ - { - key: 'id', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.ID' - }, - { - key: 'name', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.NAME' - }, - { - key: 'status', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.STATUS' - }, - { - key: 'startDate', - type: 'date', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.START_DATE', - format: 'timeAgo' - }, - { - key: 'appName', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.APP_NAME' - }, - { - key: 'businessKey', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.BUSINESS_KEY' - }, - { - key: 'initiator', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.INITIATOR' - }, - { - key: 'lastModified', - type: 'date', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.LAST_MODIFIED' - }, - { - key: 'processDefinitionId', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEF_ID' - }, - { - key: 'processDefinitionKey', - title: 'ADF_CLOUD_PROCESS_LIST.PROPERTIES.PROCESS_DEF_KEY' - } - ].map((column: { - key: string; - type: string; - title: string; - sortable: boolean; - format: string; - }) => { - column.sortable = true; - if (!column.type) { - column.type = 'text'; - } - return column; - }) - } -}; diff --git a/lib/process-services-cloud/src/lib/process/process-list/process-list-cloud.module.ts b/lib/process-services-cloud/src/lib/process/process-list/process-list-cloud.module.ts index 98e72af6b41..37d42a2d02f 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/process-list-cloud.module.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/process-list-cloud.module.ts @@ -16,22 +16,18 @@ */ import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; import { ProcessListCloudComponent } from './components/process-list-cloud.component'; -import { MaterialModule } from '../../material.module'; -import { CoreModule } from '@alfresco/adf-core'; import { LocalPreferenceCloudService } from '../../services/local-preference-cloud.service'; import { PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN } from '../../services/cloud-token.service'; @NgModule({ - imports: [CommonModule, MaterialModule, CoreModule], + imports: [ProcessListCloudComponent], providers: [ { provide: PROCESS_LISTS_PREFERENCES_SERVICE_TOKEN, useClass: LocalPreferenceCloudService } ], - declarations: [ProcessListCloudComponent], exports: [ProcessListCloudComponent] }) export class ProcessListCloudModule {} diff --git a/lib/process-services-cloud/src/lib/process/start-process/mock/start-process.component.mock.ts b/lib/process-services-cloud/src/lib/process/start-process/mock/start-process.component.mock.ts index 8691861820f..38a8f8531c2 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/mock/start-process.component.mock.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/mock/start-process.component.mock.ts @@ -59,17 +59,6 @@ export const fakeProcessWithFormInstance: ProcessInstanceCloud = { processDefinitionName: 'my-process' }; -export const fakeCreatedProcessInstance: ProcessInstanceCloud = { - appName: 'simple-app', - id: 'd0b30377-dc5a-11e8-ae24-0a58646001fa', - name: 'My Process Name', - startDate: null, - initiator: 'usermock', - status: 'CREATED', - processDefinitionId: 'BasicProcess:1:d05062f1-c6fb-11e8-ae24-0a58646001fa', - processDefinitionKey: 'BasicProcess' -}; - export const fakeProcessDefinitions: ProcessDefinitionCloud[] = [ new ProcessDefinitionCloud({ appName: 'myApp', From 89a3753af9b1fba4fa9056295fc9a992b0b89d8c Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 12:56:23 -0500 Subject: [PATCH 04/10] reorg process filters structure --- docs/README.md | 4 +- .../edit-process-filter-cloud.component.md | 93 ++++++++++--------- .../process-filters-cloud.component.md | 28 +++--- .../edit-process-filter-cloud.component.html | 0 .../edit-process-filter-cloud.component.scss | 0 ...dit-process-filter-cloud.component.spec.ts | 32 +++---- .../edit-process-filter-cloud.component.ts | 16 ++-- ...process-filter-dialog-cloud.component.html | 0 ...process-filter-dialog-cloud.component.scss | 0 ...cess-filter-dialog-cloud.component.spec.ts | 4 +- .../process-filter-dialog-cloud.component.ts | 0 .../process-filters-cloud.component.html | 0 .../process-filters-cloud.component.scss | 0 .../process-filters-cloud.component.spec.ts | 23 +++-- .../process-filters-cloud.component.ts | 25 ++--- .../process-filters-cloud.module.ts | 6 +- .../lib/process/process-filters/public-api.ts | 6 +- 17 files changed, 116 insertions(+), 121 deletions(-) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => edit-process-filter}/edit-process-filter-cloud.component.html (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => edit-process-filter}/edit-process-filter-cloud.component.scss (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => edit-process-filter}/edit-process-filter-cloud.component.spec.ts (97%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => edit-process-filter}/edit-process-filter-cloud.component.ts (97%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filter-dialog}/process-filter-dialog-cloud.component.html (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filter-dialog}/process-filter-dialog-cloud.component.scss (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filter-dialog}/process-filter-dialog-cloud.component.spec.ts (96%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filter-dialog}/process-filter-dialog-cloud.component.ts (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filters}/process-filters-cloud.component.html (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filters}/process-filters-cloud.component.scss (100%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filters}/process-filters-cloud.component.spec.ts (97%) rename lib/process-services-cloud/src/lib/process/process-filters/components/{ => process-filters}/process-filters-cloud.component.ts (93%) diff --git a/docs/README.md b/docs/README.md index fd8f1dd4135..47f1556eca2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -474,7 +474,7 @@ for more information about installing and using the source code. | Name | Description | Source link | | ---- | ----------- | ----------- | | [App List Cloud Component](process-services-cloud/components/app-list-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows all deployed cloud application instances. | [Source](../lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts) | -| [Edit Process Filter Cloud component](process-services-cloud/components/edit-process-filter-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows/edits process filter details. | [Source](../lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts) | +| [Edit Process Filter Cloud component](process-services-cloud/components/edit-process-filter-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows/edits process filter details. | [Source](../lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts) | | [Edit Task Filter Cloud component](process-services-cloud/components/edit-task-filter-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Edits task filter details. | [Source](../lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.ts) | | [Form cloud custom outcomes component](process-services-cloud/components/form-cloud-custom-outcome.component.md) | Supplies custom outcome buttons to be included in Form cloud component. | [Source](../lib/process-services-cloud/src/lib/form/components/form-cloud-custom-outcomes.component.ts) | | [Form cloud component](process-services-cloud/components/form-cloud.component.md) | Shows a form from Process Services. | [Source](../lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts) | @@ -484,7 +484,7 @@ for more information about installing and using the source code. Added: v3.0.0 Status: Experimental | [Source](<>) | -| [Process Filters Cloud Component](process-services-cloud/components/process-filters-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Lists all available process filters and allows to select a filter. | [Source](../lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.ts) | +| [Process Filters Cloud Component](process-services-cloud/components/process-filters-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Lists all available process filters and allows to select a filter. | [Source](../lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.ts) | | [Process Header Cloud Component](process-services-cloud/components/process-header-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Shows all the information related to a process instance. | [Source](../lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts) | | [Process Instance List Cloud component](process-services-cloud/components/process-list-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Renders a list containing all the process instances matched by the parameters specified. | [Source](../lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts) | | [Start Process Cloud Component](process-services-cloud/components/start-process-cloud.component.md) ![Experimental](docassets/images/ExperimentalIcon.png) | Starts a process. | [Source](../lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts) | diff --git a/docs/process-services-cloud/components/edit-process-filter-cloud.component.md b/docs/process-services-cloud/components/edit-process-filter-cloud.component.md index 766937e06fe..f95465e87fc 100644 --- a/docs/process-services-cloud/components/edit-process-filter-cloud.component.md +++ b/docs/process-services-cloud/components/edit-process-filter-cloud.component.md @@ -5,7 +5,7 @@ Status: Experimental Last reviewed: 2023-04-03 --- -# [Edit Process Filter Cloud component](../../../lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts "Defined in edit-process-filter-cloud.component.ts") +# Edit Process Filter Cloud component Shows/edits process filter details. @@ -41,27 +41,27 @@ Shows/edits process filter details. ### Properties -| Name | Type | Default value | Description | -| ---- | ---- | ------------- | ----------- | -| actions | `string[]` | DEFAULT_ACTIONS | List of sort actions. | -| appName | `string` | "" | The name of the application. | -| environmentId | `string` | | [Environment](../../../lib/process-services-cloud/src/lib/common/interface/environment.interface.ts) ID of the application. | -| environmentList | [`Environment`](../../../lib/process-services-cloud/src/lib/common/interface/environment.interface.ts)`[]` | \[] | List of environments. | -| filterProperties | `string[]` | | List of process filter properties to display | -| id | `string` | | Id of the process instance filter. | -| role | `string` | "" | roles to filter the apps | -| showFilterActions | `boolean` | true | Toggles editing of process filter actions. | -| showProcessFilterName | `boolean` | true | Toggles the appearance of the process filter name . | -| showTitle | `boolean` | true | Toggles editing of the process filter title. | -| sortProperties | `string[]` | | List of sort properties to display. | -| processFilter | [`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts) | | Process filter | +| Name | Type | Default value | Description | +|-----------------------|---------------------------|-----------------|-----------------------------------------------------| +| actions | `string[]` | DEFAULT_ACTIONS | List of sort actions. | +| appName | `string` | "" | The name of the application. | +| environmentId | `string` | | Environment ID of the application. | +| environmentList | `Environment[]` | \[] | List of environments. | +| filterProperties | `string[]` | | List of process filter properties to display | +| id | `string` | | Id of the process instance filter. | +| role | `string` | "" | roles to filter the apps | +| showFilterActions | `boolean` | true | Toggles editing of process filter actions. | +| showProcessFilterName | `boolean` | true | Toggles the appearance of the process filter name . | +| showTitle | `boolean` | true | Toggles editing of the process filter title. | +| sortProperties | `string[]` | | List of sort properties to display. | +| processFilter | `ProcessFilterCloudModel` | | Process filter | ### Events -| Name | Type | Description | -| ---- | ---- | ----------- | -| action | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterAction`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter action occurs i.e Save, SaveAs, Delete. | -| filterChange | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a process instance filter property changes. | +| Name | Type | Description | +|--------------|-----------------------------------------|---------------------------------------------------------------| +| action | `EventEmitter` | Emitted when a filter action occurs i.e Save, SaveAs, Delete. | +| filterChange | `EventEmitter` | Emitted when a process instance filter property changes. | ## Details @@ -72,8 +72,8 @@ Use the `appName` and `id` properties to choose which process filter to edit: ```html - + [appName]="appName" +/> ``` ### Filter properties @@ -82,18 +82,18 @@ You can supply various _filter properties_ to edit. These will determine which processes are found by a filter. The full set of properties is given below: -| Name | Description | -| ---- | ----------- | -| **_appName_** | Name of the app | -| **_id_** | Process instance ID | -| **_name_** | Process name. | -| **_initiator_** | ID of the user who initiated the process | -| **_status_** | Execution status of the process. | -| **_processDefinitionId_** | Process definition ID | -| **_processDefinitionKey_** | Process definition key | -| **_lastModified_** | Date the process was last modified. If lastModified defined the component will show the range **_lastModifiedTo_**, **_lastModifiedFrom_** | -| **_sort_** | Field on which the filter results will be sorted. Can be "id", "name", "status", "startDate". | -| **_order_** | Sort ordering of the filter results (this doesn't participate in the filtering itself) | +| Name | Description | +|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| **_appName_** | Name of the app | +| **_id_** | Process instance ID | +| **_name_** | Process name. | +| **_initiator_** | ID of the user who initiated the process | +| **_status_** | Execution status of the process. | +| **_processDefinitionId_** | Process definition ID | +| **_processDefinitionKey_** | Process definition key | +| **_lastModified_** | Date the process was last modified. If lastModified defined the component will show the range **_lastModifiedTo_**, **_lastModifiedFrom_** | +| **_sort_** | Field on which the filter results will be sorted. Can be "id", "name", "status", "startDate". | +| **_order_** | Sort ordering of the filter results (this doesn't participate in the filtering itself) | By default, the **_status_**, **_sort_** and **_order_** properties are displayed in the editor. However, you can also choose which properties @@ -118,14 +118,15 @@ export class SomeComponent implements OnInit { onAction($event: ProcessFilterAction) { console.log('Clicked action: ', $event); } +} ``` ```html - + [filterProperties]="filterProperties" +/> ``` With this configuration, only the four listed properties will be shown. @@ -146,7 +147,8 @@ export class SomeComponent implements OnInit { sortProperties: string[] = [ "startDate", - "lastModified"]; + "lastModified" + ]; onFilterChange(filter: ProcessFilterCloudModel) { console.log('On filter change: ', filter); @@ -155,14 +157,15 @@ export class SomeComponent implements OnInit { onAction($event: ProcessFilterAction) { console.log('Clicked action: ', $event); } +} ``` ```html - + [sortProperties]="sortProperties" +/> ``` With this configuration, only the two listed sort properties will be shown. @@ -171,11 +174,11 @@ With this configuration, only the two listed sort properties will be shown. You can supply various _actions_ to apply on process filter. -| Name | Description | -| ---- | ----------- | -| **_save_** | Save process filter. | +| Name | Description | +|--------------|-------------------------------| +| **_save_** | Save process filter. | | **_saveAs_** | Creates a new process filter. | -| **_delete_** | Delete process filter. | +| **_delete_** | Delete process filter. | By default, the **_save_**, **_saveAs_** and **_delete_** actions are displayed in the editor. However, you can also choose which actions to @@ -194,14 +197,15 @@ export class SomeComponent implements OnInit { onAction($event: ProcessFilterAction) { console.log('Clicked action: ', $event); } +} ``` ```html - + [actions]="actions" +/> ``` With this configuration, only the two actions will be shown. @@ -211,7 +215,6 @@ With this configuration, only the two actions will be shown. Users can save a filter if they make any changes to it in an application using the **Save** icon. How it is saved is dictated by the Activiti version used: - An Activiti 7 community version stores saved filters in the local browser storage. This restricts a user's custom filters to that single session. - - An Activiti Enterprise version uses the preference service to store saved filters. This allows for user's custom filters to be available between sessions and between devices. ## See also diff --git a/docs/process-services-cloud/components/process-filters-cloud.component.md b/docs/process-services-cloud/components/process-filters-cloud.component.md index 59e77352a4f..d960153d1d2 100644 --- a/docs/process-services-cloud/components/process-filters-cloud.component.md +++ b/docs/process-services-cloud/components/process-filters-cloud.component.md @@ -5,7 +5,7 @@ Status: Experimental Last reviewed: 2019-01-08 --- -# [Process Filters Cloud Component](../../../lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.ts "Defined in process-filters-cloud.component.ts") +# Process Filters Cloud Component Lists all available process filters and allows to select a filter. @@ -14,28 +14,28 @@ Lists all available process filters and allows to select a filter. ```html - + [showIcons]="true" +/> ``` ## Class members ### Properties -| Name | Type | Default value | Description | -| ---- | ---- | ------------- | ----------- | -| appName | `string` | "" | (required) The application name | -| filterParam | `UserTaskFilterRepresentation` | | (optional) The filter to be selected by default | -| showIcons | `boolean` | false | (optional) Toggles showing an icon by the side of each filter | +| Name | Type | Default value | Description | +|-------------|--------------------------------|---------------|---------------------------------------------------------------| +| appName | `string` | "" | (required) The application name | +| filterParam | `UserTaskFilterRepresentation` | | (optional) The filter to be selected by default | +| showIcons | `boolean` | false | (optional) Toggles showing an icon by the side of each filter | ### Events -| Name | Type | Description | -| ---- | ---- | ----------- | -| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when any error occurs while loading the filters | -| filterClicked | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter is being clicked from the UI. | -| filterSelected | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`ProcessFilterCloudModel`](../../../lib/process-services-cloud/src/lib/process/process-filters/models/process-filter-cloud.model.ts)`>` | Emitted when a filter is being selected based on the filterParam input. | -| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when filters are loaded successfully | +| Name | Type | Description | +|----------------|-----------------------------------------|-------------------------------------------------------------------------| +| error | `EventEmitter` | Emitted when any error occurs while loading the filters | +| filterClicked | `EventEmitter` | Emitted when a filter is being clicked from the UI. | +| filterSelected | `EventEmitter` | Emitted when a filter is being selected based on the filterParam input. | +| success | `EventEmitter` | Emitted when filters are loaded successfully | ## See also diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.html rename to lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.scss b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.scss similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.scss rename to lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.scss diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.spec.ts similarity index 97% rename from lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.spec.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.spec.ts index 3a18dc27150..2f3cba8022c 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.spec.ts @@ -40,27 +40,27 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { endOfDay, format, isValid, startOfDay, subYears } from 'date-fns'; import { enUS } from 'date-fns/locale'; import { of } from 'rxjs'; -import { AppsProcessCloudService } from '../../../app/services/apps-process-cloud.service'; -import { DateRangeFilterComponent } from '../../../common/date-range-filter/date-range-filter.component'; -import { fakeEnvironmentList } from '../../../common/mock/environment.mock'; -import { DateCloudFilterType } from '../../../models/date-cloud-filter.model'; -import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud.model'; -import { PeopleCloudComponent } from '../../../people/components/people-cloud.component'; -import { IdentityUserServiceMock } from '../../../people/mock/people-cloud.mock'; -import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../services/cloud-token.service'; -import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service'; -import { NotificationCloudService } from '../../../services/notification-cloud.service'; -import { ProcessCloudService } from '../../services/process-cloud.service'; -import { mockAppVersions } from '../mock/process-filters-cloud.mock'; -import { ProcessFilterCloudModel } from '../models/process-filter-cloud.model'; -import { ProcessFilterCloudService } from '../services/process-filter-cloud.service'; -import { fakeApplicationInstance, fakeApplicationInstanceWithEnvironment } from './../../../app/mock/app-model.mock'; +import { AppsProcessCloudService } from '../../../../app/services/apps-process-cloud.service'; +import { DateRangeFilterComponent } from '../../../../common/date-range-filter/date-range-filter.component'; +import { fakeEnvironmentList } from '../../../../common/mock/environment.mock'; +import { DateCloudFilterType } from '../../../../models/date-cloud-filter.model'; +import { ProcessDefinitionCloud } from '../../../../models/process-definition-cloud.model'; +import { PeopleCloudComponent } from '../../../../people/components/people-cloud.component'; +import { IdentityUserServiceMock } from '../../../../people/mock/people-cloud.mock'; +import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../../services/cloud-token.service'; +import { LocalPreferenceCloudService } from '../../../../services/local-preference-cloud.service'; +import { NotificationCloudService } from '../../../../services/notification-cloud.service'; +import { ProcessCloudService } from '../../../services/process-cloud.service'; +import { mockAppVersions } from '../../mock/process-filters-cloud.mock'; +import { ProcessFilterCloudModel } from '../../models/process-filter-cloud.model'; +import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service'; +import { fakeApplicationInstance, fakeApplicationInstanceWithEnvironment } from '../../../../app/mock/app-model.mock'; import { EditProcessFilterCloudComponent, PROCESS_FILTER_ACTION_RESTORE, PROCESS_FILTER_ACTION_SAVE_DEFAULT } from './edit-process-filter-cloud.component'; -import { ProcessFilterDialogCloudComponent } from './process-filter-dialog-cloud.component'; +import { ProcessFilterDialogCloudComponent } from '../process-filter-dialog/process-filter-dialog-cloud.component'; import { IdentityUserService } from '@alfresco/adf-process-services-cloud'; describe('EditProcessFilterCloudComponent', () => { diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts similarity index 97% rename from lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts index 5a6aa9c8782..7fe22605f69 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts @@ -21,21 +21,21 @@ import { DateAdapter } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { debounceTime, filter, finalize, switchMap, tap } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; -import { AppsProcessCloudService } from '../../../app/services/apps-process-cloud.service'; +import { AppsProcessCloudService } from '../../../../app/services/apps-process-cloud.service'; import { ProcessFilterAction, ProcessFilterCloudModel, ProcessFilterOptions, ProcessFilterProperties, ProcessSortFilterProperty -} from '../models/process-filter-cloud.model'; +} from '../../models/process-filter-cloud.model'; import { DateFnsUtils, TranslationService, UserPreferencesService, UserPreferenceValues } from '@alfresco/adf-core'; -import { ProcessFilterCloudService } from '../services/process-filter-cloud.service'; -import { ProcessFilterDialogCloudComponent } from './process-filter-dialog-cloud.component'; -import { ProcessCloudService } from '../../services/process-cloud.service'; -import { DateCloudFilterType, DateRangeFilter } from '../../../models/date-cloud-filter.model'; -import { IdentityUserModel } from '../../../people/models/identity-user.model'; -import { Environment } from '../../../common/interface/environment.interface'; +import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service'; +import { ProcessFilterDialogCloudComponent } from '../process-filter-dialog/process-filter-dialog-cloud.component'; +import { ProcessCloudService } from '../../../services/process-cloud.service'; +import { DateCloudFilterType, DateRangeFilter } from '../../../../models/date-cloud-filter.model'; +import { IdentityUserModel } from '../../../../people/models/identity-user.model'; +import { Environment } from '../../../../common/interface/environment.interface'; import { endOfDay, isValid, startOfDay } from 'date-fns'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.html rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.scss b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.scss similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.scss rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.scss diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.spec.ts similarity index 96% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.spec.ts index 9f33a739255..ccc6c6bb26f 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.spec.ts @@ -18,8 +18,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { ProcessFilterDialogCloudComponent } from './process-filter-dialog-cloud.component'; -import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module'; -import { ProcessFiltersCloudModule } from '../process-filters-cloud.module'; +import { ProcessServiceCloudTestingModule } from '../../../../testing/process-service-cloud.testing.module'; +import { ProcessFiltersCloudModule } from '../../process-filters-cloud.module'; describe('ProcessFilterDialogCloudComponent', () => { let component: ProcessFilterDialogCloudComponent; diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.ts similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.ts diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.html similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.html rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.html diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.scss b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.scss similarity index 100% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.scss rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.scss diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.spec.ts similarity index 97% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.spec.ts index 4807b9c8ecb..7f11ab6ea63 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.spec.ts @@ -18,15 +18,15 @@ import { SimpleChange } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of, throwError } from 'rxjs'; -import { ProcessFilterCloudService } from '../services/process-filter-cloud.service'; +import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service'; import { ProcessFiltersCloudComponent } from './process-filters-cloud.component'; import { By } from '@angular/platform-browser'; -import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../services/cloud-token.service'; -import { LocalPreferenceCloudService } from '../../../services/local-preference-cloud.service'; -import { mockProcessFilters } from '../mock/process-filters-cloud.mock'; +import { PROCESS_FILTERS_SERVICE_TOKEN } from '../../../../services/cloud-token.service'; +import { LocalPreferenceCloudService } from '../../../../services/local-preference-cloud.service'; +import { mockProcessFilters } from '../../mock/process-filters-cloud.mock'; import { AppConfigService, AppConfigServiceMock, NoopTranslateModule } from '@alfresco/adf-core'; -import { ProcessListCloudService } from '../../../process/process-list/services/process-list-cloud.service'; -import { NotificationCloudService } from '../../../services/notification-cloud.service'; +import { ProcessListCloudService } from '../../../process-list/services/process-list-cloud.service'; +import { NotificationCloudService } from '../../../../services/notification-cloud.service'; import { ApolloModule } from 'apollo-angular'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatListModule } from '@angular/material/list'; @@ -50,10 +50,13 @@ describe('ProcessFiltersCloudComponent', () => { providers: [ { provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }, { provide: AppConfigService, useClass: AppConfigServiceMock }, - { provide: ProcessListCloudService, useValue: { - getProcessCounter: () => of(10), - getProcessListCounter: () => of(10) - }}, + { + provide: ProcessListCloudService, + useValue: { + getProcessCounter: () => of(10), + getProcessListCounter: () => of(10) + } + }, { provide: ProcessFilterCloudService, useValue: ProcessFilterCloudServiceMock }, NotificationCloudService, ApolloModule diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.ts similarity index 93% rename from lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.ts rename to lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.ts index d48dff8ea78..e2beb12bff4 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters/process-filters-cloud.component.ts @@ -15,26 +15,15 @@ * limitations under the License. */ -import { - Component, - DestroyRef, - EventEmitter, - inject, - Input, - OnChanges, - OnInit, - Output, - SimpleChanges, - ViewEncapsulation -} from '@angular/core'; +import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core'; import { Observable } from 'rxjs'; -import { ProcessFilterCloudService } from '../services/process-filter-cloud.service'; -import { ProcessFilterCloudModel } from '../models/process-filter-cloud.model'; +import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service'; +import { ProcessFilterCloudModel } from '../../models/process-filter-cloud.model'; import { AppConfigService, TranslationService } from '@alfresco/adf-core'; -import { FilterParamsModel } from '../../../task/task-filters/models/filter-cloud.model'; +import { FilterParamsModel } from '../../../../task/task-filters/models/filter-cloud.model'; import { debounceTime, tap } from 'rxjs/operators'; -import { ProcessListCloudService } from '../../../process/process-list/services/process-list-cloud.service'; -import { ProcessFilterCloudAdapter } from '../../process-list/models/process-cloud-query-request.model'; +import { ProcessListCloudService } from '../../../process-list/services/process-list-cloud.service'; +import { ProcessFilterCloudAdapter } from '../../../process-list/models/process-cloud-query-request.model'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @Component({ @@ -326,6 +315,6 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges { private fetchProcessFilterCounter(filter: ProcessFilterCloudModel): Observable { return this.searchApiMethod === 'POST' ? this.processListCloudService.getProcessListCounter(new ProcessFilterCloudAdapter(filter)) - : this.processListCloudService.getProcessCounter(filter.appName, filter.status) + : this.processListCloudService.getProcessCounter(filter.appName, filter.status); } } diff --git a/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts b/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts index 7524f57e74e..96fbbc8b6d9 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts @@ -18,12 +18,12 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { ProcessFiltersCloudComponent } from './components/process-filters-cloud.component'; +import { ProcessFiltersCloudComponent } from './components/process-filters/process-filters-cloud.component'; import { MaterialModule } from '../../material.module'; import { CoreModule } from '@alfresco/adf-core'; 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 { EditProcessFilterCloudComponent } from './components/edit-process-filter/edit-process-filter-cloud.component'; +import { ProcessFilterDialogCloudComponent } from './components/process-filter-dialog/process-filter-dialog-cloud.component'; import { APP_LIST_CLOUD_DIRECTIVES } from './../../app/app-list-cloud.module'; import { PeopleCloudComponent } from '../../people/components/people-cloud.component'; import { DateRangeFilterComponent } from '../../common/date-range-filter/date-range-filter.component'; diff --git a/lib/process-services-cloud/src/lib/process/process-filters/public-api.ts b/lib/process-services-cloud/src/lib/process/process-filters/public-api.ts index 7d0b72a8053..b2450d68096 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/public-api.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/public-api.ts @@ -15,9 +15,9 @@ * limitations under the License. */ -export * from './components/process-filters-cloud.component'; -export * from './components/edit-process-filter-cloud.component'; -export * from './components/process-filter-dialog-cloud.component'; +export * from './components/process-filters/process-filters-cloud.component'; +export * from './components/edit-process-filter/edit-process-filter-cloud.component'; +export * from './components/process-filter-dialog/process-filter-dialog-cloud.component'; export * from './models/process-filter-cloud.model'; export * from './services/process-filter-cloud.service'; export * from './process-filters-cloud.module'; From 43d250ffa822b34f267013b68b8fb646c9a3f740 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 15:19:55 -0500 Subject: [PATCH 05/10] migrate EditProcessFilterCloudComponent --- .../edit-process-filter-cloud.component.html | 23 ++++++++----- ...dit-process-filter-cloud.component.spec.ts | 24 ++----------- .../edit-process-filter-cloud.component.ts | 34 +++++++++++++++++-- .../process-filters-cloud.module.ts | 6 ++-- 4 files changed, 53 insertions(+), 34 deletions(-) diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html index 769de7df985..66b70c8e475 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.html @@ -8,7 +8,12 @@ {{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.TITLE' | translate}}
- @@ -72,14 +77,16 @@ [matDatepicker]="dateController" placeholder="{{processFilterProperty.label | translate}}" [attr.data-automation-id]="'adf-cloud-edit-process-property-' + processFilterProperty.key"> - - -
-
-
{{'ADF_CLOUD_EDIT_PROCESS_FILTER.ERROR.DATE' | translate}}
- warning + + +
+
+
{{'ADF_CLOUD_EDIT_PROCESS_FILTER.ERROR.DATE' | translate}}
+ warning +
-
{ MatDialogModule, NoopTranslateModule, NoopAnimationsModule, - MatSelectModule, - MatDatepickerModule, - MatAutocompleteModule, - FullNamePipe, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule, - MatChipsModule, - MatProgressBarModule, - PeopleCloudComponent, - DateRangeFilterComponent + EditProcessFilterCloudComponent ], providers: [ { provide: PROCESS_FILTERS_SERVICE_TOKEN, useClass: LocalPreferenceCloudService }, diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts index 7fe22605f69..86eca1cbf90 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter/edit-process-filter-cloud.component.ts @@ -16,7 +16,7 @@ */ import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { AbstractControl, FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { AbstractControl, FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { DateAdapter } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { debounceTime, filter, finalize, switchMap, tap } from 'rxjs/operators'; @@ -29,7 +29,7 @@ import { ProcessFilterProperties, ProcessSortFilterProperty } from '../../models/process-filter-cloud.model'; -import { DateFnsUtils, TranslationService, UserPreferencesService, UserPreferenceValues } from '@alfresco/adf-core'; +import { DateFnsUtils, IconComponent, TranslationService, UserPreferencesService, UserPreferenceValues } from '@alfresco/adf-core'; import { ProcessFilterCloudService } from '../../services/process-filter-cloud.service'; import { ProcessFilterDialogCloudComponent } from '../process-filter-dialog/process-filter-dialog-cloud.component'; import { ProcessCloudService } from '../../../services/process-cloud.service'; @@ -38,6 +38,18 @@ import { IdentityUserModel } from '../../../../people/models/identity-user.model import { Environment } from '../../../../common/interface/environment.interface'; import { endOfDay, isValid, startOfDay } from 'date-fns'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { TranslateModule } from '@ngx-translate/core'; +import { MatButtonModule } from '@angular/material/button'; +import { NgForOf, NgIf } from '@angular/common'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatIconModule } from '@angular/material/icon'; +import { DateRangeFilterComponent } from '../../../../common/date-range-filter/date-range-filter.component'; +import { PeopleCloudComponent } from '../../../../people/components/people-cloud.component'; export const PROCESS_FILTER_ACTION_SAVE = 'save'; export const PROCESS_FILTER_ACTION_SAVE_AS = 'saveAs'; @@ -68,6 +80,24 @@ interface ProcessFilterFormProps { @Component({ selector: 'adf-cloud-edit-process-filter', + standalone: true, + imports: [ + IconComponent, + MatProgressSpinnerModule, + TranslateModule, + MatButtonModule, + NgForOf, + NgIf, + MatExpansionModule, + MatFormFieldModule, + MatSelectModule, + ReactiveFormsModule, + MatInputModule, + MatDatepickerModule, + MatIconModule, + DateRangeFilterComponent, + PeopleCloudComponent + ], templateUrl: './edit-process-filter-cloud.component.html', styleUrls: ['./edit-process-filter-cloud.component.scss'], encapsulation: ViewEncapsulation.None diff --git a/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts b/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts index 96fbbc8b6d9..2318a0f1504 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/process-filters-cloud.module.ts @@ -38,9 +38,11 @@ import { DateRangeFilterComponent } from '../../common/date-range-filter/date-ra ...APP_LIST_CLOUD_DIRECTIVES, CoreModule, DateRangeFilterComponent, - PeopleCloudComponent + PeopleCloudComponent, + // + EditProcessFilterCloudComponent ], - declarations: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent], + declarations: [ProcessFiltersCloudComponent, ProcessFilterDialogCloudComponent], exports: [ProcessFiltersCloudComponent, EditProcessFilterCloudComponent, ProcessFilterDialogCloudComponent] }) export class ProcessFiltersCloudModule {} From 20b232bfc2710128cebe8659b88211ad9ff02165 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 14 Jan 2025 15:25:51 -0500 Subject: [PATCH 06/10] migrate ProcessFilterDialogCloudComponent --- .../process-filter-dialog-cloud.component.html | 13 ++++++++----- .../process-filter-dialog-cloud.component.spec.ts | 3 +-- .../process-filter-dialog-cloud.component.ts | 10 ++++++++-- .../process-filters-cloud.module.ts | 14 ++++++++++---- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html index 475387c011b..36649eda142 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog/process-filter-dialog-cloud.component.html @@ -4,11 +4,14 @@ -
- - - -
+
+ + + +