Skip to content

Administrate improvement and updates #2436

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

A-Wheeto
Copy link
Contributor

@A-Wheeto A-Wheeto commented Jun 16, 2025

Status

Review progress:

  • Browser tested
  • Front-end review completed
  • Tech review completed

What's changed?

  • Removed hubs and hub regions from administrate as no longer used
  • Organised routes so dashboards now show in alphabetical order
  • Added a new programme dashboard that shows an overview of
    • programme activity groupings
    • pathways
    • assessments
  • Minor updates to reports dashboard

image

Steps to perform after deploying to production

If the production environment requires any extra work after this PR has been deployed detail it here. This could be running a Rake task, migrating a DB table, or upgrading a Gem. That kind of thing.

@tc-deploybot tc-deploybot temporarily deployed to teachcomputing-pr-2436 June 16, 2025 15:02 Inactive
@A-Wheeto A-Wheeto temporarily deployed to teachcomputing-pr-2436 June 17, 2025 12:29 Inactive
@A-Wheeto A-Wheeto temporarily deployed to teachcomputing-pr-2436 June 17, 2025 12:45 Inactive
@A-Wheeto A-Wheeto temporarily deployed to teachcomputing-pr-2436 June 17, 2025 13:12 Inactive
@A-Wheeto A-Wheeto force-pushed the 2739-programme-overview-in-administrate branch from a118f38 to 4100fe4 Compare July 15, 2025 08:06
@barrywoolgar barrywoolgar self-requested a review July 15, 2025 08:07
@tc-deploybot tc-deploybot temporarily deployed to teachcomputing-pr-2436 July 15, 2025 08:20 Inactive
Copy link
Contributor

@barrywoolgar barrywoolgar left a comment

Choose a reason for hiding this comment

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

One micro-optimisation of note, but otherwise this looks good to me. Thanks Adam!

<% @programme.pathways.each do |pathway| %>
<tr>
<td><%= pathway.title %></td>
<td><%= pathway.pathway_activities.count %></td>
Copy link
Contributor

Choose a reason for hiding this comment

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

Using .count on an association you've eager loaded will be triggering an extra SQL query unnecessarily. In Rails it's best to prefer .size over .count as the former will first check if the collection has already been loaded into memory, and count that instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good tip, I'll update this to .size, thanks Barry!

Comment on lines +4 to +10
@programmes = [
Programme.cs_accelerator,
Programme.primary_certificate,
Programme.secondary_certificate,
Programme.i_belong,
Programme.a_level
].compact.sort_by(&:title)
Copy link
Contributor

Choose a reason for hiding this comment

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

This raised an eyebrow at first, but I then realised this is just 5 records being sorted in memory, not 5 sets of records.

@A-Wheeto A-Wheeto temporarily deployed to teachcomputing-pr-2436 July 15, 2025 11:56 Inactive
@A-Wheeto A-Wheeto temporarily deployed to teachcomputing-pr-2436 July 15, 2025 12:03 Inactive
Copy link

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.

3 participants