{project.name}
+ { + withRequest &&diff --git a/backend/src/DataFixtures/ProjectFixtures.php b/backend/src/DataFixtures/ProjectFixtures.php
index 2ce92ad..3747deb 100644
--- a/backend/src/DataFixtures/ProjectFixtures.php
+++ b/backend/src/DataFixtures/ProjectFixtures.php
@@ -3,6 +3,7 @@
namespace App\DataFixtures;
use App\Entity\Project;
+use App\Entity\Request;
use App\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
@@ -14,15 +15,77 @@ class ProjectFixtures extends Fixture implements DependentFixtureInterface
public function load(ObjectManager $manager)
{
- $dev1 = $manager
+ //NEW PROJECT
+ $user = $manager
->getRepository(User::class)
->findOneByUsername('dev1')
;
- $project1 = new Project();
- $project1->setName("Test");
- $project1->addUser($dev1);
- $manager->persist($project1);
+ $project = new Project();
+ $request = $manager
+ ->getRepository(Request::class)
+ ->findOneByTitle('Demande num 1')
+ ;
+ $project->addRequest($request);
+ $request = $manager
+ ->getRepository(Request::class)
+ ->findOneByTitle('Demande num 2')
+ ;
+ $project->addRequest($request);
+ $request = $manager
+ ->getRepository(Request::class)
+ ->findOneByTitle('Demande num 3')
+ ;
+ $project->addRequest($request);
+
+ $project->setName("Projet 1");
+ $project->addUser($user);
+ $manager->persist($project);
+
+ //NEW PROJECT
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client1')
+ ;
+
+ $project = new Project();
+
+ $request = $manager
+ ->getRepository(Request::class)
+ ->findOneByTitle('Demande num 4')
+ ;
+ $project->addRequest($request);
+ $request = $manager
+ ->getRepository(Request::class)
+ ->findOneByTitle('Demande num 5')
+ ;
+ $project->addRequest($request);
+
+ $project->setName("Projet 2");
+ $project->addUser($user);
+ $manager->persist($project);
+
+ //NEW PROJECT
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client1')
+ ;
+
+ $project = new Project();
+ $project->setName("Projet 3");
+ $project->addUser($user);
+ $manager->persist($project);
+
+ //NEW PROJECT
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client2')
+ ;
+
+ $project = new Project();
+ $project->setName("Projet 4");
+ $project->addUser($user);
+ $manager->persist($project);
$manager->flush();
@@ -32,6 +95,7 @@ class ProjectFixtures extends Fixture implements DependentFixtureInterface
{
return [
UserFixtures::class,
+ RequestFixtures::class
];
}
diff --git a/backend/src/DataFixtures/RequestFixtures.php b/backend/src/DataFixtures/RequestFixtures.php
new file mode 100644
index 0000000..e8f515f
--- /dev/null
+++ b/backend/src/DataFixtures/RequestFixtures.php
@@ -0,0 +1,121 @@
+getRepository(User::class)
+ ->findOneByUsername('client1')
+ ;
+
+ $status = $manager
+ ->getRepository(RequestStatus::class)
+ ->findOneBySlug('en-attente')
+ ;
+
+ $request = new Request();
+ $request->setTitle("Demande num 1");
+ $request->setAuthor($user);
+ $request->setCreatedAt(new DateTime());
+ $request->setStatus($status);
+ $manager->persist($request);
+
+ //NEW REQUEST
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client1')
+ ;
+
+ $status = $manager
+ ->getRepository(RequestStatus::class)
+ ->findOneBySlug('pris-en-compte')
+ ;
+
+ $request = new Request();
+ $request->setTitle("Demande num 2");
+ $request->setAuthor($user);
+ $request->setCreatedAt(new DateTime());
+ $request->setStatus($status);
+ $manager->persist($request);
+
+ //NEW REQUEST
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client1')
+ ;
+
+ $status = $manager
+ ->getRepository(RequestStatus::class)
+ ->findOneBySlug('en-cours-de-traitement')
+ ;
+
+ $request = new Request();
+ $request->setTitle("Demande num 3");
+ $request->setAuthor($user);
+ $request->setCreatedAt(new DateTime());
+ $request->setStatus($status);
+ $manager->persist($request);
+
+ //NEW REQUEST
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client2')
+ ;
+
+ $status = $manager
+ ->getRepository(RequestStatus::class)
+ ->findOneBySlug('traite')
+ ;
+
+ $request = new Request();
+ $request->setTitle("Demande num 4");
+ $request->setAuthor($user);
+ $request->setCreatedAt(new DateTime());
+ $request->setStatus($status);
+ $manager->persist($request);
+
+ //NEW REQUEST
+ $user = $manager
+ ->getRepository(User::class)
+ ->findOneByUsername('client2')
+ ;
+
+ $status = $manager
+ ->getRepository(RequestStatus::class)
+ ->findOneBySlug('clos')
+ ;
+
+ $request = new Request();
+ $request->setTitle("Demande num 5");
+ $request->setAuthor($user);
+ $request->setCreatedAt(new DateTime());
+ $request->setStatus($status);
+ $manager->persist($request);
+
+ $manager->flush();
+
+ }
+
+ public function getDependencies()
+ {
+ return [
+ RequestStatusFixtures::class,
+ UserFixtures::class,
+ ];
+ }
+
+
+}
diff --git a/backend/src/DataFixtures/RequestStatusFixtures.php b/backend/src/DataFixtures/RequestStatusFixtures.php
index 1d7a867..3041bdd 100644
--- a/backend/src/DataFixtures/RequestStatusFixtures.php
+++ b/backend/src/DataFixtures/RequestStatusFixtures.php
@@ -11,16 +11,32 @@ class RequestStatusFixtures extends Fixture
public function load(ObjectManager $manager)
{
$statuses = [
- 'En attente',
- 'Pris en compte',
- 'En cours de traitement',
- 'Traité',
- 'Clos',
+ [
+ 'label' => 'En attente',
+ 'slug' => 'en-attente'
+ ],
+ [
+ 'label' => 'Pris en compte',
+ 'slug' => 'pris-en-compte'
+ ],
+ [
+ 'label' => 'En cours de traitement',
+ 'slug' => 'en-cours-de-traitement'
+ ],
+ [
+ 'label' => 'Traité',
+ 'slug' => 'traite'
+ ],
+ [
+ 'label' => 'Clos',
+ 'slug' => 'clos'
+ ],
];
- foreach($statuses as $statusLabel) {
+ foreach($statuses as $s) {
$status = new RequestStatus();
- $status->setLabel($statusLabel);
+ $status->setLabel($s['label']);
+ $status->setSlug($s['slug']);
$manager->persist($status);
}
diff --git a/backend/src/Entity/RequestStatus.php b/backend/src/Entity/RequestStatus.php
index 803adc5..8affdfb 100644
--- a/backend/src/Entity/RequestStatus.php
+++ b/backend/src/Entity/RequestStatus.php
@@ -23,6 +23,11 @@ class RequestStatus
*/
private $label;
+ /**
+ * @ORM\Column(type="string", length=64)
+ */
+ private $slug;
+
/**
* @ORM\OneToMany(targetEntity="App\Entity\Request", mappedBy="status")
*/
@@ -50,6 +55,18 @@ class RequestStatus
return $this;
}
+ public function getSlug(): ?string
+ {
+ return $this->slug;
+ }
+
+ public function setSlug(string $slug): self
+ {
+ $this->slug = $slug;
+
+ return $this;
+ }
+
/**
* @return Collection|Request[]
*/
diff --git a/frontend/src/actions/project.js b/frontend/src/actions/project.js
new file mode 100644
index 0000000..fc03b46
--- /dev/null
+++ b/frontend/src/actions/project.js
@@ -0,0 +1,27 @@
+export const PROJECT_USER_LIST = 'PROJECT_USER_LIST';
+export const PROJECT_USER_LIST_SUCCESS = 'PROJECT_USER_LIST_SUCCESS';
+export const PROJECT_USER_LIST_FAILURE = 'PROJECT_USER_LIST_FAILURE';
+
+export function projectUserListRequest() {
+ return { type: PROJECT_USER_LIST}
+}
+export function projectUserListSuccess(projects) {
+ return { type: PROJECT_USER_LIST_SUCCESS, projects }
+}
+export function projectUserListFailure(error) {
+ return { type: PROJECT_USER_LIST_FAILURE, error }
+}
+
+export const PROJECT_LIST = 'PROJECT_LIST';
+export const PROJECT_LIST_SUCCESS = 'PROJECT_LIST_SUCCESS';
+export const PROJECT_LIST_FAILURE = 'PROJECT_LIST_FAILURE';
+
+export function projectList() {
+ return { type: PROJECT_LIST}
+}
+export function projectListSuccess(projects) {
+ return { type: PROJECT_LIST_SUCCESS, projects }
+}
+export function projectListFailure(error) {
+ return { type: PROJECT_LIST_FAILURE, error }
+}
\ No newline at end of file
diff --git a/frontend/src/app.js b/frontend/src/app.js
index c7e5e20..a67b5c6 100644
--- a/frontend/src/app.js
+++ b/frontend/src/app.js
@@ -4,6 +4,8 @@ import { HashRouter } from 'react-router-dom' // ou BrowserRouter
import { Route, Switch, Redirect } from 'react-router'
import HomePage from './pages/home';
import { ConnectedLoginPage as LoginPage } from './pages/login';
+import DashBoardClient from './pages/DashBoardClient';
+import DashBoardDev from './pages/DashBoardDev';
class App extends Component {
render () {
@@ -13,6 +15,8 @@ class App extends Component {
{project.name}
+ { + withRequest &&{request.title}
+