mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Removed return null from methods
This commit is contained in:
parent
8f6a9fb03b
commit
6f24b88465
@ -236,11 +236,11 @@ describe('WidgetVisibilityService', () => {
|
||||
});
|
||||
|
||||
|
||||
it('should return null if the variable does not exist', (done) => {
|
||||
it('should return undefined if the variable does not exist', (done) => {
|
||||
service.getTaskProcessVariableModelsForTask(9999).subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
let varValue = service.getValueFromVariable(formTest, 'TEST_MYSTERY_VAR', res);
|
||||
expect(varValue).toBeNull();
|
||||
expect(varValue).toBeUndefined();
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
@ -128,20 +128,18 @@ export class WidgetVisibilityService {
|
||||
if ( form.json.variables) {
|
||||
let variableFromForm = form.json.variables.find(formVar => formVar.name === name);
|
||||
if ( variableFromForm ) {
|
||||
return variableFromForm.value;
|
||||
return variableFromForm ? variableFromForm.value : variableFromForm;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private getProcessVariableValue(name: string, processVarList: TaskProcessVariableModel[]) {
|
||||
if ( this.processVarList ) {
|
||||
let variableFromProcess = this.processVarList.find(variable => variable.id === name);
|
||||
if ( variableFromProcess ) {
|
||||
return variableFromProcess.value;
|
||||
return variableFromProcess ? variableFromProcess.value : variableFromProcess;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private evaluateLogicalOperation(logicOp, previousValue, newValue): boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user