-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTA for embeddings and model evaluation #5110
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,167 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { constants } from "@fiftyone/utilities"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { OpenInNew, West } from "@mui/icons-material"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Box, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Button, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Card, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IconProps, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Stack, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Typography, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypographyProps, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useTheme, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} from "@mui/material"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import React, { FunctionComponent } from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import MuiButton from "../MuiButton"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import MuiIconFont from "../MuiIconFont"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { IS_APP_MODE_FIFTYONE, BOOK_A_DEMO_LINK, TRY_IN_BROWSER_LINK } = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
constants; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default function PanelCTA(props: PanelCTAProps) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoLabel, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoDescription, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoCaption, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Actions, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caption, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docCaption, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docLink, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
icon: Icon, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iconProps = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mode, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onBack, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} = props; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const theme = useTheme(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const isDefault = mode === "default"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const computedLabel = IS_APP_MODE_FIFTYONE ? demoLabel || label : label; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const computedDescription = IS_APP_MODE_FIFTYONE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? demoDescription || description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: description; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const computedCaption = IS_APP_MODE_FIFTYONE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
? demoCaption || caption | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
: caption; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Stack spacing={1} sx={{ height: "100%", p: 2 }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{isDefault && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Box> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Button onClick={onBack} startIcon={<West />} color="secondary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Back to {name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Button> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Box> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Card sx={{ position: "relative", height: "100%" }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Stack | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
spacing={1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sx={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
height: "100%", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
alignItems: "center", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
justifyContent: "center", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{typeof Icon === "string" && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<MuiIconFont | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sx={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
fontSize: 64, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
color: theme.palette.custom.primarySoft, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
marginBottom: 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{...(iconProps as IconProps)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name={Icon} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{Boolean(Icon) && typeof Icon !== "string" && Icon} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<TypographyOrNode variant="h6">{computedLabel}</TypographyOrNode> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<TypographyOrNode color="secondary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{computedDescription} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</TypographyOrNode> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<TypographyOrNode sx={{ color: theme.palette.text.tertiary }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{computedCaption} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</TypographyOrNode> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{!IS_APP_MODE_FIFTYONE && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Box pt={1}>{Actions && <Actions {...props} />}</Box> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{IS_APP_MODE_FIFTYONE && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Stack direction="row" spacing={2} pt={2}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<MuiButton | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="contained" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
color="primary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={BOOK_A_DEMO_LINK} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target="_blank" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Book a demo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</MuiButton> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<MuiButton | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="contained" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
color="primary" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={TRY_IN_BROWSER_LINK} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target="_blank" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Try in browser | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</MuiButton> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{docLink && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Stack | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
spacing={1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sx={{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
position: "absolute", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
bottom: "32px", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
alignItems: "center", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{docCaption && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Typography color="secondary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{docCaption || "Not ready to upgrade yet?"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Typography> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<MuiButton | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="outlined" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
endIcon={<OpenInNew sx={{ fontSize: "16px!important" }} />} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
href={docLink} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
target="_blank" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
View documentation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</MuiButton> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Card> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
</Stack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
function TypographyOrNode(props: TypographyProps) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { children, ...otherProps } = props; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (typeof children === "string") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return <Typography {...otherProps}>{children}</Typography>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (React.isValidElement(children)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return children; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return null; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export type PanelCTAProps = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Actions?: FunctionComponent<any>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
caption?: string | React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description?: string | React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docCaption?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docLink?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
icon?: string | React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
iconProps?: IconProps; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label: string | React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mode?: "onboarding" | "default"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onBack: () => void; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
panelProps?: any; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoLabel?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoDescription?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoCaption?: string; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+166
to
+182
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve type definitions for better type safety. The type definitions could be improved in several ways: export type PanelCTAProps = {
Actions?: FunctionComponent<any>;
caption?: string | React.ReactNode;
description?: string | React.ReactNode;
docCaption?: string;
docLink?: string;
icon?: string | React.ReactNode;
iconProps?: IconProps;
label: string | React.ReactNode;
- mode?: "onboarding" | "default";
+ mode: "onboarding" | "default"; // Since it's used in logic, it should be required
name: string;
onBack: () => void;
- panelProps?: any;
+ panelProps?: Record<string, unknown>; // Or define a specific type
demoLabel?: string;
demoDescription?: string;
demoCaption?: string;
}; 📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { type AdaptiveMenuItemComponentPropsType } from "./AdaptiveMenu"; | ||
export { type PanelCTAProps } from "./PanelCTA"; |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,12 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { Box } from "@mui/material"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import React, { useMemo } from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import React, { useCallback, useMemo } from "react"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import EmptyOverview from "./EmptyOverview"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import Evaluation from "./Evaluation"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import Overview from "./Overview"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { useTriggerEvent } from "./utils"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { PanelCTA } from "@fiftyone/components"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { constants } from "@fiftyone/utilities"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import Evaluate from "./Evaluate"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
1
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add TypeScript type definitions for better type safety The component and its props lack proper TypeScript type definitions. This could lead to potential runtime errors and makes the code harder to maintain. Consider adding the following type definitions: interface NativeModelEvaluationViewProps {
data?: {
evaluations?: Array<{ key: string; id: string }>;
view?: Record<string, any>;
statuses?: Record<string, any>;
notes?: Record<string, any>;
permissions?: Record<string, any>;
pending_evaluations?: Array<any>;
};
schema: {
view: {
on_change_view: string;
on_evaluate_model: string;
load_evaluation: string;
load_evaluation_view: string;
set_status: string;
set_note: string;
load_view: string;
};
};
onChange: (path: string, value: any) => void;
layout: any;
} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export default function NativeModelEvaluationView(props) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { data = {}, schema, onChange, layout } = props; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -42,9 +45,17 @@ export default function NativeModelEvaluationView(props) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const { page = "overview", key, id, compareKey } = viewState; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const showEmptyOverview = computedEvaluations.length === 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const triggerEvent = useTriggerEvent(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const [showCTA, setShowCTA] = React.useState(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const onEvaluate = useCallback(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (constants.IS_APP_MODE_FIFTYONE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowCTA(true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerEvent(on_evaluate_model); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, [triggerEvent, on_evaluate_model]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Box> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Box sx={{ height: "100%" }}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{page === "evaluation" && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Evaluation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name={key} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -72,13 +83,28 @@ export default function NativeModelEvaluationView(props) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{page === "overview" && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(showEmptyOverview ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<EmptyOverview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
height={layout?.height as number} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onEvaluate={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerEvent(on_evaluate_model); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(showEmptyOverview || showCTA ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<PanelCTA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
label="Create you first model evaluation" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
demoLabel="Upgrade to Fiftyone Teams to Evaluate Models" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
description="Analyze and improve models collaboratively with your team" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docLink="https://docs.voxel51.com/user_guide/evaluation.html" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
docCaption="Not ready to upgrade yet? Learn how to create model evaluation via code." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
icon="ssid_chart" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Actions={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Evaluate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onEvaluate={onEvaluate} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
permissions={permissions} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
variant="empty" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
permissions={permissions} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name="Model Evaluation" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onBack={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setShowCTA(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mode={showCTA ? "default" : "onboarding"} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+87
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address panel dimension concerns Based on the PR feedback, the panel dimensions need attention, particularly regarding minimum height and text alignment at smaller widths. Add style constraints to ensure proper panel dimensions: <PanelCTA
+ sx={{
+ minHeight: '400px',
+ '& .MuiTypography-root': {
+ textAlign: 'center',
+ width: '100%',
+ minWidth: '200px'
+ }
+ }}
label="Create you first model evaluation"
demoLabel="Upgrade to Fiftyone Teams to Evaluate Models" 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<Overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -87,9 +113,7 @@ export default function NativeModelEvaluationView(props) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerEvent(on_change_view); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerEvent(load_evaluation_view); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onEvaluate={() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
triggerEvent(on_evaluate_model); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onEvaluate={onEvaluate} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
evaluations={computedEvaluations} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statuses={statuses} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
notes={notes} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add accessibility attributes to external links
External links should include proper accessibility attributes for better user experience and security.
Apply this diff to add the missing attributes:
And for the documentation link:
Also applies to: 121-128