Fix Operation Row component.

This commit is contained in:
Alexis Lahouze 2017-07-30 15:12:57 +02:00
parent 558988a57a
commit b7c2d94c62

View File

@ -17,7 +17,8 @@ import { OperationService } from './operation.service';
"[id]": "operation.id",
"[class.stroke]": "operation.canceled",
"[class.italic]": "!operation.confirmed",
"[class.warning]": "operation.balance < 0, danger: operation.balance < operationsCtrl.account.authorized_overdraft"
"[class.warning]": "operation.balance < 0",
"[class.danger]": "operation.balance < account.authorized_overdraft"
},
template: `
<td>{{ operation.operation_date | date:"yyyy-MM-dd" }}</td>
@ -37,14 +38,14 @@ import { OperationService } from './operation.service';
<div class="btn-group btn-group-sm">
<!-- Edit operation, for non-canceled operation. -->
<button type="button" class="btn btn-success"
[hidden]="operation.canceled"
*ngIf="!operation.canceled"
(click)="modify(operation)" title="edit">
<span class="fa fa-pencil-square-o"></span>
</button>
<!-- Toggle pointed operation, for non-canceled operations. -->
<button type="button" class="btn btn-secondary"
[hidden]="operation.canceled"
*ngIf="!operation.canceled"
(click)="togglePointed(operation)"
[class.active]="operation.pointed" title="point">
<span class="fa" [class.fa-check-square-o]="operation.pointed"
@ -54,15 +55,15 @@ import { OperationService } from './operation.service';
<!-- Toggle canceled operation. -->
<button type="button" class="btn btn-warning"
(click)="toggleCanceled(operation)"
[hidden]="!operation.scheduled_operation_id"
*ngIf="operation.scheduled_operation_id"
[class.active]="operation.canceled" title="cancel">
<span class="fa fa-remove"></span>
</button>
<!-- Delete operation, with confirm. -->
<button type="button" class="btn btn-danger"
(click)="confirmDelete(operation)">
[hidden]="!operation.id || operation.scheduled_operation_id"
(click)="confirmDelete(operation)"
*ngIf="operation.id && !operation.scheduled_operation_id">
<span class="fa fa-trash-o"></span>
</button>
</div>
@ -70,7 +71,8 @@ import { OperationService } from './operation.service';
`
})
export class OperationRowComponent {
@Input() operation: Operation;
@Input('operation-row') operation: Operation;
@Input() account: Account;
@Output() needsReload: EventEmitter<void> = new EventEmitter<void>();
constructor(