[ADF-4393] TaskHeaderCloud - remove readOnly property (#4599)

This commit is contained in:
Silviu Popa 2019-04-12 15:59:14 +03:00 committed by Eugenio Romano
parent 338b208a73
commit 16aaa0f0b3
4 changed files with 6 additions and 17 deletions

View File

@ -7,10 +7,10 @@
<button mat-button (click)="goBack()">Cancel</button> <button mat-button (click)="goBack()">Cancel</button>
<button mat-button color="primary" *ngIf="canCompleteTask()" adf-cloud-complete-task <button mat-button color="primary" *ngIf="canCompleteTask()" adf-cloud-complete-task
(success)="onCompletedTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.COMPLETE' | translate }}</button> (success)="onCompletedTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.COMPLETE' | translate }}</button>
<button mat-button color="primary" *ngIf="canClaimTask()" adf-cloud-claim-task <button mat-button color="primary" *ngIf="canClaimTask()" adf-cloud-claim-task
(success)="onClaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.CLAIM' | translate }}</button> (success)="onClaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.CLAIM' | translate }}</button>
<button mat-button color="primary" *ngIf="canUnClaimTask()" adf-cloud-unclaim-task <button mat-button color="primary" *ngIf="canUnClaimTask()" adf-cloud-unclaim-task
(success)="onUnclaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.UNCLAIM' | translate }}</button> (success)="onUnclaimTask()">{{ 'ADF_TASK_LIST.DETAILS.BUTTON.UNCLAIM' | translate }}</button>
</div> </div>
@ -23,8 +23,7 @@
</div> </div>
<adf-cloud-task-header fxFlex <adf-cloud-task-header fxFlex
[appName]="appName" [appName]="appName"
[taskId]="taskId" [taskId]="taskId">
[readOnly]="readOnly">
</adf-cloud-task-header> </adf-cloud-task-header>
</div> </div>
</div> </div>

View File

@ -29,7 +29,6 @@ export class TaskDetailsCloudDemoComponent implements OnInit {
taskDetails: TaskDetailsCloudModel; taskDetails: TaskDetailsCloudModel;
taskId: string; taskId: string;
appName: string; appName: string;
readOnly = false;
constructor( constructor(
private route: ActivatedRoute, private route: ActivatedRoute,

View File

@ -27,7 +27,6 @@ Shows all the information related to a task.
| Name | Type | Default value | Description | | Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- | | ---- | ---- | ------------- | ----------- |
| appName | `string` | | (Required) The name of the application. | | appName | `string` | | (Required) The name of the application. |
| readOnly | `boolean` | false | Toggles Read Only Mode. This disables click selection and editing for all cells. |
| taskId | `string` | | (Required) The id of the task. | | taskId | `string` | | (Required) The id of the task. |
### Events ### Events

View File

@ -45,10 +45,6 @@ export class TaskHeaderCloudComponent implements OnInit {
@Input() @Input()
taskId: string; taskId: string;
/** Toggles Read Only Mode. This disables click selection and editing for all cells. */
@Input()
readOnly: boolean = false;
/** Emitted when the task is claimed. */ /** Emitted when the task is claimed. */
@Output() @Output()
claim: EventEmitter<any> = new EventEmitter<any>(); claim: EventEmitter<any> = new EventEmitter<any>();
@ -113,7 +109,7 @@ export class TaskHeaderCloudComponent implements OnInit {
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PRIORITY', label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PRIORITY',
value: this.taskDetails.priority, value: this.taskDetails.priority,
key: 'priority', key: 'priority',
editable: this.isReadOnlyMode() editable: true
} }
), ),
new CardViewDateItemModel( new CardViewDateItemModel(
@ -123,7 +119,7 @@ export class TaskHeaderCloudComponent implements OnInit {
key: 'dueDate', key: 'dueDate',
format: 'DD-MM-YYYY', format: 'DD-MM-YYYY',
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DUE_DATE_DEFAULT'), default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DUE_DATE_DEFAULT'),
editable: this.isReadOnlyMode() editable: true
} }
), ),
new CardViewTextItemModel( new CardViewTextItemModel(
@ -179,7 +175,7 @@ export class TaskHeaderCloudComponent implements OnInit {
key: 'description', key: 'description',
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION_DEFAULT'), default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION_DEFAULT'),
multiline: true, multiline: true,
editable: this.isReadOnlyMode() editable: true
} }
) )
]; ];
@ -237,10 +233,6 @@ export class TaskHeaderCloudComponent implements OnInit {
return this.taskDetails.assignee !== undefined; return this.taskDetails.assignee !== undefined;
} }
isReadOnlyMode() {
return !this.readOnly;
}
private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean { private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean {
return filteredProperties ? filteredProperties.indexOf(cardItem.key) >= 0 : true; return filteredProperties ? filteredProperties.indexOf(cardItem.key) >= 0 : true;
} }