Browse Source

Add RollOver button to UI

compile-for-aarch64
Philipp Hoenisch 3 years ago
parent
commit
963a9e58e6
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 5
      daemon/src/to_sse_event.rs
  2. 1
      frontend/src/components/Types.tsx
  3. 9
      frontend/src/components/cfdtables/CfdTable.tsx

5
daemon/src/to_sse_event.rs

@ -300,13 +300,16 @@ fn available_actions(state: CfdState, role: Role) -> Vec<CfdAction> {
(CfdState::IncomingSettlementProposal { .. }, Role::Maker) => { (CfdState::IncomingSettlementProposal { .. }, Role::Maker) => {
vec![CfdAction::AcceptSettlement, CfdAction::RejectSettlement] vec![CfdAction::AcceptSettlement, CfdAction::RejectSettlement]
} }
(CfdState::IncomingRollOverProposal { .. }, Role::Maker) => {
vec![CfdAction::AcceptRollOver, CfdAction::RejectRollOver]
}
// If there is an outgoing settlement proposal already, user can't // If there is an outgoing settlement proposal already, user can't
// initiate new one // initiate new one
(CfdState::OutgoingSettlementProposal { .. }, Role::Maker) => { (CfdState::OutgoingSettlementProposal { .. }, Role::Maker) => {
vec![CfdAction::Commit] vec![CfdAction::Commit]
} }
(CfdState::Open { .. }, Role::Taker) => { (CfdState::Open { .. }, Role::Taker) => {
vec![CfdAction::Commit, CfdAction::Settle] vec![CfdAction::RollOver, CfdAction::Commit, CfdAction::Settle]
} }
(CfdState::Open { .. }, Role::Maker) => vec![CfdAction::Commit], (CfdState::Open { .. }, Role::Maker) => vec![CfdAction::Commit],
_ => vec![], _ => vec![],

1
frontend/src/components/Types.tsx

@ -169,6 +169,7 @@ export enum Action {
REJECT_ORDER = "rejectOrder", REJECT_ORDER = "rejectOrder",
COMMIT = "commit", COMMIT = "commit",
SETTLE = "settle", SETTLE = "settle",
ROLL_OVER = "rollOver",
ACCEPT_SETTLEMENT = "acceptSettlement", ACCEPT_SETTLEMENT = "acceptSettlement",
REJECT_SETTLEMENT = "rejectSettlement", REJECT_SETTLEMENT = "rejectSettlement",
ACCEPT_ROLL_OVER = "acceptRollOver", ACCEPT_ROLL_OVER = "acceptRollOver",

9
frontend/src/components/cfdtables/CfdTable.tsx

@ -4,6 +4,7 @@ import {
ChevronRightIcon, ChevronRightIcon,
ChevronUpIcon, ChevronUpIcon,
CloseIcon, CloseIcon,
RepeatIcon,
TriangleDownIcon, TriangleDownIcon,
TriangleUpIcon, TriangleUpIcon,
WarningIcon, WarningIcon,
@ -199,6 +200,12 @@ function iconForAction(action: Action): any {
return <CheckIcon />; return <CheckIcon />;
case Action.REJECT_SETTLEMENT: case Action.REJECT_SETTLEMENT:
return <CloseIcon />; return <CloseIcon />;
case Action.ROLL_OVER:
return <RepeatIcon />;
case Action.ACCEPT_ROLL_OVER:
return <CheckIcon />;
case Action.REJECT_ROLL_OVER:
return <CloseIcon />;
} }
} }
@ -212,6 +219,8 @@ function colorSchemaForAction(action: Action): string {
return "red"; return "red";
case Action.SETTLE: case Action.SETTLE:
return "green"; return "green";
case Action.ROLL_OVER:
return "green";
case Action.ACCEPT_SETTLEMENT: case Action.ACCEPT_SETTLEMENT:
return "green"; return "green";
case Action.REJECT_SETTLEMENT: case Action.REJECT_SETTLEMENT:

Loading…
Cancel
Save