Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
064c5099
Commit
064c5099
authored
Sep 15, 2018
by
Florent Chehab
Browse files
Lock on adding element
parent
ef8f4ee4
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/university/modules/UniversityDri.js
View file @
064c5099
...
...
@@ -76,6 +76,7 @@ class UniversityDri extends MyComponent {
return
(
<
GenericGroupModule
groupTitle
=
{
"
Informations émanant de la DRI
"
}
endPoint
=
{
"
universityDri
"
}
editor
=
{
UniversityDriEditor
}
invalidateGroup
=
{
this
.
props
.
invalidateData
}
propsForEditor
=
{{
...
...
frontend/src/components/university/shared/GenericGroupModule.js
View file @
064c5099
...
...
@@ -58,9 +58,11 @@ class GenericGroupModule extends MyComponent {
}
};
r
ender
()
{
myR
ender
()
{
const
{
classes
,
theme
,
groupTitle
}
=
this
.
props
;
const
{
endPoint
}
=
this
.
props
;
const
userCanPostTo
=
this
.
getFetchedData
(
'
userDataEl
'
).
owner_can_post_to
;
const
disabled
=
userCanPostTo
.
indexOf
(
endPoint
)
<
0
;
return
(
<
Paper
className
=
{
classes
.
root
}
>
<
this
.
props
.
editor
...
...
@@ -76,14 +78,14 @@ class GenericGroupModule extends MyComponent {
<
/Grid
>
<
Grid
item
xs
=
{
2
}
style
=
{{
textAlign
:
'
right
'
}}
>
<
Tooltip
title
=
"
Ajouter un élément
"
placement
=
"
top
"
>
<
Tooltip
title
=
{
disabled
?
"
Vous ne pouvez pas ajouter d'élément
"
:
"
Ajouter un élément
"
}
placement
=
"
top
"
>
<
div
style
=
{{
display
:
'
inline-block
'
}}
>
{
/* Needed to fire events for the tooltip when below is disabled! */
}
<
Button
variant
=
'
fab
'
mini
aria
-
label
=
"
Ajouter un élément
"
disabled
=
{
false
}
style
=
{{
backgroundColor
:
green
.
A700
}}
disabled
=
{
disabled
}
style
=
{
disabled
?
{}
:
{
backgroundColor
:
green
.
A700
}}
className
=
{
classes
.
button
}
onClick
=
{
this
.
handleOpenEditor
}
>
...
...
@@ -103,6 +105,7 @@ class GenericGroupModule extends MyComponent {
GenericGroupModule
.
propTypes
=
{
groupTitle
:
PropTypes
.
string
.
isRequired
,
endPoint
:
PropTypes
.
string
.
isRequired
,
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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