Skip to content

Commit 7ae0e4d

Browse files
authored
Merge pull request #666 from BMDSoftware/imp/result-event-emit
Provide search results on search-result plugin mount event
2 parents 6e06233 + 56d7f1b commit 7ae0e4d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

dicoogle/src/main/resources/webapp/js/components/plugin/pluginForm.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import * as PropTypes from "prop-types";
33
import { ResultsSelected } from "../../stores/resultSelected";
4+
import { SearchStore } from "../../stores/searchStore";
45
import Webcore from "dicoogle-webcore";
56

67
export default class PluginForm extends React.Component {
@@ -39,9 +40,12 @@ export default class PluginForm extends React.Component {
3940
node.addEventListener("hide", this.handleHideSignal);
4041

4142
Webcore.emitSlotSignal(
42-
node,
43-
"result-selection-ready",
44-
ResultsSelected.get()
43+
node,
44+
"result-selection-ready",
45+
{
46+
"selected": ResultsSelected.get(),
47+
"search": SearchStore.get()
48+
}
4549
);
4650
}
4751
}

dicoogle/src/main/resources/webapp/js/stores/searchStore.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ const SearchStore = Reflux.createStore({
9292
data: this._contents,
9393
success: true
9494
});
95+
},
96+
97+
get: function() {
98+
return {
99+
data: this._contents
100+
};
95101
}
96102
});
97103

webcore/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ This section documents each possible type of web UI plugin. Note that not all of
181181
- **result-option**: Result option plugins are used to provide advanced operations to a result entry. If the user activates
182182
_"Advanced Options"_ in the search results view, these plugins will be attached into a new column, one for each visible result entry.
183183
- **result-batch**: Result batch plugins are used to provide advanced operations over an existing list of results. These plugins will
184-
attach a button (named with the plugin's caption property), which will pop-up a division below the search result view.
184+
attach a button (named with the plugin's caption property), which appear in a division below the search result view.
185185
- **settings**: Settings plugins can be used to provide addition management information and control. These plugins will be attached to
186186
the _"Plugins & Services"_ tab in the _Management_ menu.
187187
- **query**: _(currently unsupported)_ Create different query user interfaces. Once supported, they will be
@@ -257,6 +257,7 @@ Full list of events that can be used by plugins and the webapp. _(Work in Progre
257257

258258
- "load" : Emitted when a plugin package is retrieved.
259259
- "result" : Emitted when a list of search results is obtained from the search interface.
260+
- "result-selection-ready" : Emitted on plugin mount for "result-batch" plugins. Provides current list of search results and selected entries.
260261

261262
## Installing Plugins
262263

0 commit comments

Comments
 (0)