Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CRIMAPP-1553] replace MoJ task list with Govuk one #1299

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

timpeat
Copy link
Member

@timpeat timpeat commented Dec 31, 2024

Description of change

Move to latest GDS task list to address accessibility issues and improve identification of unfinished tasks.

Link to relevant ticket

CRIMAPP-1553

Notes for reviewer

Screenshots of changes (if applicable)

Before changes:

Screenshot 2025-01-03 at 14 33 49 Screenshot 2025-01-03 at 14 35 56

After changes:

Screenshot 2025-01-03 at 14 33 28

How to manually test the feature

@timpeat timpeat force-pushed the CRIMAPP-1553-task-list-accessibility branch from 5be2c21 to 7702a40 Compare January 3, 2025 14:26
@timpeat timpeat changed the title [CRIMAPP-1553] WIP spike using govuk task list [CRIMAPP-1553] replace MoJ task list with Govuk one Jan 3, 2025
@timpeat timpeat force-pushed the CRIMAPP-1553-task-list-accessibility branch from 7702a40 to e8ed131 Compare January 3, 2025 14:31
@timpeat timpeat marked this pull request as ready for review January 3, 2025 14:36
@timpeat timpeat requested a review from a team as a code owner January 3, 2025 14:36

def all_tasks
@all_tasks ||= map(&:items).flatten
all_tasks.reject { |task| task.status.not_applicable? }
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've refactored the section renderer into two distinct parts: a TaskLit::Section (retaining the same class name as the old renderer) and a new TaskList::SectionComponent.

This change was driven by the lack of dedicated models for the TaskList classes. These classes currently encapsulate significant business logic, and could be used elsewhere. I believe moving towards dedicated models for Section, Task etc will improve things.

I've not moved them from the presenter folder, but I think we could. For now I've just separated business logic from view-related concerns.

TaskStatus::IN_PROGRESS => 'light-blue',
TaskStatus::NOT_STARTED => 'blue',
TaskStatus::UNREACHABLE => nil,
TaskStatus::NOT_APPLICABLE => nil
}.freeze

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See for https://design-system.service.gov.uk/patterns/complete-multiple-tasks/ for reasoning for changing the colours here:

Once the user has completed the task, the status should show as ‘Completed’ and be black text with no background colour. This will draw more attention to tasks that require action.

@timpeat timpeat force-pushed the CRIMAPP-1553-task-list-accessibility branch from e8ed131 to 5788b6a Compare January 3, 2025 15:17
tag.strong id: tag_id, class: tag_classes do
t!("tasklist.status.#{status}")
end
def to_hash
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -10,6 +10,10 @@ def initialize(crime_application:)
@crime_application = crime_application
end

def name
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved name here so that we can use the task subclass rather than a sparate task presenter.

@timpeat timpeat added the do not merge Do not merge yet, work in progress label Jan 3, 2025
Copy link
Contributor

@EdwinKruglov EdwinKruglov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactor!

spec/components/task_list/section_component_spec.rb Outdated Show resolved Hide resolved
@timpeat timpeat force-pushed the CRIMAPP-1553-task-list-accessibility branch from 5788b6a to f6b026c Compare January 6, 2025 09:32
@timpeat timpeat removed the do not merge Do not merge yet, work in progress label Jan 6, 2025
@timpeat timpeat merged commit 32e6f57 into main Jan 6, 2025
7 checks passed
@timpeat timpeat deleted the CRIMAPP-1553-task-list-accessibility branch January 6, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants