@netgrif/components-core
Version:
Netgrif Application engine frontend core Angular library
116 lines (115 loc) • 6.36 kB
TypeScript
import { OnDestroy } from '@angular/core';
import { TaskContentService } from '../../../task-content/services/task-content.service';
import { TaskDataService } from '../../../task/services/task-data.service';
import { CancelTaskService } from '../../../task/services/cancel-task.service';
import { TaskEventService } from '../../../task-content/services/task-event.service';
import { TaskResourceService } from '../../../resources/engine-endpoint/task-resource.service';
import { TreeCaseViewService } from '../tree-case-view.service';
import { Case } from '../../../resources/interface/case';
import { Task } from '../../../resources/interface/task';
import { AssignPolicyService } from '../../../task/services/assign-policy.service';
import { SubjectTaskOperations } from '../../../task/models/subject-task-operations';
import { UserComparatorService } from '../../../user/services/user-comparator.service';
import { CallChainService } from '../../../utility/call-chain/call-chain.service';
import { Observable } from 'rxjs';
import { LoggerService } from '../../../logger/services/logger.service';
import { SelectedCaseService } from '../../../task/services/selected-case.service';
import { Filter } from '../../../filter/models/filter';
import { PermissionService } from '../../../authorization/permission/permission.service';
import { ChangedFieldsService } from '../../../changed-fields/services/changed-fields.service';
import * as i0 from "@angular/core";
export declare class TreeTaskContentService implements OnDestroy {
protected _treeCaseService: TreeCaseViewService;
protected _taskDataService: TaskDataService;
protected _taskContentService: TaskContentService;
protected _taskResourceService: TaskResourceService;
protected _taskEventService: TaskEventService;
protected _assignPolicy: AssignPolicyService;
protected _cancel: CancelTaskService;
protected _userComparator: UserComparatorService;
protected _callchain: CallChainService;
protected _logger: LoggerService;
protected _selectedCaseService: SelectedCaseService;
protected _changedFieldsService: ChangedFieldsService;
protected _permissionService: PermissionService;
protected _taskOperations: SubjectTaskOperations;
private _processingTaskChange;
private _displayedTaskText$;
/**
* a unique identifier consisting of caseId and transition ID
*
* Is set if a reload of the given task is currently taking place, `undefined` otherwise.
*/
private _reloadedTaskUniqueIdentifier;
constructor(_treeCaseService: TreeCaseViewService, _taskDataService: TaskDataService, _taskContentService: TaskContentService, _taskResourceService: TaskResourceService, _taskEventService: TaskEventService, _assignPolicy: AssignPolicyService, _cancel: CancelTaskService, _userComparator: UserComparatorService, _callchain: CallChainService, _logger: LoggerService, _selectedCaseService: SelectedCaseService, _changedFieldsService: ChangedFieldsService, _permissionService: PermissionService, _taskOperations: SubjectTaskOperations);
get taskContentText$(): Observable<string>;
get processingTaskChange(): boolean;
displayEmptyTaskContent(): void;
/**
* Cancels the currently selected {@link Task} if any. And then loads and assigns the new Task.
* @param selectedCase the Case who's task should be now displayed
*/
protected cancelAndLoadFeaturedTask(selectedCase: Case | undefined): void;
/**
* Changes the currently displayed {@link Task} based on the selected {@link Case} from the Tree.
* @param selectedCase the Case who's task should be now displayed
*/
protected loadFeaturedTask(selectedCase: Case | undefined): void;
/**
* Checks whether the currently displayed task differs from the new one
* @param newCase [Case]{@link Case} object that holds the newly selected {@link Task}
* @returns `true` if the currently selected Case has a different ID from the newly selected Case.
* If the IDs are the same returns `true` if the transition IDs are different.
* Returns `false` otherwise.
*/
private taskChanged;
/**
* Checks whether a Task object is currently selected and if it can be cancelled by the user
*/
private get shouldCancelTask();
/**
* Creates a {@link Filter} object that finds the specified Task for the currently selected Case in a Tree Case View
* @returns a request body that finds tasks of the given case with task id that corresponds to the value in the `treeTaskTransitionId`
* immediate data field. Returns `undefined` if the request body cannot be created.
*/
protected getTaskFilter(): Filter | undefined;
/**
* @param examinedCase the {@link Case} object from which we want to extract the transition ID
* @returns the ID of the transition that should be displayed in the {@link AbstractTaskContentComponent},
* or `undefined` if the currently selected case doesn't define it
*/
protected getTransitionId(examinedCase: Case): string | undefined;
/**
* Changes the currently selected {@link Task}.
* @param task the Task that should now be selected
*/
protected switchToTask(task: Task): void;
/**
* Notifies all connected Services that no Task is currently selected
*/
protected clearCurrentTask(): void;
/**
* Updates the state of the current Task from backend
*/
protected updateTaskState(): void;
/**
* If the current {@link Task} is assigned to the current user it is unblocked. Otherwise it is blocked.
*/
protected resolveTaskBlockState(): void;
/**
* Sets the noData text in the task content to it's default value
*/
protected setStandardTaskText(): void;
/**
* Attempts to cancel the currently opened Task if the Task is in such state that allows cancellation.
*/
ngOnDestroy(): void;
/**
* @returns a unique identifier for the currently selected task, that consists of it's case's id and it's transition id.
*
* Returns `undefined`, if no task is currently selected.
*/
protected getUniqueTaskIdentifier(): string;
static ɵfac: i0.ɵɵFactoryDeclaration<TreeTaskContentService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TreeTaskContentService>;
}