mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Re Added visibility feature
This commit is contained in:
@@ -26,7 +26,7 @@ import {
|
||||
import { MATERIAL_DESIGN_DIRECTIVES } from 'ng2-alfresco-core';
|
||||
|
||||
import { FormService } from './../services/form.service';
|
||||
import { FormModel, FormOutcomeModel, FormValues } from './widgets/core/index';
|
||||
import { FormModel, FormOutcomeModel, FormValues, FormFieldModel } from './widgets/core/index';
|
||||
|
||||
import { TabsWidget } from './widgets/tabs/tabs.widget';
|
||||
import { ContainerWidget } from './widgets/container/container.widget';
|
||||
@@ -34,6 +34,8 @@ import { ContainerWidget } from './widgets/container/container.widget';
|
||||
declare let __moduleName: string;
|
||||
declare var componentHandler;
|
||||
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
|
||||
/**
|
||||
* @Input
|
||||
* ActivitiForm can show 3 forms searching by 3 type of params:
|
||||
@@ -70,7 +72,7 @@ declare var componentHandler;
|
||||
templateUrl: './activiti-form.component.html',
|
||||
styleUrls: ['./activiti-form.component.css'],
|
||||
directives: [MATERIAL_DESIGN_DIRECTIVES, ContainerWidget, TabsWidget],
|
||||
providers: [FormService]
|
||||
providers: [FormService, WidgetVisibilityService]
|
||||
})
|
||||
export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
|
||||
@@ -118,7 +120,8 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
|
||||
debugMode: boolean = false;
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
constructor(private formService: FormService,
|
||||
private visibilityService: WidgetVisibilityService) {
|
||||
}
|
||||
|
||||
hasForm(): boolean {
|
||||
@@ -220,6 +223,7 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
loadForm() {
|
||||
if (this.taskId) {
|
||||
this.getFormByTaskId(this.taskId);
|
||||
this.visibilityService.getTaskProcessVariableModelsForTask(this.taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -334,4 +338,8 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
new FormOutcomeModel(form, { id: '$custom', name: FormOutcomeModel.SAVE_ACTION, isSystem: true })
|
||||
];
|
||||
}
|
||||
|
||||
checkVisibility(field: FormFieldModel) {
|
||||
this.visibilityService.updateVisibilityForForm(field.form);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user