Skip to content

Commit

Permalink
fix(explore): Double divider if no permissions for adding reports (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Apr 19, 2022
1 parent 6f4480a commit 3663a33
Showing 1 changed file with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,31 +370,35 @@ const ExploreAdditionalActionsMenu = ({
</Menu.Item>
</Menu.SubMenu>
<Menu.Divider />
{canAddReports &&
(report ? (
<Menu.SubMenu
title={t('Manage email report')}
key={MENU_KEYS.REPORT_SUBMENU}
>
<Menu.Item key={MENU_KEYS.SET_REPORT_ACTIVE}>
<MenuItemWithCheckboxContainer>
<Checkbox checked={isReportActive} onChange={noOp} />
{t('Email reports active')}
</MenuItemWithCheckboxContainer>
</Menu.Item>
<Menu.Item key={MENU_KEYS.EDIT_REPORT}>
{t('Edit email report')}
</Menu.Item>
<Menu.Item key={MENU_KEYS.DELETE_REPORT}>
{t('Delete email report')}
{canAddReports && (
<>
{report ? (
<Menu.SubMenu
title={t('Manage email report')}
key={MENU_KEYS.REPORT_SUBMENU}
>
<Menu.Item key={MENU_KEYS.SET_REPORT_ACTIVE}>
<MenuItemWithCheckboxContainer>
<Checkbox checked={isReportActive} onChange={noOp} />
{t('Email reports active')}
</MenuItemWithCheckboxContainer>
</Menu.Item>
<Menu.Item key={MENU_KEYS.EDIT_REPORT}>
{t('Edit email report')}
</Menu.Item>
<Menu.Item key={MENU_KEYS.DELETE_REPORT}>
{t('Delete email report')}
</Menu.Item>
</Menu.SubMenu>
) : (
<Menu.Item key={MENU_KEYS.SET_UP_REPORT}>
{t('Set up an email report')}
</Menu.Item>
</Menu.SubMenu>
) : (
<Menu.Item key={MENU_KEYS.SET_UP_REPORT}>
{t('Set up an email report')}
</Menu.Item>
))}
<Menu.Divider />
)}
<Menu.Divider />
</>
)}

<Menu.Item key={MENU_KEYS.VIEW_QUERY}>
<ModalTrigger
triggerNode={
Expand Down

0 comments on commit 3663a33

Please sign in to comment.