Skip to content

Conversation

@nachandr
Copy link
Contributor

@nachandr nachandr commented Oct 30, 2025

Resolves Jira 6244

Summary by CodeRabbit

  • New Features
    • Added a credential tooltip for Cloud Foundry platform configuration to help users choose the correct source-control credential type.
    • Tooltip text added to translations so the help copy displays in the UI.
  • UI Improvements
    • Credentials field now shows contextual help (popover) when a Cloud Foundry platform is selected.

@coderabbitai
Copy link

coderabbitai bot commented Oct 30, 2025

Walkthrough

Added a translation key for Cloud Foundry credential tooltips, extended the platform-kind KIND_MAP and hook to include a credential tooltip key, and updated the platform form to show a credential tooltip Popover for credentials when applicable.

Changes

Cohort / File(s) Summary
Translations
client/public/locales/en/translation.json
Added platformKind.cloudfoundry.credentialTooltip with value "Use credential of type source control".
Hook & form UI
client/src/app/hooks/usePlatformKindList.ts, client/src/app/pages/source-platforms/components/platform-form.tsx
Extended KIND_MAP entries to include credentialTooltipKey (added for cloudfoundry), added getCredentialTooltip(kind) (returned from usePlatformKindList), and wired a conditional Popover/HelpIcon in the credentials field to display the translated credential tooltip for the selected kind.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Form as PlatformFormRenderer
  participant Hook as usePlatformKindList
  participant I18n as i18n/translation.json
  Note over Form,Hook: User opens / edits platform form
  Form->>Hook: getCredentialTooltip(selectedKind)
  Hook->>I18n: lookup credentialTooltipKey for kind
  I18n-->>Hook: translated tooltip text (or empty)
  alt tooltip text present
    Hook-->>Form: tooltip text
    Form->>Form: render HelpIcon -> Popover with text
  else no tooltip
    Hook-->>Form: empty string
    Form->>Form: no Popover rendered
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: KIND_MAP type changes and usage sites.
  • Verify translation key naming and that the hook returns an empty string for undefined/null kinds.
  • Confirm the Popover/HelpIcon accessibility and placement in platform-form.tsx.

Possibly related PRs

Suggested reviewers

  • ibolton336
  • rszwajko
  • sjd78

Poem

🐰 A little hop, a helpful hint to show,
Cloud Foundry credentials now softly glow.
KIND_MAP grows a twig, translations take flight,
A popover blooms — tooltip snug and bright. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning PR description lacks required title prefix emoji and provides minimal context about changes. Add appropriate emoji prefix (e.g., ✨ for feature) to title and provide brief summary of the tooltip addition and affected components.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a tooltip for the Cloud Foundry credential field on the create platform wizard, with an appropriate 🐛 prefix.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 786b3cf and 99c03de.

📒 Files selected for processing (2)
  • client/public/locales/en/translation.json (1 hunks)
  • client/src/app/hooks/usePlatformKindList.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-29T16:01:04.207Z
Learnt from: sjd78
Repo: konveyor/tackle2-ui PR: 2583
File: client/src/app/pages/identities/components/identity-form/kind-source-form.tsx:17-26
Timestamp: 2025-08-29T16:01:04.207Z
Learning: Skip i18n/internationalization suggestions for the file client/src/app/pages/identities/components/identity-form/kind-source-form.tsx - hardcoded strings like "Username/Password" and "Private Key/Passphrase" should remain as-is.

Applied to files:

  • client/src/app/hooks/usePlatformKindList.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (3)
client/public/locales/en/translation.json (1)

877-878: LGTM! Translation key added correctly.

The new credentialTooltip translation key follows the existing naming convention and the JSON structure is valid.

client/src/app/hooks/usePlatformKindList.ts (2)

54-62: LGTM! Function implementation follows existing patterns.

The getCredentialTooltip function correctly mirrors the implementation pattern of getUrlTooltip, with proper null/undefined handling and an appropriate fallback to an empty string. Once the translation key issue on Line 17 is fixed, this will work as expected.


64-64: LGTM! Public API correctly extended.

The return statement properly exposes the new getCredentialTooltip function, maintaining a consistent API pattern with the existing helpers.

@nachandr nachandr force-pushed the cf_credential_tooltip branch from 99c03de to 2f3a25f Compare October 31, 2025 20:23
@nachandr nachandr changed the title [WIP] Add tooltip for Cloud Foundry credential on create platform wizard 🐛 Add tooltip for Cloud Foundry credential on create platform wizard Oct 31, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
client/src/app/pages/source-platforms/components/platform-form.tsx (1)

236-249: LGTM! Tooltip implementation follows established patterns.

The credential field tooltip correctly mirrors the URL field tooltip implementation (lines 215-228):

  • Conditional rendering based on tooltip availability
  • Proper accessibility with descriptive aria-label
  • Prevents default button behavior
  • Uses PatternFly's Popover and HelpIcon components consistently

Optional: Consider extracting the Popover pattern to reduce duplication.

Since the URL and credentials fields use identical Popover patterns, you could extract this into a reusable TooltipIcon component:

const TooltipIcon: React.FC<{ tooltip: string; ariaLabel: string }> = ({ tooltip, ariaLabel }) => (
  <Popover bodyContent={<div>{tooltip}</div>}>
    <button
      type="button"
      aria-label={ariaLabel}
      onClick={(e) => e.preventDefault()}
      className="pf-v5-c-button pf-m-plain"
    >
      <HelpIcon />
    </button>
  </Popover>
);

Then use it as:

labelIcon={
  getCredentialTooltip(selectedKind) ? (
    <TooltipIcon 
      tooltip={getCredentialTooltip(selectedKind)} 
      ariaLabel="More info for credential field" 
    />
  ) : undefined
}

This is entirely optional and can be deferred to reduce duplication across the codebase later.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99c03de and 2f3a25f.

📒 Files selected for processing (3)
  • client/public/locales/en/translation.json (1 hunks)
  • client/src/app/hooks/usePlatformKindList.ts (2 hunks)
  • client/src/app/pages/source-platforms/components/platform-form.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • client/public/locales/en/translation.json
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-08-29T16:01:04.207Z
Learnt from: sjd78
Repo: konveyor/tackle2-ui PR: 2583
File: client/src/app/pages/identities/components/identity-form/kind-source-form.tsx:17-26
Timestamp: 2025-08-29T16:01:04.207Z
Learning: Skip i18n/internationalization suggestions for the file client/src/app/pages/identities/components/identity-form/kind-source-form.tsx - hardcoded strings like "Username/Password" and "Private Key/Passphrase" should remain as-is.

Applied to files:

  • client/src/app/hooks/usePlatformKindList.ts
  • client/src/app/pages/source-platforms/components/platform-form.tsx
📚 Learning: 2025-07-29T14:20:50.580Z
Learnt from: sjd78
Repo: konveyor/tackle2-ui PR: 2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: The TargetCard component operates independently from the usePlatformProviderList hook and source platform functionality. References to cloud providers like "Azure" in TargetCard are unrelated to the platform provider list changes and serve a different purpose in the application.

Applied to files:

  • client/src/app/pages/source-platforms/components/platform-form.tsx
📚 Learning: 2025-07-29T14:20:50.580Z
Learnt from: sjd78
Repo: konveyor/tackle2-ui PR: 2468
File: client/src/app/pages/source-platforms/usePlatformProviderList.ts:1-3
Timestamp: 2025-07-29T14:20:50.580Z
Learning: TargetCard component is focused on transformation targets, not source platform providers. It imports Target/TargetLabel models and operates independently from usePlatformProviderList. The codebase maintains clear separation between source platforms (managed by usePlatformProviderList) and transformation targets (managed by TargetCard).

Applied to files:

  • client/src/app/pages/source-platforms/components/platform-form.tsx
🧬 Code graph analysis (1)
client/src/app/pages/source-platforms/components/platform-form.tsx (1)
client/src/app/hooks/usePlatformKindList.ts (1)
  • usePlatformKindList (22-65)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit-test
  • GitHub Check: build-and-upload-for-global-ci
🔇 Additional comments (4)
client/src/app/hooks/usePlatformKindList.ts (3)

10-17: LGTM! Type extension and translation key are correct.

The KIND_MAP type has been properly extended to include credentialTooltipKey, and the cloudfoundry entry uses the correct translation key "platformKind.cloudfoundry.credentialTooltip" instead of a literal string. This follows the established pattern for labelKey and urlTooltipKey.


54-62: LGTM! Implementation follows existing patterns.

The getCredentialTooltip function correctly mirrors the implementation pattern of getUrlTooltip and getDisplayLabel:

  • Proper null/undefined checks before accessing KIND_MAP
  • Safe use of non-null assertion after has() check
  • Correctly wrapped in useCallback with appropriate dependency
  • Returns empty string for unknown/missing kinds

64-64: LGTM! Public API appropriately extended.

The hook now exposes getCredentialTooltip alongside the existing utilities, maintaining a clean and consistent API surface.

client/src/app/pages/source-platforms/components/platform-form.tsx (1)

64-64: LGTM! Hook integration is correct.

The getCredentialTooltip function is properly destructured from usePlatformKindList() alongside the existing tooltip utilities, maintaining consistency with the URL tooltip implementation pattern.

@nachandr nachandr self-assigned this Nov 3, 2025
@nachandr nachandr added this to Planning Nov 3, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Planning Nov 3, 2025
@nachandr nachandr moved this from 🆕 New to 🏗 In progress in Planning Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

1 participant