Skip to content

Commit

Permalink
Improves the text panel initializer similar to graph panel (#6)
Browse files Browse the repository at this point in the history
Since text panel has no datasource property the initializer is currently broken.
Also the dashboard parameter can be optional in graph panel so I copied the same logic here.
  • Loading branch information
cmur2 authored and kalinon committed Dec 21, 2019
1 parent bde07c8 commit 3a310d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/crafana/models/panels/text.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ module Crafana
property mode : String = Crafana::Vars::TEXT_MODE_MARKDOWN
property span : String?

def initialize(@dashboard : Crafana::Dashboard, @datasource)
def initialize(@dashboard : Crafana::Dashboard? = nil)
@panel_type = Crafana::Vars::TEXT_TYPE
@id = @dashboard.next_panel_id
@id = @dashboard.as(Crafana::Dashboard).next_panel_id unless @dashboard.nil?
end
end
end

0 comments on commit 3a310d8

Please sign in to comment.