forked from demarches-simplifiees/demarches-simplifiees.fr
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: lexpol 01 review edit and lexpol component chore: few fixes feat: variable support feat: allow administrator to select model for lexpol type field feat: use Typhoeus instead of uri feat: add mapping to variable to send to lexpol & fix dropdown to select lexpol modele chore: rubocop Graphql: add champ descriptor for lexpol chore: dossier controller spec 1 chore: dossier controller spec 1 feat: add feature flag for lexpol chore: graphql schema load fix: some changes according to comments chore: rubocop feat: add feature flag rake chore: upgrade vite
- Loading branch information
Showing
33 changed files
with
1,381 additions
and
325 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class EditableChamp::LexpolComponent < EditableChamp::EditableChampBaseComponent | ||
end |
15 changes: 15 additions & 0 deletions
15
app/components/editable_champ/lexpol_component/lexpol_component.html.haml
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,15 @@ | ||
-# %div.lexpol-champ | ||
-# - if @champ.value.blank? | ||
-# = form_with url: lexpol_create_dossier_instructeur_dossier_path(@champ.dossier.revision.procedure.id, @champ.dossier.id, champ_id: @champ.id), method: :post do |form| | ||
-# = form.submit 'Créer le dossier dans LexPol', class: 'fr-btn' | ||
-# - else | ||
-# %p | ||
-# %strong Numéro NOR : | ||
-# = @champ.value | ||
-# %p | ||
-# %strong Statut du dossier : | ||
-# = @champ.lexpol_status | ||
-# - if @champ.lexpol_dossier_url.present? | ||
-# = link_to 'Aller sur LexPol', @champ.lexpol_dossier_url, target: '_blank', class: 'fr-btn fr-btn--secondary' | ||
-# = form_with url: lexpol_update_dossier_instructeur_dossier_path(@champ.dossier.revision.procedure.id, @champ.dossier.id, champ_id: @champ.id), method: :post do |form| | ||
-# = form.submit 'Mettre à jour le dossier', class: 'fr-btn fr-btn--secondary' |
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
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,29 @@ | ||
module Instructeurs | ||
class LexpolController < ApplicationController | ||
before_action :authenticate_instructeur! | ||
before_action :set_dossier_and_champ | ||
|
||
def create_dossier | ||
if @champ.lexpol_create_dossier | ||
redirect_to annotations_instructeur_dossier_path(@dossier.procedure, @dossier), notice: 'Dossier LexPol créé avec succès.' | ||
else | ||
redirect_to annotations_instructeur_dossier_path(@dossier.procedure, @dossier), alert: @champ.errors.full_messages.join(', ') | ||
end | ||
end | ||
|
||
def update_dossier | ||
if @champ.lexpol_update_dossier | ||
redirect_to annotations_instructeur_dossier_path(@dossier.procedure, @dossier), notice: 'Dossier LexPol mis à jour avec succès.' | ||
else | ||
redirect_to annotations_instructeur_dossier_path(@dossier.procedure, @dossier), alert: @champ.errors.full_messages.join(', ') | ||
end | ||
end | ||
|
||
private | ||
|
||
def set_dossier_and_champ | ||
@dossier = Dossier.find(params[:dossier_id]) | ||
@champ = @dossier.champs.find(params[:champ_id]) | ||
end | ||
end | ||
end |
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
Oops, something went wrong.