feat(webui): preserve state in shared widget launches
This commit is contained in:
@@ -57,6 +57,8 @@ export type DashboardWidgetListItem = {
|
|||||||
leading?: ReactNode;
|
leading?: ReactNode;
|
||||||
trailing?: ReactNode;
|
trailing?: ReactNode;
|
||||||
to?: string;
|
to?: string;
|
||||||
|
state?: unknown;
|
||||||
|
onClick?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function DashboardWidgetList({
|
export function DashboardWidgetList({
|
||||||
@@ -105,7 +107,12 @@ export function DashboardWidgetList({
|
|||||||
return (
|
return (
|
||||||
<li key={item.id}>
|
<li key={item.id}>
|
||||||
{item.to ? (
|
{item.to ? (
|
||||||
<Link className="dashboard-contribution-row" to={item.to}>
|
<Link
|
||||||
|
className="dashboard-contribution-row"
|
||||||
|
to={item.to}
|
||||||
|
state={item.state}
|
||||||
|
onClick={item.onClick}
|
||||||
|
>
|
||||||
{content}
|
{content}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { ArrowDown, ArrowUp, LockKeyhole } from "lucide-react";
|
import { ArrowDown, ArrowUp, LockKeyhole } from "lucide-react";
|
||||||
import type { NavigationPreferences, PlatformNavItem } from "../types";
|
import type { NavigationPreferences, PlatformNavItem } from "../types";
|
||||||
|
import ActionToolbar from "./ActionToolbar";
|
||||||
import Button from "./Button";
|
import Button from "./Button";
|
||||||
import IconButton from "./IconButton";
|
import IconButton from "./IconButton";
|
||||||
import ToggleSwitch from "./ToggleSwitch";
|
import ToggleSwitch from "./ToggleSwitch";
|
||||||
@@ -66,14 +67,14 @@ export default function NavigationPreferenceEditor({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="navigation-preference-editor" data-navigation-preference-scope={scope}>
|
<div className="navigation-preference-editor" data-navigation-preference-scope={scope}>
|
||||||
<div className="navigation-preference-toolbar">
|
<ActionToolbar className="navigation-preference-toolbar" justify="between">
|
||||||
<p className="muted small-note">
|
<p className="muted small-note">
|
||||||
Higher personal settings take precedence over tenant and system order. Locked entries remain visible.
|
Higher personal settings take precedence over tenant and system order. Locked entries remain visible.
|
||||||
</p>
|
</p>
|
||||||
<Button onClick={() => onChange(null)} disabled={disabled || value === null}>
|
<Button onClick={() => onChange(null)} disabled={disabled || value === null}>
|
||||||
Use inherited order
|
Use inherited order
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</ActionToolbar>
|
||||||
<ol className="navigation-preference-list">
|
<ol className="navigation-preference-list">
|
||||||
{orderedIds.map((id, index) => {
|
{orderedIds.map((id, index) => {
|
||||||
const item = byId.get(id);
|
const item = byId.get(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user