mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
#540 hide/show save and complete button forms
This commit is contained in:
parent
2f941c95a5
commit
65ec34041b
@ -19,3 +19,7 @@
|
||||
.activiti-form-debug-container .debug-toggle-text:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.activiti-form-hide-button {
|
||||
display: none;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
<button *ngFor="let outcome of form.outcomes"
|
||||
alfresco-mdl-button
|
||||
[class.mdl-button--colored]="!outcome.isSystem"
|
||||
[class.activiti-form-hide-button]="!isOutcomeButtonEnabled(outcome)"
|
||||
(click)="onOutcomeClicked(outcome, $event)">
|
||||
{{outcome.name}}
|
||||
</button>
|
||||
|
@ -53,6 +53,10 @@ declare var componentHandler;
|
||||
*
|
||||
* {showRefreshButton} boolean - to hide the refresh button of the form pass false, default true;
|
||||
*
|
||||
* {showCompleteButton} boolean - to hide the complete button of the form pass false, default true;
|
||||
*
|
||||
* {showSaveButton} boolean - to hide the save button of the form pass false, default true;
|
||||
*
|
||||
* @Output
|
||||
* {formLoaded} EventEmitter - This event is fired when the form is loaded, it pass all the value in the form.
|
||||
* {formsaved} EventEmitter - This event is fired when the form is saved, it pass all the value in the form.
|
||||
@ -85,6 +89,12 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
@Input()
|
||||
showTitle: boolean = true;
|
||||
|
||||
@Input()
|
||||
showCompleteButton: boolean = true;
|
||||
|
||||
@Input()
|
||||
showSaveButton: boolean = true;
|
||||
|
||||
@Input()
|
||||
readOnly: boolean = false;
|
||||
|
||||
@ -104,6 +114,9 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
|
||||
debugMode: boolean = false;
|
||||
|
||||
constructor(private formService: FormService) {
|
||||
}
|
||||
|
||||
hasForm(): boolean {
|
||||
return this.form ? true : false;
|
||||
}
|
||||
@ -112,7 +125,15 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
return this.form.taskName && this.showTitle;
|
||||
}
|
||||
|
||||
constructor(private formService: FormService) {}
|
||||
isOutcomeButtonEnabled(outcome: any): boolean {
|
||||
if (outcome.name === 'Complete') {
|
||||
return this.showCompleteButton;
|
||||
}
|
||||
if (outcome.name === 'Save') {
|
||||
return this.showSaveButton;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.taskId) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user