fix modal issue

This commit is contained in:
Charles 2026-03-09 10:06:46 +01:00
parent 91304d95dc
commit 2dae055ae9
5 changed files with 14 additions and 48 deletions

View File

@ -171,7 +171,7 @@ export default class extends Controller {
this.modalTitleTarget.textContent = "Modifier l'organisation";
try {
const response = await fetch(`/organization/${this.currentOrgId}`);
const response = await fetch(`/organization/editModal/${this.currentOrgId}`);
const data = await response.json();
// Fill targets

View File

@ -14,6 +14,7 @@ parameters:
oauth_sso_identifier: '%env(OAUTH_SSO_IDENTIFIER)%'
oauth_sso_identifier_login: '%env(OAUTH_SSO_IDENTIFIER_LOGIN)%'
easycheck_url: '%env(EASYCHECK_URL)%'
webhook_secret: '%env(WEBHOOK_SECRET)%'
services:
# default configuration for services in *this* file
@ -58,12 +59,13 @@ services:
App\Command\CreateSuperAdminCommand:
arguments:
$environment: '%kernel.environment%'
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
App\EventListener\LogoutSubscriber:
arguments:
$easycheckUrl: '%env(EASYCHECK_URL)%'
tags:
- { name: kernel.event_subscriber }
App\Webhook\OrganizationNotifier:
arguments:
$easycheckUrl: '%easycheck_url%'
$webhookSecret: '%webhook_secret%'

View File

@ -375,7 +375,7 @@ class OrganizationController extends AbstractController
/*
* Path used to get data on an organization for the edit modal
*/
#[Route(path: '/{id}', name: 'get', methods: ['GET'])]
#[Route(path: '/editModal/{id}', name: 'get', methods: ['GET'])]
public function get(int $id): JsonResponse{
$this->denyAccessUnlessGranted('ROLE_USER');
$actingUser = $this->getUser();

View File

@ -414,5 +414,11 @@
"files": [
"config/packages/messenger.yaml"
]
},
"symfony/webhook": {
"version": "7.4",
"recipe": {
"version": "7.3"
}
}
}

View File

@ -26,49 +26,7 @@
{% endif %}
{# New organization modal #}
<div class="modal fade" id="createOrganizationModal" tabindex="-1" aria-labelledby="createOrganizationModalLabel"
aria-hidden="true"
data-organization-target="modal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="createOrganizationModalLabel">Créer une organisation</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<form data-action="submit->organization#createOrganization">
<div class="mb-3">
<label for="organizationName" class="form-label">Nom de l'organisation</label>
<input type="text" class="form-control" id="organizationName" name="name" required>
</div>
<div class="mb-3">
<label for="organizationEmail" class="form-label">Email</label>
<input class="form-control" id="organizationEmail" type="email" name="email" required>
</div>
<div class="mb-3">
<label for="organizationPhone" class="form-label">Téléphone</label>
<input class="form-control" type="number" id="organizationPhone" name="phone">
</div>
<div class="mb-3">
<label for="organizationAddress" class="form-label">Adresse</label>
<input class="form-control" id="organizationAddress" name="address">
</div>
<div class="mb-3">
<label class="form-label" for="organizationLogo">Logo de l'organisation</label>
<input type="file" name="logoUrl" id="organizationLogo" class="form-control"
accept="image/*">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
Annuler
</button>
<button type="submit" class="btn btn-primary">Créer l'organisation</button>
</div>
</form>
</div>
</div>
</div>
</div>
{{ include('organization/organizationModal.html.twig') }}
</div>
<div class="card-body">
{% if is_granted('ROLE_SUPER_ADMIN') and not hasOrganizations %}