removed serializer code

This commit is contained in:
Giga Chubinidze 2023-08-28 12:14:44 +04:00
parent 6d8d804c71
commit 0e2f9ff81d
5 changed files with 5 additions and 17 deletions

View file

@ -12,7 +12,7 @@
:value="element.attributes.orderable.name"
:sa_value="element.attributes.orderable.sa_name"
:characterLimit="10000"
:placeholder="element.attributes.orderable.placeholder"
:placeholder="i18n.t('protocols.steps.checklist.checklist_name')"
:allowBlank="false"
:autofocus="editingName"
:smartAnnotation="true"

View file

@ -13,7 +13,7 @@
<InlineEdit
:value="element.attributes.orderable.name"
:characterLimit="255"
:placeholder="element.attributes.orderable.placeholder"
:placeholder="i18n.t('protocols.steps.table.table_name')"
:allowBlank="false"
:autofocus="editingName"
:attributeName="`${i18n.t('Table')} ${i18n.t('name')}`"

View file

@ -6,11 +6,7 @@ class ChecklistSerializer < ActiveModel::Serializer
include ApplicationHelper
include ActionView::Helpers::TextHelper
attributes :id, :name, :urls, :icon, :sa_name, :checklist_items, :parent_type, :placeholder
def placeholder
I18n.t('protocols.steps.checklist.checklist_name')
end
attributes :id, :name, :urls, :icon, :sa_name, :checklist_items, :parent_type
def icon
'fa-list-ul'

View file

@ -4,16 +4,12 @@ class ResultTableSerializer < ActiveModel::Serializer
include Canaid::Helpers::PermissionsHelper
include Rails.application.routes.url_helpers
attributes :name, :contents, :urls, :icon, :metadata, :parent_type, :placeholder
attributes :name, :contents, :urls, :icon, :metadata, :parent_type
def contents
object.contents_utf_8
end
def placeholder
I18n.t('protocols.steps.table.table_name')
end
def icon
'fa-table'
end

View file

@ -4,16 +4,12 @@ class TableSerializer < ActiveModel::Serializer
include Canaid::Helpers::PermissionsHelper
include Rails.application.routes.url_helpers
attributes :name, :contents, :urls, :icon, :metadata, :parent_type, :placeholder
attributes :name, :contents, :urls, :icon, :metadata, :parent_type
def contents
object.contents_utf_8
end
def placeholder
I18n.t('protocols.steps.table.table_name')
end
def icon
'fa-table'
end