diff --git a/docs/README.md b/docs/README.md index 0b42a6d5e1..47f1556eca 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 @@ -475,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) | @@ -485,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/docassets/images/adf-task-audit-directive.png b/docs/docassets/images/adf-task-audit-directive.png deleted file mode 100644 index 770e27c33b..0000000000 Binary files a/docs/docassets/images/adf-task-audit-directive.png and /dev/null differ 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 766937e06f..f95465e87f 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 59e77352a4..d960153d1d 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/docs/process-services/components/task-details.component.md b/docs/process-services/components/task-details.component.md index 4f21be779f..b0b24e14a1 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/docs/process-services/directives/task-audit.directive.md b/docs/process-services/directives/task-audit.directive.md deleted file mode 100644 index 87a1f0e5cc..0000000000 --- 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-cloud/src/lib/material.module.ts b/lib/process-services-cloud/src/lib/material.module.ts deleted file mode 100644 index b9a832560a..0000000000 --- a/lib/process-services-cloud/src/lib/material.module.ts +++ /dev/null @@ -1,92 +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 { NgModule } from '@angular/core'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatChipsModule } from '@angular/material/chips'; -import { MatNativeDateModule, MatRippleModule, MatOptionModule } from '@angular/material/core'; -import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MatGridListModule } from '@angular/material/grid-list'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTableModule } from '@angular/material/table'; -import { MatTabsModule } from '@angular/material/tabs'; - -@NgModule({ - providers: [{ provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { floatLabel: 'never' } }], - imports: [ - MatAutocompleteModule, - MatButtonModule, - MatCardModule, - MatDialogModule, - MatCheckboxModule, - MatDatepickerModule, - MatGridListModule, - MatIconModule, - MatInputModule, - MatListModule, - MatOptionModule, - MatRadioModule, - MatSelectModule, - MatSlideToggleModule, - MatTableModule, - MatTabsModule, - MatProgressSpinnerModule, - MatNativeDateModule, - MatRippleModule, - MatChipsModule, - MatMenuModule, - MatExpansionModule - ], - exports: [ - MatAutocompleteModule, - MatButtonModule, - MatCardModule, - MatDialogModule, - MatCheckboxModule, - MatDatepickerModule, - MatGridListModule, - MatIconModule, - MatInputModule, - MatListModule, - MatOptionModule, - MatRadioModule, - MatSelectModule, - MatSlideToggleModule, - MatTableModule, - MatTabsModule, - MatProgressSpinnerModule, - MatNativeDateModule, - MatRippleModule, - MatChipsModule, - MatMenuModule, - MatExpansionModule - ] -}) -export class MaterialModule {} diff --git a/lib/process-services-cloud/src/lib/process-services-cloud.module.ts b/lib/process-services-cloud/src/lib/process-services-cloud.module.ts index 4a994895ee..435826dbac 100644 --- a/lib/process-services-cloud/src/lib/process-services-cloud.module.ts +++ b/lib/process-services-cloud/src/lib/process-services-cloud.module.ts @@ -16,7 +16,7 @@ */ import { NgModule, ModuleWithProviders } from '@angular/core'; -import { CoreModule, FormRenderingService, provideTranslations } from '@alfresco/adf-core'; +import { FormRenderingService, provideTranslations } from '@alfresco/adf-core'; import { APP_LIST_CLOUD_DIRECTIVES } from './app/app-list-cloud.module'; import { TaskCloudModule } from './task/task-cloud.module'; import { ProcessCloudModule } from './process/process-cloud.module'; @@ -31,35 +31,22 @@ import { TASK_LIST_PREFERENCES_SERVICE_TOKEN } from './services/public-api'; import { CloudFormRenderingService } from './form/components/cloud-form-rendering.service'; -import { ApolloModule } from 'apollo-angular'; import { RichTextEditorComponent } from './rich-text-editor'; import { GroupCloudComponent } from './group/components/group-cloud.component'; import { PeopleCloudComponent } from './people/components/people-cloud.component'; +export const PROCESS_SERVICES_CLOUD_DIRECTIVES = [ + ...APP_LIST_CLOUD_DIRECTIVES, + ...FORM_CLOUD_DIRECTIVES, + ...TASK_FORM_CLOUD_DIRECTIVES, + PeopleCloudComponent, + RichTextEditorComponent +] as const; + @NgModule({ - imports: [ - CoreModule, - ...APP_LIST_CLOUD_DIRECTIVES, - ProcessCloudModule, - TaskCloudModule, - GroupCloudComponent, - PeopleCloudComponent, - ...FORM_CLOUD_DIRECTIVES, - ...TASK_FORM_CLOUD_DIRECTIVES, - ApolloModule, - RichTextEditorComponent - ], + imports: [ProcessCloudModule, TaskCloudModule, GroupCloudComponent, ...PROCESS_SERVICES_CLOUD_DIRECTIVES], providers: [provideTranslations('adf-process-services-cloud', 'assets/adf-process-services-cloud')], - exports: [ - ...APP_LIST_CLOUD_DIRECTIVES, - ProcessCloudModule, - TaskCloudModule, - GroupCloudComponent, - ...FORM_CLOUD_DIRECTIVES, - ...TASK_FORM_CLOUD_DIRECTIVES, - PeopleCloudComponent, - RichTextEditorComponent - ] + exports: [ProcessCloudModule, TaskCloudModule, GroupCloudComponent, ...PROCESS_SERVICES_CLOUD_DIRECTIVES] }) export class ProcessServicesCloudModule { static forRoot( diff --git a/lib/process-services-cloud/src/lib/process/process-cloud.module.ts b/lib/process-services-cloud/src/lib/process/process-cloud.module.ts index 5487d76494..89c724d581 100644 --- a/lib/process-services-cloud/src/lib/process/process-cloud.module.ts +++ b/lib/process-services-cloud/src/lib/process/process-cloud.module.ts @@ -16,14 +16,16 @@ */ import { NgModule } from '@angular/core'; -import { ProcessFiltersCloudModule } from './process-filters/process-filters-cloud.module'; +import { PROCESS_FILTERS_CLOUD_DIRECTIVES } from './process-filters/process-filters-cloud.module'; import { ProcessListCloudModule } from './process-list/process-list-cloud.module'; -import { CoreModule } from '@alfresco/adf-core'; import { StartProcessCloudComponent } from './start-process/components/start-process-cloud.component'; import { ProcessHeaderCloudComponent } from './process-header/components/process-header-cloud.component'; +export const PROCESS_CLOUD_DIRECTIVES = [StartProcessCloudComponent, ProcessHeaderCloudComponent] as const; + +/** @deprecated use standalone components or PROCESS_CLOUD_DIRECTIVES instead */ @NgModule({ - imports: [CoreModule, ProcessFiltersCloudModule, ProcessListCloudModule, StartProcessCloudComponent, ProcessHeaderCloudComponent], - exports: [ProcessFiltersCloudModule, ProcessListCloudModule, StartProcessCloudComponent, ProcessHeaderCloudComponent] + imports: [...PROCESS_FILTERS_CLOUD_DIRECTIVES, ProcessListCloudModule, ...PROCESS_CLOUD_DIRECTIVES], + exports: [...PROCESS_FILTERS_CLOUD_DIRECTIVES, ProcessListCloudModule, ...PROCESS_CLOUD_DIRECTIVES] }) export class ProcessCloudModule {} 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 85% 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 index 769de7df98..66b70c8e47 100644 --- 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 @@ -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 +
-
{ @@ -106,17 +96,7 @@ describe('EditProcessFilterCloudComponent', () => { 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-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 93% 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 5a6aa9c878..86eca1cbf9 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 @@ -16,28 +16,40 @@ */ 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'; 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'; -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'; +} from '../../models/process-filter-cloud.model'; +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'; +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'; +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/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 67% 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 index 475387c011..36649eda14 100644 --- 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 @@ -4,11 +4,14 @@ -
- - - -
+
+ + + +
` - }) - 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 aa5ec71198..0000000000 --- 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 f0f331f779..bce8c34064 100644 --- a/lib/process-services/src/lib/task-list/public-api.ts +++ b/lib/process-services/src/lib/task-list/public-api.ts @@ -20,8 +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'; import { TaskDetailsComponent } from './components/task-details/task-details.component'; @@ -32,13 +30,11 @@ 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'; 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'; @@ -64,7 +60,5 @@ export const TASK_LIST_DIRECTIVES = [ StartTaskComponent, TaskStandaloneComponent, ClaimTaskDirective, - UnclaimTaskDirective, - NoTaskDetailsTemplateDirective, - TaskAuditDirective + UnclaimTaskDirective ] as const;