Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide full search results on result-batch plugin mount event #666

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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