mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1312] form validation enhancements (#2180)
* validation api enhancements - changing 'required' causes re-validation of the form - get field by id * allow binding field validators from html * demo validator * documentation updates * fix after rebase * markdown fixes * markdown linter settings for workspace config (vs code) * restore material theme
This commit is contained in:
committed by
Mario Romano
parent
6c1a758561
commit
3d65b49af7
@@ -169,6 +169,7 @@ The component shows the details of the task id passed in input
|
||||
| showInvolvePeople | boolean | true | Toggle `Involve People` feature for Header component |
|
||||
| showComments | boolean | true | Toggle `Comments` feature for Header component |
|
||||
| showChecklist | boolean | true | Toggle `Checklist` feature for Header component |
|
||||
| fieldValidators | FormFieldValidator[] | [] | Field validators for use with the form. |
|
||||
|
||||
### Events
|
||||
|
||||
|
@@ -40,6 +40,7 @@
|
||||
[disableCompleteButton]="!isAssignedToMe()"
|
||||
[showSaveButton]="showFormSaveButton"
|
||||
[readOnly]="readOnlyForm"
|
||||
[fieldValidators]="fieldValidators"
|
||||
(formSaved)='onFormSaved($event)'
|
||||
(formCompleted)='onFormCompleted($event)'
|
||||
(formContentClicked)='onFormContentClick($event)'
|
||||
|
@@ -26,7 +26,7 @@ import { Component,
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { ContentLinkModel, FormModel, FormOutcomeEvent } from 'ng2-activiti-form';
|
||||
import { ContentLinkModel, FormFieldValidator, FormModel, FormOutcomeEvent } from 'ng2-activiti-form';
|
||||
import { AlfrescoAuthenticationService, AlfrescoTranslationService, CardViewUpdateService, ClickNotification, UpdateNotification } from 'ng2-alfresco-core';
|
||||
import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
@@ -96,6 +96,9 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
@Input()
|
||||
peopleIconImageUrl: string = require('../assets/images/user.jpg');
|
||||
|
||||
@Input()
|
||||
fieldValidators: FormFieldValidator[] = [];
|
||||
|
||||
@Output()
|
||||
formSaved: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
||||
|
||||
|
@@ -48,7 +48,6 @@ export class TaskHeaderComponent implements OnChanges {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
console.log('change van:', changes, this.taskDetails);
|
||||
this.refreshData();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user