add translations profile identification tokens
This commit is contained in:
parent
93c5c52e19
commit
c37a54b65b
6 changed files with 58 additions and 15 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
en:
|
||||||
|
tokens_title: API identification tokens
|
||||||
|
first_paragraph: These tokens are needed to make calls to the
|
||||||
|
second_paragraph: If you already have applications that use a token and you revoke it, access to the API will be blocked for those applications.
|
||||||
|
action: Create and display a new token
|
|
@ -0,0 +1,5 @@
|
||||||
|
fr:
|
||||||
|
tokens_title: Jetons d’identification de l’API (token)
|
||||||
|
first_paragraph: Ces jetons sont nécessaire pour effectuer des appels vers l’API de
|
||||||
|
second_paragraph: Si vous avez déjà des applications qui utilisent un jeton et vous le révoquez, l’accès à l’API sera bloqué pour ces applications.
|
||||||
|
action: Créer et afficher un nouveau jeton
|
|
@ -1,7 +1,11 @@
|
||||||
.card.no-list{ 'data-turbo': 'true', id: dom_id(current_administrateur, :profil_api_token) }
|
.card.no-list{ 'data-turbo': 'true', id: dom_id(current_administrateur, :profil_api_token) }
|
||||||
.card-title Jetons d’identification de l’API (token)
|
.card-title
|
||||||
%p Ces jetons sont nécessaire pour effectuer des appels vers l’API de #{APPLICATION_NAME}.
|
= t('.tokens_title')
|
||||||
%p Si vous avez déjà des applications qui utilisent un jeton et vous le révoquez, l’accès à l’API sera bloqué pour ces applications.
|
%p
|
||||||
|
= t('.first_paragraph')
|
||||||
|
#{APPLICATION_NAME}.
|
||||||
|
%p
|
||||||
|
= t('.second_paragraph')
|
||||||
|
|
||||||
= render Dsfr::ListComponent.new do |list|
|
= render Dsfr::ListComponent.new do |list|
|
||||||
- api_and_packed_tokens.each do |(api_token, packed_token)|
|
- api_and_packed_tokens.each do |(api_token, packed_token)|
|
||||||
|
@ -11,5 +15,4 @@
|
||||||
.fr-card__content
|
.fr-card__content
|
||||||
= render Profile::APITokenComponent.new(api_token:, packed_token:)
|
= render Profile::APITokenComponent.new(api_token:, packed_token:)
|
||||||
|
|
||||||
%br
|
= button_to t('.action'), api_tokens_path, method: :post, class: "fr-btn fr-btn--secondary"
|
||||||
= button_to "Créer et afficher un nouveau jeton", api_tokens_path, method: :post, class: "fr-btn fr-btn--secondary"
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
en:
|
||||||
|
allowed_full_access_html: This token has access to <strong>all</strong> the procedures attached to your administrator account
|
||||||
|
allowed_procedures_html:
|
||||||
|
zero: This token has no access to <strong>any</strong> process.
|
||||||
|
one: This token has access to a selected process
|
||||||
|
other: This token has access to %{count} selected steps
|
||||||
|
security_one: For security reasons, it will not be re-posted, please note.
|
||||||
|
security_two: For security reasons, we can only show it to you when it is created.
|
||||||
|
action_all: Allow access to all procedures
|
||||||
|
action_choice: Allow access only to selected steps
|
||||||
|
add: Add
|
||||||
|
delete: Delete
|
||||||
|
token_procedures: This token has access to the procedures
|
||||||
|
revoke_token: Revoke token
|
||||||
|
reading_writing: Reading and writing
|
||||||
|
reading: Read only
|
|
@ -4,3 +4,13 @@ fr:
|
||||||
zero: Ce jeton n’a accès à <strong>aucune</strong> démarche
|
zero: Ce jeton n’a accès à <strong>aucune</strong> démarche
|
||||||
one: Ce jeton a accès a une démarche sélectionnée
|
one: Ce jeton a accès a une démarche sélectionnée
|
||||||
other: Ce jeton a accès a %{count} démarches sélectionnées
|
other: Ce jeton a accès a %{count} démarches sélectionnées
|
||||||
|
security_one: Pour des raisons de sécurité, il ne sera plus ré-affiché, notez-le bien.
|
||||||
|
security_two: Pour des raisons de sécurité, nous ne pouvons vous l’afficher que lors de sa création.
|
||||||
|
action_all: Autoriser l’accès a toutes les démarches
|
||||||
|
action_choice: Autoriser l’accès seulement a des démarches choisies
|
||||||
|
add: Ajouter
|
||||||
|
delete: Supprimer
|
||||||
|
token_procedures: Ce jeton a accès aux démarches
|
||||||
|
revoke_token: Révoquer le jeton
|
||||||
|
reading_writing: En lecture et écriture
|
||||||
|
reading: En lecture seule
|
||||||
|
|
|
@ -13,10 +13,12 @@
|
||||||
- button = render Dsfr::CopyButtonComponent.new(text: @packed_token, title: "Copier le jeton dans le presse-papier", success: "Le jeton a été copié dans le presse-papier")
|
- button = render Dsfr::CopyButtonComponent.new(text: @packed_token, title: "Copier le jeton dans le presse-papier", success: "Le jeton a été copié dans le presse-papier")
|
||||||
= "#{@packed_token} #{button}"
|
= "#{@packed_token} #{button}"
|
||||||
|
|
||||||
%p Pour des raisons de sécurité, il ne sera plus ré-affiché, notez-le bien.
|
%p
|
||||||
|
= t('.security_one')
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%p Pour des raisons de sécurité, nous ne pouvons vous l’afficher que lors de sa création.
|
%p
|
||||||
|
= t('.security_two')
|
||||||
|
|
||||||
- if @api_token.full_access?
|
- if @api_token.full_access?
|
||||||
%p.fr-text--lg
|
%p.fr-text--lg
|
||||||
|
@ -26,33 +28,35 @@
|
||||||
= t('.allowed_procedures_html', count: @api_token.allowed_procedures.size)
|
= t('.allowed_procedures_html', count: @api_token.allowed_procedures.size)
|
||||||
|
|
||||||
- if @api_token.allowed_procedures.empty?
|
- if @api_token.allowed_procedures.empty?
|
||||||
= button_to "Autoriser l’accès a toutes les démarches", @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary"
|
= button_to t('.action_all'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary"
|
||||||
- else
|
- else
|
||||||
%ul
|
%ul
|
||||||
- @api_token.allowed_procedures.each do |procedure|
|
- @api_token.allowed_procedures.each do |procedure|
|
||||||
%li.flex.justify-between.align-center
|
%li.flex.justify-between.align-center
|
||||||
.truncate-80
|
.truncate-80
|
||||||
= "#{procedure.id} – #{procedure.libelle}"
|
= "#{procedure.id} – #{procedure.libelle}"
|
||||||
= button_to "Supprimer", @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary"
|
= button_to t('.delete'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary"
|
||||||
|
|
||||||
.fr-card__end
|
.fr-card__end
|
||||||
= form_for @api_token, namespace: dom_id(@api_token, :allowed_procedures), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true } } do |f|
|
= form_for @api_token, namespace: dom_id(@api_token, :allowed_procedures), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true } } do |f|
|
||||||
= f.label :allowed_procedure_ids do
|
= f.label :allowed_procedure_ids do
|
||||||
Autoriser l’accès seulement a des démarches choisies
|
= t('.action_choice')
|
||||||
- @api_token.allowed_procedures.each do |procedure|
|
- @api_token.allowed_procedures.each do |procedure|
|
||||||
= f.hidden_field :allowed_procedure_ids, value: procedure.id, multiple: true, id: dom_id(procedure, :allowed_procedure)
|
= f.hidden_field :allowed_procedure_ids, value: procedure.id, multiple: true, id: dom_id(procedure, :allowed_procedure)
|
||||||
.flex.justify-between.align-center{ 'data-turbo-force': true }
|
.flex.justify-between.align-center{ 'data-turbo-force': true }
|
||||||
= f.select :allowed_procedure_ids, procedures_to_allow_options, procedures_to_allow_select_options, { class: 'no-margin width-66 small', name: "api_token[allowed_procedure_ids][]" }
|
= f.select :allowed_procedure_ids, procedures_to_allow_options, procedures_to_allow_select_options, { class: 'no-margin width-66 small', name: "api_token[allowed_procedure_ids][]" }
|
||||||
= f.button type: :submit, class: "fr-btn fr-btn--secondary" do
|
= f.button type: :submit, class: "fr-btn fr-btn--secondary" do
|
||||||
Ajouter
|
= t('.add')
|
||||||
|
|
||||||
= form_for @api_token, namespace: dom_id(@api_token, :write_access), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true, controller: 'autosubmit' } } do |f|
|
= form_for @api_token, namespace: dom_id(@api_token, :write_access), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true, controller: 'autosubmit' } } do |f|
|
||||||
= f.label :write_access do
|
= f.label :write_access do
|
||||||
Ce jeton a accès aux démarches
|
= t('.token_procedures')
|
||||||
%label.toggle-switch.no-margin
|
%label.toggle-switch.no-margin
|
||||||
= f.check_box :write_access, class: 'toggle-switch-checkbox'
|
= f.check_box :write_access, class: 'toggle-switch-checkbox'
|
||||||
%span.toggle-switch-control.round
|
%span.toggle-switch-control.round
|
||||||
%span.toggle-switch-label.on En lecture et écriture
|
%span.toggle-switch-label.on
|
||||||
%span.toggle-switch-label.off En lecture seule
|
= t('.reading_writing')
|
||||||
|
%span.toggle-switch-label.off
|
||||||
|
= t('.reading')
|
||||||
|
|
||||||
= button_to "Révoquer le jeton", api_token_path(@api_token), method: :delete, class: "fr-btn fr-btn--secondary", data: { turbo_confirm: "Confirmez-vous la révocation de ce jeton ? Les applications qui l’utilisent actuellement seront bloquées." }
|
= button_to t('.revoke_token'), api_token_path(@api_token), method: :delete, class: "fr-btn fr-btn--secondary", data: { turbo_confirm: "Confirmez-vous la révocation de ce jeton ? Les applications qui l’utilisent actuellement seront bloquées." }
|
||||||
|
|
Loading…
Reference in a new issue