Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor : Change menu name and reorder items #11993

Merged
merged 2 commits into from
Dec 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class SliceHeaderControls extends React.PureComponent {
const refreshTooltip = isCached
? t('Cached %s', cachedWhen)
: (updatedWhen && t('Fetched %s', updatedWhen)) || '';
const resizeLabel = isFullSize ? t('Minimize') : t('Maximize');
const resizeLabel = isFullSize ? t('Minimize Chart') : t('Maximize Chart');

const menu = (
<Menu
Expand Down Expand Up @@ -206,16 +206,10 @@ class SliceHeaderControls extends React.PureComponent {

{this.props.supersetCanExplore && (
<Menu.Item key={MENU_KEYS.EXPLORE_CHART}>
{t('Explore chart')}
{t('View Chart in Explore')}
</Menu.Item>
)}

{this.props.supersetCanCSV && (
<Menu.Item key={MENU_KEYS.EXPORT_CSV}>{t('Export CSV')}</Menu.Item>
)}

<Menu.Item key={MENU_KEYS.RESIZE_LABEL}>{resizeLabel}</Menu.Item>

<Menu.Item key={MENU_KEYS.SHARE_CHART}>
<URLShortLinkModal
url={getDashboardUrl(
Expand All @@ -229,9 +223,15 @@ class SliceHeaderControls extends React.PureComponent {
/>
</Menu.Item>

<Menu.Item key={MENU_KEYS.RESIZE_LABEL}>{resizeLabel}</Menu.Item>

<Menu.Item key={MENU_KEYS.DOWNLOAD_AS_IMAGE}>
{t('Download as image')}
</Menu.Item>

{this.props.supersetCanCSV && (
<Menu.Item key={MENU_KEYS.EXPORT_CSV}>{t('Export CSV')}</Menu.Item>
)}
</Menu>
);

Expand Down