Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Rex Dri
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rex Dri
Rex Dri
Commits
b68243af
Commit
b68243af
authored
Mar 01, 2019
by
Florent Chehab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restored University Dri and fixes accross the board
parent
65260c06
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
19 deletions
+30
-19
frontend/src/components/university/editors/UniversityDriEditor.js
.../src/components/university/editors/UniversityDriEditor.js
+16
-3
frontend/src/components/university/modules/UniversityDri.js
frontend/src/components/university/modules/UniversityDri.js
+6
-7
frontend/src/components/university/shared/Form.js
frontend/src/components/university/shared/Form.js
+1
-0
frontend/src/components/university/shared/GenericGroupModule.js
...nd/src/components/university/shared/GenericGroupModule.js
+6
-6
frontend/src/components/university/shared/GenericModule.js
frontend/src/components/university/shared/GenericModule.js
+1
-1
frontend/src/components/university/shared/Module.js
frontend/src/components/university/shared/Module.js
+0
-2
No files found.
frontend/src/components/university/editors/UniversityDriEditor.js
View file @
b68243af
...
...
@@ -5,18 +5,19 @@ import compose from "recompose/compose";
import
{
connect
}
from
"
react-redux
"
;
import
Editor
from
"
../shared/Editor
"
;
import
Form
from
"
../shared/Form
"
;
import
editorStyle
from
"
../shared/editorStyle
"
;
import
getMapStateToPropsForEditor
from
"
../shared/editorFunctions/getMapStateToPropsForEditor
"
;
import
getMapDispatchToPropsForEditor
from
"
../shared/editorFunctions/getMapDispatchToPropsForEditor
"
;
import
{
withSnackbar
}
from
"
notistack
"
;
const
styles
=
theme
=>
({
...
editorStyle
(
theme
)
});
class
UniversityDriEditor
extends
Editor
{
renderEditor
()
{
class
UniversityDriForm
extends
Form
{
render
()
{
return
(
<
div
>
{
this
.
renderTitleField
()}
...
...
@@ -29,12 +30,24 @@ class UniversityDriEditor extends Editor {
}
}
class
UniversityDriEditor
extends
Editor
{
renderForm
()
{
return
<
UniversityDriForm
modelData
=
{
this
.
props
.
modelData
}
outsideData
=
{
this
.
props
.
outsideData
}
ref
=
{
this
.
formRef
}
/>
;
}
}
UniversityDriEditor
.
propTypes
=
{
modelData
:
PropTypes
.
object
.
isRequired
,
};
export
default
compose
(
withSnackbar
,
withStyles
(
styles
,
{
withTheme
:
true
}),
connect
(
getMapStateToPropsForEditor
(
"
universityDri
"
),
...
...
frontend/src/components/university/modules/UniversityDri.js
View file @
b68243af
...
...
@@ -50,13 +50,12 @@ function parseRawModelData(rawModelData) {
class
UniversityDri
extends
Module
{
customRender
()
{
const
univDriItems
=
this
.
getReadData
(
"
universityDri
"
);
const
{
universities
,
classes
}
=
this
.
props
;
const
{
universities
,
classes
}
=
this
.
props
,
outsideData
=
{
universities
}
;
const
outsideData
=
{
universities
};
const
univDriItems
=
this
.
getReadData
(
"
universityDri
"
);
return
(
<
GenericGroupModule
...
...
@@ -72,9 +71,9 @@ class UniversityDri extends Module {
}}
>
{
univDriItems
.
map
(
(
rawModelData
,
idx
)
=>
(
univDriItems
.
map
(
rawModelData
=>
(
<
GenericModule
key
=
{
idx
}
key
=
{
rawModelData
.
id
}
// use the id of the model to prevent useless unmount
buildTitle
=
{(
modelData
)
=>
modelData
.
title
}
rawModelData
=
{
rawModelData
}
parseRawModelData
=
{
parseRawModelData
}
...
...
frontend/src/components/university/shared/Form.js
View file @
b68243af
...
...
@@ -160,6 +160,7 @@ Object.assign(Form.prototype, renderFieldsMixIn);
Form
.
propTypes
=
{
modelData
:
PropTypes
.
object
.
isRequired
,
outsideData
:
PropTypes
.
object
,
};
export
default
Form
;
frontend/src/components/university/shared/GenericGroupModule.js
View file @
b68243af
...
...
@@ -56,7 +56,7 @@ class GenericGroupModule extends CustomComponentForAPI {
this
.
setState
({
editorOpen
:
true
});
}
handle
CloseEditor
=
(
somethingWasSaved
=
false
)
=>
{
handle
EditorWasClosed
=
(
somethingWasSaved
=
false
)
=>
{
this
.
setState
({
editorOpen
:
false
});
if
(
somethingWasSaved
)
{
this
.
props
.
invalidateGroup
();
...
...
@@ -64,16 +64,16 @@ class GenericGroupModule extends CustomComponentForAPI {
};
customRender
()
{
const
{
classes
,
groupTitle
}
=
this
.
props
;
const
{
endPoint
}
=
this
.
props
;
const
userCanPostTo
=
this
.
getReadData
(
"
userData
"
).
owner_can_post_to
;
const
disabled
=
userCanPostTo
.
indexOf
(
endPoint
)
<
0
;
const
{
classes
,
groupTitle
,
endPoint
}
=
this
.
props
,
userCanPostTo
=
this
.
getReadData
(
"
userData
"
).
owner_can_post_to
,
disabled
=
userCanPostTo
.
indexOf
(
endPoint
)
<
0
;
return
(
<
Paper
className
=
{
classes
.
root
}
>
<
this
.
props
.
editor
{...
this
.
props
.
propsForEditor
}
open
=
{
this
.
state
.
editorOpen
}
handle
CloseEditor
=
{
this
.
handleCloseEditor
}
handle
EditorWasClosed
=
{
this
.
handleEditorWasClosed
}
userData
=
{
this
.
props
.
userData
}
/
>
<
Grid
container
spacing
=
{
8
}
alignItems
=
'
center
'
>
...
...
frontend/src/components/university/shared/GenericModule.js
View file @
b68243af
...
...
@@ -68,7 +68,7 @@ class GenericModule extends CustomComponentForAPI {
handleEditorWasClosed
=
(
somethingWasSaved
=
false
)
=>
{
this
.
setState
({
editorOpen
:
false
,
dataToSave
:
null
});
if
(
somethingWasSaved
&&
this
.
props
.
moduleInGroupInfos
.
isInGroup
)
{
//
this.props.moduleInGroupInfos.invalidateGroup();
this
.
props
.
moduleInGroupInfos
.
invalidateGroup
();
}
};
...
...
frontend/src/components/university/shared/Module.js
View file @
b68243af
...
...
@@ -7,8 +7,6 @@ import CustomComponentForAPI from "../../CustomComponentForAPI";
* @extends React.Component
*/
class
Module
extends
CustomComponentForAPI
{
// prevent hard reset of module when refetching
// ignoreInvalidation = true;
componentWillUnmount
()
{
this
.
props
.
invalidateData
(
true
);
...
...
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