Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luc Didry
kresus
Commits
354e2701
Commit
354e2701
authored
Sep 20, 2018
by
Antoine
Browse files
Display outstanding balance in the menu of the client.
parent
f299c6d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/components/menu/account.js
View file @
354e2701
...
...
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import
{
connect
}
from
'
react-redux
'
;
import
{
get
}
from
'
../../store
'
;
import
{
displayLabel
}
from
'
../../helpers
'
;
import
{
displayLabel
,
translate
as
$t
}
from
'
../../helpers
'
;
import
ColoredAmount
from
'
./colored-amount
'
;
...
...
@@ -13,16 +13,27 @@ const AccountListItem = connect((state, props) => {
return
{
account
};
})(
props
=>
{
let
{
account
,
accountId
}
=
props
;
let
{
balance
,
formatCurrency
}
=
account
;
let
{
balance
,
outstandingSum
,
formatCurrency
}
=
account
;
let
newPathname
=
props
.
location
.
pathname
.
replace
(
props
.
currentAccountId
,
accountId
);
// Outstanding balance.
let
maybeOutstandingSum
=
outstandingSum
!==
0
?
(
<
React
.
Fragment
>
&
ensp
;
{
`(
${
$t
(
'
client.menu.outstanding_balance
'
)}
`
}
<
ColoredAmount
amount
=
{
outstandingSum
}
formatCurrency
=
{
formatCurrency
}
/
>
{
'
)
'
}
<
/React.Fragment
>
)
:
null
;
return
(
<
li
key
=
{
`account-details-account-list-item-
${
accountId
}
`
}
>
<
NavLink
to
=
{
newPathname
}
activeClassName
=
"
active
"
>
<
span
>
{
displayLabel
(
account
)}
<
/span
>
&
ensp
;
<
ColoredAmount
amount
=
{
balance
}
formatCurrency
=
{
formatCurrency
}
/
>
{
maybeOutstandingSum
}
<
/NavLink
>
<
/li
>
);
...
...
shared/locales/en.json
View file @
354e2701
...
...
@@ -163,7 +163,8 @@
"budget"
:
"Budget"
,
"about"
:
"About"
,
"different_currencies"
:
"Different currencies"
,
"total"
:
"Total"
"total"
:
"Total"
,
"outstanding_balance"
:
"Ongoing: "
},
"operations"
:
{
"amount"
:
"Amount"
,
...
...
shared/locales/fr.json
View file @
354e2701
...
...
@@ -163,7 +163,8 @@
"budget"
:
"Budget"
,
"about"
:
"À propos"
,
"different_currencies"
:
"Devises différentes"
,
"total"
:
"Total"
"total"
:
"Total"
,
"outstanding_balance"
:
"Encours : "
},
"operations"
:
{
"amount"
:
"Montant"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment