This commit is contained in:
2019-08-02 12:02:02 +02:00
20 changed files with 121 additions and 74 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
function redirect(params) {
const { Router, ctx, location, status = 302 } = params
console.log(ctx.res)
if (ctx.res) {
// Seems to be the version used by zeit
ctx.res.writeHead(status, {
-3
View File
@@ -144,9 +144,6 @@ const theme = createMuiTheme({
},
MuiButtonGroup: {
'& *': {
border: 0,
},
contained: {
boxShadow: 'inherit',
},
+1 -1
View File
@@ -132,7 +132,7 @@ class CompanyRowComponent extends React.Component {
const nbOffre = (rowData.count_ads > 0) ? offre : 'Candidature spontanée'
return (
<Card className={classes.card+' cypCardCompany'} onClick={() => Router.push(`/Company/${rowData.id}`)}>
<Card className={classes.card} onClick={() => Router.push(`/Entreprise/${rowData.id}`)}>
<CardContent className={classes.content}>
<CardMedia
className={classes.cover}
+26 -15
View File
@@ -23,6 +23,9 @@ const styles = theme => ({
backgroundColor: theme.palette.primary.main,
padding: theme.spacing(10, 18),
},
'& a': {
textDecoration: 'none',
},
},
container: {
display: 'flex',
@@ -148,7 +151,7 @@ const styles = theme => ({
alignItems: 'center',
justifyContent: 'center',
padding: theme.spacing(6, 4),
},
},
});
@@ -196,12 +199,12 @@ function Footer(props) {
Offre d'emploi
</Typography>
</Link>
<Link href="/Companies" prefetch >
<Link href="/Entreprises" prefetch >
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Entreprises
</Typography>
</Link>
<Link href="/help" prefetch >
<Link href="/Help" prefetch >
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Comment ça marche ?
</Typography>
@@ -211,20 +214,28 @@ function Footer(props) {
<Typography color="secondary" component="p" className={classes.titleContainer}>
Informations
</Typography>
<Link href="/toto" prefetch >
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
CGU
</Typography>
<Link href="https://www.talentstube.com" prefetch >
<a>
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
CGU
</Typography>
</a>
</Link>
<Link href="/toto" prefetch >
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Mentions légales
</Typography>
<Link href="https://www.talentstube.com" prefetch >
<a>
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Mentions légales
</Typography>
</a>
</Link>
<Link href="/toto" prefetch >
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Politique de confidentialité et Protection <br />des données
</Typography>
<Link href="https://www.talentstube.com" prefetch >
<a>
<Typography gutterBottom color="secondary" component="p" className={classes.textContainer}>
Politique de confidentialité et Protection <br />des données
</Typography>
</a>
</Link>
</section>
<section className={classes.container}>
+7 -7
View File
@@ -329,14 +329,14 @@ class Header extends React.Component {
</ListItemText>
</ListItem></a>
</Link>
<Link href="/Companies" prefetch >
<Link href="/Entreprises" prefetch >
<a className={classes.darkMenuItem}><ListItem classes={{ root: classes.rootListItemIcon }}>
<CompanyIcon className={classes.icon} />
<ListItemText classes={{ primary: classes.ListItemText }} primary='Nos entreprises'>
</ListItemText>
</ListItem></a>
</Link>
<Link href="/help" prefetch >
<Link href="/Help" prefetch >
<a className={classes.darkMenuItem}><ListItem classes={{ root: classes.rootListItem }}>
<HelpIcon className={classes.icon} />
<ListItemText classes={{ primary: classes.ListItemText }} primary='Comment ça marche ?'>
@@ -462,21 +462,21 @@ class Header extends React.Component {
</ListItemText>
</ListItem></a>
</Link>
<Link href="/help" prefetch >
<Link href="/Help" prefetch >
<a className={classes.lightMenuItem}><ListItem classes={{ root: classes.rootListItemIcon }}>
<AccountCircleIcon className={classes.icon} />
<ListItemText primary='Mon compte'>
</ListItemText>
</ListItem></a>
</Link>
<Link href="/help" prefetch >
<Link href="/Help" prefetch >
<a className={classes.lightMenuItem}><ListItem classes={{ root: classes.rootListItemIcon }}>
<SettingsIcon className={classes.icon} />
<ListItemText primary='Paramètres'>
</ListItemText>
</ListItem></a>
</Link>
<Link href="/help" prefetch>
<Link href="/Help" prefetch>
<a onClick={() => this.props.requestLogout()} className={classes.lightMenuItem}><ListItem classes={{ root: classes.rootListItemIcon }}>
<PowerSettingsNewIcon className={classes.icon} />
<ListItemText primary='Déconnexion'>
@@ -514,7 +514,7 @@ class Header extends React.Component {
</ListItemText>
</a>
</Link>
<Link href="/Companies" prefetch >
<Link href="/Entreprises" prefetch >
<a className={classes.desktopMenuItem}>
<ListItemText primary='Nos entreprises'>
</ListItemText>
@@ -557,7 +557,7 @@ class Header extends React.Component {
</List>
</section>
<section className={classes.appBarDesktopSection + ' ' + classes.appBarDesktopSection3}>
<Link href="/Help" prefetch >
<Link href="https://www.talentstube.com/faire-offre-emploi-video" prefetch >
<a className={classes.desktopMenuItem}>
<ListItemText primary='Espace recruteurs'>
</ListItemText>
+3 -3
View File
@@ -257,7 +257,7 @@ function OffreDetail(props) {
<section className={classes.headerContainerDesktop}>
<div className={classes.offerInfoContainer}>
<div className={classes.logoContainer}>
<Link href={`/Company/${offre.company.id}`} prefetch >
<Link href={`/Entreprise/${offre.company.id}`} prefetch >
<Avatar className={classes.logo} classes={{ img: classes.MuiAvatarImg }} src={logoUrl} />
</Link>
</div>
@@ -265,7 +265,7 @@ function OffreDetail(props) {
<Typography gutterBottom className={classes.offreTitle}>
{offre.title}
</Typography>
<Link href={`/Company/${offre.company.id}`} prefetch >
<Link href={`/Entreprise/${offre.company.id}`} prefetch >
<Typography gutterBottom variant="subtitle1" className={classes.companyName}>
{offre.company.brand_name}
</Typography>
@@ -374,7 +374,7 @@ function OffreDetail(props) {
Découvrir l'entreprise <span className={classes.primary}>{offre.company.brand_name}</span>
</Typography>
<Link href={`/Company/${offre.company.id}`} prefetch >
<Link href={`/Entreprise/${offre.company.id}`} prefetch >
<div className={classes.discoverContainerImage}>
<img src={isWidthUp('sm', props.width) ? imgUrlDesktop : imgUrl} />
<KeyboardArrowleftIcon className={classes.iconPlay} />
+1 -1
View File
@@ -84,7 +84,7 @@ class Tile extends React.Component {
const logoName = (rowData.company) ? rowData.company.logo : rowData.logo
const logoUrl = publicRuntimeConfig.logoRootUrl + logoName
const router = (rowData.company) ? `/Offre/${rowData.id}` : `/Company/${rowData.id}`
const router = (rowData.company) ? `/Offre/${rowData.id}` : `/Entreprise/${rowData.id}`
//rowData._embedded.company.business_name
return (
+5 -3
View File
@@ -63,9 +63,11 @@ class TileOffre extends React.Component {
{tile.title}
</Typography>
{(tile.title) &&
(<IconText classes={{root: classes.rootIconText}} variant="business_center" text={tile.title} />)
}
{/*
<IconText classes={{root: classes.rootIconText}} variant="business_center" text={tile.title} />
*/}
{(tile.location.gmap_address.address_components[0].long_name) &&
(<IconText classes={{root: classes.rootIconText}} variant="location_on" text={tile.location.gmap_address.address_components[0].long_name} />)
}
-2
View File
@@ -20,8 +20,6 @@ const styles = theme => ({
top: '64px',
height: 'calc(100vh - 64px)',
position: 'relative',
overflow: 'auto',
}
});
@@ -19,7 +19,6 @@ const styles = theme => ({
},
content: {
top: '64px',
height: 'calc(100vh - 64px)',
[theme.breakpoints.up('sm')]: {
top: '64px',
height: 'calc(100vh - 64px)',
@@ -13,17 +13,17 @@ import OffreRow from "../components/organisms/OffreRow"
import LayoutCompany from "../components/templates/LayoutCompany"
import Link from 'next/link'
import { fetchCompanyRequest, clearCompany } from '../actions/companies'
import IconText from './../components/atoms/IconText'
import IconTextInline from './../components/atoms/IconTextInline'
import SimpleCollapse from './../components/atoms/SimpleCollapse'
import IconText from '../components/atoms/IconText'
import IconTextInline from '../components/atoms/IconTextInline'
import SimpleCollapse from '../components/atoms/SimpleCollapse'
import SocialShare from '../components/organisms/SocialShare'
import Loader from './../components/templates/loader'
import Loader from '../components/templates/loader'
import Plyr from 'react-plyr'
import _ from "lodash"
import Ar from "lodash/array"
import withWidth, { isWidthUp, isWidthDown } from '@material-ui/core/withWidth'
import Hidden from '@material-ui/core/Hidden';
import NoResult from './../components/atoms/NoResult';
import NoResult from '../components/atoms/NoResult';
const styles = theme => ({
companyContainer: {
@@ -279,13 +279,13 @@ const CustomTableBody = ({ rowIds, Row, style, className }) => (
const { publicRuntimeConfig } = getConfig()
class Company extends React.Component {
class Entreprise extends React.Component {
state = {
loading: true,
};
componentDidMount() {
console.log("Company componentDidMount")
console.log("Entreprise componentDidMount")
}
componentWillUnmount() {
@@ -330,7 +330,7 @@ class Company extends React.Component {
const { loading } = this.state;
return (
<LayoutCompany backLink="/Companies" companyId={company.id}>
<LayoutCompany backLink="/Entreprises" companyId={company.id}>
{company.presentation_video && (
<div className={classes.companyContainer}>
<Hidden smDown>
@@ -443,7 +443,7 @@ class Company extends React.Component {
</Typography>
<section className={classes.ShareIcons}>
<SocialShare url={typeof window !== 'undefined' ? window.location
: publicRuntimeConfig.frontServerUrl + `/Company/${company.id}`} />
: publicRuntimeConfig.frontServerUrl + `/Entreprise/${company.id}`} />
</section>
</div>
</section>
@@ -472,7 +472,7 @@ class Company extends React.Component {
}
Company.getInitialProps = function (context) {
Entreprise.getInitialProps = function (context) {
const { email } = context.query
console.log("getInitialProps")
@@ -492,8 +492,8 @@ function mapStateToProps(state) {
};
}
Company.propTypes = {
Entreprise.propTypes = {
classes: PropTypes.object.isRequired,
};
export default withStyles(styles)(connect(mapStateToProps, { fetchCompanyRequest, clearCompany })(withWidth()(Company)));
export default withStyles(styles)(connect(mapStateToProps, { fetchCompanyRequest, clearCompany })(withWidth()(Entreprise)));
@@ -50,7 +50,7 @@ const styles = theme => ({
});
class Companies extends React.Component {
class Entreprises extends React.Component {
render() {
const { classes } = this.props;
@@ -76,10 +76,10 @@ class Companies extends React.Component {
}
}
Companies.defaultProps = {
Entreprises.defaultProps = {
currentPage: 1,
}
Companies.propTypes = {
Entreprises.propTypes = {
classes: PropTypes.object.isRequired,
};
@@ -92,4 +92,4 @@ function mapStateToProps(state) {
recordCount: _.toNumber(!!state.companies.meta && state.companies.meta.total_items)
};
}
export default withStyles(styles)(connect(mapStateToProps, { fetchCompaniesRequest })(Companies));
export default withStyles(styles)(connect(mapStateToProps, { fetchCompaniesRequest })(Entreprises));
+1 -1
View File
@@ -56,7 +56,7 @@ class Offre extends React.Component {
Offre.getInitialProps = function (context) {
const { id } = context.query
console.log('get initial props')
console.log('get initial props')
context.store.dispatch(fetchAdRequest(id))
}
+19 -10
View File
@@ -21,6 +21,7 @@ import Snack from '../components/atoms/snack';
import KeyboardArrowRightIcon from '@material-ui/icons/KeyboardArrowRight';
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
import Router from 'next/router'
import redirect from '../components/Atoms/Utils'
const styles = theme => ({
root: {
@@ -217,19 +218,25 @@ class Reponse extends React.Component {
};
componentDidMount() {
console.log("componentDidMount -- this.props.user")
console.log("componentDidMount -*- this.props.user")
console.log(this.props.user)
localStorage.setItem('loginRedirect', window.location)
if(!!!localStorage.getItem('ttJWT'))
{
Router.push("/Login")
}
}
componentWillReceiveProps(nextProps) {
console.log("componentWillReceiveProps")
console.log(nextProps)
if(!!!nextProps.user.fetched)
{
localStorage.setItem('loginRedirect', window.location)
Router.push('/Login')
}
// if(!!!nextProps.user.fetched)
// {
// localStorage.setItem('loginRedirect', window.location)
// Router.push('/Login')
// }
this.setState({
loading: nextProps.loading,
@@ -394,10 +401,12 @@ Reponse.getInitialProps = function (context) {
const { id } = context.query
const {res} =context
// console.debug('reponse getInitialProps')
// console.debug(id)
context.store.dispatch(fetchCurrentUserRequest())
// if (!!!context.store.user.fetched) {
context.store.dispatch(fetchCurrentUserRequest())
// }else{
// if (!!!context.store.getState().user.fetched) {
// redirect({Router:Router, ctx:context, location:'/Login'})
// }
context.store.dispatch(fetchAdRequest(id))
}
+24
View File
@@ -0,0 +1,24 @@
import React from 'react'
import LayoutBack from '../components/templates/LayoutBack'
class Error extends React.Component {
static getInitialProps({ res, err }) {
const statusCode = res ? res.statusCode : err ? err.statusCode : null
return { statusCode }
}
render() {
return (
<LayoutBack>
<p>
{this.props.statusCode
? `An error ${this.props.statusCode} occurred on server`
: 'An error occurred on client'}
</p>
</LayoutBack>
)
}
}
export default Error
+1 -1
View File
@@ -204,7 +204,7 @@ class Index extends React.Component {
<Button
variant="contained"
color="primary"
onClick={() => Router.push('/Companies')}
onClick={() => Router.push('/Entreprises')}
className={classes.button}
>
Toutes les entreprises
+2 -3
View File
@@ -25,10 +25,9 @@ export function* requestAdsSaga(action) {
export function* requestAdSaga(action) {
try {
console.log("function* requestAdSaga")
console.log(action)
const res = yield call(api.ads.fetchAd, action.payload);
console.log(res)
if (!!res)
yield put(fetchAdSuccess(res));
else
+1 -1
View File
@@ -75,7 +75,7 @@ export function* requestUserSaga(action) {
} catch (error) {
console.log(error)
localStorage.removeItem("ttJWT")
// localStorage.removeItem("ttJWT")
setAuthorizationHeader()
yield put(fetchCurrentUserFailure(error));
}
+2 -2
View File
@@ -151,8 +151,8 @@ app.prepare()
})
server.get('/Company/:id', (req, res) => {
const actualPage = '/Company'
server.get('/Entreprise/:id', (req, res) => {
const actualPage = '/Entreprise'
const queryParams = { id: req.params.id }
app.render(req, res, actualPage, queryParams)
})
+11 -3
View File
@@ -2684,6 +2684,7 @@ concat-map@0.0.1:
concat-stream@1.6.2, concat-stream@^1.4.6, concat-stream@^1.4.7, concat-stream@^1.5.0:
version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
dependencies:
buffer-from "^1.0.0"
inherits "^2.0.3"
@@ -3887,6 +3888,7 @@ exec-series@^1.0.0:
execa@0.10.0, execa@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
integrity sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==
dependencies:
cross-spawn "^6.0.0"
get-stream "^3.0.0"
@@ -4155,6 +4157,7 @@ figgy-pudding@^3.1.0, figgy-pudding@^3.5.1:
figures@^1.3.5, figures@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e"
integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=
dependencies:
escape-string-regexp "^1.0.5"
object-assign "^4.1.0"
@@ -7353,6 +7356,7 @@ os-filter-obj@^1.0.0:
os-homedir@^1.0.0, os-homedir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2:
version "1.0.2"
@@ -7651,6 +7655,7 @@ performance-now@^2.1.0:
pify@^2.0.0, pify@^2.2.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw=
pify@^3.0.0:
version "3.0.0"
@@ -8231,9 +8236,9 @@ pseudomap@^1.0.2:
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
psl@^1.1.24:
version "1.2.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6"
integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==
version "1.3.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.3.0.tgz#e1ebf6a3b5564fa8376f3da2275da76d875ca1bd"
integrity sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==
public-encrypt@^4.0.0:
version "4.0.2"
@@ -8274,6 +8279,7 @@ punycode@1.3.2:
punycode@^1.2.4, punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
punycode@^2.1.0:
version "2.1.1"
@@ -8290,6 +8296,7 @@ qs@6.5.1:
qs@6.5.2, qs@~6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
qs@^6.5.0, qs@^6.5.1:
version "6.7.0"
@@ -10897,6 +10904,7 @@ yallist@^3.0.0, yallist@^3.0.2:
yauzl@2.10.0, yauzl@^2.2.1, yauzl@^2.4.2:
version "2.10.0"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
dependencies:
buffer-crc32 "~0.2.3"
fd-slicer "~1.1.0"