generated from dxw/rails-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
228 additions
and
44 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
..._log/types/emails_moved_from_component.rb → ...evaluation/emails_moved_from_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...types/evaluation_transferred_component.rb → ...ation/evaluation_transferred_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...components/activity_log/types/frameworks/framework/evaluation_approved_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 approved: <%= link_to evaluation_reference, evaluation, class: "govuk-link", "data-turbo" => false %> | ||
<% end %> | ||
<% end %> |
15 changes: 15 additions & 0 deletions
15
app/components/activity_log/types/frameworks/framework/evaluation_approved_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class ActivityLog::Types::Frameworks::Framework::EvaluationApprovedComponent < 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 |
5 changes: 5 additions & 0 deletions
5
app/components/activity_log/types/frameworks/framework/evaluation_created_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 created: <%= link_to evaluation_reference, evaluation, class: "govuk-link", "data-turbo" => false %> | ||
<% end %> | ||
<% end %> |
15 changes: 15 additions & 0 deletions
15
app/components/activity_log/types/frameworks/framework/evaluation_created_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
class ActivityLog::Types::Frameworks::Framework::EvaluationCreatedComponent < 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 |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...log/types/evaluation_started_component.rb → ...framework/evaluation_started_component.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
module Frameworks::Evaluation::QuickEditable | ||
extend ActiveSupport::Concern | ||
|
||
def quick_editor(note: latest_note&.body, next_key_date: self.next_key_date, next_key_date_description: self.next_key_date_description) | ||
Frameworks::Evaluation::QuickEditor.new(frameworks_evaluation: self, note:, next_key_date:, next_key_date_description:) | ||
def quick_editor( | ||
note: latest_note.try(:body), | ||
next_key_date: self.next_key_date, | ||
next_key_date_description: self.next_key_date_description, | ||
status: self.status | ||
) | ||
Frameworks::Evaluation::QuickEditor.new( | ||
frameworks_evaluation: self, | ||
note:, | ||
next_key_date:, | ||
next_key_date_description:, | ||
status:, | ||
) | ||
end | ||
|
||
def quick_edit(details) | ||
def quick_edit(details = {}) | ||
transaction do | ||
update!(details.except(:note)) if details[:next_key_date_description].present? | ||
add_note(details[:note]) if details[:note].present? && details[:note] != latest_note&.body | ||
update!(details.except(:note)) if details.except(:note).any? | ||
add_note(details[:note]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
spec/components/activity_log/types/emails_moved_from_component_spec.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.