diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb
index 0ff5442..f188f55 100644
--- a/app/channels/application_cable/connection.rb
+++ b/app/channels/application_cable/connection.rb
@@ -1,4 +1,18 @@
module ApplicationCable
class Connection < ActionCable::Connection::Base
+ identified_by :current_user
+
+ def connect
+ self.current_user = find_verified_user
+ end
+
+ private
+ def find_verified_user
+ if verified_user = User.find_by(id: cookies.encrypted[:user_id])
+ verified_user
+ else
+ reject_unauthorized_connection
+ end
+ end
end
end
diff --git a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
index 32f9337..f045b98 100644
--- a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
+++ b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb
@@ -8,10 +8,10 @@
-
+
<%= label_tag :annotation_marks %>
<%= hidden_field_tag :document_id, opts[:document_id] %>
- <%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all, :id, :name, annotation.annomark_ids), class: "form-select i-chosen", multiple: true, prompt: "Please select" %>
+ <%= select_tag "annomark_ids[]", options_from_collection_for_select(Annomark.all, :id, :name, annotation.annomark_ids), class: "form-select annomark-ids-select2", multiple: true, prompt: "Please select" %>
@@ -31,7 +31,7 @@
<%= label_tag :editor_notes %>
- <%= editor_notes %>
+ <%= annotation.editor_notes %>
diff --git a/app/components/desicions_index_component.rb b/app/components/desicions_index_component.rb
new file mode 100644
index 0000000..d775b5e
--- /dev/null
+++ b/app/components/desicions_index_component.rb
@@ -0,0 +1,9 @@
+class DesicionsIndexComponent < BaseComponent
+ with_collection_parameter :search_result
+ attr_reader :search_result, :opts
+
+ def initialize(search_result:, current_user:, opts: {})
+ @search_result = search_result
+ @opts = opts
+ end
+end
\ No newline at end of file
diff --git a/app/components/doctrine_modal_form_component.rb b/app/components/doctrine_modal_form_component.rb
index 86ca73c..bc70adc 100644
--- a/app/components/doctrine_modal_form_component.rb
+++ b/app/components/doctrine_modal_form_component.rb
@@ -1,8 +1,9 @@
class DoctrineModalFormComponent < BaseComponent
- attr_reader :doctrine, :opts
+ attr_reader :doctrine, :subjects, :opts
- def initialize(current_user:, doctrine:, opts:)
+ def initialize(current_user:, doctrine:, subjects:, opts:)
@doctrine = doctrine
+ @subjects = subjects
@opts = opts
end
diff --git a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
index 7dd7477..daee096 100644
--- a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
+++ b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb
@@ -9,9 +9,9 @@
-
+
<%= label_tag :subjects %>
- <%= select_tag "subject_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, doctrine.subject_ids), class: "form-select i-chosen", multiple: true, prompt: "Please select" %>
+ <%= select_tag "subject_ids[]", options_from_collection_for_select(subjects, :id, :lineage_name, doctrine.subject_ids), class: "form-select subject-ids-modal-select2", multiple: true, prompt: "Please select" %>
diff --git a/app/components/document_doctrine_show_component.rb b/app/components/document_doctrine_show_component.rb
index 0d4de2b..8a45818 100644
--- a/app/components/document_doctrine_show_component.rb
+++ b/app/components/document_doctrine_show_component.rb
@@ -1,9 +1,10 @@
class DocumentDoctrineShowComponent < BaseComponent
- attr_reader :current_user, :doctrine
+ attr_reader :current_user, :doctrine, :subjects
- def initialize(current_user:, doctrine:, opts: {})
+ def initialize(current_user:, doctrine:, subjects:, opts: {})
@doctrine = doctrine
@current_user = current_user
+ @subjects = subjects
end
delegate :id, to: :doctrine
@@ -23,6 +24,6 @@ class DocumentDoctrineShowComponent < BaseComponent
end
def annotation_form_url
- doctrine_annotations_path(doctrine_id: id)
+ doctrine_annotations_path(doctrine_id: id,)
end
end
\ No newline at end of file
diff --git a/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
index 22933d2..7a338df 100644
--- a/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
+++ b/app/components/document_doctrine_show_component/document_doctrine_show_component.html.erb
@@ -1,22 +1,26 @@
-