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

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

parent 5d13b0b9
Pipeline #35700 failed with stages
in 0 seconds
......@@ -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 >
);
}
......
......@@ -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 >
);
}
......
......@@ -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 >
);
}
......
......@@ -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}
......
......@@ -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 >
);
}
......
......@@ -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);
......@@ -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);
......@@ -17,19 +17,19 @@ import Alert from "./Alert";
import getActions from "../../../api/getActions";
import renderUsefulLinks from "./genericModuleFunctions/renderUsefulLinks";
import renderFirstRow from "./genericModuleFunctions/renderFirstRow";
import renderTitle from "./genericModuleFunctions/renderTitle";
import renderUsefulLinks from "./moduleWrapperFunctions/renderUsefulLinks";
import renderFirstRow from "./moduleWrapperFunctions/renderFirstRow";
import renderTitle from "./moduleWrapperFunctions/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);
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>
<GenericGroupModules groupTitle={"Logement"} />
<GenericGroupModules groupTitle={"Vie étudiante"} />
<GenericGroupModules groupTitle={"Vie quotidienne (et transport)"} />
<GenericGroupModules groupTitle={"Autre chose ?"} />
<ModuleGroupWrappers groupTitle={"Logement"} />
<ModuleGroupWrappers groupTitle={"Vie étudiante"} />
<ModuleGroupWrappers groupTitle={"Vie quotidienne (et transport)"} />
<ModuleGroupWrappers groupTitle={"Autre chose ?"} />
</div>
);
}
......
......@@ -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>
......
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>
<GenericGroupModules groupTitle={"Administratif"} />
<GenericGroupModules groupTitle={"Assurances"} />
<GenericGroupModules groupTitle={"Transport"} />
<GenericGroupModules groupTitle={"Culture"} />
<GenericGroupModules groupTitle={"Tourisme"} />
<GenericGroupModules groupTitle={"Photos"} />
<GenericGroupModules groupTitle={"Autres"} />
<ModuleGroupWrappers groupTitle={"Administratif"} />
<ModuleGroupWrappers groupTitle={"Assurances"} />
<ModuleGroupWrappers groupTitle={"Transport"} />
<ModuleGroupWrappers groupTitle={"Culture"} />
<ModuleGroupWrappers groupTitle={"Tourisme"} />
<ModuleGroupWrappers groupTitle={"Photos"} />
<ModuleGroupWrappers groupTitle={"Autres"} />
</div>
);
}
......
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>
);
}
......
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>
<GenericGroupModules groupTitle={"Partenariats spécifiques"} />
<GenericGroupModules groupTitle={"Commentaires partagés"} />
<GenericGroupModules groupTitle={"Autres"} />
<ModuleGroupWrappers groupTitle={"Partenariats spécifiques"} />
<ModuleGroupWrappers groupTitle={"Commentaires partagés"} />
<ModuleGroupWrappers groupTitle={"Autres"} />
</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