Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5975e49
feat: datacollection grouping
sergiocarracedo Apr 14, 2025
cf0ca9b
feat: datacollection grouping
sergiocarracedo Apr 14, 2025
7a0863a
refactor: grouping types
sergiocarracedo Apr 16, 2025
4e28b46
chore: reorganize stories
sergiocarracedo Apr 17, 2025
58bf040
feat: cards view grouping
sergiocarracedo Apr 17, 2025
a38c9ee
chore: fix types
sergiocarracedo Apr 17, 2025
d868e2b
chore: fix types
sergiocarracedo Apr 22, 2025
16cbb5d
chore: fix types
sergiocarracedo Apr 22, 2025
5695a7e
chore: fix types
sergiocarracedo Apr 22, 2025
f56d166
chore: fix types
sergiocarracedo Apr 22, 2025
7332ee0
chore: fix types
sergiocarracedo Apr 22, 2025
3c6421c
chore: simplify types
sergiocarracedo Apr 22, 2025
29d5a16
chore: add filters in itemCount
sergiocarracedo Apr 23, 2025
f300070
chore: settings folder case
sergiocarracedo Apr 23, 2025
8c2f5cc
chore: rebase fixes
sergiocarracedo May 19, 2025
ca259b6
chore: rebase fixes
sergiocarracedo May 19, 2025
b920f15
docs: add groping docs
sergiocarracedo May 19, 2025
9451bce
feat: grouping header
sergiocarracedo May 21, 2025
fabf906
feat: grouping header
sergiocarracedo May 21, 2025
4684649
fix: key in table
sergiocarracedo May 21, 2025
9a925e4
feat: datacollection group selection
sergiocarracedo May 22, 2025
6e0cfcc
feat: datacollection group selection
sergiocarracedo May 22, 2025
468cc7c
docs: selectable and bulkactions
sergiocarracedo May 23, 2025
7f74a66
chore: fix tests
sergiocarracedo May 23, 2025
8a3cbd5
Merge branch 'main' into FCT-25305-grouping
sergiocarracedo May 28, 2025
6a3024a
chore: fix tests
sergiocarracedo May 23, 2025
07596a4
chore: fix tests
sergiocarracedo May 23, 2025
087b8b6
chore: rebase fixes
sergiocarracedo May 19, 2025
f83774f
chore: rebase main
sergiocarracedo May 22, 2025
8fe1e17
fix: key in table
sergiocarracedo May 21, 2025
e00c1b3
feat: add new activity list component and icon avatar (#1842)
CarlosBM18 May 21, 2025
cd69a1e
feat: datacollection list view
sergiocarracedo May 21, 2025
23ed4fe
chore: rebase card
sergiocarracedo May 22, 2025
a0d52b2
refactor: modular visualizacion type
sergiocarracedo May 22, 2025
b62433b
fix: empty records
sergiocarracedo May 26, 2025
2c15b48
docs: visualizations
sergiocarracedo May 26, 2025
c7d803a
chore: rebase fixes
sergiocarracedo May 28, 2025
23f8c34
chore: fix tests
sergiocarracedo May 23, 2025
e30e4ac
Merge branch 'main' into FCT-25305-grouping
sergiocarracedo May 29, 2025
c8717f6
Merge branch 'main' into FCT-25305-grouping
sergiocarracedo May 29, 2025
0c61785
Merge branch 'FCT-25305-grouping' into FCT-26242-list-view
sergiocarracedo May 30, 2025
eacfad8
feat: sortingselector
sergiocarracedo May 30, 2025
dd974af
Merge branch 'FCT-25305-grouping' into FCT-26242-datacollection-list-…
sergiocarracedo May 30, 2025
3f19b0c
chore: fix currentGrouping type when mandatory
sergiocarracedo May 30, 2025
0d9cff2
chore: fix tests
sergiocarracedo May 30, 2025
cd30142
feat: datacollection grouping
sergiocarracedo Apr 14, 2025
5a8068b
feat: datacollection grouping
sergiocarracedo Apr 14, 2025
5afa85f
refactor: grouping types
sergiocarracedo Apr 16, 2025
c411d47
chore: reorganize stories
sergiocarracedo Apr 17, 2025
f5774e7
feat: cards view grouping
sergiocarracedo Apr 17, 2025
747775d
chore: fix types
sergiocarracedo Apr 17, 2025
7fb1009
chore: fix types
sergiocarracedo Apr 22, 2025
90d0c35
chore: fix types
sergiocarracedo Apr 22, 2025
2f6f1d2
chore: fix types
sergiocarracedo Apr 22, 2025
c69b3f2
chore: fix types
sergiocarracedo Apr 22, 2025
5ddbd18
chore: fix types
sergiocarracedo Apr 22, 2025
a233d2c
chore: simplify types
sergiocarracedo Apr 22, 2025
b52cd33
chore: add filters in itemCount
sergiocarracedo Apr 23, 2025
46a42c6
chore: settings folder case
sergiocarracedo Apr 23, 2025
3efd2ef
chore: rebase fixes
sergiocarracedo May 19, 2025
e1df0a8
chore: rebase fixes
sergiocarracedo May 19, 2025
cf5edeb
docs: add groping docs
sergiocarracedo May 19, 2025
62f4140
feat: grouping header
sergiocarracedo May 21, 2025
8ae56c2
feat: grouping header
sergiocarracedo May 21, 2025
9ff7e55
fix: key in table
sergiocarracedo May 21, 2025
c37e5a2
feat: datacollection group selection
sergiocarracedo May 22, 2025
73e4b9c
feat: datacollection group selection
sergiocarracedo May 22, 2025
f2e269e
docs: selectable and bulkactions
sergiocarracedo May 23, 2025
9745fd2
chore: fix tests
sergiocarracedo May 23, 2025
1248595
chore: fix tests
sergiocarracedo May 23, 2025
e0e976f
chore: rebase main
sergiocarracedo Jun 2, 2025
64fa404
chore: merge grouping
sergiocarracedo Jun 2, 2025
a82b7f1
feat(datacollection): dynamic cols def from fetcher
sergiocarracedo Jun 5, 2025
54c50a1
Merge branch 'FCT-26242-datacollection-list-view' into FCT-30936-po-c…
sergiocarracedo Jun 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .cursor/rules/02-typescript-testing.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ alwaysApply: false
- Implement proper generic constraints.

# Testing Standards
- Write **Vitest** unit tests for utilities and hooks.
- Write **Vitest** unit tests for utilities and hooks and components.
- Create **Storybook stories** for visual testing.
- Include **accessibility tests** using axe-playwright.
- Test component variants and edge cases.
- Avoid excessive mocking; test behavior, not internals.
- Always run tests to confirm changes.
- Do not import `@testing-library/jest-dom`
- Import vitest methods like: describe, it, expect, etc. explicitily
- name test files with `.test.tsx` or `.test.ts`, never with `.specs.ts`

## Example with Icon component

Expand Down
50 changes: 50 additions & 0 deletions packages/react/src/components/Utilities/Await/Await.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { ReactNode, useEffect, useState } from "react"

type AwaitProps<T> = {
resolve: Promise<T> | T
fallback: ReactNode
error?: ReactNode
className?: string
children: (value: T) => ReactNode
}

export const Await = <T,>({
resolve,
fallback,
error: errorFallback,
children,
}: AwaitProps<T>): ReactNode => {
const [resolvedValue, setResolvedValue] = useState<T | null>(null)
const [error, setError] = useState<Error | null>(null)
const [isPending, setIsPending] = useState(false)

useEffect(() => {
if (resolve instanceof Promise) {
setIsPending(true)
resolve
.then((value) => {
setResolvedValue(value)
})
.catch((error) => {
setError(error)
})
.finally(() => {
setIsPending(false)
})
} else {
setResolvedValue(resolve)
setIsPending(false)
}
}, [resolve])

if (isPending) {
return fallback
}
if (error) {
return errorFallback ?? null
}
if (resolvedValue) {
return children(resolvedValue)
}
return null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import type { Meta, StoryObj } from "@storybook/react"

import { Button } from "@/components/Actions/Button"
import { Skeleton } from "@/ui/skeleton"
import { ComponentProps, useCallback, useEffect, useState } from "react"
import { Await } from "../index"

const ExampleComponent = (args: Story["args"]) => {
const [count, setCount] = useState(0)
const [value, setValue] = useState<Promise<string> | null>(null)

const triggerPromise = useCallback(() => {
setValue(
new Promise((resolve) =>
setTimeout(() => resolve(`${args.resolve as string} - ${count}`), 1000)
)
)
setCount(count + 1)
}, [args.resolve, count])

useEffect(() => {
triggerPromise()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
<>
<div style={{ marginBottom: "20px" }}>
<Button onClick={() => triggerPromise()} label="Trigger promise" />
</div>
<Await fallback={args.fallback} resolve={value}>
{args.children}
</Await>
</>
)
}

const meta = {
title: "Await",
component: Await,
argTypes: {
fallback: {
description:
"Fallback to display when the promise is pending. It can be a ReactNode",
},
resolve: {
description:
"Value to await for, it can be a promise or a primitive value",
},
error: {
description: "Error to display when the promise is rejected",
},
children: {
description:
"Children to display when the promise is resolved. It's a function that gets the resolved value as an argument",
},
},
parameters: {
layout: "centered",
docs: {
description: {
component:
"This is an utility component. The `Await` component is used to display a fallback component when a promise is resolved, but it accepts a promise or a primitive value as a prop, you don't need to take care. ",
},
},
},
tags: ["autodocs", "stable"],
} satisfies Meta<ComponentProps<typeof Await>>

export default meta
type Story = StoryObj<typeof meta>

export const Default: Story = {
render: (args) => <ExampleComponent {...args} />,
args: {
resolve: "Hello",
fallback: "Loading...",
children: (value) => `${value}`,
},
}

export const WithSkeleton: Story = {
render: (args) => <ExampleComponent {...args} />,
args: {
resolve: "Hello",
fallback: <Skeleton className="h-4 w-full" />,
children: (value) => `${value}`,
},
}
1 change: 1 addition & 0 deletions packages/react/src/components/Utilities/Await/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Await"
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ interface CheckboxProps extends DataAttributes {
* @default false
*/
presentational?: boolean

/**
* Whether the checkbox should stop event propagation
* @default false
*/
stopPropagation?: boolean
}

export function Checkbox({
Expand All @@ -62,6 +68,7 @@ export function Checkbox({
value,
hideLabel = false,
presentational = false,
stopPropagation = false,
...rest
}: CheckboxProps) {
return (
Expand All @@ -75,6 +82,7 @@ export function Checkbox({
value={value}
hideLabel={hideLabel}
tabIndex={presentational ? -1 : undefined}
onClick={(e) => stopPropagation && e.stopPropagation()}
{...rest}
/>
)
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/experimental/OneCard/OneCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export function OneCard({
{link && (
<Link
href={link}
className={cn("absolute inset-0 z-0 block rounded-xl", focusRing())}
style={{
zIndex: 1,
}}
className={cn("z-1 absolute inset-0 block rounded-xl", focusRing())}
aria-label={title}
/>
)}
Expand Down

This file was deleted.

Loading
Loading