-
@@ -193,32 +153,24 @@ const dataview = {
width: util.getDataviewItemWidth(),
height: util.getDataviewItemHeight()
},
- activeContent: {
- markCheckbox: {
- view: "checkbox",
- css: "checkbox-ctrl",
- width: 20,
- height: 30,
- on: {
- onChange(value, oldValue) {
- let studyFlag = selectedImages.getStudyFlag();
- const datav = $$(dataview.id);
- const item = datav.getItem(this.config.$masterId);
- if (value
- && (
- selectedImages.count() >= constants.MAX_COUNT_IMAGES_SELECTION
- || selectedImages.countForStudies() >= constants.MAX_COUNT_IMAGES_SELECTION
- )
- ) {
- datav.updateItem(item.id, {markCheckbox: oldValue});
- webix.alert({
- text: `You can select maximum ${constants.MAX_COUNT_IMAGES_SELECTION} images`
- });
- return;
- }
- changeSelectedItem(item, value, datav, studyFlag);
- }
+ onClick: {
+ "gallery-images-checkbox": function (event, id, checkbox) {
+ const studyFlag = selectedImages.getStudyFlag();
+ const item = this.getItem(id);
+ const value = checkbox.checked;
+ if (value
+ && (
+ selectedImages.count() >= constants.MAX_COUNT_IMAGES_SELECTION
+ || selectedImages.countForStudies() >= constants.MAX_COUNT_IMAGES_SELECTION
+ )
+ ) {
+ this.updateItem(id, {markCheckbox: !value});
+ webix.alert({
+ text: `You can select maximum ${constants.MAX_COUNT_IMAGES_SELECTION} images`
+ });
+ return;
}
+ changeSelectedItem(item, value, this, studyFlag);
}
}
};
diff --git a/sources/views/subviews/gallery/parts/galleryPager.js b/sources/views/subviews/gallery/parts/galleryPager.js
index 16255910..a5998772 100644
--- a/sources/views/subviews/gallery/parts/galleryPager.js
+++ b/sources/views/subviews/gallery/parts/galleryPager.js
@@ -62,9 +62,10 @@ const mobilePager = createPager({
/**
- * @param id
- * @param sourceDataviewId
+ * @param {string} id
+ * @param {string} sourceDataviewId
* @param {boolean} isMobile
+ * @returns {webix.ui.pagerConfig}
*/
function getConfig(id, sourceDataviewId, isMobile) {
if (isMobile) {
diff --git a/sources/views/subviews/gallery/windows/imageWindow.js b/sources/views/subviews/gallery/windows/imageWindow.js
index 99b692f0..d718e674 100644
--- a/sources/views/subviews/gallery/windows/imageWindow.js
+++ b/sources/views/subviews/gallery/windows/imageWindow.js
@@ -1,15 +1,12 @@
-import galleryImagesUrls from "../../../../models/galleryImagesUrls";
import windowWithHeader from "../../../components/windowWithHeader";
import "../../../components/slideButton";
-
const templateViewer = {
view: "template",
css: "absolute-centered-image-template",
template(obj) {
- const imageUrl = galleryImagesUrls.getNormalImageUrl(obj.imageId) || "";
return `
-

+
❮
❯
@@ -23,9 +20,8 @@ const templateViewerWithoutControls = {
css: "absolute-centered-image-template",
hidden: true,
template(obj) {
- const imageUrl = galleryImagesUrls.getNormalImageUrl(obj.imageId) || "";
return `
-

+
`;
},
@@ -60,27 +56,13 @@ const slideButton = {
labelLeft: "off",
labelRight: "on",
value: false,
- on: {
- onChange(newv) {
- if (newv) {
- $$(metadataContainer.id).show();
- // eslint-disable-next-line no-use-before-define
- refreshTemplate();
- }
- else {
- $$(metadataContainer.id).hide();
- // eslint-disable-next-line no-use-before-define
- refreshTemplate();
- }
- }
- }
};
const windowBody = {
css: "metadata-window-body",
paddingX: 35,
- width: 1100,
- height: 610,
+ width: Math.floor(window.innerWidth * 0.7),
+ height: Math.floor(window.innerHeight * 0.7),
type: "clean",
rows: [
{
@@ -105,26 +87,14 @@ const windowBody = {
]
};
-function refreshTemplate() {
- // eslint-disable-next-line no-use-before-define
- let imageTemplate = $$(getViewerId());
- imageTemplate.refresh();
-}
-
function getConfig(id, studyImage, closeCallback) {
- let windowTitle;
templateViewer.id = `viewer-${webix.uid()}`;
templateViewerWithoutControls.id = `viewer-without-controls-${webix.uid()}`;
slideButton.id = `slidebutton-${webix.uid()}`;
layoutForMetadata.id = `layout-for-metadata-${webix.uid()}`;
metadataContainer.id = `metadata-container-${webix.uid()}`;
zoomButtonsTemplate.id = `zoombuttons-template-${webix.uid()}`;
- if (!studyImage) {
- windowTitle = "Metadata";
- }
- else {
- windowTitle = studyImage;
- }
+ const windowTitle = studyImage ?? "";
return windowWithHeader.getConfig(id, windowBody, windowTitle, closeCallback);
}
@@ -148,6 +118,10 @@ function getMetadataLayoutId() {
return layoutForMetadata.id;
}
+function getMetadataContainerId() {
+ return metadataContainer.id;
+}
+
function getZoomButtonTemplateId() {
return zoomButtonsTemplate.id;
}
@@ -159,5 +133,6 @@ export default {
getViewerWithoutControlsId,
getSliderButtonId,
getMetadataLayoutId,
+ getMetadataContainerId,
getZoomButtonTemplateId
};
diff --git a/sources/views/subviews/gallery/windows/metadataWindow.js b/sources/views/subviews/gallery/windows/metadataWindow.js
index 9efa6451..ac79fc3e 100644
--- a/sources/views/subviews/gallery/windows/metadataWindow.js
+++ b/sources/views/subviews/gallery/windows/metadataWindow.js
@@ -10,7 +10,7 @@ const windowBody = {
css: "metadata-window-body",
paddingX: 35,
width: 523,
- height: 610,
+ height: Math.floor(window.innerHeight * 0.7),
type: "clean",
rows: [
{ // this container is needed to draw external borders
diff --git a/sources/views/subviews/gallery/windows/mobileImageWindow.js b/sources/views/subviews/gallery/windows/mobileImageWindow.js
index 0be8b9b2..2d524330 100644
--- a/sources/views/subviews/gallery/windows/mobileImageWindow.js
+++ b/sources/views/subviews/gallery/windows/mobileImageWindow.js
@@ -1,6 +1,5 @@
import windowWithHeader from "app-components/mobileWindow";
-import galleryImageUrl from "../../../../models/galleryImagesUrls";
import "../../../components/slideButton";
const closeArea = {
@@ -15,10 +14,8 @@ const templateViewer = {
autoHeight: true,
gravity: 1,
template(obj) {
- const imageUrl = galleryImageUrl.getNormalImageUrl(obj.imageId) ?? "";
-
return `
-

+
`;
},
borderless: true
diff --git a/sources/views/subviews/gallery/windows/multiImageLesionWindow.js b/sources/views/subviews/gallery/windows/multiImageLesionWindow.js
index 3de32533..a9a9b3e3 100644
--- a/sources/views/subviews/gallery/windows/multiImageLesionWindow.js
+++ b/sources/views/subviews/gallery/windows/multiImageLesionWindow.js
@@ -45,74 +45,22 @@ function getConfig(windowTitle, closeCallback) {
const leftSlider = getVerticalSlider(ID_LEFT_SLIDER, constants.MULTI_LESION_SIDE.LEFT);
const rightSlider = getVerticalSlider(ID_RIGHT_SLIDER, constants.MULTI_LESION_SIDE.RIGHT);
- /** @type {webix.ui.labelConfig} */
const leftImageLabel = getImageLabel(ID_LEFT_IMAGE_NAME_LABEL);
const rightImageLabel = getImageLabel(ID_RIGHT_IMAGE_NAME_LABEL);
- const leftAnchorIcon = {
- view: "icon",
- id: ID_LEFT_ANCHOR_ICON,
- width: 20,
- height: 20,
- icon: "fas fa-anchor"
- };
+ const leftAnchorIcon = getAnchorIcon(ID_LEFT_ANCHOR_ICON);
+ const rightAnchorIcon = getAnchorIcon(ID_RIGHT_ANCHOR_ICON);
- const rightAnchorIcon = {
- view: "icon",
- id: ID_RIGHT_ANCHOR_ICON,
- width: 20,
- height: 20,
- icon: "fas fa-anchor"
- };
-
- /** @type {webix.ui.richselectConfig} */
- const leftGroupDropdown = {
- view: "richselect",
- id: ID_LEFT_DROP_DOWN_FILTER,
- css: "multilesion-filter-dropdown",
- label: "Group by:",
- labelAlign: "left",
- width: 270,
- height: 24,
- labelWidth: 75,
- value: constants.MULTI_LESION_GROUP_BY.TIME,
- // TODO: check options
- options: [
- constants.MULTI_LESION_GROUP_BY.TIME,
- constants.MULTI_LESION_GROUP_BY.TYPE,
- constants.MULTI_LESION_GROUP_BY.COMBINATION,
- constants.MULTI_LESION_GROUP_BY.NO_GROUP,
- ]
- };
-
- const rightGroupDropdown = {
- view: "richselect",
- id: ID_RIGHT_DROP_DOWN_FILTER,
- css: "multilesion-filter-dropdown",
- label: "Group by:",
- labelAlign: "left",
- width: 270,
- height: 30,
- labelWidth: 75,
- value: constants.MULTI_LESION_GROUP_BY.TIME,
- // TODO: check options
- options: [
- constants.MULTI_LESION_GROUP_BY.TIME,
- constants.MULTI_LESION_GROUP_BY.TYPE,
- constants.MULTI_LESION_GROUP_BY.COMBINATION,
- constants.MULTI_LESION_GROUP_BY.NO_GROUP,
- ]
- };
+ const leftGroupDropdown = getGroupDropdown(ID_LEFT_DROP_DOWN_FILTER);
+ const rightGroupDropdown = getGroupDropdown(ID_RIGHT_DROP_DOWN_FILTER);
const leftTemplateViewer = getTemplateViewer(
ID_LEFT_IMAGE,
- true,
constants.MULTI_LESION_SIDE.LEFT
);
const rightTemplateViewer = getTemplateViewer(
ID_RIGHT_IMAGE,
- true,
constants.MULTI_LESION_SIDE.RIGHT
);
@@ -122,17 +70,13 @@ function getConfig(windowTitle, closeCallback) {
cols: [
{width: 20},
leftImageLabel,
- {width: 5},
leftAnchorIcon,
- {
- gravity: 1,
- minWidth: 10
- },
+ {},
{
rows: [
- {gravity: 1},
+ {},
leftGroupDropdown,
- {gravity: 1},
+ {},
]
},
{width: 100}
@@ -146,16 +90,15 @@ function getConfig(windowTitle, closeCallback) {
{width: 100},
{
rows: [
- {gravity: 1},
+ {},
rightGroupDropdown,
- {gravity: 1},
+ {},
]
},
- {gravity: 1},
+ {},
rightImageLabel,
- {width: 5},
rightAnchorIcon,
- {gravity: 1},
+ {width: 20},
],
};
@@ -216,11 +159,16 @@ function getConfig(windowTitle, closeCallback) {
]
};
+ const initialWidth = Math.floor(window.innerWidth * 0.85);
+ const initialHeight = Math.floor(window.innerHeight * 0.85);
+
return {
view: "window",
id: ID_MULTI_IMAGE_LESION_WINDOW,
- width: 1240,
- height: 750,
+ width: initialWidth,
+ height: initialHeight,
+ initialWidth,
+ initialHeight,
css: "window-with-header",
modal: true,
fullscreen: false,
@@ -313,8 +261,10 @@ function getConfig(windowTitle, closeCallback) {
}
/**
- * Description placeholder
- *
+ * @param {string} topPanelID
+ * @param {string} sliderID
+ * @param {string} prevButtonID
+ * @param {string} nextButtonID
* @returns {webix.ui.listConfig}
*/
function getTopSlider(topPanelID, sliderID, prevButtonID, nextButtonID) {
@@ -347,47 +297,19 @@ function getTopSlider(topPanelID, sliderID, prevButtonID, nextButtonID) {
const lesion = lesionsModel.getLesionByID(lesionID);
const lesionModalitiesCount = lesionID
? lesionsModel.getLesionModalitiesCount(lesionID)
- : null;
+ : 0;
const lesionTimePointsCount = lesionID
? lesionsModel.getLesionTimePointsCount(lesionID)
- : null;
- const imageIconDimensions = {
- iconContainerDimensions: {
- width: constants.DEFAULT_RIBBON_ICON_CONTAINER_WIDTH,
- height: constants.DEFAULT_RIBBON_ICON_CONTAINER_HEIGHT
- },
- iconDimensions: {
- width: constants.DEFAULT_RIBBON_IMAGE_ICON_WIDTH,
- height: constants.DEFAULT_RIBBON_IMAGE_ICON_HEIGHT
- }
- };
- const lesionIconElementClass = lesion
- ? "gallery-images-button-elem"
- : "gallery-images-button-elem-disabled";
- const disabledBadge = lesion
- ? ""
- : " disabled-badge";
- const diagnosisIcon = obj.hasAnnotations ?
- `
-
-
-
- Multirater
-
` : "";
- const lesionIcon = `
-
-
-
- Lesion
- ${lesionModalitiesCount ?? 0}
- Modalities count
- ${lesionTimePointsCount ?? 0}
- Time points count
-
`;
+ : 0;
+
+ const lesionIconBadges = `
+ ${util.getIconBadge(lesionTimePointsCount, "Lesion time points count", lesion, true)}
+ ${util.getIconBadge(lesionModalitiesCount, "Lesion modalities count", lesion, false)}
+ `;
+ const diagnosisIcon = obj.hasAnnotations
+ ? util.getIconButton("diagnosis-icon", true, "Multirater", "", "")
+ : "";
+
const starHtml = obj.hasAnnotations ? "
" : "";
if (typeof galleryImageUrl.getPreviewImageUrl(lesionsModel.getItemID(obj)) === "undefined") {
galleryImageUrl.setPreviewImageUrl(
@@ -396,37 +318,16 @@ function getTopSlider(topPanelID, sliderID, prevButtonID, nextButtonID) {
); // to prevent sending query more than 1 time
}
return `
-
+
-
${starHtml}
@@ -466,7 +367,7 @@ function getVerticalSlider(id, side) {
* @param {string} obj.groupBy
* @param {string | number} obj.groupValue
* @param {Array} obj.images
- * @returns
+ * @returns {string}
*/
template(obj, /* common */) {
let images;
@@ -506,31 +407,33 @@ function getVerticalSlider(id, side) {
/**
- * Description placeholder
- *
- * @param {boolean} showButtons
+ * @param {string} id
+ * @param {string} side
* @returns {webix.ui.templateConfig}
*/
-function getTemplateViewer(id, showButtons, side) {
+function getTemplateViewer(id, side) {
return {
view: "template",
id,
css: "absolute-centered-image-template",
template(obj) {
- const imageUrl = galleryImageUrl.getNormalImageUrl(lesionsModel.getItemID(obj)) || "";
const lesionsImages = side === constants.MULTI_LESION_SIDE.LEFT
? lesionsModel.getCurrentLeftImages()
: lesionsModel.getCurrentRightImages();
return `
-

+
- ${showButtons && lesionsImages.length > 1 ? '
❮❯' : ""}
+ ${lesionsImages.length > 1 ? '
❮❯' : ""}
`;
},
borderless: true
};
}
+/**
+ * @param {string} imageNameId
+ * @returns {webix.ui.labelConfig}
+ */
function getImageLabel(imageNameId) {
return {
view: "label",
@@ -541,6 +444,44 @@ function getImageLabel(imageNameId) {
};
}
+/**
+ * @param {string} id
+ * @returns {webix.ui.iconConfig}
+ */
+function getAnchorIcon(id) {
+ return {
+ view: "icon",
+ id,
+ width: 30,
+ height: 20,
+ icon: "fas fa-anchor"
+ };
+}
+
+/**
+ * @param {string} id
+ * @returns {webix.ui.richselectConfig}
+ */
+function getGroupDropdown(id) {
+ return {
+ view: "richselect",
+ id,
+ css: "multilesion-filter-dropdown",
+ label: "Group by:",
+ labelAlign: "left",
+ width: 270,
+ height: 30,
+ labelWidth: 75,
+ value: constants.MULTI_LESION_GROUP_BY.TIME,
+ options: [
+ constants.MULTI_LESION_GROUP_BY.TIME,
+ constants.MULTI_LESION_GROUP_BY.TYPE,
+ constants.MULTI_LESION_GROUP_BY.COMBINATION,
+ constants.MULTI_LESION_GROUP_BY.NO_GROUP,
+ ]
+ };
+}
+
function footerTemplateFunction(obj, /* common */) {
const lesionID = lesionsModel.getItemLesionID(obj);
const lesionImagesCount = lesionID