feat: auto refresh dashboard (#37459)

Co-authored-by: Richard <richard@ip-192-168-1-32.sa-east-1.compute.internal>
Co-authored-by: richard <richard@richards-MacBook-Pro-2.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
Richard Fogaca Nienkotter
2026-02-24 11:37:28 -03:00
committed by GitHub
parent f60432e34c
commit fca8a49561
66 changed files with 4818 additions and 462 deletions

View File

@@ -17,9 +17,11 @@
* under the License.
*/
import buildQuery from '../../src/Graph/buildQuery';
import { DEFAULT_FORM_DATA } from '../../src/Graph/types';
describe('Graph buildQuery', () => {
const formData = {
...DEFAULT_FORM_DATA,
datasource: '5__table',
granularity_sqla: 'ds',
source: 'dummy_source',

View File

@@ -860,8 +860,8 @@ describe('legend sorting', () => {
const transformed = transformProps(chartProps);
expect((transformed.echartOptions.legend as any).data).toEqual([
'San Francisco',
'Boston',
'San Francisco',
'New York',
'Milton',
]);

View File

@@ -17,17 +17,35 @@
* under the License.
*/
import buildQuery from '../../src/Tree/buildQuery';
import { EchartsTreeFormData } from '../../src/Tree/types';
const BASE_FORM_DATA: EchartsTreeFormData = {
datasource: '5__table',
granularity_sqla: 'ds',
viz_type: 'my_chart',
id: '',
parent: '',
name: '',
orient: 'LR',
symbol: 'emptyCircle',
symbolSize: 7,
layout: 'orthogonal',
roam: true,
nodeLabelPosition: 'left',
childLabelPosition: 'bottom',
emphasis: 'descendant',
initialTreeDepth: 2,
metrics: [],
};
describe('Tree buildQuery', () => {
test('should build query', () => {
const formData = {
datasource: '5__table',
granularity_sqla: 'ds',
const formData: EchartsTreeFormData = {
...BASE_FORM_DATA,
id: 'id_col',
parent: 'relation_col',
name: 'name_col',
metrics: ['foo', 'bar'],
viz_type: 'my_chart',
};
const queryContext = buildQuery(formData);
const [query] = queryContext.queries;
@@ -35,13 +53,12 @@ describe('Tree buildQuery', () => {
expect(query.metrics).toEqual(['foo', 'bar']);
});
test('should build query without name column', () => {
const formData = {
datasource: '5__table',
granularity_sqla: 'ds',
const formData: EchartsTreeFormData = {
...BASE_FORM_DATA,
id: 'id_col',
parent: 'relation_col',
name: '',
metrics: ['foo', 'bar'],
viz_type: 'my_chart',
};
const queryContext = buildQuery(formData);
const [query] = queryContext.queries;

View File

@@ -53,7 +53,7 @@ import { NULL_STRING } from '../../src/constants';
const expectedThemeProps = {
selector: ['all', 'inverse'],
selected: undefined,
selected: {},
selectorLabel: {
fontFamily: theme.fontFamily,
fontSize: theme.fontSizeSM,