Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
e95756cb
Commit
e95756cb
authored
Jun 21, 2017
by
jasonych99
Committed by
PiTrem
Sep 27, 2017
Browse files
disable searchBtn for guest
parent
e0cb637a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/assets/javascripts/components/structure_editor/StructureEditorModal.js
View file @
e95756cb
import
React
from
'
react
'
;
import
{
Button
,
ButtonToolbar
,
Input
,
Modal
,
Panel
}
from
'
react-bootstrap
'
;
import
Select
from
'
react-select
'
;
import
Aviator
from
'
aviator
'
;
import
UserStore
from
'
../stores/UserStore
'
;
export
default
class
StructureEditorModal
extends
React
.
Component
{
constructor
(
props
)
{
...
...
@@ -87,6 +87,9 @@ export default class StructureEditorModal extends React.Component {
// and would give a feedback if the structure is valid or not
render
()
{
const
userState
=
UserStore
.
getState
();
const
disableSearch
=
userState
.
currentUser
==
null
;
let
editorContent
=
this
.
state
.
showWarning
?
<
WarningBox
handleCancelBtn
=
{
this
.
handleCancelBtn
.
bind
(
this
)}
hideWarning
=
{
this
.
hideWarning
.
bind
(
this
)}
/
>
...
...
@@ -103,6 +106,7 @@ export default class StructureEditorModal extends React.Component {
submitAddons
=
{
this
.
props
.
submitAddons
?
this
.
props
.
submitAddons
:
""
}
disableSearch
=
{
disableSearch
}
/
>
let
dom_class
=
this
.
state
.
showWarning
?
""
:
"
structure-editor-modal
"
...
...
@@ -125,8 +129,8 @@ export default class StructureEditorModal extends React.Component {
}
}
const
StructureEditor
=
({
handleCancelBtn
,
handleSaveBtn
,
cancelBtnText
,
submitBtnText
,
submitAddons
})
=>
{
const
StructureEditor
=
({
handleCancelBtn
,
handleSaveBtn
,
cancelBtnText
,
submitBtnText
,
submitAddons
,
disableSearch
})
=>
{
return
(
<
div
>
<
div
>
...
...
@@ -138,7 +142,12 @@ const StructureEditor =
<
Button
bsStyle
=
"
warning
"
onClick
=
{
handleCancelBtn
}
>
{
cancelBtnText
}
<
/Button
>
<
Button
bsStyle
=
"
primary
"
onClick
=
{
handleSaveBtn
}
style
=
{{
marginRight
:
"
20px
"
}}
>
<
Button
bsStyle
=
"
primary
"
onClick
=
{
handleSaveBtn
}
style
=
{{
marginRight
:
"
20px
"
}}
disabled
=
{
disableSearch
}
>
{
submitBtnText
}
<
/Button
>
{
submitAddons
}
...
...
Write
Preview
Markdown
is supported
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