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
Jan
kresus
Commits
12f407e2
Commit
12f407e2
authored
Aug 07, 2016
by
Benjamin Bouvier
Browse files
Rename the `has` helper to `assertHas`;
parent
ebbcc440
Changes
26
Hide whitespace changes
Inline
Side-by-side
client/components/categories/create-form.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
ColorPicker
from
'
../ui/color-picker
'
;
export
default
class
CreateForm
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
onSave
'
);
h
as
(
props
,
'
onCancel
'
);
assertH
as
(
props
,
'
onSave
'
);
assertH
as
(
props
,
'
onCancel
'
);
// Facultative: previousValue, previousColor
super
(
props
);
this
.
handleSave
=
this
.
handleSave
.
bind
(
this
);
...
...
client/components/operations/delete-operation.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
actions
}
from
'
../../store
'
;
import
ConfirmDeleteModal
from
'
../ui/confirm-delete-modal
'
;
class
DeleteOperation
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
operation
'
);
h
as
(
props
,
'
formatCurrency
'
);
assertH
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
formatCurrency
'
);
super
(
props
);
}
...
...
client/components/operations/details.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
DetailedViewLabel
}
from
'
./label
'
;
import
DeleteOperation
from
'
./delete-operation
'
;
...
...
@@ -15,10 +15,10 @@ export function computeAttachmentLink(op) {
export
default
class
OperationDetails
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
onToggleDetails
'
);
h
as
(
props
,
'
operation
'
);
h
as
(
props
,
'
rowClassName
'
);
h
as
(
props
,
'
formatCurrency
'
);
assertH
as
(
props
,
'
onToggleDetails
'
);
assertH
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
rowClassName
'
);
assertH
as
(
props
,
'
formatCurrency
'
);
super
(
props
);
}
...
...
client/components/operations/item.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
translate
as
$t
,
h
as
}
from
'
../../helpers
'
;
import
{
translate
as
$t
,
assertH
as
}
from
'
../../helpers
'
;
import
{
default
as
OperationDetails
,
computeAttachmentLink
}
from
'
./details
'
;
import
{
OperationListViewLabel
}
from
'
./label
'
;
...
...
@@ -11,8 +11,8 @@ import CategorySelect from './category-select';
export
default
class
Operation
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
operation
'
);
h
as
(
props
,
'
formatCurrency
'
);
assertH
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
formatCurrency
'
);
super
(
props
);
this
.
state
=
{
showDetails
:
false
...
...
client/components/operations/label.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
h
as
,
assert
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
assert
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
actions
}
from
'
../../store
'
;
// If the length of the short label (of an operation) is smaller than this
...
...
@@ -12,7 +12,7 @@ const SMALL_TITLE_THRESHOLD = 4;
class
LabelComponent
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
operation
'
);
super
(
props
);
this
.
state
=
{
editMode
:
false
...
...
@@ -129,7 +129,7 @@ function mapDispatch(component) {
class
DetailedViewLabel_
extends
LabelComponent
{
constructor
(
props
)
{
h
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
operation
'
);
super
(
props
);
}
...
...
@@ -150,8 +150,8 @@ export const DetailedViewLabel = mapDispatch(DetailedViewLabel_);
class
OperationListViewLabel_
extends
LabelComponent
{
constructor
(
props
)
{
h
as
(
props
,
'
operation
'
);
h
as
(
props
,
'
link
'
);
assertH
as
(
props
,
'
operation
'
);
assertH
as
(
props
,
'
link
'
);
super
(
props
);
}
...
...
client/components/operations/sync-button.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
get
,
actions
}
from
'
../../store
'
;
export
default
connect
(
state
=>
{
...
...
@@ -15,7 +15,7 @@ export default connect(state => {
}
};
})(
props
=>
{
h
as
(
props
,
'
account
'
);
assertH
as
(
props
,
'
account
'
);
let
text
=
(
props
.
synchronizing
?
...
...
client/components/settings/bank-accesses/add-operation-modal.js
View file @
12f407e2
...
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
get
,
actions
}
from
'
../../../store
'
;
import
{
h
as
,
translate
as
$t
,
NONE_CATEGORY_ID
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
,
NONE_CATEGORY_ID
}
from
'
../../../helpers
'
;
import
CategorySelect
from
'
../../operations/category-select
'
;
import
OperationTypeSelect
from
'
../../operations/operation-type-select
'
;
...
...
@@ -14,7 +14,7 @@ import ValidableInputDate from '../../ui/checked-date';
class
AddOperationModal
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
account
'
);
assertH
as
(
props
,
'
account
'
);
super
(
props
);
this
.
state
=
this
.
makeClearState
();
...
...
client/components/settings/bank-accesses/custom-bank-field.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
export
default
class
CustomBankField
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
params
'
);
assertH
as
(
props
,
'
params
'
);
super
(
props
);
}
...
...
client/components/settings/bank-accesses/edit-access-modal.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
CustomBankField
from
'
./custom-bank-field
'
;
import
Modal
from
'
../../ui/modal
'
;
...
...
@@ -37,7 +37,7 @@ export default class EditAccessModal extends React.Component {
}
constructor
(
props
)
{
h
as
(
props
,
'
modalId
'
);
assertH
as
(
props
,
'
modalId
'
);
super
(
props
);
this
.
handleSubmit
=
this
.
handleSubmit
.
bind
(
this
);
this
.
extractCustomFieldValue
=
this
.
extractCustomFieldValue
.
bind
(
this
);
...
...
client/components/settings/bank-accesses/form.js
View file @
12f407e2
...
...
@@ -2,13 +2,13 @@ import React from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
{
get
,
actions
}
from
'
../../../store
'
;
import
{
h
as
,
assert
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
assert
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
CustomBankField
from
'
./custom-bank-field
'
;
class
NewBankForm
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
expanded
'
);
assertH
as
(
props
,
'
expanded
'
);
super
(
props
);
this
.
state
=
{
...
...
client/components/settings/emails/alert-form-modal.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
actions
}
from
'
../../../store
'
;
import
AccountSelector
from
'
./account-select
'
;
...
...
@@ -11,10 +11,10 @@ import Modal from '../../ui/modal';
class
AlertCreationModal
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
alertType
'
);
h
as
(
props
,
'
modalId
'
);
h
as
(
props
,
'
titleTranslationKey
'
);
h
as
(
props
,
'
sendIfText
'
);
assertH
as
(
props
,
'
alertType
'
);
assertH
as
(
props
,
'
modalId
'
);
assertH
as
(
props
,
'
titleTranslationKey
'
);
assertH
as
(
props
,
'
sendIfText
'
);
super
(
props
);
this
.
state
=
{
maybeLimitError
:
''
};
this
.
handleSubmit
=
this
.
handleSubmit
.
bind
(
this
);
...
...
client/components/settings/emails/alert-item.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
assert
,
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assert
,
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
actions
}
from
'
../../../store
'
;
import
ConfirmDeleteModal
from
'
../../ui/confirm-delete-modal
'
;
...
...
@@ -9,9 +9,9 @@ import ConfirmDeleteModal from '../../ui/confirm-delete-modal';
class
AlertItem
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
alert
'
);
h
as
(
props
,
'
account
'
);
h
as
(
props
,
'
sendIfText
'
);
assertH
as
(
props
,
'
alert
'
);
assertH
as
(
props
,
'
account
'
);
assertH
as
(
props
,
'
sendIfText
'
);
super
(
props
);
this
.
handleSelect
=
this
.
handleSelect
.
bind
(
this
);
this
.
handleChangeLimit
=
this
.
handleChangeLimit
.
bind
(
this
);
...
...
client/components/settings/emails/alert-list.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
get
}
from
'
../../../store
'
;
import
AlertCreationModal
from
'
./alert-form-modal
'
;
...
...
@@ -10,10 +10,10 @@ import AlertItem from './alert-item';
class
Alerts
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
alertType
'
);
h
as
(
props
,
'
sendIfText
'
);
h
as
(
props
,
'
titleTranslationKey
'
);
h
as
(
props
,
'
panelTitleKey
'
);
assertH
as
(
props
,
'
alertType
'
);
assertH
as
(
props
,
'
sendIfText
'
);
assertH
as
(
props
,
'
titleTranslationKey
'
);
assertH
as
(
props
,
'
panelTitleKey
'
);
super
(
props
);
}
...
...
client/components/settings/emails/report-item.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
assert
,
h
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
assert
,
assertH
as
,
translate
as
$t
}
from
'
../../../helpers
'
;
import
{
actions
}
from
'
../../../store
'
;
import
ConfirmDeleteModal
from
'
../../ui/confirm-delete-modal
'
;
...
...
@@ -23,7 +23,7 @@ class ReportItem extends React.Component {
render
()
{
let
{
account
,
alert
}
=
this
.
props
;
h
as
(
alert
,
'
frequency
'
);
assertH
as
(
alert
,
'
frequency
'
);
assert
(
alert
.
type
===
'
report
'
);
return
(
...
...
client/components/ui/checked-date.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
}
from
'
../../helpers
'
;
import
{
assertH
as
}
from
'
../../helpers
'
;
import
DatePicker
from
'
./date-picker
'
;
export
default
class
ValidableInputDate
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
returnInputValue
'
);
h
as
(
props
,
'
inputID
'
);
h
as
(
props
,
'
label
'
);
assertH
as
(
props
,
'
returnInputValue
'
);
assertH
as
(
props
,
'
inputID
'
);
assertH
as
(
props
,
'
label
'
);
super
(
props
);
this
.
state
=
{
valid
:
false
};
this
.
handleSelect
=
this
.
handleSelect
.
bind
(
this
);
...
...
client/components/ui/checked-number.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
}
from
'
../../helpers
'
;
import
{
assertH
as
}
from
'
../../helpers
'
;
export
default
class
ValidableInputNumber
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
returnInputValue
'
);
h
as
(
props
,
'
inputID
'
);
h
as
(
props
,
'
step
'
);
h
as
(
props
,
'
label
'
);
assertH
as
(
props
,
'
returnInputValue
'
);
assertH
as
(
props
,
'
inputID
'
);
assertH
as
(
props
,
'
step
'
);
assertH
as
(
props
,
'
label
'
);
super
(
props
);
this
.
state
=
{
valid
:
false
};
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
...
...
client/components/ui/checked-text.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
}
from
'
../../helpers
'
;
import
{
assertH
as
}
from
'
../../helpers
'
;
export
default
class
ValidableInputText
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
returnInputValue
'
);
h
as
(
props
,
'
inputID
'
);
h
as
(
props
,
'
label
'
);
assertH
as
(
props
,
'
returnInputValue
'
);
assertH
as
(
props
,
'
inputID
'
);
assertH
as
(
props
,
'
label
'
);
super
(
props
);
this
.
state
=
{
valid
:
false
};
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
...
...
client/components/ui/confirm-delete-modal.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
{
assertH
as
,
translate
as
$t
}
from
'
../../helpers
'
;
import
Modal
from
'
./modal
'
;
export
default
class
ConfirmDeleteModal
extends
React
.
Component
{
constructor
(
props
)
{
h
as
(
props
,
'
modalId
'
);
h
as
(
props
,
'
modalBody
'
);
h
as
(
props
,
'
onDelete
'
);
assertH
as
(
props
,
'
modalId
'
);
assertH
as
(
props
,
'
modalBody
'
);
assertH
as
(
props
,
'
onDelete
'
);
super
(
props
);
}
...
...
client/components/ui/modal.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
}
from
'
../../helpers
'
;
import
{
assertH
as
}
from
'
../../helpers
'
;
export
default
class
Modal
extends
React
.
Component
{
export
default
props
=>
{
assertHas
(
props
,
'
modalId
'
);
assertHas
(
props
,
'
modalBody
'
);
assertHas
(
props
,
'
modalTitle
'
);
assertHas
(
props
,
'
modalFooter
'
);
constructor
(
props
)
{
has
(
props
,
'
modalId
'
);
has
(
props
,
'
modalBody
'
);
has
(
props
,
'
modalTitle
'
);
has
(
props
,
'
modalFooter
'
);
super
(
props
);
}
render
()
{
return
(
<
div
className
=
"
modal fade
"
id
=
{
this
.
props
.
modalId
}
tabIndex
=
"
-1
"
role
=
"
dialog
"
aria
-
labelledby
=
"
myModalLabel
"
aria
-
hidden
=
"
true
"
>
<
div
className
=
"
modal-dialog
"
>
<
div
className
=
"
modal-content
"
>
<
div
className
=
"
modal-header
"
>
<
button
type
=
"
button
"
className
=
"
close
"
data
-
dismiss
=
"
modal
"
aria
-
label
=
"
Close
"
>
<
span
aria
-
hidden
=
"
true
"
>&
times
;
<
/span
>
<
/button
>
<
h4
className
=
"
modal-title
"
id
=
"
myModalLabel
"
>
{
this
.
props
.
modalTitle
}
<
/h4
>
<
/div
>
<
div
className
=
"
modal-body
"
>
{
this
.
props
.
modalBody
}
<
/div
>
<
div
className
=
"
modal-footer
"
>
{
this
.
props
.
modalFooter
}
<
/div
>
return
(
<
div
className
=
"
modal fade
"
id
=
{
props
.
modalId
}
tabIndex
=
"
-1
"
role
=
"
dialog
"
aria
-
labelledby
=
"
myModalLabel
"
aria
-
hidden
=
"
true
"
>
<
div
className
=
"
modal-dialog
"
>
<
div
className
=
"
modal-content
"
>
<
div
className
=
"
modal-header
"
>
<
button
type
=
"
button
"
className
=
"
close
"
data
-
dismiss
=
"
modal
"
aria
-
label
=
"
Close
"
>
<
span
aria
-
hidden
=
"
true
"
>&
times
;
<
/span
>
<
/button
>
<
h4
className
=
"
modal-title
"
id
=
"
myModalLabel
"
>
{
props
.
modalTitle
}
<
/h4
>
<
/div
>
<
div
className
=
"
modal-body
"
>
{
props
.
modalBody
}
<
/div
>
<
div
className
=
"
modal-footer
"
>
{
props
.
modalFooter
}
<
/div
>
<
/div
>
<
/div
>
);
}
}
<
/div
>
);
}
;
client/components/ui/select-with-default.js
View file @
12f407e2
import
React
from
'
react
'
;
import
{
h
as
}
from
'
../../helpers
'
;
import
{
assertH
as
}
from
'
../../helpers
'
;
export
default
class
SelectWithDefault
extends
React
.
Component
{
constructor
(
props
,
options
)
{
h
as
(
props
,
'
defaultValue
'
);
h
as
(
props
,
'
onChange
'
);
h
as
(
props
,
'
htmlId
'
);
assertH
as
(
props
,
'
defaultValue
'
);
assertH
as
(
props
,
'
onChange
'
);
assertH
as
(
props
,
'
htmlId
'
);
super
(
props
);
this
.
options
=
options
;
}
...
...
Prev
1
2
Next
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