mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-24 08:43:13 +08:00
14 lines
432 B
Ruby
14 lines
432 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Reports
|
|
class TemplateValueComponent < ApplicationComponent
|
|
def initialize(report:, name:, label:, placeholder: nil, editing: true)
|
|
@report = report
|
|
@name = name
|
|
@label = label
|
|
@placeholder = placeholder
|
|
@editing = editing
|
|
@value = @report.report_template_values.find_by(view_component: self.class.name.demodulize, name: name)&.value
|
|
end
|
|
end
|
|
end
|