mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
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:
commit
e66b0ad516
@ -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)">
|
||||
|
@ -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', () => {
|
||||
|
@ -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) {
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
/widget.model.ts
|
@ -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
|
||||
|
@ -18,6 +18,7 @@
|
||||
[showRefreshButton]="showRefreshButton"
|
||||
[showCompleteButton]="showCompleteButton"
|
||||
[showSaveButton]="showSaveButton"
|
||||
[readOnly]="readOnly"
|
||||
(formSaved)='formSavedEmitter($event)'
|
||||
(formCompleted)='formCompletedEmitter($event)'
|
||||
(formLoaded)='formLoadedEmitter($event)'
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user