diff --git a/dicoogle/src/main/resources/webapp/js/actions/requestActions.js b/dicoogle/src/main/resources/webapp/js/actions/requestActions.js new file mode 100644 index 000000000..ebe937e40 --- /dev/null +++ b/dicoogle/src/main/resources/webapp/js/actions/requestActions.js @@ -0,0 +1,5 @@ +import Reflux from "reflux"; +const RequestActions = { + query: Reflux.createAction(), +}; +export { RequestActions }; diff --git a/dicoogle/src/main/resources/webapp/js/components/plugin/pluginForm.jsx b/dicoogle/src/main/resources/webapp/js/components/plugin/pluginForm.jsx index 327c9435a..184d43879 100644 --- a/dicoogle/src/main/resources/webapp/js/components/plugin/pluginForm.jsx +++ b/dicoogle/src/main/resources/webapp/js/components/plugin/pluginForm.jsx @@ -1,6 +1,7 @@ import React from "react"; import * as PropTypes from "prop-types"; import { ResultsSelected } from "../../stores/resultSelected"; +import { RequestStore } from "../../stores/requestStore"; import { SearchStore } from "../../stores/searchStore"; import Webcore from "dicoogle-webcore"; @@ -43,6 +44,7 @@ export default class PluginForm extends React.Component { node, "result-selection-ready", { + "request": RequestStore.get(), "selected": ResultsSelected.get(), "search": SearchStore.get() } diff --git a/dicoogle/src/main/resources/webapp/js/stores/requestStore.js b/dicoogle/src/main/resources/webapp/js/stores/requestStore.js new file mode 100644 index 000000000..b0a50cc89 --- /dev/null +++ b/dicoogle/src/main/resources/webapp/js/stores/requestStore.js @@ -0,0 +1,26 @@ +import Reflux from "reflux"; + +import { RequestActions } from "../actions/requestActions"; + +const RequestStore = Reflux.createStore({ + listenables: RequestActions, + + init: function() { + this._query = ""; + this._provider = ""; + }, + + onQuery: function(query, provider) { + this._query = query + this._provider = provider + }, + + get: function() { + return { + query: this._query, + provider: this._provider + }; + } +}); + +export { RequestStore }; diff --git a/dicoogle/src/main/resources/webapp/js/stores/searchStore.js b/dicoogle/src/main/resources/webapp/js/stores/searchStore.js index 2addbc310..9952c4708 100644 --- a/dicoogle/src/main/resources/webapp/js/stores/searchStore.js +++ b/dicoogle/src/main/resources/webapp/js/stores/searchStore.js @@ -6,6 +6,8 @@ import { getPatients } from "../handlers/requestHandler"; import { unindex } from "../handlers/requestHandler"; import { remove } from "../handlers/requestHandler"; +import { RequestActions } from "../actions/requestActions"; + const SearchStore = Reflux.createStore({ listenables: ActionCreators, init: function() { @@ -20,6 +22,9 @@ const SearchStore = Reflux.createStore({ onSearch: function(data) { var self = this; + + RequestActions.query(data.text, data.provider) + getPatients( data.text, undefined,