-
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 branch 'main' of https://github.com/solver-it-sro/govbox-pro in…
…to GO-170/sign_imported_message_drafts
- Loading branch information
Showing
26 changed files
with
143 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<% if @tag.visible %> | ||
<div class="flex justify-center items-center relative gap-1 px-2 py-1 rounded-md bg-gray-50 border border-gray-300"> | ||
<p class=" text-sm text-left text-gray-600"><%= @tag.name %></p> | ||
<% if @object_tag.deletable %> | ||
<%= button_to url_for(@object_tag), method: :delete, form: { data: { turbo_confirm: "Naozaj odstrániť štítok #{@tag.name} zo správy?" } } do %> | ||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class=" w-3.5 h-3.5 relative" preserveAspectRatio="xMidYMid meet"> | ||
<path d="M3.5 3.5L10.5 10.5M3.5 10.5L10.5 3.5L3.5 10.5Z" stroke="#6B7280" stroke-linecap="round" stroke-linejoin="round"></path> | ||
</svg> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<% 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,8 @@ | ||
module Common | ||
class RemovableTagComponent < ViewComponent::Base | ||
def initialize(object_tag) | ||
@object_tag = object_tag | ||
@tag = @object_tag.tag | ||
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
module Common | ||
class TagSelectorComponent < ViewComponent::Base | ||
def initialize(object, available_tags) | ||
def initialize(object) | ||
@object = object | ||
@available_tags = available_tags | ||
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
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,9 +1,10 @@ | ||
class MessageComponent < ViewComponent::Base | ||
renders_many :attachments | ||
|
||
def initialize(message:, notice:, available_tags:) | ||
def initialize(message:, notice:, message_tags_with_deletable_flag:, thread_tags_with_deletable_flag:) | ||
@message = message | ||
@notice = notice | ||
@available_tags = available_tags | ||
@message_tags_with_deletable_flag = message_tags_with_deletable_flag | ||
@thread_tags_with_deletable_flag = thread_tags_with_deletable_flag | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
class MessageThreadHeaderComponent < ViewComponent::Base | ||
def initialize(message_thread, available_tags) | ||
def initialize(message_thread, thread_tags_with_deletable_flag) | ||
@message_thread = message_thread | ||
@available_tags = available_tags | ||
@thread_tags_with_deletable_flag = thread_tags_with_deletable_flag | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
class Searchable::ReindexMessageThreadJob < ApplicationJob | ||
queue_as :default | ||
|
||
include GoodJob::ActiveJobExtensions::Concurrency | ||
|
||
good_job_control_concurrency_with( | ||
# Maximum number of unfinished jobs to allow with the concurrency key | ||
# Can be an Integer or Lambda/Proc that is invoked in the context of the job | ||
total_limit: 1, | ||
|
||
key: -> { "Searchable::ReindexMessageThreadJob-#{arguments.first.try(:id)}" } | ||
) | ||
|
||
discard_on ActiveJob::DeserializationError | ||
|
||
def perform(message_thread) | ||
return if message_thread.nil? | ||
|
||
::Searchable::MessageThread.index_record(message_thread) | ||
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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
class ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
|
||
class FailedToAcquireLockError < StandardError | ||
end | ||
|
||
def self.with_advisory_lock!(lock_name, options = {}, &block) | ||
result = with_advisory_lock_result(lock_name, options, &block) | ||
if result.lock_was_acquired? | ||
result.result | ||
else | ||
raise FailedToAcquireLockError | ||
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
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 |
---|---|---|
|
@@ -31,6 +31,10 @@ def index? | |
true | ||
end | ||
|
||
def scroll? | ||
true | ||
end | ||
|
||
def update? | ||
true | ||
end | ||
|
Oops, something went wrong.