-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from digio-ch/issue/hc-235
WIP: All widgets without filter
- Loading branch information
Showing
33 changed files
with
2,478 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
preview: | ||
path: /preview | ||
methods: GET | ||
controller: App\Controller\Api\Apps\CensusController::getPreview | ||
|
||
getFilter: | ||
path: /filter | ||
methods: GET | ||
controller: App\Controller\Api\Apps\CensusController:getFilterData | ||
|
||
postFilter: | ||
path: /filter | ||
methods: POST | ||
controller: App\Controller\Api\Apps\CensusController:postFilterData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
|
||
namespace App\Controller\Api\Apps; | ||
|
||
use App\DTO\Model\FilterRequestData\CensusRequestData; | ||
use App\Entity\Midata\Group; | ||
use App\Service\DataProvider\CensusDataProvider; | ||
use App\Service\DataProvider\CensusFilterDataProvider; | ||
use App\Service\Security\PermissionVoter; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | ||
use Symfony\Component\HttpFoundation\JsonResponse; | ||
|
||
class CensusController extends AbstractController | ||
{ | ||
private CensusDataProvider $censusDataProvider; | ||
private CensusFilterDataProvider $censusFilterDataProvider; | ||
|
||
public function __construct( | ||
CensusDataProvider $censusDataProvider, | ||
CensusFilterDataProvider $censusFilterDataProvider | ||
) { | ||
$this->censusDataProvider = $censusDataProvider; | ||
$this->censusFilterDataProvider = $censusFilterDataProvider; | ||
} | ||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getPreview(Group $group) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusDataProvider->getPreviewData($group)); | ||
} | ||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getTableData(Group $group, CensusRequestData $censusRequestData) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusDataProvider->getTableData($group, $censusRequestData)); | ||
} | ||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getDevelopmentData(Group $group, CensusRequestData $censusRequestData) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusDataProvider->getDevelopmentData($group, $censusRequestData)); | ||
} | ||
|
||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getMembersData(Group $group, CensusRequestData $censusRequestData) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusDataProvider->getMembersData($group, $censusRequestData)); | ||
} | ||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getTreemapData(Group $group, CensusRequestData $censusRequestData) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusDataProvider->getTreemapData($group, $censusRequestData)); | ||
} | ||
|
||
/** | ||
* @param Group $group | ||
* @return JsonResponse | ||
* | ||
* @ParamConverter("group", options={"mapping": {"groupId": "id"}}) | ||
*/ | ||
public function getFilterData(Group $group) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusFilterDataProvider->getFilterData($group)); | ||
} | ||
|
||
public function postFilterData(Group $group, CensusRequestData $censusRequestData) | ||
{ | ||
$this->denyAccessUnlessGranted(PermissionVoter::VIEWER, $group); | ||
return $this->json($this->censusFilterDataProvider->setFilterData($group, $censusRequestData)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.