Skip to content

Commit d2bb011

Browse files
author
Alexander Tikvach
authored
Merge pull request #405 from gemini-testing/feature/top-extension-point
feat: added 'root' extension-point
2 parents 52cda51 + b7e571a commit d2bb011

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ directory.
291291
* `result` - allows to extend each test result; adds `resultId` and `testName` props to the plugin component;
292292
* `result_meta` - allows to extend meta information of each test result; adds `result` and `testName` props to the plugin component;
293293
* `menu-bar` - allows to extend menu bar.
294+
* `root` - allows to add floating items like modal or popup.
294295

295296
An extension point may be extended by more than one component. In that case order of components application is determined by `plugins` config order. Each following component is applied to all previously composed components at the extension point.
296297

lib/constants/extension-points.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
export const RESULT = 'result';
44
export const RESULT_META = 'result_meta';
55
export const MENU_BAR = 'menu-bar';
6+
export const ROOT = 'root';

lib/static/components/gui.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Notifications from 'reapop';
55
import wybo from 'reapop-theme-wybo';
66
import {bindActionCreators} from 'redux';
77

8+
import {ROOT} from '../../constants/extension-points';
89
import * as actions from '../modules/actions';
910
import ControlButtons from './controls/gui-controls';
1011
import SkippedList from './skipped-list';
@@ -14,6 +15,7 @@ import MainTree from './main-tree';
1415
import CustomScripts from './custom-scripts';
1516
import clientEvents from '../../gui/constants/client-events';
1617
import FaviconChanger from './favicon-changer';
18+
import ExtensionPoint from './extension-point';
1719

1820
class Gui extends Component {
1921
static propTypes = {
@@ -74,16 +76,18 @@ class Gui extends Component {
7476

7577
return (
7678
<Fragment>
77-
<CustomScripts scripts={customScripts}/>
78-
<Notifications theme={wybo}/>
79-
<FaviconChanger />
80-
<ControlButtons />
81-
<main className="container">
82-
<SkippedList />
83-
<MainTree />
84-
</main>
85-
<Loading active={loading.active} content={loading.content} />
86-
<ModalContainer />
79+
<ExtensionPoint name={ROOT}>
80+
<CustomScripts scripts={customScripts}/>
81+
<Notifications theme={wybo}/>
82+
<FaviconChanger />
83+
<ControlButtons />
84+
<main className="container">
85+
<SkippedList />
86+
<MainTree />
87+
</main>
88+
<Loading active={loading.active} content={loading.content} />
89+
<ModalContainer />
90+
</ExtensionPoint>
8791
</Fragment>
8892
);
8993
}

lib/static/components/report.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Notifications from 'reapop';
55
import wybo from 'reapop-theme-wybo';
66
import {bindActionCreators} from 'redux';
77

8+
import {ROOT} from '../../constants/extension-points';
89
import * as actions from '../modules/actions';
910
import Loading from './loading';
1011
import Header from './header';
@@ -13,6 +14,7 @@ import SkippedList from './skipped-list';
1314
import MainTree from './main-tree';
1415
import CustomScripts from './custom-scripts';
1516
import FaviconChanger from './favicon-changer';
17+
import ExtensionPoint from './extension-point';
1618

1719
class Report extends Component {
1820
static propTypes = {
@@ -44,15 +46,17 @@ class Report extends Component {
4446

4547
return (
4648
<Fragment>
47-
<CustomScripts scripts={this.props.customScripts}/>
48-
<Notifications theme={wybo} />
49-
<FaviconChanger />
50-
<Header/>
51-
<ControlButtons/>
52-
<main className="container">
53-
<SkippedList />
54-
<MainTree />
55-
</main>
49+
<ExtensionPoint name={ROOT}>
50+
<CustomScripts scripts={this.props.customScripts}/>
51+
<Notifications theme={wybo} />
52+
<FaviconChanger />
53+
<Header/>
54+
<ControlButtons/>
55+
<main className="container">
56+
<SkippedList />
57+
<MainTree />
58+
</main>
59+
</ExtensionPoint>
5660
</Fragment>
5761
);
5862
}

0 commit comments

Comments
 (0)