-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reopening an authorization with previous stages gives a choice
- Loading branch information
1 parent
1fecc05
commit e423b34
Showing
14 changed files
with
177 additions
and
10 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/assets/stylesheets/components/reopen_authorizations.css
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,18 @@ | ||
.reopen-stage-buttons-container { | ||
width: 100%; | ||
display: flex; | ||
align-items: flex-start; | ||
} | ||
|
||
.reopen-stage-buttons { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.reopen-stage-cancel { | ||
display: flex; | ||
align-items: flex-end; | ||
height: 100%; | ||
} |
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
20 changes: 20 additions & 0 deletions
20
app/interactors/transition_authorization_request_to_previous_stage.rb
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,20 @@ | ||
class TransitionAuthorizationRequestToPreviousStage < ApplicationInteractor | ||
def call | ||
return if context.authorization_request_class.blank? | ||
|
||
context.fail! unless context.authorization_request.can_reopen_to_class?(context.authorization_request_class) | ||
|
||
return if context.authorization_request.is_a? context.authorization_request_class | ||
|
||
transition_to_previous_stage | ||
end | ||
|
||
private | ||
|
||
def transition_to_previous_stage | ||
context.authorization_request.update!( | ||
type: context.authorization_request_class.to_s, | ||
form_uid: context.authorization_request.definition.previous_stage_form(context.authorization_request_class).id | ||
) | ||
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
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 |
---|---|---|
|
@@ -444,8 +444,14 @@ fr: | |
<br /> | ||
<br /> | ||
Votre habilitation restera valide quelque soit l'issue de la demande de mise à jour. | ||
warning_for_stages: | ||
title: Vos mises à jour peuvent concerner votre habilitation bac à sable | ||
content: "Pour savoir si les mises à jour que vous désirez effectuer nécessitent de passer d'abord par une mise à jour de l'habilitation bac à sable, contactez le fournisseur de données : <br /><a class=\"fr-link\" target=\"_blank\" href=\"mailto:[email protected]\">[email protected]</a>" | ||
cancel: Annuler | ||
reopen: Mettre à jour l'habilitation | ||
reopen_to_stage: | ||
sandbox: Mettre à jour l'habilitation bac à sable | ||
production: Mettre à jour l'habilitation de production | ||
create: | ||
success: | ||
title: L'habilitation %{name} a bien été réouverte | ||
|
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