Skip to content

Commit

Permalink
feat(fworks): component for eval cancelled event
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantk committed Nov 29, 2023
1 parent 708e006 commit ee1a542
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%= render ActivityLog::HistoryItemComponent.new(by:, date:) do |component| %>
<% component.with_title do %>
Evaluation cancelled: <%= link_to evaluation_reference, evaluation, class: "govuk-link", "data-turbo" => false %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

class ActivityLog::Types::Frameworks::Framework::EvaluationCancelledComponent < ViewComponent::Base
include ActivityLog::Types::BasicActivityDetails

def initialize(activity_log_item:)
@activity_log_item = activity_log_item
end

def evaluation
Frameworks::Evaluation.find(@activity_log_item.activity.data["evaluation_id"])
end

delegate :reference, to: :evaluation, prefix: true
end

0 comments on commit ee1a542

Please sign in to comment.