mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
feat: disposition modal, persistent top bar, pagination, QA fixes
- DispositionModal: single modal for all call endings. Dismissable (agent can resume call). Agent clicks End → modal → select reason → hangup + dispose. Caller disconnects → same modal. - One call screen: CallWidget stripped to ringing notification + auto-redirect to Call Desk. - Persistent top bar in AppShell: agent status toggle + network indicator on all pages. - Network indicator always visible (Connected/Unstable/No connection). - Pagination: Untitled UI PaginationCardDefault on Call History + Appointments (20/page). - Pinned table headers/footers: sticky column headers, scrollable body, pinned pagination. Applied to Call Desk worklist, Call History, Appointments, Call Recordings, Missed Calls. - "Patient" → "Caller" column label in Call History. - Offline → Ready toggle enabled. - Profile status dot reflects Ozonetel state. - NavAccountCard: popover placement top, View Profile + Account Settings restored. - WIP pages for /profile and /account-settings. - Enquiry form PHONE_INQUIRY → PHONE enum fix. - Force Ready / View Profile / Account Settings removed then restored properly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import type { FC } from "react";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faArrowLeft, faArrowRight } from "@fortawesome/pro-duotone-svg-icons";
|
||||
import { Button } from "@/components/base/buttons/button";
|
||||
|
||||
const ArrowLeft: FC<{ className?: string }> = ({ className }) => <FontAwesomeIcon icon={faArrowLeft} className={className} />;
|
||||
const ArrowRight: FC<{ className?: string }> = ({ className }) => <FontAwesomeIcon icon={faArrowRight} className={className} />;
|
||||
import { ButtonGroup, ButtonGroupItem } from "@/components/base/button-group/button-group";
|
||||
import { Button } from "@/components/base/buttons/button";
|
||||
import { useBreakpoint } from "@/hooks/use-breakpoint";
|
||||
import { cx } from "@/utils/cx";
|
||||
import type { PaginationRootProps } from "./pagination-base";
|
||||
@@ -23,7 +22,7 @@ const PaginationItem = ({ value, rounded, isCurrent }: { value: number; rounded?
|
||||
isCurrent={isCurrent}
|
||||
className={({ isSelected }) =>
|
||||
cx(
|
||||
"flex size-10 cursor-pointer items-center justify-center p-3 text-sm font-medium text-quaternary outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover hover:text-secondary focus-visible:z-10 focus-visible:bg-primary_hover focus-visible:outline-2 focus-visible:outline-offset-2",
|
||||
"flex size-9 cursor-pointer items-center justify-center p-3 text-sm font-medium text-quaternary outline-focus-ring transition duration-100 ease-linear hover:bg-primary_hover hover:text-secondary focus-visible:z-10 focus-visible:bg-primary_hover focus-visible:outline-2 focus-visible:outline-offset-2",
|
||||
rounded ? "rounded-full" : "rounded-lg",
|
||||
isSelected && "bg-primary_hover text-secondary",
|
||||
)
|
||||
@@ -34,43 +33,6 @@ const PaginationItem = ({ value, rounded, isCurrent }: { value: number; rounded?
|
||||
);
|
||||
};
|
||||
|
||||
interface MobilePaginationProps {
|
||||
/** The current page. */
|
||||
page?: number;
|
||||
/** The total number of pages. */
|
||||
total?: number;
|
||||
/** The class name of the pagination component. */
|
||||
className?: string;
|
||||
/** The function to call when the page changes. */
|
||||
onPageChange?: (page: number) => void;
|
||||
}
|
||||
|
||||
const MobilePagination = ({ page = 1, total = 10, className, onPageChange }: MobilePaginationProps) => {
|
||||
return (
|
||||
<nav aria-label="Pagination" className={cx("flex items-center justify-between md:hidden", className)}>
|
||||
<Button
|
||||
aria-label="Go to previous page"
|
||||
iconLeading={ArrowLeft}
|
||||
color="secondary"
|
||||
size="sm"
|
||||
onClick={() => onPageChange?.(Math.max(0, page - 1))}
|
||||
/>
|
||||
|
||||
<span className="text-sm text-fg-secondary">
|
||||
Page <span className="font-medium">{page}</span> of <span className="font-medium">{total}</span>
|
||||
</span>
|
||||
|
||||
<Button
|
||||
aria-label="Go to next page"
|
||||
iconLeading={ArrowRight}
|
||||
color="secondary"
|
||||
size="sm"
|
||||
onClick={() => onPageChange?.(Math.min(total, page + 1))}
|
||||
/>
|
||||
</nav>
|
||||
);
|
||||
};
|
||||
|
||||
export const PaginationPageDefault = ({ rounded, page = 1, total = 10, className, ...props }: PaginationProps) => {
|
||||
const isDesktop = useBreakpoint("md");
|
||||
|
||||
@@ -84,7 +46,7 @@ export const PaginationPageDefault = ({ rounded, page = 1, total = 10, className
|
||||
<div className="hidden flex-1 justify-start md:flex">
|
||||
<Pagination.PrevTrigger asChild>
|
||||
<Button iconLeading={ArrowLeft} color="link-gray" size="sm">
|
||||
{isDesktop ? "Previous" : undefined}{" "}
|
||||
{isDesktop ? "Previous" : undefined}
|
||||
</Button>
|
||||
</Pagination.PrevTrigger>
|
||||
</div>
|
||||
@@ -103,7 +65,7 @@ export const PaginationPageDefault = ({ rounded, page = 1, total = 10, className
|
||||
page.type === "page" ? (
|
||||
<PaginationItem key={index} rounded={rounded} {...page} />
|
||||
) : (
|
||||
<Pagination.Ellipsis key={index} className="flex size-10 shrink-0 items-center justify-center text-tertiary">
|
||||
<Pagination.Ellipsis key={index} className="flex size-9 shrink-0 items-center justify-center text-tertiary">
|
||||
…
|
||||
</Pagination.Ellipsis>
|
||||
),
|
||||
@@ -159,7 +121,7 @@ export const PaginationPageMinimalCenter = ({ rounded, page = 1, total = 10, cla
|
||||
page.type === "page" ? (
|
||||
<PaginationItem key={index} rounded={rounded} {...page} />
|
||||
) : (
|
||||
<Pagination.Ellipsis key={index} className="flex size-10 shrink-0 items-center justify-center text-tertiary">
|
||||
<Pagination.Ellipsis key={index} className="flex size-9 shrink-0 items-center justify-center text-tertiary">
|
||||
…
|
||||
</Pagination.Ellipsis>
|
||||
),
|
||||
@@ -210,7 +172,7 @@ export const PaginationCardDefault = ({ rounded, page = 1, total = 10, ...props
|
||||
page.type === "page" ? (
|
||||
<PaginationItem key={index} rounded={rounded} {...page} />
|
||||
) : (
|
||||
<Pagination.Ellipsis key={index} className="flex size-10 shrink-0 items-center justify-center text-tertiary">
|
||||
<Pagination.Ellipsis key={index} className="flex size-9 shrink-0 items-center justify-center text-tertiary">
|
||||
…
|
||||
</Pagination.Ellipsis>
|
||||
),
|
||||
@@ -235,99 +197,3 @@ export const PaginationCardDefault = ({ rounded, page = 1, total = 10, ...props
|
||||
);
|
||||
};
|
||||
|
||||
interface PaginationCardMinimalProps {
|
||||
/** The current page. */
|
||||
page?: number;
|
||||
/** The total number of pages. */
|
||||
total?: number;
|
||||
/** The alignment of the pagination. */
|
||||
align?: "left" | "center" | "right";
|
||||
/** The class name of the pagination component. */
|
||||
className?: string;
|
||||
/** The function to call when the page changes. */
|
||||
onPageChange?: (page: number) => void;
|
||||
}
|
||||
|
||||
export const PaginationCardMinimal = ({ page = 1, total = 10, align = "left", onPageChange, className }: PaginationCardMinimalProps) => {
|
||||
return (
|
||||
<div className={cx("border-t border-secondary px-4 py-3 md:px-6 md:pt-3 md:pb-4", className)}>
|
||||
<MobilePagination page={page} total={total} onPageChange={onPageChange} />
|
||||
|
||||
<nav aria-label="Pagination" className={cx("hidden items-center gap-3 md:flex", align === "center" && "justify-between")}>
|
||||
<div className={cx(align === "center" && "flex flex-1 justify-start")}>
|
||||
<Button isDisabled={page === 1} color="secondary" size="sm" onClick={() => onPageChange?.(Math.max(0, page - 1))}>
|
||||
Previous
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<span
|
||||
className={cx(
|
||||
"text-sm font-medium text-fg-secondary",
|
||||
align === "right" && "order-first mr-auto",
|
||||
align === "left" && "order-last ml-auto",
|
||||
)}
|
||||
>
|
||||
Page {page} of {total}
|
||||
</span>
|
||||
|
||||
<div className={cx(align === "center" && "flex flex-1 justify-end")}>
|
||||
<Button isDisabled={page === total} color="secondary" size="sm" onClick={() => onPageChange?.(Math.min(total, page + 1))}>
|
||||
Next
|
||||
</Button>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
interface PaginationButtonGroupProps extends Partial<Omit<PaginationRootProps, "children">> {
|
||||
/** The alignment of the pagination. */
|
||||
align?: "left" | "center" | "right";
|
||||
}
|
||||
|
||||
export const PaginationButtonGroup = ({ align = "left", page = 1, total = 10, ...props }: PaginationButtonGroupProps) => {
|
||||
const isDesktop = useBreakpoint("md");
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cx(
|
||||
"flex border-t border-secondary px-4 py-3 md:px-6 md:pt-3 md:pb-4",
|
||||
align === "left" && "justify-start",
|
||||
align === "center" && "justify-center",
|
||||
align === "right" && "justify-end",
|
||||
)}
|
||||
>
|
||||
<Pagination.Root {...props} page={page} total={total}>
|
||||
<Pagination.Context>
|
||||
{({ pages }) => (
|
||||
<ButtonGroup size="md">
|
||||
<Pagination.PrevTrigger asChild>
|
||||
<ButtonGroupItem iconLeading={ArrowLeft}>{isDesktop ? "Previous" : undefined}</ButtonGroupItem>
|
||||
</Pagination.PrevTrigger>
|
||||
|
||||
{pages.map((page, index) =>
|
||||
page.type === "page" ? (
|
||||
<Pagination.Item key={index} {...page} asChild>
|
||||
<ButtonGroupItem isSelected={page.isCurrent} className="size-10 items-center justify-center">
|
||||
{page.value}
|
||||
</ButtonGroupItem>
|
||||
</Pagination.Item>
|
||||
) : (
|
||||
<Pagination.Ellipsis key={index}>
|
||||
<ButtonGroupItem className="pointer-events-none size-10 items-center justify-center rounded-none!">
|
||||
…
|
||||
</ButtonGroupItem>
|
||||
</Pagination.Ellipsis>
|
||||
),
|
||||
)}
|
||||
|
||||
<Pagination.NextTrigger asChild>
|
||||
<ButtonGroupItem iconTrailing={ArrowRight}>{isDesktop ? "Next" : undefined}</ButtonGroupItem>
|
||||
</Pagination.NextTrigger>
|
||||
</ButtonGroup>
|
||||
)}
|
||||
</Pagination.Context>
|
||||
</Pagination.Root>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user