Skip to content

Conversation

Bubballoo3
Copy link
Contributor

@Bubballoo3 Bubballoo3 commented Sep 18, 2025

Fixes #1648. Mimics the approach taken in

title: I18n.t('dashboard.shell_app_title', cluster_title: cluster.metadata.title || cluster.id.to_s.titleize),

for accessing cluster title but defaulting to id.titleize. While this hurts the style, we will be able to get our terseness back when we implement #4613

label: 'Cluster',
options: clusters.map(&:id)
options: clusters.map do |c|
[c.metadata.title || c.id.to_s.titleize, c.id]
Copy link
Contributor

Choose a reason for hiding this comment

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

We likely need safe traversal here as c.metadata may itself be nil.

@johrstrom
Copy link
Contributor

Thinking about this again we should bury this in ood_core. I've reopened this ticket: OSC/ood_core#899 with a comment.

label: 'Cluster',
options: clusters.map do |c|
[c.metadata.title || c.id.to_s.titleize, c.id]
[c&.metadata&.title || c.id.to_s.titleize, c.id]
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like since we're putting this in ood_core it's just [c.title, c.id] right? Though this'll be on hold until that API exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it will be, so we could either put this on hold until then or merge it now and know that we will be writing over this section before 4.1 is finished. I would also mention that we don't do safe calls on metadata.title anywhere else in the codebase, but I am happy to play it safe here until we get a chance to consider it carefully there.

Copy link
Contributor

Choose a reason for hiding this comment

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

we could either put this on hold until then or merge it now and know that we will be writing over this section before 4.1 is finished

Yea I'd say to hold it.

I would also mention that we don't do safe calls on metadata.title anywhere else

Yea that's what happens when there are reviews or a 2nd pair of eyes!

@Bubballoo3 Bubballoo3 moved this from Awaiting Review to On Hold in PR Review Pipeline Sep 25, 2025
@Bubballoo3 Bubballoo3 moved this from On Hold to Blocked in PR Review Pipeline Sep 25, 2025
@Bubballoo3 Bubballoo3 moved this from Blocked to On Hold in PR Review Pipeline Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: On Hold
Development

Successfully merging this pull request may close these issues.

batch connect forms use cluster prettty name
3 participants