Skip to content

Commit

Permalink
Merge pull request #666 from BMDSoftware/imp/result-event-emit
Browse files Browse the repository at this point in the history
Provide search results on search-result plugin mount event
  • Loading branch information
Enet4 authored Sep 25, 2023
2 parents 6e06233 + 56d7f1b commit 7ae0e4d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import * as PropTypes from "prop-types";
import { ResultsSelected } from "../../stores/resultSelected";
import { SearchStore } from "../../stores/searchStore";
import Webcore from "dicoogle-webcore";

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

Webcore.emitSlotSignal(
node,
"result-selection-ready",
ResultsSelected.get()
node,
"result-selection-ready",
{
"selected": ResultsSelected.get(),
"search": SearchStore.get()
}
);
}
}
Expand Down
6 changes: 6 additions & 0 deletions dicoogle/src/main/resources/webapp/js/stores/searchStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ const SearchStore = Reflux.createStore({
data: this._contents,
success: true
});
},

get: function() {
return {
data: this._contents
};
}
});

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

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

## Installing Plugins

Expand Down

0 comments on commit 7ae0e4d

Please sign in to comment.