mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Merge development branch
# Conflicts: # ng2-components/ng2-activiti-tasklist/index.ts # ng2-components/ng2-activiti-tasklist/src/components/activiti-filters.com ponent.spec.ts # ng2-components/ng2-activiti-tasklist/src/components/activiti-task-detail s.component.ts # ng2-components/ng2-activiti-tasklist/src/components/activiti-tasklist.co mponent.spec.ts # ng2-components/ng2-alfresco-login/demo/package.json
This commit is contained in:
@@ -30,13 +30,14 @@ declare var componentHandler;
|
||||
})
|
||||
export class UploadWidget extends WidgetComponent implements OnInit {
|
||||
|
||||
hasFile: boolean;
|
||||
fileName: string;
|
||||
|
||||
constructor(private settingsService: AlfrescoSettingsService,
|
||||
private authService: AlfrescoAuthenticationService) {
|
||||
super();
|
||||
}
|
||||
|
||||
hasFile: boolean;
|
||||
fileName: string;
|
||||
|
||||
ngOnInit() {
|
||||
if (this.field &&
|
||||
|
@@ -81,7 +81,7 @@ export class WidgetVisibilityService {
|
||||
|
||||
private getLeftValue(form: FormModel, visibilityObj: WidgetVisibilityModel) {
|
||||
if ( visibilityObj.leftRestResponseId ) {
|
||||
return this.getValueFromVariable(form, visibilityObj.leftRestResponseId);
|
||||
return this.getValueFromVariable(form, visibilityObj.leftRestResponseId, this.processVarList);
|
||||
}
|
||||
return this.getValueOField(form, visibilityObj.leftFormFieldId);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ export class WidgetVisibilityService {
|
||||
private getRightValue(form: FormModel, visibilityObj: WidgetVisibilityModel) {
|
||||
let valueFound = null;
|
||||
if ( visibilityObj.rightRestResponseId ) {
|
||||
valueFound = this.getValueFromVariable(form, visibilityObj.rightRestResponseId);
|
||||
valueFound = this.getValueFromVariable(form, visibilityObj.rightRestResponseId, this.processVarList);
|
||||
}else if ( visibilityObj.rightFormFieldId ) {
|
||||
valueFound = this.getValueOField(form, visibilityObj.rightFormFieldId);
|
||||
}else {
|
||||
@@ -116,18 +116,29 @@ export class WidgetVisibilityService {
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private getValueFromVariable(form: FormModel, name: string) {
|
||||
let formVariable = form.json.variables.find(formVar => formVar.name === name);
|
||||
if ( !formVariable && this.processVarList ) {
|
||||
formVariable = this.processVarList.find(variable => variable.id === name);
|
||||
}
|
||||
if ( formVariable ) {
|
||||
return formVariable.value;
|
||||
}
|
||||
return null;
|
||||
private getValueFromVariable( form: FormModel, name: string, processVarList: TaskProcessVariableModel[] ) {
|
||||
return this.getFormVariableValue(form, name) ||
|
||||
this.getProcessVariableValue(name, processVarList);
|
||||
}
|
||||
|
||||
private getFormVariableValue(form: FormModel, name: string ) {
|
||||
if ( form.json.variables) {
|
||||
let variableFromForm = form.json.variables.find(formVar => formVar.name === name);
|
||||
if ( variableFromForm ) {
|
||||
return variableFromForm ? variableFromForm.value : variableFromForm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private getProcessVariableValue(name: string, processVarList: TaskProcessVariableModel[]) {
|
||||
if ( this.processVarList ) {
|
||||
let variableFromProcess = this.processVarList.find(variable => variable.id === name);
|
||||
if ( variableFromProcess ) {
|
||||
return variableFromProcess ? variableFromProcess.value : variableFromProcess;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private evaluateLogicalOperation(logicOp, previousValue, newValue): boolean {
|
||||
@@ -168,7 +179,7 @@ export class WidgetVisibilityService {
|
||||
console.error( 'NO valid operation!' );
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
getTaskProcessVariableModelsForTask(taskId: string): Observable<TaskProcessVariableModel[]> {
|
||||
|
Reference in New Issue
Block a user