Standup Updates should be rich text, so that they can support links, images, attachments, and so forth
This implementations should be pretty straight forward since Action Text is already installed. So my proposal would be to add new rich text fields to the standup_meeting model and add the new rich fields to the form
class StandupMeeting < ApplicationRecord
...
has_rich_text :yesterdays_description
has_rich_text :todays_description
has_rich_text :blockers
end
<div class="flex flex-col justify-between space-y-2">
<%= form.label :yesterdays_description, '1. What did you work on yesterday? (or last working day)', class: 'mb-4 md:mb-0' %>
<%= form.rich_text_area :yesterdays_description, required: true, class: 'textarea-lg textarea-primary textarea', placeholder: 'e.g., Got the first version of feature X up in a draft PR' %>
</div>
<div class="flex flex-col justify-between space-y-2">
<%= form.label :todays_description, '2. What do you plan on working on today?', class: 'mb-4 md:mb-0' %>
<%= form.rich_text_area :todays_description, required: true, class: 'textarea-lg textarea-primary textarea', placeholder: "e.g., 1. Review some outstanding PRs\\n2. Push forward on second feature" %>
</div>
<div class="flex flex-col justify-between space-y-2">
<%= form.label :blockers, '3. Do you have any blockers? (Leave empty if none)', class: 'mb-4 md:mb-0' %>
<%= form.rich_text_area :blockers, required: true, class: 'textarea-lg textarea-primary textarea' %>
</div>
div
<%= render StandupMeeting::MeetingColumnComponent.new(title: "Previous Work Day") do |component| %>
<%= render StandupMeeting::MeetingUpdateComponent.with_collection(@completed_meetings, content_type: :yesterdays_description) %>
<% end %>
<%= render StandupMeeting::MeetingColumnComponent.new(title: "Today's Work Day") do |component| %>
<%= render StandupMeeting::MeetingUpdateComponent.with_collection(@completed_meetings, content_type: :todays_description) %>
<% end %>
<%= render StandupMeeting::MeetingColumnComponent.new(title: "Blockers") do |component| %>
<%= render StandupMeeting::MeetingUpdateComponent.with_collection(@completed_meetings, content_type: :blockers) %>
<% end %>
As I reviewed the documentation, the current today_work_description and yesterday_work_description columns are not be needed. So To avoid repeated code, we should remove those to columns. But before they are removed, we’ll need to migrate the existing data in this columns over to the Action Text table
class MigrateStandupMeetingDataToActionText < ActiveRecord::Migration[7.0]
def change
def up
StandupMeeting.where(status: 'completed').find_each do |meeting|
meeting.update!(
# The read_attribute_before_type_cast method is used to get the raw value of the attribute and assign it to the new column intact.
today_work_description: meeting.read_attribute_before_type_cast(:today_work_description),
yesterday_work_description: meeting.read_attribute_before_type_cast(:yesterday_work_description)
blockers_description: meeting.read_attribute_before_type_cast(:blockers_description)
)
end
end
end
end