mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 22:25:30 +08:00
15 lines
432 B
Ruby
15 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
|