From 4eb96e9d1d3b78f1ae907de697bc3506c4860ab8 Mon Sep 17 00:00:00 2001 From: Ayobami Akingbade Date: Sun, 30 Jun 2024 06:56:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(ui):=20forward=20ref=20to=20to?= =?UTF-8?q?oltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/data/data.service.ts | 1 + src/components/app/button/soft.tsx | 4 ++- src/components/app/form/input/date.tsx | 1 + .../app/form/input/label-and-error.tsx | 2 +- src/components/app/off-canvas.tsx | 3 +- src/components/app/section-box/index.tsx | 2 +- src/components/app/system-icons.tsx | 35 ++++++++++--------- src/components/app/table/_Pagination.tsx | 5 +-- .../app/table/filters/Date/_Selection.tsx | 4 +-- src/components/app/table/index.tsx | 8 +++-- src/components/app/tabs.tsx | 25 +++++++------ src/components/app/tooltip/index.tsx | 5 +-- src/components/ui/button.tsx | 2 +- src/components/ui/scroll-area.tsx | 8 +++-- src/components/ui/tabs.tsx | 2 +- .../app/NavigationSideBar/SideBar.tsx | 4 +-- .../Variables/ManageCredentialGroup.tsx | 22 ++++++------ tailwind.config.js | 5 --- 18 files changed, 76 insertions(+), 62 deletions(-) diff --git a/src/backend/data/data.service.ts b/src/backend/data/data.service.ts index 53f5a5e94..8853489cc 100644 --- a/src/backend/data/data.service.ts +++ b/src/backend/data/data.service.ts @@ -138,6 +138,7 @@ export class DataApiService implements IDataApiService { ], }) ); + if (!data) { throw new NotFoundError( `Entity '${entity}' with '${columnField}' '${id}' does not exist` diff --git a/src/components/app/button/soft.tsx b/src/components/app/button/soft.tsx index feae1d4ac..ec5ff1104 100644 --- a/src/components/app/button/soft.tsx +++ b/src/components/app/button/soft.tsx @@ -79,7 +79,9 @@ export function SoftButton({ ); return size === "icon" ? ( - {buttonElement} + + {buttonElement} + ) : ( buttonElement ); diff --git a/src/components/app/form/input/date.tsx b/src/components/app/form/input/date.tsx index 17771cd4e..7daabbbde 100644 --- a/src/components/app/form/input/date.tsx +++ b/src/components/app/form/input/date.tsx @@ -118,6 +118,7 @@ export function ControlledFormDateInput({ export function FormDateInput(formInput: IFormDateInput) { const { input, disabled, meta, minDate, maxDate } = formInput; let { value } = input; + if (value && typeof value === "string") { value = new Date(value); input.onChange(value); diff --git a/src/components/app/form/input/label-and-error.tsx b/src/components/app/form/input/label-and-error.tsx index cd690095b..2d8a62e06 100644 --- a/src/components/app/form/input/label-and-error.tsx +++ b/src/components/app/form/input/label-and-error.tsx @@ -38,7 +38,7 @@ export function LabelAndError({ formInput, children }: IProps) { )} {description ? ( - + ) : null} diff --git a/src/components/app/off-canvas.tsx b/src/components/app/off-canvas.tsx index cb39cbf88..8f837e146 100644 --- a/src/components/app/off-canvas.tsx +++ b/src/components/app/off-canvas.tsx @@ -5,6 +5,7 @@ import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet"; import { cn } from "@/lib/utils"; import { Separator } from "../ui/separator"; import { NextPortal } from "./next-portal"; +import { ScrollArea } from "../ui/scroll-area"; export interface IProps { show: boolean; @@ -35,7 +36,7 @@ export function OffCanvas({ show, onClose, title, children, size }: IProps) { {_(title)} -
{children}
+ {children} diff --git a/src/components/app/section-box/index.tsx b/src/components/app/section-box/index.tsx index f25e8facb..3b6970b54 100644 --- a/src/components/app/section-box/index.tsx +++ b/src/components/app/section-box/index.tsx @@ -49,7 +49,7 @@ export function SectionBox({

{_(title)}

)} {description ? ( - + ) : null} diff --git a/src/components/app/system-icons.tsx b/src/components/app/system-icons.tsx index 03a5b2fe5..68da241ef 100644 --- a/src/components/app/system-icons.tsx +++ b/src/components/app/system-icons.tsx @@ -9,24 +9,27 @@ interface IProps { className: string; } -export function SystemIcon({ icon, label, strokeWidth, className }: IProps) { - if (!icon) { - return null; - } +export const SystemIcon = forwardRef( + ({ icon, label, strokeWidth, className }, ref) => { + if (!icon) { + return null; + } - if (icon === "none") { - return null; - } + if (icon === "none") { + return null; + } - const iconSvg = systemIconToSVG(icon, strokeWidth); - return ( - - ); -} + const iconSvg = systemIconToSVG(icon, strokeWidth); + return ( + + ); + } +); export const GrabIcon = forwardRef< SVGSVGElement, diff --git a/src/components/app/table/_Pagination.tsx b/src/components/app/table/_Pagination.tsx index 4c5937cc9..820f2e9a4 100644 --- a/src/components/app/table/_Pagination.tsx +++ b/src/components/app/table/_Pagination.tsx @@ -50,8 +50,7 @@ export function TablePagination({ onChange={(value) => setPageSize(Number(value))} value={`${pageSize}`} />{" "} - entries of {Intl.NumberFormat("en-US").format(totalRecords)}{" "} - results + of {Intl.NumberFormat("en-US").format(totalRecords)} results