[8542] Fix NPM builds for studio-ui and guest#4789
[8542] Fix NPM builds for studio-ui and guest#4789jvega190 wants to merge 6 commits intocraftercms:developfrom
Conversation
WalkthroughAdded explicit default Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@ui/guest/src/store/epics/root.ts`:
- Around line 582-583: The code casts field.properties?.rteConfiguration?.value
to string for the setupId lookup, which masks the declared union type (string |
boolean | number) and can break state.rteConfig[setupId]; update the lookup to
handle the union safely: validate or coerce
field.properties?.rteConfiguration?.value at runtime (e.g., check typeof value
=== 'string' and use fallback 'generic' otherwise) before assigning setupId and
then use setup = state.rteConfig[setupId] ?? Object.values(state.rteConfig)[0]
?? {}; ensure references to setupId and the rtcConfig lookup (state.rteConfig)
use the validated/coerced string so no type cast is needed.
🧹 Nitpick comments (3)
ui/app/src/components/FormsEngine/components/StickyBox.tsx (1)
17-20: Consider consolidating the tworeactimports into one.Other files in this PR (e.g.,
FeaturedButton.tsx,SortableList.tsx) combine theReactdefault import with named imports in a single statement. Keeping it consistent here avoids having two import lines from the same module.♻️ Suggested consolidation
-import React from 'react'; import { styled } from '@mui/material/styles'; import Box from '@mui/material/Box'; -import { PropsWithChildren, useEffect, useRef, useState } from 'react'; +import React, { PropsWithChildren, useEffect, useRef, useState } from 'react';ui/app/src/components/ImageEditorDialog/ImageEditorDialogContainer.tsx (1)
17-20: Consider consolidating the tworeactimports into one.Same pattern as noted in
StickyBox.tsx— the default and named imports from'react'can be combined into a single statement for consistency with other files in this PR.♻️ Suggested consolidation
-import React from 'react'; import { DialogBody } from '../DialogBody'; import { DialogFooter } from '../DialogFooter'; -import { useRef, useState } from 'react'; +import React, { useRef, useState } from 'react';ui/app/src/components/FormsEngine/components/ContentPicker.tsx (1)
17-25: Consider consolidating the tworeactimports into one.Same pattern as other files in this PR — the default and named imports can be combined.
♻️ Suggested consolidation
-import React from 'react'; import FormControl from '@mui/material/FormControl'; import FormLabel from '@mui/material/FormLabel'; import RadioGroup from '@mui/material/RadioGroup'; import FormControlLabel from '@mui/material/FormControlLabel'; import Radio from '@mui/material/Radio'; import Box from '@mui/material/Box'; import Typography from '@mui/material/Typography'; -import { ReactNode, SyntheticEvent } from 'react'; +import React, { ReactNode, SyntheticEvent } from 'react';
craftercms/craftercms#8542
Summary by CodeRabbit
Bug Fixes
Style