From 5169dd95f12ed929e7509f11067bbeb83230a9fe Mon Sep 17 00:00:00 2001 From: Meewan Date: Thu, 19 Sep 2024 13:32:46 +0200 Subject: [PATCH] (PC-31860)[BO] feat: transfert all PRO links in BO to connect as extended --- api/src/pcapi/routes/backoffice/filters.py | 8 +- .../pcapi/routes/backoffice/pro/blueprint.py | 22 +++ api/src/pcapi/routes/backoffice/pro/forms.py | 1 + .../accounts/get/details/bookings.html | 4 +- .../bank_account/get/linked_venues.html | 4 +- .../templates/collective_bookings/list.html | 4 +- .../templates/collective_offer/list.html | 4 +- .../collective_offer_template/list.html | 4 +- .../templates/components/links.html | 39 +++--- .../custom_reimbursement_rules/list.html | 24 +++- .../incidents/get/details/bookings.html | 4 +- .../get/details/collective_bookings.html | 4 +- .../templates/individual_bookings/list.html | 4 +- .../backoffice/templates/offer/details.html | 4 +- .../backoffice/templates/offer/list.html | 4 +- .../backoffice/templates/offerer/get.html | 4 +- .../offerer/get/details/bank_accounts.html | 4 +- .../offerer/get/details/managed_venues.html | 4 +- .../templates/providers/get/venues.html | 4 +- .../backoffice/templates/venue/get.html | 18 +-- api/src/pcapi/utils/urls.py | 28 ++-- .../routes/backoffice/bank_account_test.py | 3 +- .../collective_offer_templates_test.py | 3 +- .../backoffice/collective_offers_test.py | 12 +- .../custom_reimbursement_rules_test.py | 5 +- api/tests/routes/backoffice/finance_test.py | 4 +- api/tests/routes/backoffice/offerers_test.py | 6 +- api/tests/routes/backoffice/offers_test.py | 13 +- api/tests/routes/backoffice/pro_test.py | 132 ++++++++++++++++++ api/tests/routes/backoffice/providers_test.py | 3 +- api/tests/routes/backoffice/venues_test.py | 3 +- 31 files changed, 280 insertions(+), 100 deletions(-) diff --git a/api/src/pcapi/routes/backoffice/filters.py b/api/src/pcapi/routes/backoffice/filters.py index 29ba3a6750a..77836ffd295 100644 --- a/api/src/pcapi/routes/backoffice/filters.py +++ b/api/src/pcapi/routes/backoffice/filters.py @@ -1395,13 +1395,7 @@ def install_template_filters(app: Flask) -> None: app.jinja_env.filters["unescape"] = html.unescape app.jinja_env.filters["action_to_name"] = action_to_name app.jinja_env.filters["field_list_get_number_from_name"] = field_list_get_number_from_name - app.jinja_env.filters["pc_pro_bank_account_link"] = urls.build_pc_pro_bank_account_link - app.jinja_env.filters["pc_pro_offer_link"] = urls.build_pc_pro_offer_link - app.jinja_env.filters["pc_pro_offerer_link"] = urls.build_pc_pro_offerer_link - app.jinja_env.filters["pc_pro_venue_bookings_link"] = urls.build_pc_pro_venue_bookings_link - app.jinja_env.filters["pc_pro_venue_offers_link"] = urls.build_pc_pro_venue_offers_link - app.jinja_env.filters["pc_pro_venue_link"] = urls.build_pc_pro_venue_link - app.jinja_env.filters["pc_pro_venue_parameters_link"] = urls.build_pc_pro_venue_parameters_link + app.jinja_env.filters["pc_pro_offer_link"] = urls.build_pc_pro_offer_path app.jinja_env.filters["pc_backoffice_public_account_link"] = urls.build_backoffice_public_account_link app.jinja_env.filters["pc_backoffice_public_account_link_in_comment"] = ( urls.build_backoffice_public_account_link_in_comment diff --git a/api/src/pcapi/routes/backoffice/pro/blueprint.py b/api/src/pcapi/routes/backoffice/pro/blueprint.py index a28d1d6e35c..fcdf0cbc644 100644 --- a/api/src/pcapi/routes/backoffice/pro/blueprint.py +++ b/api/src/pcapi/routes/backoffice/pro/blueprint.py @@ -13,6 +13,7 @@ from pcapi import settings from pcapi.connectors import api_adresse +from pcapi.core.finance import models as finance_models from pcapi.core.mails import transactional as transactional_mails from pcapi.core.offerers import api as offerers_api from pcapi.core.offerers import models as offerers_models @@ -358,6 +359,25 @@ def _get_user_id_from_offer_id(offer_id: int) -> int: return user_id +def _get_user_id_from_bank_account_id(bank_account_id: int) -> int: + if not FeatureToggle.WIP_CONNECT_AS_EXTENDED.is_active(): + raise ValueError( + "L'utilisation de la version étendue de « connect as » requiert l'activation de la feature : WIP_CONNECT_AS_EXTENDED" + ) + query = get_user_id_for_connect_as_base_query() + user_id = ( + query.join(offerers_models.UserOfferer.offerer) + .join(offerers_models.Offerer.bankAccounts) + .filter(finance_models.BankAccount.id == bank_account_id) + .order_by(offerers_models.UserOfferer.id) + .limit(1) + .scalar() + ) + if not user_id: + raise ValueError("Aucun utilisateur approprié n'a été trouvé pour se connecter à ce compte bancaire") + return user_id + + @pro_blueprint.route("/connect-as", methods=["POST"]) @utils.permission_required(perm_models.Permissions.MANAGE_PRO_ENTITY) @atomic() @@ -371,6 +391,8 @@ def connect_as() -> utils.BackofficeResponse: try: match form.object_type.data: + case "bank_account": + user_id = _get_user_id_from_bank_account_id(form.object_id.data) case "offer": user_id = _get_user_id_from_offer_id(form.object_id.data) case "offerer": diff --git a/api/src/pcapi/routes/backoffice/pro/forms.py b/api/src/pcapi/routes/backoffice/pro/forms.py index ea36180c7e4..af88fb9fb32 100644 --- a/api/src/pcapi/routes/backoffice/pro/forms.py +++ b/api/src/pcapi/routes/backoffice/pro/forms.py @@ -144,6 +144,7 @@ class ConnectAsForm(FlaskForm): object_id = fields.PCStringField() object_type = fields.PCSelectField( choices=( + ("bank_account", "bank_account"), ("offer", "offer"), ("offerer", "offerer"), ("user", "user"), diff --git a/api/src/pcapi/routes/backoffice/templates/accounts/get/details/bookings.html b/api/src/pcapi/routes/backoffice/templates/accounts/get/details/bookings.html index 6dcbe83b6ef..c385432530d 100644 --- a/api/src/pcapi/routes/backoffice/templates/accounts/get/details/bookings.html +++ b/api/src/pcapi/routes/backoffice/templates/accounts/get/details/bookings.html @@ -18,7 +18,9 @@ {{ build_booking_toggle_extra_row_button(booking) }} {{ booking.offerer.name | escape }} - {{ links.build_offer_name_to_pc_pro_link(booking.stock.offer) }} + + {{ links.build_offer_name_to_pc_pro_link(booking.stock.offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ booking.amount | format_amount }} {% if booking.stock.offer.isDuo and booking.quantity == 2 %}(Duo){% endif %} diff --git a/api/src/pcapi/routes/backoffice/templates/bank_account/get/linked_venues.html b/api/src/pcapi/routes/backoffice/templates/bank_account/get/linked_venues.html index eb644ad29bd..19273444726 100644 --- a/api/src/pcapi/routes/backoffice/templates/bank_account/get/linked_venues.html +++ b/api/src/pcapi/routes/backoffice/templates/bank_account/get/linked_venues.html @@ -14,7 +14,9 @@ {{ links.build_venue_name_to_details_link(link_venue.venue, text_attr="id") }} - {{ links.build_venue_name_to_pc_pro_link(link_venue.venue) }} + + {{ links.build_venue_name_to_pc_pro_link(link_venue.venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ link_venue.timespan.lower | format_date_time }} {% endfor %} diff --git a/api/src/pcapi/routes/backoffice/templates/collective_bookings/list.html b/api/src/pcapi/routes/backoffice/templates/collective_bookings/list.html index 2ff24c47142..46c2a4a71ff 100644 --- a/api/src/pcapi/routes/backoffice/templates/collective_bookings/list.html +++ b/api/src/pcapi/routes/backoffice/templates/collective_bookings/list.html @@ -174,7 +174,9 @@ ({{ collective_booking.educationalInstitution.id }}) {{ collective_booking.educationalRedactor.firstName }} {{ collective_booking.educationalRedactor.lastName }} - {{ links.build_offer_name_to_pc_pro_link(collective_offer) }} + + {{ links.build_offer_name_to_pc_pro_link(collective_offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ links.build_collective_offer_name_to_details_link(collective_offer, text_attr="id") }} {{ collective_booking.total_amount | format_amount }} {{ collective_booking | format_booking_status(with_badge=True) | safe }} diff --git a/api/src/pcapi/routes/backoffice/templates/collective_offer/list.html b/api/src/pcapi/routes/backoffice/templates/collective_offer/list.html index 2c97154006c..01608978c94 100644 --- a/api/src/pcapi/routes/backoffice/templates/collective_offer/list.html +++ b/api/src/pcapi/routes/backoffice/templates/collective_offer/list.html @@ -100,7 +100,9 @@

Offres collectives

{% endif %} {{ links.build_collective_offer_details_link(collective_offer) }} - {{ links.build_offer_name_to_pc_pro_link(collective_offer) }} + + {{ links.build_offer_name_to_pc_pro_link(collective_offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ collective_offer.formats | format_collective_offer_formats }} {% if has_permission("PRO_FRAUD_ACTIONS") %} diff --git a/api/src/pcapi/routes/backoffice/templates/collective_offer_template/list.html b/api/src/pcapi/routes/backoffice/templates/collective_offer_template/list.html index 19546f2a5c8..ff56dea2c3e 100644 --- a/api/src/pcapi/routes/backoffice/templates/collective_offer_template/list.html +++ b/api/src/pcapi/routes/backoffice/templates/collective_offer_template/list.html @@ -97,7 +97,9 @@

Offres collectives vitrine

{% endif %} {{ links.build_collective_offer_template_details_link(collective_offer_template, text_attr="id") }} - {{ links.build_offer_name_to_pc_pro_link(collective_offer_template) }} + + {{ links.build_offer_name_to_pc_pro_link(collective_offer_template, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ collective_offer_template.formats | format_collective_offer_formats }} {% if has_permission("PRO_FRAUD_ACTIONS") %} {{ collective_offer_template.flaggingValidationRules | format_offer_validation_rule_list }} diff --git a/api/src/pcapi/routes/backoffice/templates/components/links.html b/api/src/pcapi/routes/backoffice/templates/components/links.html index 2768e4a97bf..f3f8944a53e 100644 --- a/api/src/pcapi/routes/backoffice/templates/components/links.html +++ b/api/src/pcapi/routes/backoffice/templates/components/links.html @@ -30,7 +30,7 @@ - {{ text_link }} + {{ text_link }} {% else %} {{ text_link }} @@ -128,30 +128,27 @@ {% macro build_pro_offerer_offers_link(offerer, is_feature_active, has_permission) %} {{ build_connect_as_pseudo_link(offerer.id, "offerer", "/offres?structure="~offerer.id~"&from-bo=true", "Offres associées", "fw-bold link-primary", is_feature_active, has_permission) }} {% endmacro %} -{% macro build_offerer_name_to_pc_pro_link(offerer) %} - {{ offerer.name }} +{% macro build_offerer_name_to_pc_pro_link(offerer, is_feature_active, has_permission) %} + {{ build_connect_as_pseudo_link(offerer.id, "offerer", "/accueil?structure="~offerer.id~"&from-bo=true", offerer.name, "link-primary", is_feature_active, has_permission) }} {% endmacro %} -{% macro build_venue_name_to_pc_pro_link(venue, public_name=true, siret=false) %} - {{ ((public_name and venue.publicName) or venue.name) + ((" - " + venue.siret) if siret else "") }} +{% macro build_venue_name_to_pc_pro_link(venue, is_feature_active, has_permission, public_name=true, siret=false) %} + {% if venue.isVirtual %} + {{ build_connect_as_pseudo_link(venue.id, "venue", "/accueil?structure="~venue.managingOffererId~"&from-bo=true", (((public_name and venue.publicName) or venue.name) + ((" - " + venue.siret) if siret else "")), "link-primary", is_feature_active, has_permission) }} + {% else %} + {{ build_connect_as_pseudo_link(venue.id, "venue", "/structures/"~venue.managingOffererId~"/lieux/"~venue.id~"", (((public_name and venue.publicName) or venue.name) + ((" - " + venue.siret) if siret else "")), "link-primary", is_feature_active, has_permission) }} + {% endif %} {% endmacro %} -{% macro build_venue_parameters_name_to_pc_pro_link(venue, public_name=true, siret=false) %} - {{ ((public_name and venue.publicName) or venue.name) + ((" - " + venue.siret) if siret else "") }} +{% macro build_venue_parameters_name_to_pc_pro_link(venue, is_feature_active, has_permission) %} + {{ build_connect_as_pseudo_link(venue.id, "venue", "/structures/"~venue.managingOffererId~"/lieux/"~venue.id~"/parametres", (public_name or venue.name) , "link-primary", is_feature_active, has_permission) }} {% endmacro %} -{% macro build_offer_name_to_pc_pro_link(offer) %} - {{ offer.name }} +{% macro build_offer_name_to_pc_pro_link(offer, is_feature_active, has_permission) %} + {# this macro must be on one line or it breaks the connect as feature #} + {# djlint:off #}{% macro build_offer_name_to_pc_pro_url(offer) %}{{ offer | pc_pro_offer_link }}{% endmacro %}{# djlint:on #} + {% set offer_name_to_pc_pro_url = build_offer_name_to_pc_pro_url(offer) %} + {{ build_connect_as_pseudo_link(offer.id, "offer", offer_name_to_pc_pro_url, offer.name , "link-primary", is_feature_active, has_permission) }} {% endmacro %} -{% macro build_bank_account_name_to_pc_pro_link(bank_account) %} - {{ bank_account.label }} +{% macro build_bank_account_name_to_pc_pro_link(bank_account, is_feature_active, has_permission) %} + {{ build_connect_as_pseudo_link(bank_account.id, "bank_account", "/remboursements/informations-bancaires?structure="~bank_account.offererId~"&from-bo=true", bank_account.label , "link-primary", is_feature_active, has_permission) }} {% endmacro %} {# ----- external links ----- #} {% macro build_siren_to_external_link(offerer) %} diff --git a/api/src/pcapi/routes/backoffice/templates/custom_reimbursement_rules/list.html b/api/src/pcapi/routes/backoffice/templates/custom_reimbursement_rules/list.html index 8f42ff30cfe..57a2517a703 100644 --- a/api/src/pcapi/routes/backoffice/templates/custom_reimbursement_rules/list.html +++ b/api/src/pcapi/routes/backoffice/templates/custom_reimbursement_rules/list.html @@ -79,20 +79,32 @@

Tarifs dérogatoires

{{ reimbursement_rule.id }} {% if reimbursement_rule.offerer %} - {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.offerer) }} + + {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.offerer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ reimbursement_rule.offerer.siren }} {% elif reimbursement_rule.venue %} - {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.venue.managingOfferer) }} + + {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.venue.managingOfferer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ reimbursement_rule.venue.managingOfferer.siren }} - {{ links.build_venue_name_to_pc_pro_link(reimbursement_rule.venue, siret=true) }} + + {{ links.build_venue_name_to_pc_pro_link(reimbursement_rule.venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY"), siret=true) }} + {% else %} - {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.offer.venue.managingOfferer) }} + + {{ links.build_offerer_name_to_pc_pro_link(reimbursement_rule.offer.venue.managingOfferer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ reimbursement_rule.offer.venue.managingOfferer.siren }} - {{ links.build_venue_name_to_pc_pro_link(reimbursement_rule.offer.venue) }} - {{ links.build_offer_name_to_pc_pro_link(reimbursement_rule.offer) }} + + {{ links.build_venue_name_to_pc_pro_link(reimbursement_rule.offer.venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + + + {{ links.build_offer_name_to_pc_pro_link(reimbursement_rule.offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {% endif %} {{ reimbursement_rule.rate | format_rate_multiply_by_100 }} {{ reimbursement_rule.amount | format_cents if reimbursement_rule.amount else "" }} diff --git a/api/src/pcapi/routes/backoffice/templates/finance/incidents/get/details/bookings.html b/api/src/pcapi/routes/backoffice/templates/finance/incidents/get/details/bookings.html index 0d02c598d4e..e08d885e9d6 100644 --- a/api/src/pcapi/routes/backoffice/templates/finance/incidents/get/details/bookings.html +++ b/api/src/pcapi/routes/backoffice/templates/finance/incidents/get/details/bookings.html @@ -23,7 +23,9 @@ {{ links.build_public_user_name_to_details_link(booking_finance_incident.beneficiary) }} {{ booking_finance_incident.booking | format_booking_status(with_badge=True) | safe }} - {{ links.build_offer_name_to_pc_pro_link(booking_finance_incident.booking.stock.offer) }} + + {{ links.build_offer_name_to_pc_pro_link(booking_finance_incident.booking.stock.offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ booking_finance_incident.booking.dateCreated | format_date("Le %d/%m/%Y à %Hh%M") }} {{ booking_finance_incident.collectiveBooking.educationalInstitution.name }} {{ booking_finance_incident.collectiveBooking.userName }} {{ booking_finance_incident.collectiveBooking | format_booking_status(with_badge=True) | safe }} - {{ links.build_offer_name_to_pc_pro_link(booking_finance_incident.collectiveBooking.collectiveStock.collectiveOffer) }} + + {{ links.build_offer_name_to_pc_pro_link(booking_finance_incident.collectiveBooking.collectiveStock.collectiveOffer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ booking_finance_incident.collectiveBooking.dateCreated | format_date("Le %d/%m/%Y à %Hh%M") }} Annuler la réservation {{ booking.token }} {{ booking.id }} {{ booking.token }} {{ links.build_public_user_name_to_details_link(booking.user) }} - {{ links.build_offer_name_to_pc_pro_link(offer) }} + + {{ links.build_offer_name_to_pc_pro_link(offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ links.build_offer_name_to_details_link(offer, text_attr="id") }} {{ (offer.isDuo and booking.quantity == 2) | format_bool }} {{ booking.stock.quantity }} diff --git a/api/src/pcapi/routes/backoffice/templates/offer/details.html b/api/src/pcapi/routes/backoffice/templates/offer/details.html index 9a94df486ea..5954130afca 100644 --- a/api/src/pcapi/routes/backoffice/templates/offer/details.html +++ b/api/src/pcapi/routes/backoffice/templates/offer/details.html @@ -16,7 +16,9 @@
-

{{ links.build_offer_name_to_pc_pro_link(offer) }}

+

+ {{ links.build_offer_name_to_pc_pro_link(offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} +

{% if offer.lastProviderId %} diff --git a/api/src/pcapi/routes/backoffice/templates/offer/list.html b/api/src/pcapi/routes/backoffice/templates/offer/list.html index a84d58c8f82..f3175e3b239 100644 --- a/api/src/pcapi/routes/backoffice/templates/offer/list.html +++ b/api/src/pcapi/routes/backoffice/templates/offer/list.html @@ -168,7 +168,9 @@

Offres individuelles

{{ links.build_offer_details_link(offer) }} - {{ links.build_offer_name_to_pc_pro_link(offer) }} + + {{ links.build_offer_name_to_pc_pro_link(offer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ offer.subcategoryId | format_offer_category }} {{ offer.subcategoryId | format_offer_subcategory }} {% if not has_permission("PRO_FRAUD_ACTIONS") %} diff --git a/api/src/pcapi/routes/backoffice/templates/offerer/get.html b/api/src/pcapi/routes/backoffice/templates/offerer/get.html index 83b32c54333..15639ad7601 100644 --- a/api/src/pcapi/routes/backoffice/templates/offerer/get.html +++ b/api/src/pcapi/routes/backoffice/templates/offerer/get.html @@ -20,7 +20,9 @@
-

{{ links.build_offerer_name_to_pc_pro_link(offerer) }}

+

+ {{ links.build_offerer_name_to_pc_pro_link(offerer, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} +

{{ build_offerer_badges(offerer) }}
{% if has_permission("MANAGE_PRO_ENTITY") %} diff --git a/api/src/pcapi/routes/backoffice/templates/offerer/get/details/bank_accounts.html b/api/src/pcapi/routes/backoffice/templates/offerer/get/details/bank_accounts.html index cf87f5b1c28..0fbe3442ff9 100644 --- a/api/src/pcapi/routes/backoffice/templates/offerer/get/details/bank_accounts.html +++ b/api/src/pcapi/routes/backoffice/templates/offerer/get/details/bank_accounts.html @@ -14,7 +14,9 @@ {{ links.build_bank_account_name_to_details_link(bank_account, text_attr="id") }} - {{ links.build_bank_account_name_to_pc_pro_link(bank_account) }} + + {{ links.build_bank_account_name_to_pc_pro_link(bank_account, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ bank_account.status | format_dms_application_status }} {% endfor %} diff --git a/api/src/pcapi/routes/backoffice/templates/offerer/get/details/managed_venues.html b/api/src/pcapi/routes/backoffice/templates/offerer/get/details/managed_venues.html index 67514a73b95..7cdcc09a411 100644 --- a/api/src/pcapi/routes/backoffice/templates/offerer/get/details/managed_venues.html +++ b/api/src/pcapi/routes/backoffice/templates/offerer/get/details/managed_venues.html @@ -19,7 +19,9 @@ {{ links.build_venue_name_to_details_link(venue, text_attr="id") }} - {{ links.build_venue_name_to_pc_pro_link(venue) }} + + {{ links.build_venue_name_to_pc_pro_link(venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ links.build_siret_to_external_link(venue) }} {% if venue.isPermanent %}Lieu permanent{% endif %} diff --git a/api/src/pcapi/routes/backoffice/templates/providers/get/venues.html b/api/src/pcapi/routes/backoffice/templates/providers/get/venues.html index 221becededc..a0b35cd1505 100644 --- a/api/src/pcapi/routes/backoffice/templates/providers/get/venues.html +++ b/api/src/pcapi/routes/backoffice/templates/providers/get/venues.html @@ -16,7 +16,9 @@ {{ links.build_venue_name_to_details_link(venue, text_attr="id") }} - {{ links.build_venue_parameters_name_to_pc_pro_link(venue) }} + + {{ links.build_venue_parameters_name_to_pc_pro_link(venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY")) }} + {{ venue.siret | empty_string_if_null }} {{ "Activée" if venue.venueProviders[0].isActive else "Désactivée"}} {{ venue.venueProviders[0].lastSyncDate | format_date_time }} diff --git a/api/src/pcapi/routes/backoffice/templates/venue/get.html b/api/src/pcapi/routes/backoffice/templates/venue/get.html index c076850305b..d56a7c1d06f 100644 --- a/api/src/pcapi/routes/backoffice/templates/venue/get.html +++ b/api/src/pcapi/routes/backoffice/templates/venue/get.html @@ -18,7 +18,9 @@
-

{{ links.build_venue_name_to_pc_pro_link(venue, public_name=false) }}

+

+ {{ links.build_venue_name_to_pc_pro_link(venue, is_feature_active("WIP_CONNECT_AS_EXTENDED") , has_permission("MANAGE_PRO_ENTITY"), public_name=false) }} +

{{ build_venue_badges(venue) }}
{% if has_permission("MANAGE_PRO_ENTITY") and has_active_provider %} @@ -254,20 +256,10 @@