@@ -15,6 +15,7 @@ import { DashboardTagsControl } from "@/components/tags-control/TagsControl";
15
15
import getTags from "@/services/getTags" ;
16
16
import { clientConfig } from "@/services/auth" ;
17
17
import { policy } from "@/services/policy" ;
18
+ import recordEvent from "@/services/recordEvent" ;
18
19
import { durationHumanize } from "@/lib/utils" ;
19
20
import { DashboardStatusEnum } from "../hooks/useDashboard" ;
20
21
@@ -175,15 +176,22 @@ function DashboardControl({ dashboardConfiguration, headerExtra }) {
175
176
fullscreen,
176
177
toggleFullscreen,
177
178
showShareDashboardDialog,
179
+ updateDashboard,
178
180
} = dashboardConfiguration ;
179
181
const showPublishButton = dashboard . is_draft ;
180
182
const showRefreshButton = true ;
181
183
const showFullscreenButton = ! dashboard . is_draft ;
182
184
const canShareDashboard = canEditDashboard && ! dashboard . is_draft ;
183
185
const showShareButton = ! clientConfig . disablePublicUrls && ( dashboard . publicAccessEnabled || canShareDashboard ) ;
184
186
const showMoreOptionsButton = canEditDashboard ;
187
+
188
+ const unarchiveDashboard = ( ) => {
189
+ recordEvent ( "unarchive" , "dashboard" , dashboard . id ) ;
190
+ updateDashboard ( { is_archived : false } , false ) ;
191
+ } ;
185
192
return (
186
193
< div className = "dashboard-control" >
194
+ { dashboard . can_edit && dashboard . is_archived && < Button onClick = { unarchiveDashboard } > Unarchive</ Button > }
187
195
{ ! dashboard . is_archived && (
188
196
< span className = "hidden-print" >
189
197
{ showPublishButton && (
0 commit comments