[WEB-4514]chore: moved EIssueLayoutTypes enum to types#7416
Conversation
WalkthroughThe changes move the definition and import of the Changes
Sequence Diagram(s)sequenceDiagram
participant File as Any Consuming File
participant Types as @plane/types
participant Constants as @plane/constants
File->>Types: import { EIssueLayoutTypes }
Note right of Types: EIssueLayoutTypes is now defined and exported here
File--xConstants: (No longer imports EIssueLayoutTypes)
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (2)
apps/web/core/store/issue/helpers/issue-filter-helper.store.ts (1)
218-226: Broken index check causes false negatives and a crash
currentFilterIndexis a number.
!currentFilterIndextreats index0as “not found”, and accessing.lengthon a number (currentFilterIndex.length) throws at runtime.- if (!currentFilterIndex && currentFilterIndex.length < 0) return undefined; + // ‑1 means “not found”; 0 is a valid index + if (currentFilterIndex < 0) return undefined;packages/constants/src/issue/layout.ts (1)
34-60: Potential runtime holes inISSUE_LAYOUT_MAPIf the enum value stays
"gantt_chart"whilekeyis typed asEIssueLayoutTypes, the map is internally consistent.
However downstream consumers that do something like:ISSUE_LAYOUT_MAP["gantt"]will now return
undefined, whereas that worked before.
Please add an exhaustive unit-test that iterates overEIssueLayoutTypesand asserts that every enum member is present inISSUE_LAYOUT_MAPand vice-versa. That would have caught this regression.
🧹 Nitpick comments (1)
apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(list)/mobile-header.tsx (1)
9-17: Import source updated – good.Same observation as in the modules header: ensure
ISSUE_LAYOUTSkeys line up with the enum’s literal values to preserve type-safety.Consider exporting
ISSUE_LAYOUTSfrom@plane/types(or co-locating it with the enum) in a future cleanup so the layout metadata and enum stay in one place.
Description
This update moves
EIssueLayoutTypesenum from constants to types.Type of Change
Summary by CodeRabbit