mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-09 02:28:38 -05:00
feat: make Add charts a primary dashboard action
Promote Add charts to a labeled primary button in the dashboard control bar and keep secondary actions in the icon toolbar for clearer chart-creation affordance. Made-with: Cursor
This commit is contained in:
@@ -8,6 +8,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { getFormattedErrorMessage } from "@/lib/utils/helper";
|
||||
import { deleteDashboardAction } from "@/modules/ee/analysis/dashboards/actions";
|
||||
import { AddExistingChartsDialog } from "@/modules/ee/analysis/dashboards/components/add-existing-charts-dialog";
|
||||
import { Button } from "@/modules/ui/components/button";
|
||||
import { DeleteDialog } from "@/modules/ui/components/delete-dialog";
|
||||
import { IconBar } from "@/modules/ui/components/iconbar";
|
||||
|
||||
@@ -84,12 +85,6 @@ export const DashboardControlBar = ({
|
||||
];
|
||||
|
||||
const viewModeActions = [
|
||||
{
|
||||
icon: PlusIcon,
|
||||
tooltip: t("common.add_charts"),
|
||||
onClick: () => setIsAddExistingDialogOpen(true),
|
||||
isVisible: !isReadOnly,
|
||||
},
|
||||
{
|
||||
icon: RefreshCwIcon,
|
||||
tooltip: t("common.refresh"),
|
||||
@@ -112,7 +107,19 @@ export const DashboardControlBar = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<IconBar actions={isEditing ? editModeActions : viewModeActions} />
|
||||
{isEditing ? (
|
||||
<IconBar actions={editModeActions} />
|
||||
) : (
|
||||
<div className="flex items-center gap-2">
|
||||
{!isReadOnly && (
|
||||
<Button onClick={() => setIsAddExistingDialogOpen(true)}>
|
||||
<PlusIcon />
|
||||
{t("common.add_charts")}
|
||||
</Button>
|
||||
)}
|
||||
<IconBar actions={viewModeActions} />
|
||||
</div>
|
||||
)}
|
||||
<DeleteDialog
|
||||
deleteWhat={t("workspace.analysis.dashboards.dashboard")}
|
||||
open={isDeleteDialogOpen}
|
||||
|
||||
Reference in New Issue
Block a user