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
Julien Jerphanion
Rex Dri
Commits
56e9236a
Commit
56e9236a
authored
Mar 01, 2019
by
Florent Chehab
Browse files
Renamed Generic... to Wrappers for the sake of clarity
parent
5d13b0b9
Changes
20
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/university/modules/CountryDri.js
View file @
56e9236a
...
...
@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown";
import
Module
from
"
../shared/Module
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
GenericGroupModule
from
"
../shared/GenericGroupModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
ModuleGroupWrapper
from
"
../shared/ModuleGroupWrapper
"
;
import
CountryDriEditor
from
"
../editors/CountryDriEditor
"
;
import
getActions
from
"
../../../api/getActions
"
;
...
...
@@ -56,7 +56,7 @@ class CountryDri extends Module {
};
return
(
<
GenericGroupModule
<
ModuleGroupWrapper
groupTitle
=
{
"
Informations émanant de la DRI liées au pays
"
}
endPoint
=
{
"
countryDri
"
}
editor
=
{
CountryDriEditor
}
...
...
@@ -70,7 +70,7 @@ class CountryDri extends Module {
>
{
countryDriItems
.
map
((
rawModelData
,
idx
)
=>
(
<
GenericModule
<
ModuleWrapper
key
=
{
idx
}
buildTitle
=
{(
modelData
)
=>
modelData
.
title
}
rawModelData
=
{
rawModelData
}
...
...
@@ -84,7 +84,7 @@ class CountryDri extends Module {
/
>
))
}
<
/
GenericGroupModule
>
<
/
ModuleGroupWrapper
>
);
}
...
...
frontend/src/components/university/modules/CountryScholarships.js
View file @
56e9236a
...
...
@@ -7,8 +7,8 @@ import __pick from "lodash/pick";
import
Module
from
"
../shared/Module
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
GenericGroupModule
from
"
../shared/GenericGroupModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
ModuleGroupWrapper
from
"
../shared/ModuleGroupWrapper
"
;
import
Scholarship
from
"
../shared/Scholarship
"
;
import
CountryScholarshipsEditor
from
"
../editors/CountryScholarshipsEditor
"
;
...
...
@@ -75,7 +75,7 @@ class CountryScholarships extends Module {
};
return
(
<
GenericGroupModule
<
ModuleGroupWrapper
groupTitle
=
{
`Bourses liées au pays (
${
this
.
props
.
country
.
name
}
)`
}
endPoint
=
{
"
countryScholarship
"
}
editor
=
{
CountryScholarshipsEditor
}
...
...
@@ -89,7 +89,7 @@ class CountryScholarships extends Module {
>
{
countryScholarshipsItems
.
map
((
rawModelData
,
idx
)
=>
(
<
GenericModule
<
ModuleWrapper
key
=
{
idx
}
buildTitle
=
{(
modelData
)
=>
modelData
.
title
}
rawModelData
=
{
rawModelData
}
...
...
@@ -103,7 +103,7 @@ class CountryScholarships extends Module {
/
>
))
}
<
/
GenericGroupModule
>
<
/
ModuleGroupWrapper
>
);
}
...
...
frontend/src/components/university/modules/UniversityDri.js
View file @
56e9236a
...
...
@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown";
import
Module
from
"
../shared/Module
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
GenericGroupModule
from
"
../shared/GenericGroupModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
ModuleGroupWrapper
from
"
../shared/ModuleGroupWrapper
"
;
import
UniversityDriEditor
from
"
../editors/UniversityDriEditor
"
;
...
...
@@ -58,7 +58,7 @@ class UniversityDri extends Module {
const
univDriItems
=
this
.
getReadData
(
"
universityDri
"
);
return
(
<
GenericGroupModule
<
ModuleGroupWrapper
groupTitle
=
{
"
Informations émanant de la DRI liées à l'université
"
}
endPoint
=
{
"
universityDri
"
}
editor
=
{
UniversityDriEditor
}
...
...
@@ -72,7 +72,7 @@ class UniversityDri extends Module {
>
{
univDriItems
.
map
(
rawModelData
=>
(
<
GenericModule
<
ModuleWrapper
key
=
{
rawModelData
.
id
}
// use the id of the model to prevent useless unmount
buildTitle
=
{(
modelData
)
=>
modelData
.
title
}
rawModelData
=
{
rawModelData
}
...
...
@@ -86,7 +86,7 @@ class UniversityDri extends Module {
/
>
))
}
<
/
GenericGroupModule
>
<
/
ModuleGroupWrapper
>
);
}
...
...
frontend/src/components/university/modules/UniversityGeneral.js
View file @
56e9236a
...
...
@@ -7,7 +7,7 @@ import __pick from "lodash/pick";
import
Typography
from
"
@material-ui/core/Typography
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
TextLink
from
"
../../other/TextLink
"
;
import
Grid
from
"
@material-ui/core/Grid
"
;
import
Divider
from
"
@material-ui/core/Divider
"
;
...
...
@@ -87,7 +87,7 @@ class UniversityGeneral extends Module {
};
return
(
<
GenericModule
<
ModuleWrapper
buildTitle
=
{()
=>
"
Présentation
"
}
rawModelData
=
{
univInfos
}
parseRawModelData
=
{
parseRawModelData
}
...
...
frontend/src/components/university/modules/UniversityScholarships.js
View file @
56e9236a
...
...
@@ -7,8 +7,8 @@ import __pick from "lodash/pick";
import
Module
from
"
../shared/Module
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
GenericGroupModule
from
"
../shared/GenericGroupModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
ModuleGroupWrapper
from
"
../shared/ModuleGroupWrapper
"
;
import
Scholarship
from
"
../shared/Scholarship
"
;
import
UniversityScholarshipsEditor
from
"
../editors/UniversityScholarshipsEditor
"
;
...
...
@@ -73,7 +73,7 @@ class UniversityScholarships extends Module {
};
return
(
<
GenericGroupModule
<
ModuleGroupWrapper
groupTitle
=
{
"
Bourses liées à l'université
"
}
endPoint
=
{
"
universityScholarship
"
}
editor
=
{
UniversityScholarshipsEditor
}
...
...
@@ -87,7 +87,7 @@ class UniversityScholarships extends Module {
>
{
univScholarshipsItems
.
map
((
rawModelData
,
idx
)
=>
(
<
GenericModule
<
ModuleWrapper
key
=
{
idx
}
buildTitle
=
{(
modelData
)
=>
modelData
.
title
}
rawModelData
=
{
rawModelData
}
...
...
@@ -101,7 +101,7 @@ class UniversityScholarships extends Module {
/
>
))
}
<
/
GenericGroupModule
>
<
/
ModuleGroupWrapper
>
);
}
...
...
frontend/src/components/university/modules/UniversitySemestersDates.js
View file @
56e9236a
...
...
@@ -15,7 +15,7 @@ import Markdown from "../../shared/Markdown";
import
CloudQueueIcon
from
"
@material-ui/icons/CloudQueue
"
;
import
LocalFloristIcon
from
"
@material-ui/icons/LocalFlorist
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
import
Module
from
"
../shared/Module
"
;
...
...
@@ -129,7 +129,7 @@ class UniversitySemestersDates extends Module {
const
semestersDates
=
this
.
getReadData
(
"
universitySemestersDates
"
);
const
{
classes
}
=
this
.
props
;
return
(
<
GenericModule
<
ModuleWrapper
buildTitle
=
{()
=>
"
Date des semestres
"
}
rawModelData
=
{
semestersDates
}
parseRawModelData
=
{
parseRawModelData
}
...
...
@@ -170,4 +170,4 @@ const mapDispatchToProps = (dispatch) => {
export
default
compose
(
withStyles
(
styles
,
{
withTheme
:
true
}),
connect
(
mapStateToProps
,
mapDispatchToProps
)
)(
UniversitySemestersDates
);
\ No newline at end of file
)(
UniversitySemestersDates
);
frontend/src/components/university/shared/
GenericGroupModule
.js
→
frontend/src/components/university/shared/
ModuleGroupWrapper
.js
View file @
56e9236a
...
...
@@ -43,11 +43,11 @@ const styles = theme => ({
/**
* @class
GenericGroupModule
* @class
ModuleGroupWrapper
* @extends {CustomComponentForAPI}
* @extends React.Component
*/
class
GenericGroupModule
extends
CustomComponentForAPI
{
class
ModuleGroupWrapper
extends
CustomComponentForAPI
{
state
=
{
editorOpen
:
false
,
};
...
...
@@ -107,7 +107,7 @@ class GenericGroupModule extends CustomComponentForAPI {
}
}
GenericGroupModule
.
propTypes
=
{
ModuleGroupWrapper
.
propTypes
=
{
groupTitle
:
PropTypes
.
string
.
isRequired
,
endPoint
:
PropTypes
.
string
.
isRequired
,
invalidateGroup
:
PropTypes
.
func
.
isRequired
,
...
...
@@ -136,4 +136,4 @@ const mapDispatchToProps = (dispatch) => {
export
default
compose
(
withStyles
(
styles
,
{
withTheme
:
true
}),
connect
(
mapStateToProps
,
mapDispatchToProps
)
)(
GenericGroupModule
);
)(
ModuleGroupWrapper
);
frontend/src/components/university/shared/
GenericModule
.js
→
frontend/src/components/university/shared/
ModuleWrapper
.js
View file @
56e9236a
...
...
@@ -17,19 +17,19 @@ import Alert from "./Alert";
import
getActions
from
"
../../../api/getActions
"
;
import
renderUsefulLinks
from
"
./
genericModule
Functions/renderUsefulLinks
"
;
import
renderFirstRow
from
"
./
genericModule
Functions/renderFirstRow
"
;
import
renderTitle
from
"
./
genericModule
Functions/renderTitle
"
;
import
renderUsefulLinks
from
"
./
moduleWrapper
Functions/renderUsefulLinks
"
;
import
renderFirstRow
from
"
./
moduleWrapper
Functions/renderFirstRow
"
;
import
renderTitle
from
"
./
moduleWrapper
Functions/renderTitle
"
;
import
History
from
"
./History
"
;
import
PendingModeration
from
"
./PendingModeration
"
;
/**
* @class
GenericModule
* @class
ModuleWrapper
* @extends {CustomComponentForAPI}
* @extends React.Component
*/
class
GenericModule
extends
CustomComponentForAPI
{
class
ModuleWrapper
extends
CustomComponentForAPI
{
state
=
{
editorOpen
:
false
,
dataToSave
:
null
,
...
...
@@ -197,13 +197,13 @@ class GenericModule extends CustomComponentForAPI {
}
GenericModule
.
defaultProps
=
{
ModuleWrapper
.
defaultProps
=
{
buildTitle
:
()
=>
null
,
moduleInGroupInfos
:
{
isInGroup
:
false
,
invalidateGroup
:
()
=>
null
},
__apiAttr
:
""
,
};
GenericModule
.
propTypes
=
{
ModuleWrapper
.
propTypes
=
{
classes
:
PropTypes
.
object
.
isRequired
,
theme
:
PropTypes
.
object
.
isRequired
,
rawModelData
:
PropTypes
.
object
.
isRequired
,
...
...
@@ -287,4 +287,4 @@ const styles = theme => ({
export
default
compose
(
withStyles
(
styles
,
{
withTheme
:
true
}),
connect
(
mapStateToProps
,
mapDispatchToProps
)
)(
GenericModule
);
)(
ModuleWrapper
);
frontend/src/components/university/shared/
genericModule
Functions/getEditTooltipAndClass.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/getEditTooltipAndClass.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/getModerationTooltipAndClass.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/getModerationTooltipAndClass.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/getVersionTooltipAndClass.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/getVersionTooltipAndClass.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/renderFirstRow.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/renderFirstRow.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/renderTitle.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/renderTitle.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/renderUpdateInfo.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/renderUpdateInfo.js
View file @
56e9236a
File moved
frontend/src/components/university/shared/
genericModule
Functions/renderUsefulLinks.js
→
frontend/src/components/university/shared/
moduleWrapper
Functions/renderUsefulLinks.js
View file @
56e9236a
File moved
frontend/src/components/university/tabs/CampusesCitiesTab.js
View file @
56e9236a
import
React
,
{
Component
}
from
"
react
"
;
import
GenericGroupModules
from
"
../shared/GenericGroupModule
"
;
import
ModuleGroupWrappers
from
"
../shared/ModuleGroupWrapper
"
;
/**
* Tab on the university page related to Campuses and cities
...
...
@@ -11,10 +11,10 @@ class CampusesCitiesTab extends Component {
render
()
{
return
(
<
div
>
<
GenericGroupModule
s
groupTitle
=
{
"
Logement
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Vie étudiante
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Vie quotidienne (et transport)
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Autre chose ?
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Logement
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Vie étudiante
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Vie quotidienne (et transport)
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Autre chose ?
"
}
/
>
<
/div
>
);
}
...
...
frontend/src/components/university/tabs/GeneralInfoTab.js
View file @
56e9236a
...
...
@@ -58,7 +58,7 @@ class GeneralInfoTab extends Component {
/
>
<
/Grid
>
<
Grid
item
xs
>
{
/* <
GenericModule
visible={this.props.visible} title={"Offres de départs"} automaticData={true} /> */
}
{
/* <
ModuleWrapper
visible={this.props.visible} title={"Offres de départs"} automaticData={true} /> */
}
<
/Grid
>
<
/Grid
>
<
/div
>
...
...
@@ -95,7 +95,7 @@ class GeneralInfoTab extends Component {
/
>
<
/Grid
>
<
Grid
item
xs
=
{
12
}
>
{
/* <
GenericModule
title={"Offres de départs"} automaticData={true} /> */
}
{
/* <
ModuleWrapper
title={"Offres de départs"} automaticData={true} /> */
}
<
/Grid
>
<
/Grid
>
...
...
frontend/src/components/university/tabs/MoreTab.js
View file @
56e9236a
import
React
,
{
Component
}
from
"
react
"
;
import
GenericGroupModules
from
"
../shared/GenericGroupModule
"
;
import
ModuleGroupWrappers
from
"
../shared/ModuleGroupWrapper
"
;
/**
...
...
@@ -14,13 +14,13 @@ class MoreTab extends Component {
render
()
{
return
(
<
div
>
<
GenericGroupModule
s
groupTitle
=
{
"
Administratif
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Assurances
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Transport
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Culture
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Tourisme
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Photos
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Autres
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Administratif
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Assurances
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Transport
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Culture
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Tourisme
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Photos
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Autres
"
}
/
>
<
/div
>
);
}
...
...
frontend/src/components/university/tabs/PreviousDeparturesTab.js
View file @
56e9236a
import
React
,
{
Component
}
from
"
react
"
;
import
PreviousDeparture
from
"
../modules/PreviousDeparture
"
;
import
GenericModule
from
"
../shared/
GenericModule
"
;
import
ModuleWrapper
from
"
../shared/
ModuleWrapper
"
;
/**
...
...
@@ -14,9 +14,9 @@ class PreviousDeparturesTab extends Component {
render
()
{
return
(
<
GenericModule
title
=
"
Florent Chehab | GI05~FDD | Automne 2018~échange
"
>
<
ModuleWrapper
title
=
"
Florent Chehab | GI05~FDD | Automne 2018~échange
"
>
<
PreviousDeparture
/>
<
/
GenericModule
>
<
/
ModuleWrapper
>
);
}
...
...
frontend/src/components/university/tabs/UniversityMoreTab.js
View file @
56e9236a
import
React
,
{
Component
}
from
"
react
"
;
import
GenericGroupModules
from
"
../shared/GenericGroupModule
"
;
import
ModuleGroupWrappers
from
"
../shared/ModuleGroupWrapper
"
;
...
...
@@ -13,9 +13,9 @@ class UniversityMoreTab extends Component {
render
()
{
return
(
<
div
>
<
GenericGroupModule
s
groupTitle
=
{
"
Partenariats spécifiques
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Commentaires partagés
"
}
/
>
<
GenericGroupModule
s
groupTitle
=
{
"
Autres
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Partenariats spécifiques
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Commentaires partagés
"
}
/
>
<
ModuleGroupWrapper
s
groupTitle
=
{
"
Autres
"
}
/
>
<
/div
>
);
}
...
...
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