From d78dcd21566732c9e6238b105dd8231958443a2f Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Thu, 28 Sep 2023 16:44:57 +0100 Subject: [PATCH] [ACS-6071] fix docs for process cloud (#8947) * fix docs for process cloud * fix typo --- .../components/app-details-cloud.component.ts | 12 ++++++- .../components/app-list-cloud.component.ts | 13 +++++-- .../form/components/form-cloud.component.ts | 1 + .../properties-viewer-wrapper.component.ts | 3 +- .../components/group-cloud.component.spec.ts | 25 ++++++++++++-- .../group/components/group-cloud.component.ts | 9 +++-- .../components/people-cloud.component.spec.ts | 31 +++++++++++++++++ .../components/people-cloud.component.ts | 21 ++++++++---- .../edit-process-filter-cloud.component.ts | 12 +++++-- .../process-filters-cloud.component.ts | 34 ++++++++++++++----- .../services/process-filter-cloud.service.ts | 7 ++-- .../services/start-process-cloud.service.ts | 8 ++++- .../services/user-preference-cloud.service.ts | 2 +- .../lib/task/services/task-cloud.service.ts | 3 +- .../base-edit-task-filter-cloud.component.ts | 5 +-- .../edit-task-filter-cloud.component.spec.ts | 8 +++++ .../service-task-filters-cloud.component.ts | 19 ++++++++--- .../task-assignment-filter.component.spec.ts | 5 +++ .../task-filters-cloud.component.ts | 14 +++++--- .../service-task-filter-cloud.service.ts | 7 ++-- .../services/task-filter-cloud.service.ts | 11 +++--- .../components/task-form-cloud.component.ts | 6 ++-- .../components/task-header-cloud.component.ts | 4 ++- 23 files changed, 202 insertions(+), 58 deletions(-) diff --git a/lib/process-services-cloud/src/lib/app/components/app-details-cloud.component.ts b/lib/process-services-cloud/src/lib/app/components/app-details-cloud.component.ts index d28a5d9fbe..f3e23fb07a 100644 --- a/lib/process-services-cloud/src/lib/app/components/app-details-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/app/components/app-details-cloud.component.ts @@ -36,16 +36,26 @@ export class AppDetailsCloudComponent { /** * Pass the selected app as next * - * @param app + * @param app application model */ onSelectApp(app: ApplicationInstanceModel): void { this.selectedApp.emit(app); } + /** + * Get application instance theme + * + * @returns the name of the theme + */ getTheme(): string { return this.applicationInstance.theme || DEFAULT_APP_INSTANCE_THEME; } + /** + * Get application instance icon + * + * @returns the name of the icon + */ getIcon(): string { return this.applicationInstance.icon || DEFAULT_APP_INSTANCE_ICON; } diff --git a/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts b/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts index 9822acc24b..6f7d0e3cfb 100644 --- a/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/app/components/app-list-cloud.component.ts @@ -45,7 +45,8 @@ export class AppListCloudComponent implements OnInit, AfterContentInit { @ContentChild(CustomEmptyContentTemplateDirective) emptyCustomContent: CustomEmptyContentTemplateDirective; - /** (**required**) Defines the layout of the apps. There are two possible + /** + * Defines the layout of the apps. There are two possible * values, "GRID" and "LIST". */ @Input() @@ -87,6 +88,8 @@ export class AppListCloudComponent implements OnInit, AfterContentInit { /** * Check if the value of the layoutType property is an allowed value + * + * @returns `true` if layout type is valid, otherwise `false` */ isValidType(): boolean { if (this.layoutType && (this.layoutType === LAYOUT_LIST || this.layoutType === LAYOUT_GRID)) { @@ -103,14 +106,18 @@ export class AppListCloudComponent implements OnInit, AfterContentInit { } /** - * Return true if the layout type is LIST + * Check if the layout type is LIST + * + * @returns `true` if the layout is list, otherwise `false` */ isList(): boolean { return this.layoutType === LAYOUT_LIST; } /** - * Return true if the layout type is GRID + * Check if the layout type is GRID + * + * @returns `true` if layout is grid, otherwise `false` */ isGrid(): boolean { return this.layoutType === LAYOUT_GRID; diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts index 02de454f1d..0c57370bc4 100644 --- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts @@ -323,6 +323,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges, * Get custom set of outcomes for a Form Definition. * * @param form Form definition model. + * @returns list of form outcomes */ getFormDefinitionOutcomes(form: FormModel): FormOutcomeModel[] { return [new FormOutcomeModel(form, { id: '$save', name: FormOutcomeModel.SAVE_ACTION, isSystem: true })]; diff --git a/lib/process-services-cloud/src/lib/form/components/widgets/properties-viewer/properties-viewer-wrapper/properties-viewer-wrapper.component.ts b/lib/process-services-cloud/src/lib/form/components/widgets/properties-viewer/properties-viewer-wrapper/properties-viewer-wrapper.component.ts index 09ffad64b8..ae0bb5d8f4 100644 --- a/lib/process-services-cloud/src/lib/form/components/widgets/properties-viewer/properties-viewer-wrapper/properties-viewer-wrapper.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/widgets/properties-viewer/properties-viewer-wrapper/properties-viewer-wrapper.component.ts @@ -41,7 +41,8 @@ export class PropertiesViewerWrapperComponent implements OnInit, OnChanges { @Input() displayEmpty: boolean; - /** Toggles between expanded (ie, full information) and collapsed + /** + * Toggles between expanded (ie, full information) and collapsed * (ie, reduced information) in the display */ @Input() diff --git a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts index 4833fbb4c3..8cc7e67d15 100644 --- a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts @@ -22,7 +22,7 @@ import { ProcessServiceCloudTestingModule } from './../../testing/process-servic import { GroupCloudModule } from '../group-cloud.module'; import { GroupCloudComponent } from './group-cloud.component'; import { CoreTestingModule } from '@alfresco/adf-core'; -import { SimpleChange } from '@angular/core'; +import { DebugElement, SimpleChange } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; import { IdentityGroupService } from '../services/identity-group.service'; import { mockFoodGroups, mockMeatChicken, mockVegetableAubergine } from '../mock/group-cloud.mock'; @@ -35,10 +35,21 @@ describe('GroupCloudComponent', () => { let findGroupsByNameSpy: jasmine.Spy; // eslint-disable-next-line prefer-arrow/prefer-arrow-functions + /** + * get the native element for the selector + * + * @param selector selector + * @returns native element + */ function getElement(selector: string): T { return fixture.nativeElement.querySelector(selector); } + /** + * search group by value + * + * @param value element input value + */ async function searchGroup(value: string) { const input = getElement('input'); input.focus(); @@ -50,6 +61,11 @@ describe('GroupCloudComponent', () => { fixture.detectChanges(); } + /** + * search group and invoke the blur event + * + * @param value value + */ async function searchGroupsAndBlur(value: string) { const input = getElement('input'); input.focus(); @@ -64,7 +80,12 @@ describe('GroupCloudComponent', () => { fixture.detectChanges(); } - function getGroupListUI() { + /** + * get the group list UI + * + * @returns a list of debug elements + */ + function getGroupListUI(): DebugElement[] { return fixture.debugElement.queryAll(By.css('[data-automation-id="adf-cloud-group-row"]')); } diff --git a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.ts b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.ts index 758d151983..411eb1e772 100644 --- a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.ts @@ -68,19 +68,22 @@ export class GroupCloudComponent implements OnInit, OnChanges, OnDestroy { @Input() preSelectGroups: IdentityGroupModel[] = []; - /** This flag enables the validation on the preSelectGroups passed as input. + /** + * This flag enables the validation on the preSelectGroups passed as input. * In case the flag is true the components call the identity service to verify the validity of the information passed as input. * Otherwise, no check will be done. */ @Input() validate = false; - /** Show the info in readonly mode + /** + * Show the info in readonly mode */ @Input() readOnly = false; - /** Mark this field as required + /** + * Mark this field as required */ @Input() required = false; diff --git a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts index d0afae77b5..aee51f5c1d 100644 --- a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.spec.ts @@ -42,10 +42,21 @@ describe('PeopleCloudComponent', () => { let searchSpy: jasmine.Spy; // eslint-disable-next-line prefer-arrow/prefer-arrow-functions + /** + * get the native element by selector + * + * @param selector selector + * @returns native element + */ function getElement(selector: string): T { return fixture.nativeElement.querySelector(selector); } + /** + * Search users by value + * + * @param value value + */ async function searchUsers(value: string) { const input = getElement('input'); input.focus(); @@ -57,6 +68,11 @@ describe('PeopleCloudComponent', () => { fixture.detectChanges(); } + /** + * Search users and blur the input + * + * @param value value + */ async function searchUsersAndBlur(value: string) { const input = getElement('input'); input.focus(); @@ -71,14 +87,29 @@ describe('PeopleCloudComponent', () => { fixture.detectChanges(); } + /** + * Get users list UI + * + * @returns list of debug elements + */ function getUsersListUI(): DebugElement[] { return fixture.debugElement.queryAll(By.css('[data-automation-id="adf-people-cloud-row"]')); } + /** + * Get users chip list UI + * + * @returns list of debug elements + */ function getUsersChipsUI(): DebugElement[] { return fixture.debugElement.queryAll(By.css('mat-chip')); } + /** + * Get the first user from the list + * + * @returns native element + */ function getFirstUserFromListUI(): Element { return element.querySelector('[data-automation-id="adf-people-cloud-row"]'); } diff --git a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts index b8729f7dae..890779966e 100644 --- a/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/people/components/people-cloud.component.ts @@ -65,24 +65,28 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy { @Input() roles: string[]; - /** This flag enables the validation on the preSelectUsers passed as input. + /** + * This flag enables the validation on the preSelectUsers passed as input. * In case the flag is true the components call the identity service to verify the validity of the information passed as input. * Otherwise, no check will be done. */ @Input() validate: boolean = false; - /** Show the info in readonly mode + /** + * Show the info in readonly mode */ @Input() readOnly: boolean = false; - /** Mark this field as required + /** + * Mark this field as required */ @Input() required = false; - /** Array of users to be pre-selected. All users in the + /** + * Array of users to be pre-selected. All users in the * array are pre-selected in multi selection mode, but only the first user * is pre-selected in single selection mode. * Mandatory properties are: id, email, username @@ -90,13 +94,15 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy { @Input() preSelectUsers: IdentityUserModel[] = []; - /** Array of users to be excluded. + /** + * Array of users to be excluded. * Mandatory properties are: id, email, username */ @Input() excludedUsers: IdentityUserModel[] = []; - /** Array of groups to restrict user searches. + /** + * Array of groups to restrict user searches. * Mandatory property is group name */ @Input() @@ -110,7 +116,8 @@ export class PeopleCloudComponent implements OnInit, OnChanges, OnDestroy { @Input() searchUserCtrl = new UntypedFormControl({ value: '', disabled: false }); - /** Placeholder translation key + /** + * Placeholder translation key */ @Input() title: string; 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-cloud.component.ts index 309b82ff45..0608f44265 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-cloud.component.ts @@ -452,6 +452,8 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes /** * Delete a process instance filter + * + * @param deleteAction filter action */ delete(deleteAction: ProcessFilterAction) { this.processFilterCloudService @@ -469,6 +471,8 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes /** * Save As a process instance filter + * + * @param saveAsAction filter action */ saveAs(saveAsAction: ProcessFilterAction) { const dialogRef = this.dialog.open(ProcessFilterDialogCloudComponent, { @@ -512,9 +516,10 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes } /** - * Return filter name + * Get sanitized filter name * - * @param filterName + * @param filterName filter name + * @returns sanitized filter name */ getSanitizeFilterName(filterName: string): string { const nameWithHyphen = this.replaceSpaceWithHyphen(filterName.trim()); @@ -524,7 +529,8 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges, OnDes /** * Return name with hyphen * - * @param name + * @param name name + * @returns updated value */ replaceSpaceWithHyphen(name: string): string { const regExt = new RegExp(' ', 'g'); 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-cloud.component.ts index a3bcba939c..71758fa527 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-cloud.component.ts @@ -84,8 +84,10 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Fetch the filter list based on appName + * + * @param appName application name */ - getFilters(appName: string) { + getFilters(appName: string): void { this.filters$ = this.processFilterCloudService.getProcessFilters(appName); this.filters$.pipe(takeUntil(this.onDestroy$)).subscribe( @@ -103,8 +105,10 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Pass the selected filter as next + * + * @param paramFilter filter model */ - public selectFilter(paramFilter: FilterParamsModel) { + selectFilter(paramFilter: FilterParamsModel) { if (paramFilter) { this.currentFilter = this.filters.find( (filter, index) => @@ -118,6 +122,10 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Check equality of the filter names by translating the given name strings + * + * @param name1 source name + * @param name2 target name + * @returns `true` if filter names are equal, otherwise `false` */ private checkFilterNamesEquality(name1: string, name2: string): boolean { const translatedName1 = this.translationService.instant(name1); @@ -128,8 +136,10 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Selects and emits the given filter + * + * @param newParamFilter new parameter filter */ - public selectFilterAndEmit(newParamFilter: FilterParamsModel) { + selectFilterAndEmit(newParamFilter: FilterParamsModel) { if (newParamFilter) { this.selectFilter(newParamFilter); this.filterSelected.emit(this.currentFilter); @@ -140,15 +150,19 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Select filter with the id + * + * @param id filter id */ - public selectFilterById(id: string) { + selectFilterById(id: string) { this.selectFilterAndEmit({ id }); } /** * Selects and emits the clicked filter + * + * @param filter filter model */ - public onFilterClick(filter: ProcessFilterCloudModel) { + onFilterClick(filter: ProcessFilterCloudModel) { if (filter) { this.selectFilter(filter); this.filterClicked.emit(this.currentFilter); @@ -160,14 +174,16 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Select as default process filter the first in the list */ - public selectDefaultProcessFilter() { + selectDefaultProcessFilter() { if (!this.isFilterListEmpty()) { this.currentFilter = this.filters[0]; } } /** - * Return the current process + * Get current filter + * + * @returns filter model */ getCurrentFilter(): ProcessFilterCloudModel { return this.currentFilter; @@ -175,6 +191,8 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro /** * Check if the filter list is empty + * + * @returns `true` if filter list is empty, otherwise `false` */ isFilterListEmpty(): boolean { return this.filters === undefined || (this.filters && this.filters.length === 0); @@ -193,7 +211,7 @@ export class ProcessFiltersCloudComponent implements OnInit, OnChanges, OnDestro this.onDestroy$.complete(); } - isActiveFilter(filter: any): boolean { + isActiveFilter(filter: ProcessFilterCloudModel): boolean { return this.currentFilter.name === filter.name; } } diff --git a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts index c824d92cee..8d87f62f16 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts @@ -94,9 +94,8 @@ export class ProcessFilterCloudService { * Creates and returns the default process instance filters for a app. * * @param appName Name of the target app - * @returns Observable of default process instance filters just created or created filters */ - private createDefaultFilters(appName: string) { + private createDefaultFilters(appName: string): void { const key: string = this.prepareKey(appName); this.preferenceService .getPreferences(appName, key) @@ -334,8 +333,8 @@ export class ProcessFilterCloudService { * Finds and returns the process instance filters from preferences * * @returns Array of ProcessFilterCloudModel - * @param preferences - * @param key + * @param preferences preferences + * @param key key */ private findFiltersByKeyInPreferences(preferences: any, key: string): ProcessFilterCloudModel[] { const result = preferences.find((filter: any) => filter.entry.key === key); diff --git a/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts b/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts index 5e69e23e77..27e156a6be 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts @@ -24,6 +24,10 @@ import { ProcessDefinitionCloud } from '../../../models/process-definition-cloud import { BaseCloudService } from '../../../services/base-cloud.service'; import { TaskVariableCloud } from '../../../form/models/task-variable-cloud.model'; +export interface QueryParams { + include: 'variables'; +} + @Injectable({ providedIn: 'root' }) @@ -32,9 +36,10 @@ export class StartProcessCloudService extends BaseCloudService { * Gets the process definitions associated with an app. * * @param appName Name of the target app + * @param queryParams optional query parameters * @returns Array of process definitions */ - getProcessDefinitions(appName: string, queryParams?: { include: 'variables' }): Observable { + getProcessDefinitions(appName: string, queryParams?: QueryParams): Observable { if (appName || appName === '') { const url = `${this.getBasePath(appName)}/rb/v1/process-definitions`; @@ -85,6 +90,7 @@ export class StartProcessCloudService extends BaseCloudService { * * @param appName name of the Application * @param processInstanceId process instance to update + * @returns Observable */ deleteProcess(appName: string, processInstanceId: string): Observable { const url = `${this.getBasePath(appName)}/rb/v1/process-instances/${processInstanceId}`; diff --git a/lib/process-services-cloud/src/lib/services/user-preference-cloud.service.ts b/lib/process-services-cloud/src/lib/services/user-preference-cloud.service.ts index 3eb30630ce..72f0532c32 100644 --- a/lib/process-services-cloud/src/lib/services/user-preference-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/services/user-preference-cloud.service.ts @@ -60,7 +60,7 @@ export class UserPreferenceCloudService extends BaseCloudService implements Pref * * @param appName Name of the target app * @param key Key of the target preference - * @newPreference Details of new user preference + * @param newPreference Details of new user preference * @returns Observable of created user preferences */ createPreference(appName: string, key: string, newPreference: any): Observable { diff --git a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts index fe15208786..43a2e84170 100644 --- a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts @@ -194,7 +194,8 @@ export class TaskCloudService extends BaseCloudService implements TaskCloudServi /** * Creates a new standalone task. * - * @param taskDetails Details of the task to create + * @param startTaskRequest request model + * @param appName application name * @returns Details of the newly created task */ createNewTask(startTaskRequest: StartTaskCloudRequestModel, appName: string): Observable { diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts index 21bda735c5..67917bb867 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/base-edit-task-filter-cloud.component.ts @@ -215,9 +215,10 @@ export abstract class BaseEditTaskFilterCloudComponent implements OnInit, OnC } /** - * Return filter name + * Get the sanitized filter name * - * @param filterName + * @param filterName filter name + * @returns sanitized filter name */ getSanitizeFilterName(filterName: string): string { const nameWithHyphen = this.replaceSpaceWithHyphen(filterName.trim()); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.spec.ts index f9b5ffdd2f..92c68a520a 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filters/edit-task-filter-cloud.component.spec.ts @@ -120,12 +120,20 @@ describe('EditTaskFilterCloudComponent', () => { processInstanceIdInput: '[data-automation-id="adf-cloud-edit-task-property-processInstanceId"]' }; + /** + * expand filter panel + */ function expandFilterPanel(){ const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); } + /** + * resolve filter instance input element + * + * @returns native element + */ function getProcessInstanceIdInputElement(){ return fixture.debugElement.query(By.css(cssSelector.processInstanceIdInput)).nativeElement; } diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/service-task-filters-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/service-task-filters-cloud.component.ts index 1d320b4268..62e271a348 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/service-task-filters-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/service-task-filters-cloud.component.ts @@ -63,9 +63,11 @@ export class ServiceTaskFiltersCloudComponent extends BaseTaskFiltersCloudCompon } /** - * Return the filter list filtered by appName + * Load the filter list filtered by appName + * + * @param appName application name */ - getFilters(appName: string) { + getFilters(appName: string): void { this.filters$ = this.serviceTaskFilterCloudService.getTaskListFilters(appName); this.filters$.pipe(takeUntil(this.onDestroy$)).subscribe( @@ -81,7 +83,12 @@ export class ServiceTaskFiltersCloudComponent extends BaseTaskFiltersCloudCompon ); } - public selectFilter(paramFilter: FilterParamsModel) { + /** + * Select filter + * + * @param paramFilter filter model + */ + selectFilter(paramFilter: FilterParamsModel) { if (paramFilter) { this.currentFilter = this.filters.find((filter, index) => paramFilter.index === index || @@ -107,8 +114,10 @@ export class ServiceTaskFiltersCloudComponent extends BaseTaskFiltersCloudCompon /** * Selects and emits the clicked filter. + * + * @param filter filter to select */ - public onFilterClick(filter: FilterParamsModel) { + onFilterClick(filter: FilterParamsModel) { if (filter) { this.selectFilter(filter); this.filterClicked.emit(this.currentFilter); @@ -128,6 +137,8 @@ export class ServiceTaskFiltersCloudComponent extends BaseTaskFiltersCloudCompon /** * Check if the filter list is empty + * + * @returns `true` if filter list is empty, otherwise `false` */ isFilterListEmpty(): boolean { return this.filters === undefined || (this.filters && this.filters.length === 0); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/task-assignment-filter/task-assignment-filter.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/task-assignment-filter/task-assignment-filter.component.spec.ts index f4c453dfdf..a6e4cc278f 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/task-assignment-filter/task-assignment-filter.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/task-assignment-filter/task-assignment-filter.component.spec.ts @@ -34,6 +34,11 @@ describe('TaskAssignmentFilterComponent', () => { let fixture: ComponentFixture; let identityUserService: IdentityUserService; + /** + * select the assignment type + * + * @param type type to select + */ function selectAssignmentType(type: AssignmentType) { const assignmentTypeChangeSpy = spyOn(component.assignmentTypeChange, 'emit'); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.ts index 6b1cf8fa2f..27eec2aa7f 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.ts @@ -73,13 +73,15 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp } /** - * Return the filter list filtered by appName + * Loads the filter list filtered by appName + * + * @param appName application name */ - getFilters(appName: string) { + getFilters(appName: string): void { this.filters$ = this.taskFilterCloudService.getTaskListFilters(appName); this.filters$.pipe(takeUntil(this.onDestroy$)).subscribe( - (res: TaskFilterCloudModel[]) => { + (res) => { this.resetFilter(); this.filters = res || []; this.selectFilterAndEmit(this.filterParam); @@ -157,8 +159,10 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp /** * Selects and emits the clicked filter. + * + * @param filter filter model */ - public onFilterClick(filter: FilterParamsModel) { + onFilterClick(filter: FilterParamsModel) { if (filter) { this.selectFilter(filter); this.updateFilterCounter(this.currentFilter); @@ -179,6 +183,8 @@ export class TaskFiltersCloudComponent extends BaseTaskFiltersCloudComponent imp /** * Check if the filter list is empty + * + * @returns `true` if filter list is empty, otherwise `false` */ isFilterListEmpty(): boolean { return this.filters === undefined || (this.filters && this.filters.length === 0); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts index c101355a54..a0db0bb2bd 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/services/service-task-filter-cloud.service.ts @@ -40,9 +40,8 @@ export class ServiceTaskFilterCloudService { * Creates and returns the default task filters for an app. * * @param appName Name of the target app - * @returns Observable of default filters task filters just created or created filters */ - private createDefaultFilters(appName: string) { + private createDefaultFilters(appName: string): void { const key: string = this.prepareKey(appName); this.preferenceService .getPreferences(appName, key) @@ -251,8 +250,8 @@ export class ServiceTaskFilterCloudService { * Finds and returns the task filters from preferences * * @returns Array of TaskFilterCloudModel - * @param preferences - * @param key + * @param preferences preferences + * @param key key */ private findFiltersByKeyInPreferences(preferences: any, key: string): ServiceTaskFilterCloudModel[] { const result = preferences.find((filter: any) => filter.entry.key === key); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts index 634c8364a2..4f48998f08 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts @@ -65,9 +65,8 @@ export class TaskFilterCloudService extends BaseCloudService { * Creates and returns the default task filters for an app. * * @param appName Name of the target app - * @returns Observable of default filters task filters just created or created filters */ - private createDefaultFilters(appName: string) { + private createDefaultFilters(appName: string): void { const key: string = this.prepareKey(appName); this.preferenceService .getPreferences(appName, key) @@ -254,9 +253,9 @@ export class TaskFilterCloudService extends BaseCloudService { * Finds a task using an object with optional query properties. * * @returns Task information - * @param taskFilter + * @param taskFilter task filter model */ - getTaskFilterCounter(taskFilter: TaskFilterCloudModel): Observable { + getTaskFilterCounter(taskFilter: TaskFilterCloudModel): Observable { if (taskFilter.appName || taskFilter.appName === '') { const queryUrl = `${this.getBasePath(taskFilter.appName)}/query/v1/tasks`; const queryParams = { @@ -313,8 +312,8 @@ export class TaskFilterCloudService extends BaseCloudService { * Finds and returns the task filters from preferences * * @returns Array of TaskFilterCloudModel - * @param preferences - * @param key + * @param preferences preferences + * @param key key */ private findFiltersByKeyInPreferences(preferences: any, key: string): TaskFilterCloudModel[] { const result = preferences.find((filter: any) => filter.entry.key === key); diff --git a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts index 696476dd93..25a4c6eb85 100644 --- a/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-form/components/task-form-cloud.component.ts @@ -96,13 +96,15 @@ export class TaskFormCloudComponent implements OnInit, OnChanges, OnDestroy { @Output() formContentClicked: EventEmitter = new EventEmitter(); - /** Emitted when any outcome is executed. Default behaviour can be prevented + /** + * Emitted when any outcome is executed. Default behaviour can be prevented * via `event.preventDefault()`. */ @Output() executeOutcome = new EventEmitter(); - /** Emitted when a task is loaded`. + /** + * Emitted when a task is loaded`. */ @Output() onTaskLoaded = new EventEmitter(); /* eslint-disable-line */ diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts index 5f4ad99a3d..b8394462c9 100644 --- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts @@ -288,7 +288,7 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges { /** * Save a task detail and update it after a successful response * - * @param updateNotification + * @param updateNotification notification model */ private updateTaskDetails(updateNotification: UpdateNotification) { this.taskCloudService.updateTask(this.appName, this.taskId, updateNotification.changed) @@ -336,6 +336,8 @@ export class TaskHeaderCloudComponent implements OnInit, OnDestroy, OnChanges { /** * as per [ACA-3960] it required an empty array argument for now * Empty array will be replaced with candidateGroups in feature + * + * @returns `true` if assignee property is clickable, otherwise `false` */ isAssigneePropertyClickable(): boolean { return this.taskCloudService.isAssigneePropertyClickable(this.taskDetails, this.candidateUsers, []);