@@ -3,7 +3,7 @@ import { DomUtils, Dic } from '@framework/Globals'
3
3
import * as Finder from '@framework/Finder'
4
4
import * as Navigator from '@framework/Navigator'
5
5
import { FilterOptionParsed , ColumnOption , hasAggregate , withoutAggregate , FilterOption , FindOptions , withoutPinned } from '@framework/FindOptions'
6
- import { ChartRequestModel , ChartMessage } from '../Signum.Entities.Chart'
6
+ import { ChartRequestModel , ChartMessage , UserChartEntity } from '../Signum.Entities.Chart'
7
7
import * as ChartClient from '../ChartClient'
8
8
import { toFilterOptions } from '@framework/Finder' ;
9
9
@@ -19,8 +19,10 @@ import { toAbsoluteUrl } from '@framework/AppContext'
19
19
import * as UserQueryClient from '../../UserQueries/UserQueryClient'
20
20
import { DynamicTypeConditionSymbolEntity } from '../../Dynamic/Signum.Entities.Dynamic'
21
21
import { extractFindOptions } from '../../UserQueries/UserQueryClient'
22
+ import { Lite } from '@framework/Signum.Entities'
22
23
23
24
export interface ChartRendererProps {
25
+ userChart ?: Lite < UserChartEntity > ;
24
26
chartRequest : ChartRequestModel ;
25
27
loading : boolean ;
26
28
@@ -56,7 +58,7 @@ export default function ChartRenderer(p: ChartRendererProps) {
56
58
data = { p . data }
57
59
dashboardFilter = { p . dashboardFilter }
58
60
loading = { p . loading }
59
- onDrillDown = { p . onDrillDown ?? ( ( r , e ) => handleDrillDown ( r , e , p . lastChartRequest ! , p . autoRefresh ? p . onReload : undefined ) ) }
61
+ onDrillDown = { p . onDrillDown ?? ( ( r , e ) => handleDrillDown ( r , e , p . lastChartRequest ! , p . userChart , p . autoRefresh ? p . onReload : undefined ) ) }
60
62
onBackgroundClick = { p . onBackgroundClick }
61
63
parameters = { parameters }
62
64
onReload = { p . onReload }
@@ -69,12 +71,12 @@ export default function ChartRenderer(p: ChartRendererProps) {
69
71
) ;
70
72
}
71
73
72
- export function handleDrillDown ( r : ChartRow , e : React . MouseEvent | MouseEvent , cr : ChartRequestModel , onReload ?: ( ) => void ) {
74
+ export function handleDrillDown ( r : ChartRow , e : React . MouseEvent | MouseEvent , cr : ChartRequestModel , uc ?: Lite < UserChartEntity > , onReload ?: ( ) => void ) {
73
75
74
76
e . stopPropagation ( ) ;
75
77
var newWindow = e . ctrlKey || e . button == 1 ;
76
78
77
- UserQueryClient . onDrilldownUserChart ( cr , r , { openInNewTab : newWindow , onReload } )
79
+ UserQueryClient . onDrilldownUserChart ( cr , r , uc , { openInNewTab : newWindow , onReload } )
78
80
. then ( done => {
79
81
if ( done == false ) {
80
82
if ( r . entity ) {
0 commit comments