Feat/disable services 662 (#671)

* disable button for services

* add button to disable services

* fix account services links

* fixup! fix account services links

---------

Co-authored-by: Sarahshr <sarah@les-tilleuls.coop>
This commit is contained in:
Sarahshr 2024-01-05 14:05:46 +01:00 committed by Slim
parent 9f661ebe0a
commit b1e3a5150c
3 changed files with 108 additions and 102 deletions

View file

@ -4,6 +4,8 @@ App\Entity\Configuration:
features (extends configuration_template): features (extends configuration_template):
configuration: configuration:
services:
servicesEnabled: true
notificationsSender: notificationsSender:
notificationsSenderEmail: info@example.com notificationsSenderEmail: info@example.com
notificationsSenderName: Contact notificationsSenderName: Contact

View file

@ -80,7 +80,7 @@ class Configuration
*/ */
public function getServices(): array public function getServices(): array
{ {
/** @var array<bool> $services */ /** @var array<string, bool> $services */
$services = $this->configuration['services'] ?? []; $services = $this->configuration['services'] ?? [];
return $services; return $services;

View file

@ -18,6 +18,7 @@
{% set my_account_links = [ {% set my_account_links = [
{ {
section: 'Messagerie', section: 'Messagerie',
enable: true,
links: [ links: [
{ {
name: 'Mes emprunts', name: 'Mes emprunts',
@ -36,6 +37,7 @@
}, },
{ {
section: 'Mes objets', section: 'Mes objets',
enable: true,
links: [ links: [
{ {
name: 'Voir mes objets', name: 'Voir mes objets',
@ -53,7 +55,7 @@
}, },
{ {
section: 'Mes services', section: 'Mes services',
disable: servicesConfig, enable: servicesConfig,
links: [ links: [
{ {
name: 'Voir mes services', name: 'Voir mes services',
@ -71,6 +73,7 @@
}, },
{ {
section: 'Mes groupes', section: 'Mes groupes',
enable: true,
links: [ links: [
{ {
name: 'Voir mes groupes', name: 'Voir mes groupes',
@ -94,6 +97,7 @@
}, },
{ {
section: 'Compte', section: 'Compte',
enable: true,
links: [ links: [
{ {
name: 'Mon adresse', name: 'Mon adresse',
@ -134,7 +138,7 @@
} %} } %}
<div class="row flex-wrap"> <div class="row flex-wrap">
{% for my_account_link in my_account_links %} {% for my_account_link in my_account_links %}
{% if my_account_link.disable is not defined %} {% if my_account_link.enable %}
<div class="col-12 col-md-4"> <div class="col-12 col-md-4">
<nav class="myAccount d-flex flex-column mt-3 mt-md-5"> <nav class="myAccount d-flex flex-column mt-3 mt-md-5">
<div class="myAccount-header w-100 rounded-2"> <div class="myAccount-header w-100 rounded-2">