fix(bugs): fixing lots of bugs regarding release candidate (#3700)

This commit is contained in:
Alireza authored and GitHub committed 2023-10-05 23:39:56 -04:00
1 parent 29aeb070e0
commit 8bc12a37d0
16 files changed
+119 -76

No files matched your search

@@ -160,7 +160,7 @@ export default class StaticWadoClient extends api.DICOMwebClient {
if (!valueElem) {
return false;
}
if (valueElem.vr == 'DA') {
if (valueElem.vr === 'DA' && valueElem.Value?.[0]) {
return this.compareDateRange(testValue, valueElem.Value[0]);
}
const value = valueElem.Value;
@@ -33,7 +33,6 @@ function PanelStudyBrowser({
const [studyDisplayList, setStudyDisplayList] = useState([]);
const [displaySets, setDisplaySets] = useState([]);
const [thumbnailImageSrcMap, setThumbnailImageSrcMap] = useState({});
const isMounted = useRef(true);
const onDoubleClickThumbnailHandler = displaySetInstanceUID => {
let updatedViewports = [];
@@ -120,17 +119,11 @@ function PanelStudyBrowser({
}
// When the image arrives, render it and store the result in the thumbnailImgSrcMap
newImageSrcEntry[dSet.displaySetInstanceUID] = await getImageSrc(imageId);
if (!isMounted.current) {
return;
}
setThumbnailImageSrcMap(prevState => {
return { ...prevState, ...newImageSrcEntry };
});
});
return () => {
isMounted.current = false;
};
}, [StudyInstanceUIDs, dataSource, displaySetService, getImageSrc]);
// ~~ displaySets
+26 -2
View File
@@ -170,6 +170,7 @@ const commandsModule = ({
stageIndex,
reset = false,
}: HangingProtocolParams): boolean => {
const primaryToolBeforeHPChange = toolbarService.getActivePrimaryTool();
try {
// Stores in the state the display set selector id to displaySetUID mapping
// Pass in viewportId for the active viewport. This item will get set as
@@ -241,7 +242,29 @@ const commandsModule = ({
stateSyncService.store(stateSyncReduce);
// This is a default action applied
const { protocol } = hangingProtocolService.getActiveProtocol();
actions.toggleHpTools(protocol);
actions.toggleHpTools();
// try to use the same tool in the new hanging protocol stage
const primaryButton = toolbarService.getButton(primaryToolBeforeHPChange);
if (primaryButton) {
// is there any type of interaction on this button, if not it might be in the
// items. This is a bit of a hack, but it works for now.
let interactionType = primaryButton.props?.interactionType;
if (!interactionType && primaryButton.props?.items) {
const firstItem = primaryButton.props.items[0];
interactionType = firstItem.props?.interactionType || firstItem.props?.type;
}
if (interactionType) {
toolbarService.recordInteraction({
interactionType,
...primaryButton.props,
});
}
}
// Send the notification about updating the state
if (protocolId !== hpInfo.protocolId) {
// The old protocol callbacks are used for turning off things
@@ -253,7 +276,8 @@ const commandsModule = ({
commandsManager.run(protocol.callbacks?.onProtocolEnter);
return true;
} catch (e) {
actions.toggleHpTools(hangingProtocolService.getActiveProtocol());
console.error(e);
actions.toggleHpTools();
uiNotificationService.show({
title: 'Apply Hanging Protocol',
message: 'The hanging protocol could not be applied.',