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

View File

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

View File

@ -27,7 +27,6 @@ Shows all the information related to a task.
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| 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. |
### Events

View File

@ -45,10 +45,6 @@ export class TaskHeaderCloudComponent implements OnInit {
@Input()
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. */
@Output()
claim: EventEmitter<any> = new EventEmitter<any>();
@ -113,7 +109,7 @@ export class TaskHeaderCloudComponent implements OnInit {
label: 'ADF_CLOUD_TASK_HEADER.PROPERTIES.PRIORITY',
value: this.taskDetails.priority,
key: 'priority',
editable: this.isReadOnlyMode()
editable: true
}
),
new CardViewDateItemModel(
@ -123,7 +119,7 @@ export class TaskHeaderCloudComponent implements OnInit {
key: 'dueDate',
format: 'DD-MM-YYYY',
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DUE_DATE_DEFAULT'),
editable: this.isReadOnlyMode()
editable: true
}
),
new CardViewTextItemModel(
@ -179,7 +175,7 @@ export class TaskHeaderCloudComponent implements OnInit {
key: 'description',
default: this.translationService.instant('ADF_CLOUD_TASK_HEADER.PROPERTIES.DESCRIPTION_DEFAULT'),
multiline: true,
editable: this.isReadOnlyMode()
editable: true
}
)
];
@ -237,10 +233,6 @@ export class TaskHeaderCloudComponent implements OnInit {
return this.taskDetails.assignee !== undefined;
}
isReadOnlyMode() {
return !this.readOnly;
}
private isValidSelection(filteredProperties: string[], cardItem: CardViewBaseItemModel): boolean {
return filteredProperties ? filteredProperties.indexOf(cardItem.key) >= 0 : true;
}