-
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.
fix(dossier): show ineligibilite message on update
- Loading branch information
Showing
9 changed files
with
55 additions
and
63 deletions.
There are no files selected for viewing
18 changes: 14 additions & 4 deletions
18
app/components/dossiers/invalid_ineligibilite_rules_component.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 |
---|---|---|
@@ -1,18 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
class Dossiers::InvalidIneligibiliteRulesComponent < ApplicationComponent | ||
delegate :can_passer_en_construction?, to: :@dossier | ||
delegate :can_passer_en_construction?, to: :dossier | ||
|
||
def initialize(dossier:) | ||
def initialize(dossier:, wrapped: true) | ||
@dossier = dossier | ||
@revision = dossier.revision | ||
|
||
@opened = !dossier.can_passer_en_construction? | ||
@wrapped = wrapped | ||
end | ||
|
||
private | ||
|
||
attr_reader :dossier | ||
|
||
def render? | ||
!can_passer_en_construction? | ||
dossier.revision.ineligibilite_enabled? | ||
end | ||
|
||
def error_message | ||
@dossier.revision.ineligibilite_message | ||
dossier.revision.ineligibilite_message | ||
end | ||
|
||
def opened? = @opened | ||
def wrapped? = @wrapped | ||
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
19 changes: 0 additions & 19 deletions
19
app/javascript/controllers/ineligibilite_rules_match_controller.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
= render partial: 'shared/dossiers/update_champs', locals: { to_show: @to_show, to_hide: @to_hide, to_update: @to_update, dossier: @dossier } | ||
|
||
- if !params.key?(:validate) | ||
- if @can_passer_en_construction_was && !@can_passer_en_construction_is | ||
= turbo_stream.append('contenu', render(Dossiers::InvalidIneligibiliteRulesComponent.new(dossier: @dossier))) | ||
- else @ineligibilite_rules_is_computable | ||
= turbo_stream.remove(dom_id(@dossier, :ineligibilite_rules_broken)) | ||
- if params[:validate].present? && @dossier.revision.ineligibilite_enabled? | ||
= turbo_stream.update dom_id(@dossier, :ineligibilite_rules_broken), render(Dossiers::InvalidIneligibiliteRulesComponent.new(dossier: @dossier, wrapped: false)) | ||
|
||
- if @update_contact_information | ||
= turbo_stream.update "contact_information", partial: 'shared/dossiers/update_contact_information', locals: { dossier: @dossier, procedure: @dossier.procedure } |
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