mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge branch '327_pinned_comment' into issue321_layout_improvements_actionForm
This commit is contained in:
@@ -21,11 +21,14 @@ class LocationApiController extends ApiController
|
||||
{
|
||||
public function customizeQuery(string $action, Request $request, $query): void
|
||||
{
|
||||
$query->andWhere(
|
||||
$query->expr()->andX(
|
||||
$query
|
||||
->leftJoin('e.locationType', 'lt')
|
||||
->andWhere(
|
||||
$query->expr()->andX(
|
||||
$query->expr()->eq('e.availableForUsers', "'TRUE'"),
|
||||
$query->expr()->eq('lt.availableForUsers', "'TRUE'"),
|
||||
$query->expr()->eq('e.active', "'TRUE'"),
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,27 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class UserApiController extends ApiController
|
||||
{
|
||||
/**
|
||||
* @Route(
|
||||
* "/api/1.0/main/user-current-location.{_format}",
|
||||
* name="chill_main_user_current_location",
|
||||
* requirements={
|
||||
* "_format": "json"
|
||||
* }
|
||||
* )
|
||||
*
|
||||
* @param mixed $_format
|
||||
*/
|
||||
public function currentLocation($_format): JsonResponse
|
||||
{
|
||||
return $this->json(
|
||||
$this->getUser()->getCurrentLocation(),
|
||||
JsonResponse::HTTP_OK,
|
||||
[],
|
||||
['groups' => ['read']]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(
|
||||
* "/api/1.0/main/whoami.{_format}",
|
||||
|
@@ -33,6 +33,13 @@ ul.record_actions {
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
ul.dropdown-menu {
|
||||
li {
|
||||
display: block;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.sticky-form-buttons {
|
||||
margin-top: 4em;
|
||||
|
@@ -55,6 +55,15 @@ final class UserApiControllerTest extends WebTestCase
|
||||
return $data['results'][0];
|
||||
}
|
||||
|
||||
public function testUserCurrentLocation()
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(Request::METHOD_GET, '/api/1.0/main/user-current-location.json');
|
||||
|
||||
$this->assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
public function testWhoami()
|
||||
{
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
@@ -546,6 +546,14 @@ paths:
|
||||
responses:
|
||||
200:
|
||||
description: "ok"
|
||||
/1.0/main/user-current-location.json:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Return the current location of the currently authenticated user
|
||||
responses:
|
||||
200:
|
||||
description: "ok"
|
||||
/1.0/main/user/{id}.json:
|
||||
get:
|
||||
tags:
|
||||
|
@@ -56,6 +56,7 @@ centers: centres
|
||||
Centers: Centres
|
||||
comment: commentaire
|
||||
Comment: Commentaire
|
||||
Pinned comment: Commentaire épinglé
|
||||
Any comment: Aucun commentaire
|
||||
|
||||
# comment embeddable
|
||||
|
Reference in New Issue
Block a user