-
Notifications
You must be signed in to change notification settings - Fork 6
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 #225 from solver-it-sro/GO-392/signed_draft_UX_unsign
Locked draft behavior hotfix
- Loading branch information
Showing
11 changed files
with
137 additions
and
56 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
27 changes: 27 additions & 0 deletions
27
app/components/message_draft_confirm_unlock_component.html.erb
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,27 @@ | ||
<%= render Common::ModalComponent.new do |modal| %> | ||
<% modal.with_header do %> | ||
Draft nie je možné upravovať | ||
<% end %> | ||
<% modal.with_modal_content do %> | ||
<div class="mt-2 pb-4"> | ||
<p class="text-sm text-gray-500"> | ||
<% if @message.reason_for_readonly == :form_signed %> | ||
<%= t "message_draft.form_signed" %> | ||
<% elsif @message.reason_for_readonly == :form_submitted %> | ||
<%= t "message_draft.form_submitted" %> | ||
<% else %> | ||
<%= t "message_draft.read_only_agenda" %> | ||
<% end %> | ||
</p> | ||
</div> | ||
<%= render Common::ModalActionsComponent.new do |actions| %> | ||
<% if @message.reason_for_readonly == :form_signed %> | ||
<% actions.with_submit_button do %> | ||
<%= button_to unlock_message_draft_path(@message), class: "inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 sm:ml-3 sm:w-auto", data: { turbo_frame: "_top" } do %> | ||
Odstrániť podpisy | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class MessageDraftConfirmUnlockComponent < ViewComponent::Base | ||
def initialize(message) | ||
@message = message | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,12 @@ def submit_all? | |
def destroy? | ||
create? | ||
end | ||
|
||
def confirm_unlock? | ||
unlock? | ||
end | ||
|
||
def unlock? | ||
create? | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= tag.turbo_frame id: "modal" do %> | ||
<%= render MessageDraftConfirmUnlockComponent.new(@message) %> | ||
<% 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