Skip to content

Commit 56bebef

Browse files
authored
Merge pull request #1859 from merico-dev/avoid-show-title-hack
avoid show title hack
2 parents c689b5b + efff071 commit 56bebef

File tree

8 files changed

+43
-37
lines changed

8 files changed

+43
-37
lines changed

dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/dashboard",
3-
"version": "14.58.4",
3+
"version": "14.58.5",
44
"license": "Apache-2.0",
55
"repository": {
66
"url": "https://github.com/merico-dev/table"

dashboard/src/components/panel/panel-render/panel-render-base.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
top: 16px;
4444
right: 16px;
4545
}
46+
47+
.panel-root .panel-top-right-actions-placeholder {
48+
width: 1px;
49+
height: 24px;
50+
}
4651
.panel-root .panel-viz-section {
4752
height: 100%;
4853
}

dashboard/src/components/panel/panel-render/top-right-actions/index.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,26 @@ export const PanelTopRightActions = observer(({ dropdownContent, showDropdownMen
1414

1515
const showDropdown = withPanelTitle && showDropdownMenu;
1616

17+
const hasTopRightActions = panelAddonSlotId || dropdownContent;
1718
return (
18-
<Group
19-
className="panel-top-right-actions"
20-
gap="xs"
21-
wrap="nowrap"
22-
justify="flex-end"
23-
pos="absolute"
24-
sx={{
25-
zIndex: 410,
26-
}}
27-
>
28-
{/* Panel addons portal target */}
29-
{withAddon && panelAddonSlotId && <div id={panelAddonSlotId}></div>}
19+
<>
20+
{hasTopRightActions && <div className="panel-top-right-actions-placeholder"></div>}
21+
<Group
22+
className="panel-top-right-actions"
23+
gap="xs"
24+
wrap="nowrap"
25+
justify="flex-end"
26+
pos="absolute"
27+
sx={{
28+
zIndex: 410,
29+
}}
30+
>
31+
{/* Panel addons portal target */}
32+
{withAddon && panelAddonSlotId && <div id={panelAddonSlotId}></div>}
3033

31-
{/* Panel dropdown menu */}
32-
{showDropdown && dropdownContent}
33-
</Group>
34+
{/* Panel dropdown menu */}
35+
{showDropdown && dropdownContent}
36+
</Group>
37+
</>
3438
);
3539
});

dashboard/src/dashboard-editor/ui/settings/content/edit-panel/panel-config/title.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const EditTitle = observer(() => {
1717
label={t('panel.show_title')}
1818
sx={{ userSelect: 'none' }}
1919
/>
20-
<Checkbox size="sm" checked disabled label={t('panel.use_name_as_title')} />
2120
</Group>
2221
</Stack>
2322
);

dashboard/src/i18n/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export const en = {
403403
panel_name: 'Panel Name',
404404
panel_description: 'Description',
405405
panel_description_click: 'Click to see description',
406-
show_title: 'Show title',
406+
show_title: 'Show as Panel title',
407407
use_name_as_title: 'Use name as title',
408408
settings: {
409409
change_view: 'Move into Another View',

dashboard/src/i18n/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ export const zh = {
403403
panel_name: '卡片名',
404404
panel_description: '卡片描述',
405405
panel_description_click: '点击查看卡片描述',
406-
show_title: '展示卡片标题',
406+
show_title: '作为卡片标题展示',
407407
use_name_as_title: '使用卡片名作为标题',
408408
settings: {
409409
change_view: '移至另一个视图下',

settings-form/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtable/settings-form",
3-
"version": "14.58.4",
3+
"version": "14.58.5",
44
"license": "Apache-2.0",
55
"repository": {
66
"url": "https://github.com/merico-dev/table"

website/src/utils/install-dashboard-website-plugin.tsx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IPanelAddonRenderProps, pluginManager, useVisibleFilters } from '@devtable/dashboard';
22
import { ActionIcon, Tooltip } from '@mantine/core';
3-
import { IconBug, IconCode } from '@tabler/icons-react';
3+
import { IconCode } from '@tabler/icons-react';
44
import React from 'react';
55

66
export const PrintEChartsOptionAddon = ({ viz, isInEditMode }: IPanelAddonRenderProps) => {
@@ -20,22 +20,20 @@ export const PrintEChartsOptionAddon = ({ viz, isInEditMode }: IPanelAddonRender
2020
return null;
2121
}
2222
return (
23-
<div style={{ position: 'absolute', bottom: 2, right: 2, zIndex: 400 }}>
24-
<Tooltip label="Print ECharts option to console">
25-
<ActionIcon
26-
onClick={(ev) => {
27-
ev.stopPropagation();
28-
ev.preventDefault();
29-
console.log('debug', renderOptions, 'filters', formattedFilters);
30-
}}
31-
size="sm"
32-
variant="white"
33-
color="gray"
34-
>
35-
<IconCode />
36-
</ActionIcon>
37-
</Tooltip>
38-
</div>
23+
<Tooltip label="Print ECharts option to console">
24+
<ActionIcon
25+
onClick={(ev) => {
26+
ev.stopPropagation();
27+
ev.preventDefault();
28+
console.log('debug', renderOptions, 'filters', formattedFilters);
29+
}}
30+
variant="subtle"
31+
color="black"
32+
size="md"
33+
>
34+
<IconCode size={14} style={{ width: '70%', height: '70%' }} />
35+
</ActionIcon>
36+
</Tooltip>
3937
);
4038
};
4139
pluginManager.install({

0 commit comments

Comments
 (0)