Skip to content

Commit d7e7152

Browse files
authored
feat(dashboards): wrap dashboard controls in flag if prebuilt dashboard (#104161)
See BROWSE-152 for details We don't want to show controls like duplicate/favourite on prebuilt dashboards until all modules are ported over. Perhaps we might EA this separately too, but it's all under a flag so we have the flexibility.
1 parent 4109ca1 commit d7e7152

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

static/app/views/dashboards/controls.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ function Controls({
8787
const {teams: userTeams} = useUserTeams();
8888
const api = useApi();
8989
const navigate = useNavigate();
90+
const hasPrebuiltControlsFeature = organization.features.includes(
91+
'dashboards-prebuilt-controls'
92+
);
9093

9194
const {duplicatePrebuiltDashboard, isLoading: isLoadingDuplicatePrebuiltDashboard} =
9295
useDuplicatePrebuiltDashboard({
@@ -97,6 +100,10 @@ function Controls({
97100

98101
const isPrebuiltDashboard = defined(dashboard.prebuiltId);
99102

103+
if (isPrebuiltDashboard && !hasPrebuiltControlsFeature) {
104+
return null;
105+
}
106+
100107
if ([DashboardState.EDIT, DashboardState.PENDING_DELETE].includes(dashboardState)) {
101108
return (
102109
<StyledButtonBar key="edit-controls">

0 commit comments

Comments
 (0)