projects/netgrif-components-core/src/lib/task/services/data-focus-policy.service.ts
Handles the sequence of actions that are performed when a task si opened.
Methods |
|
constructor(_taskContentService: TaskContentService)
|
||||||
Parameters :
|
Public performDataFocusPolicy |
performDataFocusPolicy()
|
Performs the selection of some data fields if the policy is set to Auto Required.
Returns :
void
|
Protected isTaskPresent |
isTaskPresent()
|
Inherited from
TaskHandlingService
|
Defined in
TaskHandlingService:42
|
Returns :
boolean
|
Protected isTaskRelevant | ||||||||
isTaskRelevant(requestedTaskId: string)
|
||||||||
Inherited from
TaskHandlingService
|
||||||||
Defined in
TaskHandlingService:56
|
||||||||
Checks whether the current state of the TaskContentService and optionally if the SelectedCaseService, is still relevant to the task that was requested. This method is useful if you use UnlimitedTaskContentService, or a similar implementation. It is possible for the currently "selected" task to change in-between a backend request was sent and the response was received. In that case the response is no longer relevant and should be discarded, otherwise an illegal task state could be achieved on frontend.
Parameters :
Returns :
boolean
|
import {Injectable} from '@angular/core';
import {DataFocusPolicy} from '../../task-content/model/policy';
import {TaskContentService} from '../../task-content/services/task-content.service';
import {TaskHandlingService} from './task-handling-service';
/**
* Handles the sequence of actions that are performed when a task si [opened]{@link TaskOperations#open}.
*/
@Injectable()
export class DataFocusPolicyService extends TaskHandlingService {
constructor(_taskContentService: TaskContentService) {
super(_taskContentService);
}
/**
* Performs the selection of some data fields if the policy is set to [Auto Required]{@link DataFocusPolicy#autoRequired}.
*/
public performDataFocusPolicy(): void {
if (this._safeTask.dataFocusPolicy === DataFocusPolicy.autoRequired) {
this.autoRequiredDataFocusPolicy();
}
}
/**
* Currently does nothing
*/
private autoRequiredDataFocusPolicy(): void {
// TODO Implement focus in FUTURE, if someone wants this feature (for now we don't want it )
}
}