Commit 56e9236a authored by Florent Chehab's avatar Florent Chehab
Browse files

Renamed Generic... to Wrappers for the sake of clarity

parent 5d13b0b9
...@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown"; ...@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown";
import Module from "../shared/Module"; import Module from "../shared/Module";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import GenericGroupModule from "../shared/GenericGroupModule"; import ModuleGroupWrapper from "../shared/ModuleGroupWrapper";
import CountryDriEditor from "../editors/CountryDriEditor"; import CountryDriEditor from "../editors/CountryDriEditor";
import getActions from "../../../api/getActions"; import getActions from "../../../api/getActions";
...@@ -56,7 +56,7 @@ class CountryDri extends Module { ...@@ -56,7 +56,7 @@ class CountryDri extends Module {
}; };
return ( return (
<GenericGroupModule <ModuleGroupWrapper
groupTitle={"Informations émanant de la DRI liées au pays"} groupTitle={"Informations émanant de la DRI liées au pays"}
endPoint={"countryDri"} endPoint={"countryDri"}
editor={CountryDriEditor} editor={CountryDriEditor}
...@@ -70,7 +70,7 @@ class CountryDri extends Module { ...@@ -70,7 +70,7 @@ class CountryDri extends Module {
> >
{ {
countryDriItems.map((rawModelData, idx) => ( countryDriItems.map((rawModelData, idx) => (
<GenericModule <ModuleWrapper
key={idx} key={idx}
buildTitle={(modelData) => modelData.title} buildTitle={(modelData) => modelData.title}
rawModelData={rawModelData} rawModelData={rawModelData}
...@@ -84,7 +84,7 @@ class CountryDri extends Module { ...@@ -84,7 +84,7 @@ class CountryDri extends Module {
/> />
)) ))
} }
</GenericGroupModule > </ModuleGroupWrapper >
); );
} }
......
...@@ -7,8 +7,8 @@ import __pick from "lodash/pick"; ...@@ -7,8 +7,8 @@ import __pick from "lodash/pick";
import Module from "../shared/Module"; import Module from "../shared/Module";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import GenericGroupModule from "../shared/GenericGroupModule"; import ModuleGroupWrapper from "../shared/ModuleGroupWrapper";
import Scholarship from "../shared/Scholarship"; import Scholarship from "../shared/Scholarship";
import CountryScholarshipsEditor from "../editors/CountryScholarshipsEditor"; import CountryScholarshipsEditor from "../editors/CountryScholarshipsEditor";
...@@ -75,7 +75,7 @@ class CountryScholarships extends Module { ...@@ -75,7 +75,7 @@ class CountryScholarships extends Module {
}; };
return ( return (
<GenericGroupModule <ModuleGroupWrapper
groupTitle={`Bourses liées au pays (${this.props.country.name})`} groupTitle={`Bourses liées au pays (${this.props.country.name})`}
endPoint={"countryScholarship"} endPoint={"countryScholarship"}
editor={CountryScholarshipsEditor} editor={CountryScholarshipsEditor}
...@@ -89,7 +89,7 @@ class CountryScholarships extends Module { ...@@ -89,7 +89,7 @@ class CountryScholarships extends Module {
> >
{ {
countryScholarshipsItems.map((rawModelData, idx) => ( countryScholarshipsItems.map((rawModelData, idx) => (
<GenericModule <ModuleWrapper
key={idx} key={idx}
buildTitle={(modelData) => modelData.title} buildTitle={(modelData) => modelData.title}
rawModelData={rawModelData} rawModelData={rawModelData}
...@@ -103,7 +103,7 @@ class CountryScholarships extends Module { ...@@ -103,7 +103,7 @@ class CountryScholarships extends Module {
/> />
)) ))
} }
</GenericGroupModule > </ModuleGroupWrapper >
); );
} }
......
...@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown"; ...@@ -9,8 +9,8 @@ import Markdown from "../../shared/Markdown";
import Module from "../shared/Module"; import Module from "../shared/Module";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import GenericGroupModule from "../shared/GenericGroupModule"; import ModuleGroupWrapper from "../shared/ModuleGroupWrapper";
import UniversityDriEditor from "../editors/UniversityDriEditor"; import UniversityDriEditor from "../editors/UniversityDriEditor";
...@@ -58,7 +58,7 @@ class UniversityDri extends Module { ...@@ -58,7 +58,7 @@ class UniversityDri extends Module {
const univDriItems = this.getReadData("universityDri"); const univDriItems = this.getReadData("universityDri");
return ( return (
<GenericGroupModule <ModuleGroupWrapper
groupTitle={"Informations émanant de la DRI liées à l'université"} groupTitle={"Informations émanant de la DRI liées à l'université"}
endPoint={"universityDri"} endPoint={"universityDri"}
editor={UniversityDriEditor} editor={UniversityDriEditor}
...@@ -72,7 +72,7 @@ class UniversityDri extends Module { ...@@ -72,7 +72,7 @@ class UniversityDri extends Module {
> >
{ {
univDriItems.map(rawModelData => ( univDriItems.map(rawModelData => (
<GenericModule <ModuleWrapper
key={rawModelData.id} // use the id of the model to prevent useless unmount key={rawModelData.id} // use the id of the model to prevent useless unmount
buildTitle={(modelData) => modelData.title} buildTitle={(modelData) => modelData.title}
rawModelData={rawModelData} rawModelData={rawModelData}
...@@ -86,7 +86,7 @@ class UniversityDri extends Module { ...@@ -86,7 +86,7 @@ class UniversityDri extends Module {
/> />
)) ))
} }
</GenericGroupModule > </ModuleGroupWrapper >
); );
} }
......
...@@ -7,7 +7,7 @@ import __pick from "lodash/pick"; ...@@ -7,7 +7,7 @@ import __pick from "lodash/pick";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import TextLink from "../../other/TextLink"; import TextLink from "../../other/TextLink";
import Grid from "@material-ui/core/Grid"; import Grid from "@material-ui/core/Grid";
import Divider from "@material-ui/core/Divider"; import Divider from "@material-ui/core/Divider";
...@@ -87,7 +87,7 @@ class UniversityGeneral extends Module { ...@@ -87,7 +87,7 @@ class UniversityGeneral extends Module {
}; };
return ( return (
<GenericModule <ModuleWrapper
buildTitle={() => "Présentation"} buildTitle={() => "Présentation"}
rawModelData={univInfos} rawModelData={univInfos}
parseRawModelData={parseRawModelData} parseRawModelData={parseRawModelData}
......
...@@ -7,8 +7,8 @@ import __pick from "lodash/pick"; ...@@ -7,8 +7,8 @@ import __pick from "lodash/pick";
import Module from "../shared/Module"; import Module from "../shared/Module";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import GenericGroupModule from "../shared/GenericGroupModule"; import ModuleGroupWrapper from "../shared/ModuleGroupWrapper";
import Scholarship from "../shared/Scholarship"; import Scholarship from "../shared/Scholarship";
import UniversityScholarshipsEditor from "../editors/UniversityScholarshipsEditor"; import UniversityScholarshipsEditor from "../editors/UniversityScholarshipsEditor";
...@@ -73,7 +73,7 @@ class UniversityScholarships extends Module { ...@@ -73,7 +73,7 @@ class UniversityScholarships extends Module {
}; };
return ( return (
<GenericGroupModule <ModuleGroupWrapper
groupTitle={"Bourses liées à l'université"} groupTitle={"Bourses liées à l'université"}
endPoint={"universityScholarship"} endPoint={"universityScholarship"}
editor={UniversityScholarshipsEditor} editor={UniversityScholarshipsEditor}
...@@ -87,7 +87,7 @@ class UniversityScholarships extends Module { ...@@ -87,7 +87,7 @@ class UniversityScholarships extends Module {
> >
{ {
univScholarshipsItems.map((rawModelData, idx) => ( univScholarshipsItems.map((rawModelData, idx) => (
<GenericModule <ModuleWrapper
key={idx} key={idx}
buildTitle={(modelData) => modelData.title} buildTitle={(modelData) => modelData.title}
rawModelData={rawModelData} rawModelData={rawModelData}
...@@ -101,7 +101,7 @@ class UniversityScholarships extends Module { ...@@ -101,7 +101,7 @@ class UniversityScholarships extends Module {
/> />
)) ))
} }
</GenericGroupModule > </ModuleGroupWrapper >
); );
} }
......
...@@ -15,7 +15,7 @@ import Markdown from "../../shared/Markdown"; ...@@ -15,7 +15,7 @@ import Markdown from "../../shared/Markdown";
import CloudQueueIcon from "@material-ui/icons/CloudQueue"; import CloudQueueIcon from "@material-ui/icons/CloudQueue";
import LocalFloristIcon from "@material-ui/icons/LocalFlorist"; import LocalFloristIcon from "@material-ui/icons/LocalFlorist";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
import Module from "../shared/Module"; import Module from "../shared/Module";
...@@ -129,7 +129,7 @@ class UniversitySemestersDates extends Module { ...@@ -129,7 +129,7 @@ class UniversitySemestersDates extends Module {
const semestersDates = this.getReadData("universitySemestersDates"); const semestersDates = this.getReadData("universitySemestersDates");
const { classes } = this.props; const { classes } = this.props;
return ( return (
<GenericModule <ModuleWrapper
buildTitle={() => "Date des semestres"} buildTitle={() => "Date des semestres"}
rawModelData={semestersDates} rawModelData={semestersDates}
parseRawModelData={parseRawModelData} parseRawModelData={parseRawModelData}
...@@ -170,4 +170,4 @@ const mapDispatchToProps = (dispatch) => { ...@@ -170,4 +170,4 @@ const mapDispatchToProps = (dispatch) => {
export default compose( export default compose(
withStyles(styles, { withTheme: true }), withStyles(styles, { withTheme: true }),
connect(mapStateToProps, mapDispatchToProps) connect(mapStateToProps, mapDispatchToProps)
)(UniversitySemestersDates); )(UniversitySemestersDates);
\ No newline at end of file
...@@ -43,11 +43,11 @@ const styles = theme => ({ ...@@ -43,11 +43,11 @@ const styles = theme => ({
/** /**
* @class GenericGroupModule * @class ModuleGroupWrapper
* @extends {CustomComponentForAPI} * @extends {CustomComponentForAPI}
* @extends React.Component * @extends React.Component
*/ */
class GenericGroupModule extends CustomComponentForAPI { class ModuleGroupWrapper extends CustomComponentForAPI {
state = { state = {
editorOpen: false, editorOpen: false,
}; };
...@@ -107,7 +107,7 @@ class GenericGroupModule extends CustomComponentForAPI { ...@@ -107,7 +107,7 @@ class GenericGroupModule extends CustomComponentForAPI {
} }
} }
GenericGroupModule.propTypes = { ModuleGroupWrapper.propTypes = {
groupTitle: PropTypes.string.isRequired, groupTitle: PropTypes.string.isRequired,
endPoint: PropTypes.string.isRequired, endPoint: PropTypes.string.isRequired,
invalidateGroup: PropTypes.func.isRequired, invalidateGroup: PropTypes.func.isRequired,
...@@ -136,4 +136,4 @@ const mapDispatchToProps = (dispatch) => { ...@@ -136,4 +136,4 @@ const mapDispatchToProps = (dispatch) => {
export default compose( export default compose(
withStyles(styles, { withTheme: true }), withStyles(styles, { withTheme: true }),
connect(mapStateToProps, mapDispatchToProps) connect(mapStateToProps, mapDispatchToProps)
)(GenericGroupModule); )(ModuleGroupWrapper);
...@@ -17,19 +17,19 @@ import Alert from "./Alert"; ...@@ -17,19 +17,19 @@ import Alert from "./Alert";
import getActions from "../../../api/getActions"; import getActions from "../../../api/getActions";
import renderUsefulLinks from "./genericModuleFunctions/renderUsefulLinks"; import renderUsefulLinks from "./moduleWrapperFunctions/renderUsefulLinks";
import renderFirstRow from "./genericModuleFunctions/renderFirstRow"; import renderFirstRow from "./moduleWrapperFunctions/renderFirstRow";
import renderTitle from "./genericModuleFunctions/renderTitle"; import renderTitle from "./moduleWrapperFunctions/renderTitle";
import History from "./History"; import History from "./History";
import PendingModeration from "./PendingModeration"; import PendingModeration from "./PendingModeration";
/** /**
* @class GenericModule * @class ModuleWrapper
* @extends {CustomComponentForAPI} * @extends {CustomComponentForAPI}
* @extends React.Component * @extends React.Component
*/ */
class GenericModule extends CustomComponentForAPI { class ModuleWrapper extends CustomComponentForAPI {
state = { state = {
editorOpen: false, editorOpen: false,
dataToSave: null, dataToSave: null,
...@@ -197,13 +197,13 @@ class GenericModule extends CustomComponentForAPI { ...@@ -197,13 +197,13 @@ class GenericModule extends CustomComponentForAPI {
} }
GenericModule.defaultProps = { ModuleWrapper.defaultProps = {
buildTitle: () => null, buildTitle: () => null,
moduleInGroupInfos: { isInGroup: false, invalidateGroup: () => null }, moduleInGroupInfos: { isInGroup: false, invalidateGroup: () => null },
__apiAttr: "", __apiAttr: "",
}; };
GenericModule.propTypes = { ModuleWrapper.propTypes = {
classes: PropTypes.object.isRequired, classes: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired, theme: PropTypes.object.isRequired,
rawModelData: PropTypes.object.isRequired, rawModelData: PropTypes.object.isRequired,
...@@ -287,4 +287,4 @@ const styles = theme => ({ ...@@ -287,4 +287,4 @@ const styles = theme => ({
export default compose( export default compose(
withStyles(styles, { withTheme: true }), withStyles(styles, { withTheme: true }),
connect(mapStateToProps, mapDispatchToProps) connect(mapStateToProps, mapDispatchToProps)
)(GenericModule); )(ModuleWrapper);
import React, { Component } from "react"; 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 * Tab on the university page related to Campuses and cities
...@@ -11,10 +11,10 @@ class CampusesCitiesTab extends Component { ...@@ -11,10 +11,10 @@ class CampusesCitiesTab extends Component {
render() { render() {
return ( return (
<div> <div>
<GenericGroupModules groupTitle={"Logement"} /> <ModuleGroupWrappers groupTitle={"Logement"} />
<GenericGroupModules groupTitle={"Vie étudiante"} /> <ModuleGroupWrappers groupTitle={"Vie étudiante"} />
<GenericGroupModules groupTitle={"Vie quotidienne (et transport)"} /> <ModuleGroupWrappers groupTitle={"Vie quotidienne (et transport)"} />
<GenericGroupModules groupTitle={"Autre chose ?"} /> <ModuleGroupWrappers groupTitle={"Autre chose ?"} />
</div> </div>
); );
} }
......
...@@ -58,7 +58,7 @@ class GeneralInfoTab extends Component { ...@@ -58,7 +58,7 @@ class GeneralInfoTab extends Component {
/> />
</Grid> </Grid>
<Grid item xs> <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>
</Grid> </Grid>
</div> </div>
...@@ -95,7 +95,7 @@ class GeneralInfoTab extends Component { ...@@ -95,7 +95,7 @@ class GeneralInfoTab extends Component {
/> />
</Grid> </Grid>
<Grid item xs={12}> <Grid item xs={12}>
{/* <GenericModule title={"Offres de départs"} automaticData={true} /> */} {/* <ModuleWrapper title={"Offres de départs"} automaticData={true} /> */}
</Grid> </Grid>
</Grid> </Grid>
......
import React, { Component } from "react"; import React, { Component } from "react";
import GenericGroupModules from "../shared/GenericGroupModule"; import ModuleGroupWrappers from "../shared/ModuleGroupWrapper";
/** /**
...@@ -14,13 +14,13 @@ class MoreTab extends Component { ...@@ -14,13 +14,13 @@ class MoreTab extends Component {
render() { render() {
return ( return (
<div> <div>
<GenericGroupModules groupTitle={"Administratif"} /> <ModuleGroupWrappers groupTitle={"Administratif"} />
<GenericGroupModules groupTitle={"Assurances"} /> <ModuleGroupWrappers groupTitle={"Assurances"} />
<GenericGroupModules groupTitle={"Transport"} /> <ModuleGroupWrappers groupTitle={"Transport"} />
<GenericGroupModules groupTitle={"Culture"} /> <ModuleGroupWrappers groupTitle={"Culture"} />
<GenericGroupModules groupTitle={"Tourisme"} /> <ModuleGroupWrappers groupTitle={"Tourisme"} />
<GenericGroupModules groupTitle={"Photos"} /> <ModuleGroupWrappers groupTitle={"Photos"} />
<GenericGroupModules groupTitle={"Autres"} /> <ModuleGroupWrappers groupTitle={"Autres"} />
</div> </div>
); );
} }
......
import React, {Component} from "react"; import React, {Component} from "react";
import PreviousDeparture from "../modules/PreviousDeparture"; import PreviousDeparture from "../modules/PreviousDeparture";
import GenericModule from "../shared/GenericModule"; import ModuleWrapper from "../shared/ModuleWrapper";
/** /**
...@@ -14,9 +14,9 @@ class PreviousDeparturesTab extends Component { ...@@ -14,9 +14,9 @@ class PreviousDeparturesTab extends Component {
render() { render() {
return ( return (
<GenericModule title="Florent Chehab | GI05~FDD | Automne 2018~échange"> <ModuleWrapper title="Florent Chehab | GI05~FDD | Automne 2018~échange">
<PreviousDeparture /> <PreviousDeparture />
</GenericModule> </ModuleWrapper>
); );
} }
......
import React, { Component } from "react"; import React, { Component } from "react";
import GenericGroupModules from "../shared/GenericGroupModule"; import ModuleGroupWrappers from "../shared/ModuleGroupWrapper";
...@@ -13,9 +13,9 @@ class UniversityMoreTab extends Component { ...@@ -13,9 +13,9 @@ class UniversityMoreTab extends Component {
render() { render() {
return ( return (
<div> <div>
<GenericGroupModules groupTitle={"Partenariats spécifiques"} /> <ModuleGroupWrappers groupTitle={"Partenariats spécifiques"} />
<GenericGroupModules groupTitle={"Commentaires partagés"} /> <ModuleGroupWrappers groupTitle={"Commentaires partagés"} />
<GenericGroupModules groupTitle={"Autres"} /> <ModuleGroupWrappers groupTitle={"Autres"} />
</div> </div>
); );
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment