fix: put booking details and calendar behind feature flag (#25175)
* Revert "fix: revert bookings redesign (#25172)"
This reverts commit 1f102bf3b4.
* add bookings-v3 feature flag
* put things behind a feature flag
* remove no longer needed test
* revert e2e tests
* put back description
* revert AvatarGroup
* apply feedback
* remove "view" booking action
* remove Alert (When the bookings query errors, this branch now renders only the alert and skips the data-table filter/segment controls. Those controls moved into BookingsList, so in error states users can no longer clear or tweak filters to recover from the failure, effectively trapping them behind the alert.)
* address feedback
* revert useMediaQuery
This commit is contained in:
1 parent
7e4d9e26c6
commit
dd7f108f08
32 files changed
+1547
-689
No files matched your search
@@ -20,8 +20,12 @@ type BaseDataTableWrapperProps<TData> = Omit<
|
||||
ToolbarRight?: React.ReactNode;
|
||||
EmptyView?: React.ReactNode;
|
||||
LoaderView?: React.ReactNode;
|
||||
ErrorView?: React.ReactNode;
|
||||
hasError?: boolean;
|
||||
tableContainerRef?: React.RefObject<HTMLDivElement>;
|
||||
onRowMouseclick?: (row: Row<TData>) => void;
|
||||
rowTestId?: string | ((row: Row<TData>) => string | undefined);
|
||||
rowDataAttributes?: (row: Row<TData>) => Record<string, string> | undefined;
|
||||
};
|
||||
|
||||
type InfinitePaginationProps<TData> = BaseDataTableWrapperProps<TData> & {
|
||||
@@ -54,10 +58,14 @@ export function DataTableWrapper<TData>({
|
||||
ToolbarRight,
|
||||
EmptyView,
|
||||
LoaderView,
|
||||
ErrorView,
|
||||
hasError,
|
||||
className,
|
||||
containerClassName,
|
||||
headerClassName,
|
||||
rowClassName,
|
||||
rowTestId,
|
||||
rowDataAttributes,
|
||||
children,
|
||||
tableContainerRef: externalRef,
|
||||
paginationMode,
|
||||
@@ -97,8 +105,10 @@ export function DataTableWrapper<TData>({
|
||||
}));
|
||||
}, [table, sorting, columnFilters, columnVisibility, setSorting, setColumnVisibility]);
|
||||
|
||||
let view: "loader" | "empty" | "table" = "table";
|
||||
if (isPending && LoaderView) {
|
||||
let view: "loader" | "empty" | "error" | "table" = "table";
|
||||
if (hasError && ErrorView) {
|
||||
view = "error";
|
||||
} else if (isPending && LoaderView) {
|
||||
view = "loader";
|
||||
} else if (table.getRowCount() === 0 && EmptyView) {
|
||||
view = "empty";
|
||||
@@ -118,6 +128,7 @@ export function DataTableWrapper<TData>({
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
{view === "error" && ErrorView}
|
||||
{view === "loader" && LoaderView}
|
||||
{view === "empty" && EmptyView}
|
||||
{view === "table" && (
|
||||
@@ -133,6 +144,8 @@ export function DataTableWrapper<TData>({
|
||||
containerClassName={containerClassName}
|
||||
headerClassName={headerClassName}
|
||||
rowClassName={rowClassName}
|
||||
rowTestId={rowTestId}
|
||||
rowDataAttributes={rowDataAttributes}
|
||||
paginationMode={paginationMode}
|
||||
onRowMouseclick={onRowMouseclick}
|
||||
hasWrapperContext={true}
|
||||
|
||||
Reference in new issue
Block a user