Skip to content

Replace deprecated view_component slot setter in more pages

Thomas Hutterer requested to merge thutterer/view_component_slot_setter_5 into master

What does this MR do and why?

This updates all remaining deprecated ViewComponent slot setter usages in the /app/views/admin, /app/views/groups and /app/views/projects.

The old way (c.SLOT_NAME) got deprecated in the later 2.x versions of the view_component gem and now got completely removed in the recent 3.0 release. We have to replace all deprecated calls before we can Upgrade to view_component v3.0 (#408988 - closed).

Because we had hundreds of lines in ~200 files to update, I do it in batches to get smaller, more reviewable MRs. This is one of them. See the checklist in #408988 (closed) for some already merged MRs.

What's special about this one?

I thought I was done with these folders already, replacing only - c.SLOT_NAME, only to later realize we also have a ton of = c.SLOT_NAME. Using - or = makes no difference for ViewComponent slot setters, but the correct way is the -, so I'm streamlining this here (and in all following MRs).

Screenshots or screen recordings

No visual or functional changes.

How to set up and validate locally

  • We are currently on the latest 2.x version of the view_component gem. Both ways to set the slot work here, so there shouldn't be any functional changes, but feel free to browse around in the affected areas of the UI for a few samples.
  • Focus on the diff itself. I've used a regular expression (find: (-|=) c\.(?!with_)(\w+) & replace: - c.with_$2) so please double-check that nothing unintentional was commited. Thanks!

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thomas Hutterer

Merge request reports