豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit d8e9b29

Browse files
cursoragentJonasBa
andcommitted
refactor(dashboards): remove redundant ternary around EditAccessSelector
Both branches of the hasPageFrameFeature ternary rendered identical EditAccessSelector components with the same props. Simplified by removing the unnecessary conditional and rendering the component directly. Co-authored-by: Jonas <JonasBa@users.noreply.github.com>
1 parent 7c4ee44 commit d8e9b29

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

static/app/views/dashboards/controls.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -363,19 +363,12 @@ export function Controls({
363363
size="sm"
364364
/>
365365
))}
366-
{dashboard.id !== 'default-overview' &&
367-
!isPrebuiltDashboard &&
368-
(hasPageFrameFeature ? (
369-
<EditAccessSelector
370-
dashboard={dashboard}
371-
onChangeEditAccess={onChangeEditAccess}
372-
/>
373-
) : (
374-
<EditAccessSelector
375-
dashboard={dashboard}
376-
onChangeEditAccess={onChangeEditAccess}
377-
/>
378-
))}
366+
{dashboard.id !== 'default-overview' && !isPrebuiltDashboard && (
367+
<EditAccessSelector
368+
dashboard={dashboard}
369+
onChangeEditAccess={onChangeEditAccess}
370+
/>
371+
)}
379372
{!hasPageFrameFeature && renderEditButton(hasFeature)}
380373
{hasFeature && !isPrebuiltDashboard && (
381374
<Tooltip

0 commit comments

Comments
 (0)