diff --git a/client/app/pages/dashboards/components/DashboardHeader.jsx b/client/app/pages/dashboards/components/DashboardHeader.jsx index 9c8bf82655..3cd5c7adfd 100644 --- a/client/app/pages/dashboards/components/DashboardHeader.jsx +++ b/client/app/pages/dashboards/components/DashboardHeader.jsx @@ -15,6 +15,7 @@ import { DashboardTagsControl } from "@/components/tags-control/TagsControl"; import getTags from "@/services/getTags"; import { clientConfig } from "@/services/auth"; import { policy } from "@/services/policy"; +import recordEvent from "@/services/recordEvent"; import { durationHumanize } from "@/lib/utils"; import { DashboardStatusEnum } from "../hooks/useDashboard"; @@ -175,6 +176,7 @@ function DashboardControl({ dashboardConfiguration, headerExtra }) { fullscreen, toggleFullscreen, showShareDashboardDialog, + updateDashboard, } = dashboardConfiguration; const showPublishButton = dashboard.is_draft; const showRefreshButton = true; @@ -182,8 +184,14 @@ function DashboardControl({ dashboardConfiguration, headerExtra }) { const canShareDashboard = canEditDashboard && !dashboard.is_draft; const showShareButton = !clientConfig.disablePublicUrls && (dashboard.publicAccessEnabled || canShareDashboard); const showMoreOptionsButton = canEditDashboard; + + const unarchiveDashboard = () => { + recordEvent("unarchive", "dashboard", dashboard.id); + updateDashboard({ is_archived: false }, false); + }; return (
+ {dashboard.can_edit && dashboard.is_archived && } {!dashboard.is_archived && ( {showPublishButton && (