-
Notifications
You must be signed in to change notification settings - Fork 95
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
[NU-1901] fix deployment status indicator for periodic scenarios #7283
[NU-1901] fix deployment status indicator for periodic scenarios #7283
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in the Despite this change in logic, the overall structure and flow of the Sequence Diagram(s)sequenceDiagram
participant User
participant ActivitiesPanelRow
participant ScenarioState
User->>ActivitiesPanelRow: Interact with activity
ActivitiesPanelRow->>ScenarioState: Check status
ScenarioState-->>ActivitiesPanelRow: Return status (RUNNING/SCHEDULED)
ActivitiesPanelRow->>ActivitiesPanelRow: Update isDeploymentActive based on status
ActivitiesPanelRow-->>User: Render updated state
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (4)designer/client/src/components/toolbars/activities/helpers/activityItemColors.ts (1)
The rename from designer/client/src/components/toolbars/activities/ActivityPanelRowItem/ActivityItem.tsx (1)
The prop rename from Also applies to: 58-58 designer/client/src/components/toolbars/activities/ActivityPanelRowItem/ActivityItemHeader.tsx (2)
The styled component properly reflects the prop rename while maintaining the same styling logic and header color calculations.
The prop rename is consistently applied across:
Also applies to: 233-233, 282-282 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Outside diff range and nitpick comments (1)
designer/client/src/components/toolbars/activities/ActivitiesPanelRow.tsx (1)
30-31
: Consider optimizing the status array definition and type safety.The implementation correctly addresses the periodic scenarios by including both "RUNNING" and "SCHEDULED" statuses. However, there are a few potential improvements:
- Move the array outside the component to prevent recreation on each render:
+const SCENARIO_ACTIVE_DEPLOY_STATUSES = ["RUNNING", "SCHEDULED"] as const; export const ActivitiesPanelRow = memo(({ index, style, setRowHeight, handleShowRows, handleHideRows, activities, searchQuery }: Props) => { - const scenarioStatusesToActiveDeploy = ["RUNNING", "SCHEDULED"]; const isRunning = firstDeployedIndex === index && - scenarioStatusesToActiveDeploy.includes(scenarioState.status.name); + SCENARIO_ACTIVE_DEPLOY_STATUSES.includes(scenarioState.status.name);
- Consider using an enum or type for better type safety:
export enum ScenarioStatus { RUNNING = "RUNNING", SCHEDULED = "SCHEDULED", } const SCENARIO_ACTIVE_DEPLOY_STATUSES = [ ScenarioStatus.RUNNING, ScenarioStatus.SCHEDULED, ] as const;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
designer/client/src/components/toolbars/activities/ActivitiesPanelRow.tsx
(1 hunks)
🔇 Additional comments (1)
designer/client/src/components/toolbars/activities/ActivitiesPanelRow.tsx (1)
30-31
: LGTM! Clean and focused implementation.
The changes effectively solve the periodic scenarios issue while maintaining the component's structure and performance optimizations. The implementation is well-isolated and doesn't introduce any breaking changes.
…-activity-for-periodic-scenarios # Conflicts: # docs/Changelog.md
Describe your changes
Before:

After:

Checklist before merge
Summary by CodeRabbit
New Features
Bug Fixes