-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9940 from demarches-simplifiees/can_edit_again_a_…
…token Admin: je peux modifier le nom et les réseaux d'un jeton d'API
- Loading branch information
Showing
7 changed files
with
133 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
- content_for :title, "Modification du jeton d'API « #{@api_token.name} »" | ||
|
||
= render partial: 'administrateurs/breadcrumbs', | ||
locals: { steps: [['Tableau de bord', tableau_de_bord_helper_path], | ||
[t('users.profil.show.profile'), profil_path], | ||
["Jeton d’API : #{@api_token.name}"]] } | ||
|
||
.fr-container.fr-mt-2w | ||
%h1 Modification du jeton d'API « #{@api_token.name} » | ||
|
||
= form_with url: admin_api_token_path(@api_token), method: :patch, html: { class: 'fr-mt-2w' } do |f| | ||
.fr-input-group | ||
= f.label :name, class: 'fr-label' do | ||
= t('name', scope: [:administrateurs, :api_tokens, :nom]) | ||
%span.fr-hint-text= t('name-hint', scope: [:administrateurs, :api_tokens, :nom]) | ||
= f.text_field :name, | ||
class: 'fr-input width-33', | ||
autocomplete: 'off', | ||
autocapitalize: 'off', | ||
autocorrect: 'off', | ||
spellcheck: false, | ||
required: true, | ||
value: @api_token.name | ||
|
||
.fr-input-group.fr-mb-4w{ | ||
class: class_names('fr-input-group--error': @invalid_network) } | ||
= f.label :name, class: 'fr-label' do | ||
= @api_token.eternal? ? "Entrez au moins 1 réseau autorisé" : "Entrez les adresses ip autorisées" | ||
%span.fr-hint-text adresses réseaux séparées par des espaces. ex: 176.31.79.200 192.168.33.0/24 2001:41d0:304:400::52f/128 | ||
= f.text_field :networks, | ||
class: class_names('fr-input': true, 'fr-input--error': @invalid_network), | ||
autocomplete: 'off', | ||
autocapitalize: 'off', | ||
autocorrect: 'off', | ||
spellcheck: false, | ||
required: @api_token.eternal?, | ||
value: @api_token.authorized_networks_for_ui.gsub(/,/, ' ') | ||
|
||
- if @invalid_network | ||
%p.fr-error-text vous devez entrer des adresses ipv4 ou ipv6 valides | ||
|
||
%ul.fr-btns-group.fr-btns-group--inline | ||
%li | ||
= f.button 'Modifier', type: :submit, class: "fr-btn fr-btn--primary" | ||
%li | ||
= link_to 'Revenir', profil_path, class: "fr-btn fr-btn--secondary" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters