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
46dd91fe
Commit
46dd91fe
authored
Mar 04, 2019
by
Benjamin Bouvier
Browse files
[client] Modernize categories code;
parent
934750fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/components/categories/index.js
View file @
46dd91fe
...
...
@@ -9,16 +9,11 @@ import CategoryListItem from './item';
import
{
MODAL_SLUG
as
DELETE_UNUSED_MODAL_SLUG
}
from
'
./delete-unused-modal
'
;
class
CategoryList
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
showForm
:
false
};
state
=
{
showForm
:
false
};
this
.
handleShowForm
=
this
.
handleShowForm
.
bind
(
this
);
this
.
refNewCategory
=
this
.
refNewCategory
.
bind
(
this
);
}
refNewCategory
=
React
.
createRef
();
handleAddDefault
=
()
=>
{
this
.
props
.
createDefaultCategories
();
...
...
@@ -34,16 +29,12 @@ class CategoryList extends React.Component {
function
()
{
// then
if
(
this
.
state
.
showForm
)
{
this
.
n
ewCategory
.
selectTitle
();
this
.
refN
ewCategory
.
current
.
selectTitle
();
}
}
);
};
refNewCategory
=
node
=>
{
this
.
newCategory
=
node
;
};
render
=
()
=>
{
let
items
=
this
.
props
.
categories
.
map
(
cat
=>
(
<
CategoryListItem
...
...
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