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
Nicolas Frandeboeuf
kresus
Commits
905bbd2b
Commit
905bbd2b
authored
Apr 21, 2017
by
ZeHiro
Browse files
Harmonize display of alert accounts. Fixes #541
parent
e983a386
Changes
5
Hide whitespace changes
Inline
Side-by-side
client/components/settings/emails/account-select.js
View file @
905bbd2b
...
...
@@ -48,7 +48,7 @@ export default connect(state => {
for
(
let
account
of
accounts
)
{
pairs
.
push
({
key
:
account
.
accountNumber
,
val
:
`
${
access
.
name
}
-
${
account
.
title
}
`
val
:
`
${
access
.
name
}
−
${
account
.
title
}
`
});
}
}
...
...
client/components/settings/emails/alert-item.js
View file @
905bbd2b
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
assert
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
actions
}
from
'
../../../store
'
;
import
{
actions
,
get
}
from
'
../../../store
'
;
import
ConfirmDeleteModal
from
'
../../ui/confirm-delete-modal
'
;
import
AmountInput
from
'
../../ui/amount-input
'
;
...
...
@@ -25,14 +25,14 @@ const AlertItem = props => {
props
.
update
({
limit
:
value
});
};
let
{
account
,
alert
}
=
props
;
let
{
account
,
alert
,
access
}
=
props
;
let
{
limit
,
type
,
id
}
=
alert
;
assert
(
alert
.
order
===
'
gt
'
||
alert
.
order
===
'
lt
'
);
return
(
<
tr
>
<
td
className
=
"
col-md-3
"
>
{
account
.
title
}
<
/td
>
<
td
className
=
"
col-md-3
"
>
{
`
${
access
.
name
}
−
${
account
.
title
}
`
}
<
/td
>
<
td
className
=
"
col-md-3
"
>
<
span
className
=
"
condition
"
>
{
props
.
sendIfText
}
<
/span
>
<
/td
>
...
...
@@ -99,11 +99,15 @@ AlertItem.propTypes = {
update
:
React
.
PropTypes
.
func
.
isRequired
,
// The alert deletion function
handleDelete
:
React
.
PropTypes
.
func
.
isRequired
handleDelete
:
React
.
PropTypes
.
func
.
isRequired
,
// The bank access to which is attached the account of the alert
access
:
React
.
PropTypes
.
object
.
isRequired
};
export
default
connect
(()
=>
{
return
{};
export
default
connect
((
state
,
ownProps
)
=>
{
let
access
=
get
.
accessById
(
state
,
ownProps
.
account
.
bankAccess
);
return
{
access
};
},
(
dispatch
,
props
)
=>
{
return
{
update
(
newFields
)
{
...
...
client/components/settings/emails/report-item.js
View file @
905bbd2b
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
assert
,
assertHas
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
actions
}
from
'
../../../store
'
;
import
{
actions
,
get
}
from
'
../../../store
'
;
import
ConfirmDeleteModal
from
'
../../ui/confirm-delete-modal
'
;
...
...
@@ -16,14 +16,14 @@ const ReportItem = props => {
props
.
update
({
frequency
:
newValue
});
};
let
{
account
,
alert
}
=
props
;
let
{
account
,
alert
,
access
}
=
props
;
assertHas
(
alert
,
'
frequency
'
);
assert
(
alert
.
type
===
'
report
'
);
return
(
<
tr
>
<
td
className
=
"
col-md-3
"
>
{
account
.
title
}
<
/td
>
<
td
className
=
"
col-md-3
"
>
{
`
${
access
.
name
}
−
${
account
.
title
}
`
}
<
/td
>
<
td
className
=
"
col-md-3
"
>
<
span
className
=
"
condition
"
>
{
$t
(
'
client.settings.emails.send_report
'
)
}
...
...
@@ -78,8 +78,9 @@ ReportItem.propTypes = {
handleDelete
:
React
.
PropTypes
.
func
.
isRequired
};
export
default
connect
(()
=>
{
return
{};
export
default
connect
((
state
,
ownProps
)
=>
{
let
access
=
get
.
accessById
(
state
,
ownProps
.
account
.
bankAccess
);
return
{
access
};
},
(
dispatch
,
props
)
=>
{
return
{
update
(
newFields
)
{
...
...
client/store/banks.js
View file @
905bbd2b
...
...
@@ -1077,7 +1077,8 @@ export function getAccesses(state) {
}
export
function
accessById
(
state
,
accessId
)
{
return
state
.
accesses
.
filter
(
access
=>
access
.
id
===
accessId
)[
0
];
let
candidate
=
state
.
accesses
.
find
(
access
=>
access
.
id
===
accessId
);
return
typeof
candidate
!==
'
undefined
'
?
candidate
:
null
;
}
export
function
byUuid
(
state
,
uuid
)
{
...
...
client/store/index.js
View file @
905bbd2b
...
...
@@ -100,6 +100,11 @@ export const get = {
}
),
accessById
(
state
,
accessId
)
{
assertDefined
(
state
);
return
Bank
.
accessById
(
state
.
banks
,
accessId
);
},
// [Access]
accesses
(
state
)
{
assertDefined
(
state
);
...
...
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