Merge pull request #675 from Alfresco/dev-denys-638

Disable save and/or complete within an Activiti form for completed tasks #638
This commit is contained in:
Mario Romano 2016-09-05 15:23:55 +01:00 committed by GitHub
commit e66b0ad516
7 changed files with 13 additions and 5 deletions

View File

@ -19,6 +19,7 @@
<div *ngIf="form.hasOutcomes()" class="mdl-card__actions mdl-card--border">
<button *ngFor="let outcome of form.outcomes"
alfresco-mdl-button
[disabled]="readOnly"
[class.mdl-button--colored]="!outcome.isSystem"
[class.activiti-form-hide-button]="!isOutcomeButtonEnabled(outcome)"
(click)="onOutcomeClicked(outcome, $event)">

View File

@ -41,7 +41,7 @@ describe('ActivitiForm', () => {
window['componentHandler'] = componentHandler;
formService = new FormService(null, null);
formComponent = new ActivitiForm(formService, visibilityService, null, null, null);
formComponent = new ActivitiForm(formService, visibilityService, null, null);
});
it('should upgrade MDL content on view checked', () => {

View File

@ -23,7 +23,7 @@ import {
Output,
EventEmitter
} from '@angular/core';
import { MATERIAL_DESIGN_DIRECTIVES, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
import { MATERIAL_DESIGN_DIRECTIVES } from 'ng2-alfresco-core';
import { EcmModelService } from './../services/ecm-model.service';
import { FormService } from './../services/form.service';
import { NodeService } from './../services/node.service';
@ -148,7 +148,6 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
constructor(private formService: FormService,
private visibilityService: WidgetVisibilityService,
private authService: AlfrescoAuthenticationService,
private ecmModelService: EcmModelService,
private nodeService: NodeService) {
}

View File

@ -1 +0,0 @@
/widget.model.ts

View File

@ -2,7 +2,7 @@
<label [attr.for]="field.id">{{field.name}}</label>
<div>
<i class="material-icons upload-widget__icon">image</i>
<i *ngIf="hasFile" class="material-icons upload-widget__icon">attachment</i>
<span *ngIf="hasFile" class="upload-widget__file">{{getUploadedFileName()}}</span>
<input *ngIf="!hasFile"
#file

View File

@ -18,6 +18,7 @@
[showRefreshButton]="showRefreshButton"
[showCompleteButton]="showCompleteButton"
[showSaveButton]="showSaveButton"
[readOnly]="readOnly"
(formSaved)='formSavedEmitter($event)'
(formCompleted)='formCompletedEmitter($event)'
(formLoaded)='formLoadedEmitter($event)'

View File

@ -109,6 +109,14 @@ export class ActivitiTaskDetails implements OnInit {
this.activitiTaskList.getTaskDetails(taskId).subscribe(
(res: TaskDetailsModel) => {
this.taskDetails = res;
let endDate: any = res.endDate;
if (endDate && !isNaN(endDate.getTime())) {
this.readOnly = true;
} else {
this.readOnly = false;
}
if (this.taskDetails && this.taskDetails.involvedPeople) {
this.taskDetails.involvedPeople.forEach((user) => {
this.taskPeople.push(new User(user.id, user.email, user.firstName, user.lastName));