mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
## Summary - Adds null check for `table.columns` in `CreateWrapperSheet` and `EditWrapperSheet` to prevent runtime errors when columns are undefined - Fixes TypeError: "can't access property 'map', e.columns is undefined" on `/dashboard/project/[ref]/integrations/stripe_wrapper/overview` ## Problem When viewing the Stripe wrapper integration overview page, users encounter a JavaScript error because `table.columns` can be undefined in some cases, but the code attempts to call `.map()` on it directly. ## Solution Changed `table.columns.map(...)` to `(table.columns ?? []).map(...)` to safely handle cases where columns is undefined by defaulting to an empty array. ## Test plan - [ ] Navigate to `/dashboard/project/[ref]/integrations/stripe_wrapper/overview` with a wrapper that has tables with undefined columns - [ ] Verify no JavaScript error occurs - [ ] Verify tables without columns display correctly (showing "Columns: " with nothing after) --- Slack thread: https://supabase.slack.com/archives/C063LNYJJKS/p1776067210776939?thread_ts=1776067141.988569&cid=C063LNYJJKS https://claude.ai/code/session_01N6nyTggA68yktWg4b46ssL <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed a stability issue in wrapper integrations where missing or undefined column information from foreign tables could cause display problems. The interface now safely handles these edge cases with improved spacing and more reliable column rendering, ensuring consistent and predictable presentation of integration data regardless of data availability or table configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude <noreply@anthropic.com>
Writing components
Where to create your components
- For components that declare the general structure and layout of a page:
/components/layouts/xxx
- For components that are tightly coupled to a specific interface:
/components/interfaces/xxx
- For components that are meant to be reusable across multiple pages:
/components/ui/xxx
- Note: We're gradually moving files out of the
to-be-cleanedfolder into the respective folders as we refactor
Component structure
- If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an
index.tsxas an entry point - Otherwise it can just be a file on its own
- For example:
-
components/ui - SampleComponentA - SampleComponentA.tsx - SampleComponentA.constants.ts - SampleComponentA.utils.ts - SampleComponentA.types.ts - index.ts - SampleComponentB.tsx
-
Template for building components
// Declare the prop types of your component
interface ComponentAProps {
sampleProp: string
}
// Name your component accordingly
const ComponentA = ({ sampleProp }: ComponentAProps) => {
return <div>ComponentA: {sampleProp}</div>
}
export default ComponentA