List projet + list request
This commit is contained in:
97
frontend/src/pages/DashBoardClient.js
Normal file
97
frontend/src/pages/DashBoardClient.js
Normal file
@ -0,0 +1,97 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import Page from './page';
|
||||
import ProjectList from '../components/ProjectList';
|
||||
import { projectUserListRequest } from '../actions/project';
|
||||
|
||||
const DashBoardClient = ({ projects = [], ...props }) => {
|
||||
|
||||
useEffect(() => {
|
||||
props.dispatch(projectUserListRequest())
|
||||
}, [])
|
||||
projects = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'mon premier projet',
|
||||
requests: [
|
||||
{
|
||||
id: 1,
|
||||
title: 'Demande num 1',
|
||||
author: 'Gael Peltey',
|
||||
status: {
|
||||
id: 1,
|
||||
slug: 'en-attente'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2019'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'Demande num 2',
|
||||
author: 'Jean Guy',
|
||||
status: {
|
||||
id: 2,
|
||||
slug: 'pris-en-compte'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2020'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: 'Demande num 3',
|
||||
author: 'Gael Peltey',
|
||||
status: {
|
||||
id: 3,
|
||||
slug: 'en-cours-de-traitement'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2021'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'mon deuxième projet',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'mon troisième projet',
|
||||
requests: [
|
||||
{
|
||||
id: 4,
|
||||
title: 'Demande num 4',
|
||||
author: 'David Pujadas',
|
||||
status: {
|
||||
id: 4,
|
||||
slug: 'traite'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2022'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: 'Demande num 5',
|
||||
author: 'Jean Mi',
|
||||
status: {
|
||||
id: 5,
|
||||
slug: 'clos'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2023'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
]
|
||||
return (
|
||||
<Page title="dashBoard client">
|
||||
<div className="notification">
|
||||
<h1>Mon dashboard</h1>
|
||||
</div>
|
||||
<ProjectList projects={projects} withRequest />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const mapStateToProps = ({ project }) => ({
|
||||
projects: project.items,
|
||||
})
|
||||
|
||||
export default connect(mapStateToProps)(DashBoardClient)
|
97
frontend/src/pages/DashBoardDev.js
Normal file
97
frontend/src/pages/DashBoardDev.js
Normal file
@ -0,0 +1,97 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import Page from './page';
|
||||
import ProjectList from '../components/ProjectList';
|
||||
import { projectList } from '../actions/project';
|
||||
|
||||
const DashBoardDev = ({ projects = [], ...props }) => {
|
||||
|
||||
useEffect(() => {
|
||||
props.dispatch(projectList())
|
||||
}, [])
|
||||
projects = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'mon premier projet',
|
||||
requests: [
|
||||
{
|
||||
id: 1,
|
||||
title: 'Demande num 1',
|
||||
author: 'Gael Peltey',
|
||||
status: {
|
||||
id: 1,
|
||||
slug: 'en-attente'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2019'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: 'Demande num 2',
|
||||
author: 'Jean Guy',
|
||||
status: {
|
||||
id: 2,
|
||||
slug: 'pris-en-compte'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2020'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: 'Demande num 3',
|
||||
author: 'Gael Peltey',
|
||||
status: {
|
||||
id: 3,
|
||||
slug: 'en-cours-de-traitement'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2021'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'mon deuxième projet',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'mon troisième projet',
|
||||
requests: [
|
||||
{
|
||||
id: 4,
|
||||
title: 'Demande num 4',
|
||||
author: 'David Pujadas',
|
||||
status: {
|
||||
id: 4,
|
||||
slug: 'traite'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2022'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: 'Demande num 5',
|
||||
author: 'Jean Mi',
|
||||
status: {
|
||||
id: 5,
|
||||
slug: 'clos'
|
||||
},
|
||||
createdAt: 'le 20 juillet 2023'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
]
|
||||
return (
|
||||
<Page title="dashBoard dev">
|
||||
<div className="notification">
|
||||
<h1>Developpeur Dashboard</h1>
|
||||
</div>
|
||||
<ProjectList projects={projects} />
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const mapStateToProps = ({ project }) => ({
|
||||
projects: project.items,
|
||||
})
|
||||
|
||||
export default connect(mapStateToProps)(DashBoardDev)
|
@ -6,7 +6,7 @@ export default function Page({ title, children }) {
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="container-fluid">
|
||||
<div className="container">
|
||||
{ children }
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user