feat: add logs link to environment cards in deploy tab#461
feat: add logs link to environment cards in deploy tab#461kaviththiranga wants to merge 1 commit intoopenchoreo:mainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis change adds a direct link to environment logs within the environment card by introducing a new Changes
Sequence DiagramsequenceDiagram
participant EL as EnvironmentsList
participant EH as useEntityLinks Hook
participant BP as buildRuntimeLogsPath
participant EC as EnvironmentCard
participant ECC as EnvironmentCardContent
participant UI as Rendered Button
EL->>EH: useEntityLinks(entity)
EH->>BP: buildRuntimeLogsPath(logsBase, env.name)
BP-->>EH: logsUrl (with ?env query param)
EH-->>EL: EntityLinks object with runtimeLogs fn
EL->>EC: Pass logsUrl prop
EC->>ECC: Forward logsUrl prop
ECC->>ECC: Conditional: if logsUrl && status truthy
ECC->>UI: Render "View Logs" button with href
UI-->>EL: Ready for user interaction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/openchoreo/src/components/Environments/components/EnvironmentCardContent.tsx (1)
112-113: Consider: The empty<span />for layout alignment.The empty span maintains layout spacing when there's no
releaseName. This works but could be slightly cleaner using CSSmarginLeft: 'auto'on the logs group instead, which would eliminate the need for a placeholder element.♻️ Optional alternative approach
- {releaseName ? ( - <Button - variant="outlined" - ... - > - View K8s Artifacts - </Button> - ) : ( - <span /> - )} {logsUrl && status && ( <Box display="flex" alignItems="stretch" className={classes.viewLogsGroup} + style={{ marginLeft: releaseName ? undefined : 'auto' }} >🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugins/openchoreo/src/components/Environments/components/EnvironmentCardContent.tsx` around lines 112 - 113, The empty <span /> used when releaseName is missing is only present for spacing; remove that placeholder and instead apply CSS marginLeft: 'auto' (or a utility class that sets margin-left: auto) to the logs group container in the EnvironmentCardContent JSX so the logs group will right-align itself when releaseName is absent; update the JSX by deleting the <span /> fallback and add the style/class to the element that renders the logs group (referencing EnvironmentCardContent and the releaseName conditional).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@plugins/openchoreo/src/components/Environments/components/EnvironmentCardContent.tsx`:
- Around line 112-113: The empty <span /> used when releaseName is missing is
only present for spacing; remove that placeholder and instead apply CSS
marginLeft: 'auto' (or a utility class that sets margin-left: auto) to the logs
group container in the EnvironmentCardContent JSX so the logs group will
right-align itself when releaseName is absent; update the JSX by deleting the
<span /> fallback and add the style/class to the element that renders the logs
group (referencing EnvironmentCardContent and the releaseName conditional).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e3167620-bb77-4560-af20-700c006057c3
📒 Files selected for processing (8)
plugins/openchoreo-react/src/routing/index.tsplugins/openchoreo-react/src/routing/pathBuilders.tsplugins/openchoreo-react/src/routing/useEntityLinks.tsplugins/openchoreo/src/components/Environments/EnvironmentsList.tsxplugins/openchoreo/src/components/Environments/components/EnvironmentCard.tsxplugins/openchoreo/src/components/Environments/components/EnvironmentCardContent.tsxplugins/openchoreo/src/components/Environments/styles.tsplugins/openchoreo/src/components/Environments/types.ts
Each environment card now shows a "Logs" row with an open-in-new-tab icon that navigates to the runtime logs page with the relevant environment filter pre-selected. fixes: openchoreo/openchoreo#2910 Signed-off-by: Kavith Lokuhewage <kaviththiranga@gmail.com>
bdaaf4a to
2e0df4b
Compare
Each environment card now shows a "Logs" row with an open-in-new-tab
icon that navigates to the runtime logs page with the relevant
environment filter pre-selected.
fixes: openchoreo/openchoreo#2910

Summary by CodeRabbit