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

Fix Web UI Plugin Settings Files Not Handled Properly / Include PatientID in study view entries #680

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -89,7 +89,11 @@ private String getPluginsBySlot(HttpServletRequest req, String... slotIds) throw
List<String> pkgList = new ArrayList<>(plugins.size());
for (WebUIPlugin plugin : plugins) {

String pkg = PluginController.getInstance().getWebUIPackageJSON(plugin.getName());
JSONObject pkgObject =
JSONObject.fromObject(PluginController.getInstance().getWebUIPackageJSON(plugin.getName()));
pkgObject.put("settings", plugin.getSettings());

String pkg = pkgObject.toString();
if (pkg == null) {
logger.warn("Ignoring web plugin {}", plugin.getName());
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const StudyView = createReactClass({
uid: item.studyInstanceUID,
// deprecated data fields
"data-result-type": "study",
"data-result-uid": item.studyInstanceUID
"data-result-uid": item.studyInstanceUID,
"data-result-patientid": item.patientid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this reasoning, maybe we should also provide more ID fields at the other levels?

}}
/>
</div>
Expand Down Expand Up @@ -141,6 +142,9 @@ const StudyView = createReactClass({
var self = this;
var resultArray = this.props.patient.studies;

for (let i = 0; i < resultArray.length; i++)
resultArray[i]['patientid'] = this.props.patient.id;

var selectRowProp = {
clickToSelect: true,
mode: "none",
Expand Down
3 changes: 2 additions & 1 deletion webcore/src/dicoogle-webcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,14 @@ export const fetchModules = m.fetchModules;
pluginInstance.Name = name;
pluginInstance.SlotId = slotId;
pluginInstance.Caption = thisPackage.dicoogle.caption || name;
pluginInstance.Settings = thisPackage.settings;
plugins[name] = pluginInstance;
if (slots[slotId]) {
for (let slot of slots[slotId]) {
slot.attachPlugin(pluginInstance);
}
}
const eventData = {name, slotId, caption: pluginInstance.Caption};
const eventData = {name, slotId, caption: pluginInstance.Caption, settings: pluginInstance.Settings};
event_hub.emit('load', eventData);
};
export const onRegister = m.onRegister;
Expand Down