Skip to content

Commit 73fdfd8

Browse files
author
Thomas Draier
authored
BACKLOG-11820: Export ComponentRenderer, fixes context in menu action (#73)
1 parent 5392f78 commit 73fdfd8

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import * as React from 'react';
2+
3+
export interface ComponentRendererProviderProps {
4+
children?: React.ReactElement<any>;
5+
}
6+
7+
export class ComponentRendererProvider extends React.Component<ComponentRendererProviderProps, any> {
8+
render(): JSX.Element;
9+
10+
}
11+
12+
export interface ComponentRendererConsumerProps {
13+
}
14+
15+
export class ComponentRendererConsumer extends React.Component<ComponentRendererConsumerProps, any> {
16+
render(): JSX.Element;
17+
18+
}
19+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
3+
export interface DisplayActionProps {
4+
/**
5+
* The key of the action to display
6+
*/
7+
actionKey: string;
8+
/**
9+
* The action context
10+
*/
11+
context: Object;
12+
/**
13+
* The render component
14+
*/
15+
render: (...args: any[])=>any;
16+
/**
17+
* ..
18+
*/
19+
observerRef?: (...args: any[])=>any;
20+
}
21+
22+
export class DisplayAction extends React.Component<DisplayActionProps, any> {
23+
render(): JSX.Element;
24+
25+
}
26+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
3+
export interface DisplayActionsProps {
4+
/**
5+
* The target from which the items will be selected
6+
*/
7+
target: string;
8+
/**
9+
* The action context
10+
*/
11+
context: Object;
12+
/**
13+
* The render component
14+
*/
15+
render: (...args: any[])=>any;
16+
/**
17+
* Additional filter function
18+
*/
19+
filter?: (...args: any[])=>any;
20+
}
21+
22+
export class DisplayActions extends React.Component<DisplayActionsProps, any> {
23+
render(): JSX.Element;
24+
25+
}
26+

packages/ui-extender/src/actions/menuAction/menuAction.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const Menu = ({context, menuContext, anchor, isOpen, onExited}) => {
2525
target={menuTarget}
2626
filter={menuFilter}
2727
context={{
28+
...originalContext,
2829
originalContext,
2930
parentMenuContext: context.menuContext,
3031
rootMenuContext: rootMenuContext

packages/ui-extender/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
export * from './ComponentRenderer';
12
export * from './actions';
23
export * from './registry';

0 commit comments

Comments
 (0)