diff --git a/.eslintrc.json b/.eslintrc.json index 65affdc01d5..eecd3d05706 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,6 +21,10 @@ "version": "detect" } }, + "rules": { + // Enforce consistent brace style for all control statements for readability + "curly": "error" + }, "globals": { "cy": true, "before": true, diff --git a/extensions/cornerstone-dicom-seg/src/viewports/_getStatusComponent.tsx b/extensions/cornerstone-dicom-seg/src/viewports/_getStatusComponent.tsx index f9614f8066e..d491faa6e14 100644 --- a/extensions/cornerstone-dicom-seg/src/viewports/_getStatusComponent.tsx +++ b/extensions/cornerstone-dicom-seg/src/viewports/_getStatusComponent.tsx @@ -2,13 +2,12 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { Icon, Tooltip } from '@ohif/ui'; - export default function _getStatusComponent({ isHydrated, onStatusClick }) { let ToolTipMessage = null; let StatusIcon = null; - const {t} = useTranslation("Common"); - const loadStr = t("LOAD"); + const { t } = useTranslation('Common'); + const loadStr = t('LOAD'); switch (isHydrated) { case true: @@ -18,7 +17,7 @@ export default function _getStatusComponent({ isHydrated, onStatusClick }) {
This Segmentation is loaded in the segmentation panel
); break; - case false: + case false: StatusIcon = () => ; ToolTipMessage = () =>
Click LOAD to load segmentation.
; @@ -42,7 +41,6 @@ export default function _getStatusComponent({ isHydrated, onStatusClick }) { ); - return ( <> {ToolTipMessage && ( diff --git a/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts b/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts index e0209447127..9601acb0b94 100644 --- a/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts +++ b/extensions/cornerstone-dicom-sr/src/getSopClassHandlerModule.ts @@ -308,8 +308,9 @@ function _measurementReferencesSOPInstanceUID( measurement.coords[0].ReferencedSOPSequence[0]?.ReferencedFrameNumber) || 1; - if (frameNumber && Number(frameNumber) !== Number(ReferencedFrameNumber)) + if (frameNumber && Number(frameNumber) !== Number(ReferencedFrameNumber)) { return false; + } for (let j = 0; j < coords.length; j++) { const coord = coords[j]; @@ -670,7 +671,9 @@ function _getReferencedImagesList(ImagingMeasurementReportContentSequence) { _getSequenceAsArray(ImageLibraryGroup.ContentSequence).forEach(item => { const { ReferencedSOPSequence } = item; - if (!ReferencedSOPSequence) return; + if (!ReferencedSOPSequence) { + return; + } for (const ref of _getSequenceAsArray(ReferencedSOPSequence)) { if (ref.ReferencedSOPClassUID) { const { ReferencedSOPClassUID, ReferencedSOPInstanceUID } = ref; @@ -687,7 +690,9 @@ function _getReferencedImagesList(ImagingMeasurementReportContentSequence) { } function _getSequenceAsArray(sequence) { - if (!sequence) return []; + if (!sequence) { + return []; + } return Array.isArray(sequence) ? sequence : [sequence]; } diff --git a/extensions/cornerstone-dicom-sr/src/tools/DICOMSRDisplayTool.ts b/extensions/cornerstone-dicom-sr/src/tools/DICOMSRDisplayTool.ts index 347159d206b..8b656e972fb 100644 --- a/extensions/cornerstone-dicom-sr/src/tools/DICOMSRDisplayTool.ts +++ b/extensions/cornerstone-dicom-sr/src/tools/DICOMSRDisplayTool.ts @@ -314,18 +314,16 @@ export default class DICOMSRDisplayTool extends AnnotationTool { ); let canvasCorners; if (rotation == 90 || rotation == 270) { - canvasCorners = >( - utilities.math.ellipse.getCanvasEllipseCorners([ - canvasCoordinates[2], - canvasCoordinates[3], - canvasCoordinates[0], - canvasCoordinates[1], - ]) - ); + canvasCorners = utilities.math.ellipse.getCanvasEllipseCorners([ + canvasCoordinates[2], + canvasCoordinates[3], + canvasCoordinates[0], + canvasCoordinates[1], + ]) as Array; } else { - canvasCorners = >( - utilities.math.ellipse.getCanvasEllipseCorners(canvasCoordinates) - ); + canvasCorners = utilities.math.ellipse.getCanvasEllipseCorners( + canvasCoordinates + ) as Array; } const lineUID = `${index}`; diff --git a/extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts b/extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts index a1dd42d2c23..bc39b80806f 100644 --- a/extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts +++ b/extensions/cornerstone-dicom-sr/src/utils/createReferencedImageDisplaySet.ts @@ -3,12 +3,16 @@ import { DisplaySetService, classes } from '@ohif/core'; const ImageSet = classes.ImageSet; const findInstance = (measurement, displaySetService: DisplaySetService) => { - const { displaySetInstanceUID, ReferencedSOPInstanceUID: sopUid } = - measurement; + const { + displaySetInstanceUID, + ReferencedSOPInstanceUID: sopUid, + } = measurement; const referencedDisplaySet = displaySetService.getDisplaySetByUID( displaySetInstanceUID ); - if (!referencedDisplaySet.images) return; + if (!referencedDisplaySet.images) { + return; + } return referencedDisplaySet.images.find(it => it.SOPInstanceUID === sopUid); }; @@ -24,8 +28,12 @@ const findReferencedInstances = ( const instanceById = {}; for (const measurement of displaySet.measurements) { const { imageId } = measurement; - if (!imageId) continue; - if (instanceById[imageId]) continue; + if (!imageId) { + continue; + } + if (instanceById[imageId]) { + continue; + } const instance = findInstance(measurement, displaySetService); if (!instance) { diff --git a/extensions/cornerstone-dicom-sr/src/utils/findInstanceMetadataBySopInstanceUid.js b/extensions/cornerstone-dicom-sr/src/utils/findInstanceMetadataBySopInstanceUid.js index 99ffbe0b540..0e40ebb585f 100644 --- a/extensions/cornerstone-dicom-sr/src/utils/findInstanceMetadataBySopInstanceUid.js +++ b/extensions/cornerstone-dicom-sr/src/utils/findInstanceMetadataBySopInstanceUid.js @@ -9,7 +9,9 @@ const findInstanceMetadataBySopInstanceUID = (displaySets, SOPInstanceUID) => { let instanceFound; displaySets.find(displaySet => { - if (!displaySet.images) return false; + if (!displaySet.images) { + return false; + } instanceFound = displaySet.images.find( instanceMetadata => diff --git a/extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js b/extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js index 346bfc5db10..a25a74c9156 100644 --- a/extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js +++ b/extensions/cornerstone-dicom-sr/src/utils/hydrateStructuredReport.js @@ -12,20 +12,26 @@ const CORNERSTONE_3D_TOOLS_SOURCE_VERSION = '0.1'; const supportedLegacyCornerstoneTags = ['cornerstoneTools@^4.0.0']; const convertCode = (codingValues, code) => { - if (!code || code.CodingSchemeDesignator === 'CORNERSTONEJS') return; + if (!code || code.CodingSchemeDesignator === 'CORNERSTONEJS') { + return; + } const ref = `${code.CodingSchemeDesignator}:${code.CodeValue}`; const ret = { ...codingValues[ref], ref, ...code, text: code.CodeMeaning }; return ret; }; const convertSites = (codingValues, sites) => { - if (!sites || !sites.length) return; + if (!sites || !sites.length) { + return; + } const ret = []; // Do as a loop to convert away from Proxy instances for (let i = 0; i < sites.length; i++) { // Deal with irregular conversion from dcmjs const site = convertCode(codingValues, sites[i][0] || sites[i]); - if (site) ret.push(site); + if (site) { + ret.push(site); + } } return (ret.length && ret) || undefined; }; @@ -287,7 +293,7 @@ function _mapLegacyDataSet(dataset) { return dataset; } -const toArray = function (x) { +const toArray = function(x) { return Array.isArray(x) ? x : [x]; }; diff --git a/extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx b/extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx index abfde7f6372..b1c98c2fb47 100644 --- a/extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx +++ b/extensions/cornerstone/src/Viewport/OHIFCornerstoneViewport.tsx @@ -445,7 +445,9 @@ function _subscribeToJumpToMeasurementEvents( props => { cacheJumpToMeasurementEvent = props; const { viewportIndex: jumpIndex, measurement, isConsumed } = props; - if (!measurement || isConsumed) return; + if (!measurement || isConsumed) { + return; + } if (cacheJumpToMeasurementEvent.cornerstoneViewport === undefined) { // Decide on which viewport should handle this cacheJumpToMeasurementEvent.cornerstoneViewport = cornerstoneViewportService.getViewportIndexToJump( @@ -482,7 +484,9 @@ function _checkForCachedJumpToMeasurementEvents( viewportGridService, cornerstoneViewportService ) { - if (!cacheJumpToMeasurementEvent) return; + if (!cacheJumpToMeasurementEvent) { + return; + } if (cacheJumpToMeasurementEvent.isConsumed) { cacheJumpToMeasurementEvent = null; return; @@ -490,7 +494,9 @@ function _checkForCachedJumpToMeasurementEvents( const displaysUIDs = displaySets.map( displaySet => displaySet.displaySetInstanceUID ); - if (!displaysUIDs?.length) return; + if (!displaysUIDs?.length) { + return; + } // Jump to measurement if the measurement exists const { measurement } = cacheJumpToMeasurementEvent; diff --git a/extensions/cornerstone/src/Viewport/Overlays/CornerstoneOverlays.tsx b/extensions/cornerstone/src/Viewport/Overlays/CornerstoneOverlays.tsx index ea0c42cb90a..a860753d1e8 100644 --- a/extensions/cornerstone/src/Viewport/Overlays/CornerstoneOverlays.tsx +++ b/extensions/cornerstone/src/Viewport/Overlays/CornerstoneOverlays.tsx @@ -36,8 +36,9 @@ function CornerstoneOverlays(props) { } if (viewportData) { - const viewportInfo = - cornerstoneViewportService.getViewportInfoByIndex(viewportIndex); + const viewportInfo = cornerstoneViewportService.getViewportInfoByIndex( + viewportIndex + ); if (viewportInfo?.viewportOptions?.customViewportProps?.hideOverlays) { return null; diff --git a/extensions/cornerstone/src/initContextMenu.ts b/extensions/cornerstone/src/initContextMenu.ts index c46e5053e94..bd11dfa719c 100644 --- a/extensions/cornerstone/src/initContextMenu.ts +++ b/extensions/cornerstone/src/initContextMenu.ts @@ -35,9 +35,15 @@ const DEFAULT_CONTEXT_MENU_CLICKS = { function getEventName(evt) { const button = evt.detail.event.which; const nameArr = []; - if (evt.detail.event.altKey) nameArr.push('alt'); - if (evt.detail.event.ctrlKey) nameArr.push('ctrl'); - if (evt.detail.event.shiftKey) nameArr.push('shift'); + if (evt.detail.event.altKey) { + nameArr.push('alt'); + } + if (evt.detail.event.ctrlKey) { + nameArr.push('ctrl'); + } + if (evt.detail.event.shiftKey) { + nameArr.push('shift'); + } nameArr.push('button'); nameArr.push(button); return nameArr.join(''); @@ -73,7 +79,9 @@ function initContextMenu({ function elementEnabledHandler(evt) { const { viewportId, element } = evt.detail; const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId); - if (!viewportInfo) return; + if (!viewportInfo) { + return; + } const viewportIndex = viewportInfo.getViewportIndex(); // TODO check update upstream setEnabledElement(viewportIndex, element); diff --git a/extensions/cornerstone/src/initDoubleClick.ts b/extensions/cornerstone/src/initDoubleClick.ts index da8fb8fa49f..14f80c77525 100644 --- a/extensions/cornerstone/src/initDoubleClick.ts +++ b/extensions/cornerstone/src/initDoubleClick.ts @@ -21,9 +21,15 @@ const DEFAULT_DOUBLE_CLICK = { */ function getDoubleClickEventName(evt: CustomEvent) { const nameArr = []; - if (evt.detail.event.altKey) nameArr.push('alt'); - if (evt.detail.event.ctrlKey) nameArr.push('ctrl'); - if (evt.detail.event.shiftKey) nameArr.push('shift'); + if (evt.detail.event.altKey) { + nameArr.push('alt'); + } + if (evt.detail.event.ctrlKey) { + nameArr.push('ctrl'); + } + if (evt.detail.event.shiftKey) { + nameArr.push('shift'); + } nameArr.push('doubleClick'); return nameArr.join(''); } diff --git a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts index 82a74fcb0ae..56ed36197e7 100644 --- a/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts +++ b/extensions/cornerstone/src/services/ViewportService/CornerstoneViewportService.ts @@ -190,18 +190,26 @@ class CornerstoneViewportService extends PubSubService public setPresentations(viewport, presentations?: Presentations): void { const properties = presentations?.lutPresentation?.properties; - if (properties) viewport.setProperties(properties); + if (properties) { + viewport.setProperties(properties); + } const camera = presentations?.positionPresentation?.camera; - if (camera) viewport.setCamera(camera); + if (camera) { + viewport.setCamera(camera); + } } public getPresentation(viewportIndex: number): Presentation { const viewportInfo = this.viewportsInfo.get(viewportIndex); - if (!viewportInfo) return; + if (!viewportInfo) { + return; + } const { viewportType, presentationIds } = viewportInfo.getViewportOptions(); const csViewport = this.getCornerstoneViewportByIndex(viewportIndex); - if (!csViewport) return; + if (!csViewport) { + return; + } const properties = csViewport.getProperties(); if (properties.isComputedVOI) { @@ -408,7 +416,9 @@ class CornerstoneViewportService extends PubSubService viewport.setStack(imageIds, initialImageIndexToUse).then(() => { viewport.setProperties(properties); const camera = presentations.positionPresentation?.camera; - if (camera) viewport.setCamera(camera); + if (camera) { + viewport.setCamera(camera); + } }); } @@ -745,7 +755,10 @@ class CornerstoneViewportService extends PubSubService const viewport = this.getCornerstoneViewport(viewportId); const viewportCamera = viewport.getCamera(); - if (viewport instanceof VolumeViewport || viewport instanceof VolumeViewport3D) { + if ( + viewport instanceof VolumeViewport || + viewport instanceof VolumeViewport3D + ) { this._setVolumeViewport(viewport, viewportData, viewportInfo).then(() => { if (keepCamera) { viewport.setCamera(viewportCamera); diff --git a/extensions/cornerstone/src/services/ViewportService/Viewport.ts b/extensions/cornerstone/src/services/ViewportService/Viewport.ts index fc7fbc3412f..75e976d4e06 100644 --- a/extensions/cornerstone/src/services/ViewportService/Viewport.ts +++ b/extensions/cornerstone/src/services/ViewportService/Viewport.ts @@ -95,7 +95,9 @@ const dataContains = ( displaySetUID: string, imageId?: string ): boolean => { - if (data.displaySetInstanceUID === displaySetUID) return true; + if (data.displaySetInstanceUID === displaySetUID) { + return true; + } if (imageId && data.isCompositeStack && data.imageIds) { return !!data.imageIds.find(dataId => dataId === imageId); } @@ -123,7 +125,9 @@ class ViewportInfo { * OR if it is a composite stack and contains the given imageId */ public contains(displaySetUID: string, imageId: string): boolean { - if (!this.viewportData?.data) return false; + if (!this.viewportData?.data) { + return false; + } if (this.viewportData.data.length) { return !!this.viewportData.data.find(data => diff --git a/extensions/cornerstone/src/utils/DicomFileUploader.ts b/extensions/cornerstone/src/utils/DicomFileUploader.ts index 64465e597e9..45a6c9e94a6 100644 --- a/extensions/cornerstone/src/utils/DicomFileUploader.ts +++ b/extensions/cornerstone/src/utils/DicomFileUploader.ts @@ -212,7 +212,9 @@ export default class DicomFileUploader extends PubSubService { } private _checkDicomFile(arrayBuffer: ArrayBuffer) { - if (arrayBuffer.length <= 132) return false; + if (arrayBuffer.length <= 132) { + return false; + } const arr = new Uint8Array(arrayBuffer.slice(128, 132)); // bytes from 128 to 132 must be "DICM" return Array.from('DICM').every((char, i) => char.charCodeAt(0) === arr[i]); diff --git a/extensions/cornerstone/src/utils/callInputDialog.tsx b/extensions/cornerstone/src/utils/callInputDialog.tsx index efcd83c3ccc..dc35d62665a 100644 --- a/extensions/cornerstone/src/utils/callInputDialog.tsx +++ b/extensions/cornerstone/src/utils/callInputDialog.tsx @@ -35,8 +35,9 @@ function callInputDialog( const onSubmitHandler = ({ action, value }) => { switch (action.id) { case 'save': - if (typeof validateFunc === 'function' && !validateFunc(value.label)) + if (typeof validateFunc === 'function' && !validateFunc(value.label)) { return; + } callback(value.label, action.id); break; diff --git a/extensions/cornerstone/src/utils/interleave.js b/extensions/cornerstone/src/utils/interleave.js index 05fe2cab19a..a21d3fb7e0b 100644 --- a/extensions/cornerstone/src/utils/interleave.js +++ b/extensions/cornerstone/src/utils/interleave.js @@ -7,8 +7,12 @@ * @returns [] reordered to be breadth first traversal of lists */ export default function interleave(lists) { - if (!lists || !lists.length) return []; - if (lists.length === 1) return lists[0]; + if (!lists || !lists.length) { + return []; + } + if (lists.length === 1) { + return lists[0]; + } console.time('interleave'); const useLists = [...lists]; const ret = []; diff --git a/extensions/cornerstone/src/utils/measurementServiceMappings/Angle.ts b/extensions/cornerstone/src/utils/measurementServiceMappings/Angle.ts index dfbe9aa62af..767f550d41d 100644 --- a/extensions/cornerstone/src/utils/measurementServiceMappings/Angle.ts +++ b/extensions/cornerstone/src/utils/measurementServiceMappings/Angle.ts @@ -3,7 +3,7 @@ import getSOPInstanceAttributes from './utils/getSOPInstanceAttributes'; import { utils } from '@ohif/core'; const Angle = { - toAnnotation: measurement => { }, + toAnnotation: measurement => {}, /** * Maps cornerstone annotation event data to measurement service format. @@ -198,7 +198,9 @@ function getDisplayText(mappedAnnotations, displaySet) { const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : ''; const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : ''; - if (angle === undefined) return displayText; + if (angle === undefined) { + return displayText; + } const roundedAngle = utils.roundNumber(angle, 2); displayText.push( `${roundedAngle} ${unit} (S: ${SeriesNumber}${instanceText}${frameText})` diff --git a/extensions/cornerstone/src/utils/measurementServiceMappings/CobbAngle.ts b/extensions/cornerstone/src/utils/measurementServiceMappings/CobbAngle.ts index 53dace2b40b..6e2ebc79c53 100644 --- a/extensions/cornerstone/src/utils/measurementServiceMappings/CobbAngle.ts +++ b/extensions/cornerstone/src/utils/measurementServiceMappings/CobbAngle.ts @@ -3,7 +3,7 @@ import getSOPInstanceAttributes from './utils/getSOPInstanceAttributes'; import { utils } from '@ohif/core'; const CobbAngle = { - toAnnotation: measurement => { }, + toAnnotation: measurement => {}, /** * Maps cornerstone annotation event data to measurement service format. @@ -198,7 +198,9 @@ function getDisplayText(mappedAnnotations, displaySet) { const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : ''; const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : ''; - if (angle === undefined) return displayText; + if (angle === undefined) { + return displayText; + } const roundedAngle = utils.roundNumber(angle, 2); displayText.push( `${roundedAngle} ${unit} (S: ${SeriesNumber}${instanceText}${frameText})` diff --git a/extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts b/extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts index 44cf64ac067..fdc5993abe4 100644 --- a/extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts +++ b/extensions/cornerstone/src/utils/measurementServiceMappings/Length.ts @@ -32,12 +32,15 @@ const Length = { throw new Error('Tool not supported'); } - const { SOPInstanceUID, SeriesInstanceUID, StudyInstanceUID } = - getSOPInstanceAttributes( - referencedImageId, - cornerstoneViewportService, - viewportId - ); + const { + SOPInstanceUID, + SeriesInstanceUID, + StudyInstanceUID, + } = getSOPInstanceAttributes( + referencedImageId, + cornerstoneViewportService, + viewportId + ); let displaySet; @@ -101,8 +104,11 @@ function getMappedAnnotations(annotation, displaySetService) { ); } - const { SOPInstanceUID, SeriesInstanceUID, frameNumber } = - getSOPInstanceAttributes(referencedImageId); + const { + SOPInstanceUID, + SeriesInstanceUID, + frameNumber, + } = getSOPInstanceAttributes(referencedImageId); const displaySet = displaySetService.getDisplaySetForSOPInstanceUID( SOPInstanceUID, @@ -173,8 +179,12 @@ function getDisplayText(mappedAnnotations, displaySet) { const displayText = []; // Area is the same for all series - const { length, SeriesNumber, SOPInstanceUID, frameNumber } = - mappedAnnotations[0]; + const { + length, + SeriesNumber, + SOPInstanceUID, + frameNumber, + } = mappedAnnotations[0]; const instance = displaySet.images.find( image => image.SOPInstanceUID === SOPInstanceUID @@ -188,7 +198,9 @@ function getDisplayText(mappedAnnotations, displaySet) { const instanceText = InstanceNumber ? ` I: ${InstanceNumber}` : ''; const frameText = displaySet.isMultiFrame ? ` F: ${frameNumber}` : ''; - if (length === null || length === undefined) return displayText; + if (length === null || length === undefined) { + return displayText; + } const roundedLength = utils.roundNumber(length, 2); displayText.push( `${roundedLength} mm (S: ${SeriesNumber}${instanceText}${frameText})` diff --git a/extensions/cornerstone/src/utils/measurementServiceMappings/PlanarFreehandROI.ts b/extensions/cornerstone/src/utils/measurementServiceMappings/PlanarFreehandROI.ts index 71ded00c1f2..2b0fd700891 100644 --- a/extensions/cornerstone/src/utils/measurementServiceMappings/PlanarFreehandROI.ts +++ b/extensions/cornerstone/src/utils/measurementServiceMappings/PlanarFreehandROI.ts @@ -2,7 +2,7 @@ import SUPPORTED_TOOLS from './constants/supportedTools'; import getSOPInstanceAttributes from './utils/getSOPInstanceAttributes'; const PlanarFreehandROI = { - toAnnotation: measurement => { }, + toAnnotation: measurement => {}, /** * Maps cornerstone annotation event data to measurement service format. diff --git a/extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts b/extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts index de3e33d5013..3694f76d00b 100644 --- a/extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts +++ b/extensions/cornerstone/src/utils/measurementServiceMappings/RectangleROI.ts @@ -25,12 +25,15 @@ const RectangleROI = { throw new Error('Tool not supported'); } - const { SOPInstanceUID, SeriesInstanceUID, StudyInstanceUID } = - getSOPInstanceAttributes( - referencedImageId, - CornerstoneViewportService, - viewportId - ); + const { + SOPInstanceUID, + SeriesInstanceUID, + StudyInstanceUID, + } = getSOPInstanceAttributes( + referencedImageId, + CornerstoneViewportService, + viewportId + ); let displaySet; @@ -95,8 +98,11 @@ function getMappedAnnotations(annotation, DisplaySetService) { ); } - const { SOPInstanceUID, SeriesInstanceUID, frameNumber } = - getSOPInstanceAttributes(referencedImageId); + const { + SOPInstanceUID, + SeriesInstanceUID, + frameNumber, + } = getSOPInstanceAttributes(referencedImageId); const displaySet = DisplaySetService.getDisplaySetForSOPInstanceUID( SOPInstanceUID, diff --git a/extensions/default/src/DicomJSONDataSource/index.js b/extensions/default/src/DicomJSONDataSource/index.js index d412a57a12d..271946c3768 100644 --- a/extensions/default/src/DicomJSONDataSource/index.js +++ b/extensions/default/src/DicomJSONDataSource/index.js @@ -46,7 +46,9 @@ function createDicomJSONApi(dicomJsonConfig) { const implementation = { initialize: async ({ query, url }) => { - if (!url) url = query.get('url'); + if (!url) { + url = query.get('url'); + } let metaData = getMetaDataByURL(url); // if we have already cached the data from this specific url @@ -212,7 +214,9 @@ function createDicomJSONApi(dicomJsonConfig) { return obj; }); storeInstances(instances); - if (index === numberOfSeries - 1) setSuccessFlag(); + if (index === numberOfSeries - 1) { + setSuccessFlag(); + } }); }, }, diff --git a/extensions/default/src/DicomLocalDataSource/index.js b/extensions/default/src/DicomLocalDataSource/index.js index 3de0cc6632a..aa9949981b7 100644 --- a/extensions/default/src/DicomLocalDataSource/index.js +++ b/extensions/default/src/DicomLocalDataSource/index.js @@ -12,8 +12,12 @@ const END_MODALITIES = { }; const compareValue = (v1, v2, def = 0) => { - if (v1 === v2) return def; - if (v1 < v2) return -1; + if (v1 === v2) { + return def; + } + if (v1 < v2) { + return -1; + } return 1; }; diff --git a/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js b/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js index 542267abefb..e902aa09598 100644 --- a/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js +++ b/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js @@ -1,4 +1,4 @@ -export default function (wadoRoot) { +export default function(wadoRoot) { return { series: (StudyInstanceUID, SeriesInstanceUID) => { return new Promise((resolve, reject) => { @@ -15,7 +15,7 @@ export default function (wadoRoot) { console.log(xhr); - xhr.onreadystatechange = function () { + xhr.onreadystatechange = function() { //Call a function when the state changes. if (xhr.readyState == 4) { switch (xhr.status) { diff --git a/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts b/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts index 9521e379b09..c6ff3c7d802 100644 --- a/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts +++ b/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts @@ -36,12 +36,16 @@ export default class StaticWadoClient extends api.DICOMwebClient { * @returns */ async searchForStudies(options) { - if (!this.staticWado) return super.searchForStudies(options); + if (!this.staticWado) { + return super.searchForStudies(options); + } const searchResult = await super.searchForStudies(options); const { queryParams } = options; - if (!queryParams) return searchResult; + if (!queryParams) { + return searchResult; + } const lowerParams = this.toLowerParams(queryParams); const filtered = searchResult.filter(study => { @@ -63,11 +67,15 @@ export default class StaticWadoClient extends api.DICOMwebClient { } async searchForSeries(options) { - if (!this.staticWado) return super.searchForSeries(options); + if (!this.staticWado) { + return super.searchForSeries(options); + } const searchResult = await super.searchForSeries(options); const { queryParams } = options; - if (!queryParams) return searchResult; + if (!queryParams) { + return searchResult; + } const lowerParams = this.toLowerParams(queryParams); const filtered = searchResult.filter(series => { @@ -112,8 +120,12 @@ export default class StaticWadoClient extends api.DICOMwebClient { actual = actual.Alphabetic; } if (typeof actual == 'string') { - if (actual.length === 0) return true; - if (desired.length === 0 || desired === '*') return true; + if (actual.length === 0) { + return true; + } + if (desired.length === 0 || desired === '*') { + return true; + } if (desired[0] === '*' && desired[desired.length - 1] === '*') { // console.log(`Comparing ${actual} to ${desired.substring(1, desired.length - 1)}`) return actual.indexOf(desired.substring(1, desired.length - 1)) != -1; @@ -131,9 +143,13 @@ export default class StaticWadoClient extends api.DICOMwebClient { /** Compares a pair of dates to see if the value is within the range */ compareDateRange(range, value) { - if (!value) return true; + if (!value) { + return true; + } const dash = range.indexOf('-'); - if (dash === -1) return this.compareValues(range, value); + if (dash === -1) { + return this.compareValues(range, value); + } const start = range.substring(0, dash); const end = range.substring(dash + 1); return (!start || value >= start) && (!end || value <= end); @@ -150,11 +166,17 @@ export default class StaticWadoClient extends api.DICOMwebClient { */ filterItem(key: string, queryParams, study, sourceFilterMap) { const altKey = sourceFilterMap[key] || key; - if (!queryParams) return true; + if (!queryParams) { + return true; + } const testValue = queryParams[key] || queryParams[altKey]; - if (!testValue) return true; + if (!testValue) { + return true; + } const valueElem = study[key] || study[altKey]; - if (!valueElem) return false; + if (!valueElem) { + return false; + } if (valueElem.vr == 'DA') { return this.compareDateRange(testValue, valueElem.Value[0]); } diff --git a/extensions/default/src/Panels/PanelMeasurementTable.tsx b/extensions/default/src/Panels/PanelMeasurementTable.tsx index 203531845f7..7d6be4aabbc 100644 --- a/extensions/default/src/Panels/PanelMeasurementTable.tsx +++ b/extensions/default/src/Panels/PanelMeasurementTable.tsx @@ -276,7 +276,9 @@ function _mapMeasurementToDisplay(measurement, index, types) { if (findingSites) { const siteText = []; findingSites.forEach(site => { - if (site?.text !== label) siteText.push(site.text); + if (site?.text !== label) { + siteText.push(site.text); + } }); displayText = [...siteText, ...displayText]; } diff --git a/extensions/default/src/Panels/debounce.js b/extensions/default/src/Panels/debounce.js index 83a16b0990a..d71793c0fc7 100644 --- a/extensions/default/src/Panels/debounce.js +++ b/extensions/default/src/Panels/debounce.js @@ -9,12 +9,16 @@ function debounce(func, wait, immediate) { args = arguments; var later = function() { timeout = null; - if (!immediate) func.apply(context, args); + if (!immediate) { + func.apply(context, args); + } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); + if (callNow) { + func.apply(context, args); + } }; } diff --git a/extensions/default/src/ViewerLayout/ToolbarButtonNestedMenu.tsx b/extensions/default/src/ViewerLayout/ToolbarButtonNestedMenu.tsx index 6e91c041808..47e6a3a9b47 100644 --- a/extensions/default/src/ViewerLayout/ToolbarButtonNestedMenu.tsx +++ b/extensions/default/src/ViewerLayout/ToolbarButtonNestedMenu.tsx @@ -40,8 +40,8 @@ NestedMenu.propTypes = { }; NestedMenu.defaultProps = { - icon: "tool-more-menu", - label: "More", + icon: 'tool-more-menu', + label: 'More', }; export default NestedMenu; diff --git a/extensions/default/src/ViewerLayout/index.tsx b/extensions/default/src/ViewerLayout/index.tsx index f67cf0b50a2..aafb74bd8e4 100644 --- a/extensions/default/src/ViewerLayout/index.tsx +++ b/extensions/default/src/ViewerLayout/index.tsx @@ -50,7 +50,7 @@ function ViewerLayout({ // dataSourceIdx === -1 // ? undefined // : `datasources=${pathname.substring(dataSourceIdx + 1)}`; - + // Todo: Handle parameters in a better way. const query = new URLSearchParams(window.location.search); const configUrl = query.get('configUrl'); @@ -69,7 +69,7 @@ function ViewerLayout({ navigate({ pathname: '/', - search: decodeURIComponent(searchQuery.toString()) + search: decodeURIComponent(searchQuery.toString()), }); }; diff --git a/extensions/default/src/commandsModule.ts b/extensions/default/src/commandsModule.ts index c711280ab9d..9b0e3444009 100644 --- a/extensions/default/src/commandsModule.ts +++ b/extensions/default/src/commandsModule.ts @@ -129,13 +129,17 @@ const commandsModule = ({ stage, } = hangingProtocolService.getActiveProtocol(); const enableListener = button => { - if (!button.id) return; + if (!button.id) { + return; + } const { commands, items } = button.props || button; if (items) { items.forEach(enableListener); } const hpCommand = commands?.find?.(isHangingProtocolCommand); - if (!hpCommand) return; + if (!hpCommand) { + return; + } const { protocolId, stageIndex, stageId } = hpCommand.commandOptions; const isActive = (!protocolId || protocolId === protocol.id) && diff --git a/extensions/default/src/findViewportsByPosition.ts b/extensions/default/src/findViewportsByPosition.ts index 76c488146a7..5132290a47e 100644 --- a/extensions/default/src/findViewportsByPosition.ts +++ b/extensions/default/src/findViewportsByPosition.ts @@ -22,7 +22,9 @@ export const findOrCreateViewport = ( options: Record ) => { const byPositionViewport = viewportsByPosition?.[positionId]; - if (byPositionViewport) return { ...byPositionViewport }; + if (byPositionViewport) { + return { ...byPositionViewport }; + } const { protocolId, stageIndex } = hangingProtocolService.getState(); // Setup the initial in display correctly for initial view/select diff --git a/extensions/default/src/getCustomizationModule.tsx b/extensions/default/src/getCustomizationModule.tsx index dee0b530f81..6d03e278602 100644 --- a/extensions/default/src/getCustomizationModule.tsx +++ b/extensions/default/src/getCustomizationModule.tsx @@ -83,17 +83,21 @@ export default function getCustomizationModule() { */ { id: 'ohif.overlayItem', - content: function (props) { - if (this.condition && !this.condition(props)) return null; + content: function(props) { + if (this.condition && !this.condition(props)) { + return null; + } const { instance } = props; const value = instance && this.attribute ? instance[this.attribute] : this.contentF && typeof this.contentF === 'function' - ? this.contentF(props) - : null; - if (!value) return null; + ? this.contentF(props) + : null; + if (!value) { + return null; + } return ( ({ ...menu })); diff --git a/extensions/default/src/utils/getDirectURL.js b/extensions/default/src/utils/getDirectURL.js index c3905e9f21a..40b320dfbe9 100644 --- a/extensions/default/src/utils/getDirectURL.js +++ b/extensions/default/src/utils/getDirectURL.js @@ -23,9 +23,13 @@ const getDirectURL = (config, params) => { singlepart: fetchPart = 'video', } = params; const value = instance[tag]; - if (!value) return undefined; + if (!value) { + return undefined; + } - if (value.DirectRetrieveURL) return value.DirectRetrieveURL; + if (value.DirectRetrieveURL) { + return value.DirectRetrieveURL; + } if (value.InlineBinary) { const blob = utils.b64toBlob(value.InlineBinary, defaultType); value.DirectRetrieveURL = URL.createObjectURL(blob); diff --git a/extensions/default/src/utils/reuseCachedLayouts.ts b/extensions/default/src/utils/reuseCachedLayouts.ts index 38ecf829848..35bb1774fef 100644 --- a/extensions/default/src/utils/reuseCachedLayouts.ts +++ b/extensions/default/src/utils/reuseCachedLayouts.ts @@ -47,10 +47,14 @@ const reuseCachedLayout = ( for (let idx = 0; idx < state.viewports.length; idx++) { const viewport = state.viewports[idx]; const { displaySetOptions, displaySetInstanceUIDs } = viewport; - if (!displaySetOptions) continue; + if (!displaySetOptions) { + continue; + } for (let i = 0; i < displaySetOptions.length; i++) { const displaySetUID = displaySetInstanceUIDs[i]; - if (!displaySetUID) continue; + if (!displaySetUID) { + continue; + } if (idx === activeViewportIndex && i === 0) { displaySetSelectorMap[ `${activeStudyUID}:activeDisplaySet:0` diff --git a/extensions/dicom-microscopy/src/DicomMicroscopyViewport.tsx b/extensions/dicom-microscopy/src/DicomMicroscopyViewport.tsx index dc794a89628..de2220593a9 100644 --- a/extensions/dicom-microscopy/src/DicomMicroscopyViewport.tsx +++ b/extensions/dicom-microscopy/src/DicomMicroscopyViewport.tsx @@ -41,7 +41,9 @@ class DicomMicroscopyViewport extends Component { const { microscopyService } = this.props.servicesManager.services; this.microscopyService = microscopyService; this.debouncedResize = debounce(() => { - if (this.viewer) this.viewer.resize(); + if (this.viewer) { + this.viewer.resize(); + } }, 100); } diff --git a/extensions/dicom-microscopy/src/components/ViewportOverlay/index.tsx b/extensions/dicom-microscopy/src/components/ViewportOverlay/index.tsx index e4bb674247c..47d80c8731c 100644 --- a/extensions/dicom-microscopy/src/components/ViewportOverlay/index.tsx +++ b/extensions/dicom-microscopy/src/components/ViewportOverlay/index.tsx @@ -107,8 +107,12 @@ const itemGenerator = (props: any) => { props.formatTime = formatDICOMTime; props.formatPN = formatPN; props.formatNumberPrecision = formatNumberPrecision; - if (condition && !condition(props)) return null; - if (!contents && !valueFunc) return null; + if (condition && !condition(props)) { + return null; + } + if (!contents && !valueFunc) { + return null; + } const value = valueFunc && valueFunc(props); const contentsValue = (contents && contents(props)) || [ { className: 'mr-1', value: title }, diff --git a/extensions/dicom-microscopy/src/components/ViewportOverlay/listComponentGenerator.tsx b/extensions/dicom-microscopy/src/components/ViewportOverlay/listComponentGenerator.tsx index 04150625df2..451607ad235 100644 --- a/extensions/dicom-microscopy/src/components/ViewportOverlay/listComponentGenerator.tsx +++ b/extensions/dicom-microscopy/src/components/ViewportOverlay/listComponentGenerator.tsx @@ -1,10 +1,16 @@ const listComponentGenerator = props => { const { list, itemGenerator } = props; - if (!list) return; + if (!list) { + return; + } return list.map(item => { - if (!item) return; + if (!item) { + return; + } const generator = item.generator || itemGenerator; - if (!generator) throw new Error(`No generator for ${item}`); + if (!generator) { + throw new Error(`No generator for ${item}`); + } return generator({ ...props, item }); }); }; diff --git a/extensions/dicom-microscopy/src/getCommandsModule.ts b/extensions/dicom-microscopy/src/getCommandsModule.ts index 7126ad6e571..1a7a421877e 100644 --- a/extensions/dicom-microscopy/src/getCommandsModule.ts +++ b/extensions/dicom-microscopy/src/getCommandsModule.ts @@ -22,7 +22,9 @@ export default function getCommandsModule({ deleteMeasurement: ({ uid }) => { if (uid) { const roiAnnotation = microscopyService.getAnnotation(uid); - if (roiAnnotation) microscopyService.removeAnnotation(roiAnnotation); + if (roiAnnotation) { + microscopyService.removeAnnotation(roiAnnotation); + } } }, @@ -72,7 +74,7 @@ export default function getCommandsModule({ ].indexOf(toolName) >= 0 ) { // TODO: read from configuration - let options = { + const options = { geometryType: toolName, vertexEnabled: true, styleOptions: styles.default, @@ -140,7 +142,9 @@ export default function getCommandsModule({ ); let onoff = false; // true if this will toggle on for (let i = 0; i < overlays.length; i++) { - if (i === 0) onoff = overlays.item(0).classList.contains('hidden'); + if (i === 0) { + onoff = overlays.item(0).classList.contains('hidden'); + } overlays.item(i).classList.toggle('hidden'); } diff --git a/extensions/dicom-microscopy/src/helpers/formatDICOMPatientName.js b/extensions/dicom-microscopy/src/helpers/formatDICOMPatientName.js index fd62d94c9d1..c1b284a9813 100644 --- a/extensions/dicom-microscopy/src/helpers/formatDICOMPatientName.js +++ b/extensions/dicom-microscopy/src/helpers/formatDICOMPatientName.js @@ -5,7 +5,9 @@ * @returns {string} formatted name */ export default function formatDICOMPatientName(name) { - if (typeof name !== 'string') return; + if (typeof name !== 'string') { + return; + } /** * Convert the first ^ to a ', '. String.replace() only affects diff --git a/extensions/dicom-microscopy/src/services/MicroscopyService.ts b/extensions/dicom-microscopy/src/services/MicroscopyService.ts index d1ff76b5b9d..a6730511c5a 100644 --- a/extensions/dicom-microscopy/src/services/MicroscopyService.ts +++ b/extensions/dicom-microscopy/src/services/MicroscopyService.ts @@ -56,7 +56,7 @@ export default class MicroscopyService extends PubSubService { clear() { this.managedViewers.forEach(managedViewer => managedViewer.destroy()); this.managedViewers.clear(); - for (var key in this.annotations) { + for (const key in this.annotations) { delete this.annotations[key]; } @@ -124,7 +124,9 @@ export default class MicroscopyService extends PubSubService { _onRoiModified(data) { const { roiGraphic, managedViewer } = data; const roiAnnotation = this.getAnnotation(roiGraphic.uid); - if (!roiAnnotation) return; + if (!roiAnnotation) { + return; + } roiAnnotation.setRoiGraphic(roiGraphic); roiAnnotation.setViewState(managedViewer.getViewState()); } @@ -156,7 +158,10 @@ export default class MicroscopyService extends PubSubService { _onRoiUpdated(data) { const { roiGraphic, managedViewer } = data; this.synchronizeViewers(managedViewer); - this._broadcastEvent(EVENTS.ANNOTATION_UPDATED, this.getAnnotation(roiGraphic.uid)); + this._broadcastEvent( + EVENTS.ANNOTATION_UPDATED, + this.getAnnotation(roiGraphic.uid) + ); } /** @@ -170,8 +175,13 @@ export default class MicroscopyService extends PubSubService { _onRoiSelected(data) { const { roiGraphic } = data; const selectedAnnotation = this.getAnnotation(roiGraphic.uid); - if (selectedAnnotation && selectedAnnotation !== this.getSelectedAnnotation()) { - if (this.selectedAnnotation) this.clearSelection(); + if ( + selectedAnnotation && + selectedAnnotation !== this.getSelectedAnnotation() + ) { + if (this.selectedAnnotation) { + this.clearSelection(); + } this.selectedAnnotation = selectedAnnotation; this._broadcastEvent(EVENTS.ANNOTATION_SELECTED, selectedAnnotation); } @@ -183,11 +193,26 @@ export default class MicroscopyService extends PubSubService { * @param {ViewerManager} managedViewer The viewer being added */ _addManagedViewerSubscriptions(managedViewer) { - managedViewer._roiAddedSubscription = managedViewer.subscribe(ViewerEvents.ADDED, this._onRoiAdded); - managedViewer._roiModifiedSubscription = managedViewer.subscribe(ViewerEvents.MODIFIED, this._onRoiModified); - managedViewer._roiRemovedSubscription = managedViewer.subscribe(ViewerEvents.REMOVED, this._onRoiRemoved); - managedViewer._roiUpdatedSubscription = managedViewer.subscribe(ViewerEvents.UPDATED, this._onRoiUpdated); - managedViewer._roiSelectedSubscription = managedViewer.subscribe(ViewerEvents.UPDATED, this._onRoiSelected); + managedViewer._roiAddedSubscription = managedViewer.subscribe( + ViewerEvents.ADDED, + this._onRoiAdded + ); + managedViewer._roiModifiedSubscription = managedViewer.subscribe( + ViewerEvents.MODIFIED, + this._onRoiModified + ); + managedViewer._roiRemovedSubscription = managedViewer.subscribe( + ViewerEvents.REMOVED, + this._onRoiRemoved + ); + managedViewer._roiUpdatedSubscription = managedViewer.subscribe( + ViewerEvents.UPDATED, + this._onRoiUpdated + ); + managedViewer._roiSelectedSubscription = managedViewer.subscribe( + ViewerEvents.UPDATED, + this._onRoiSelected + ); } /** @@ -196,11 +221,16 @@ export default class MicroscopyService extends PubSubService { * @param {ViewerManager} managedViewer The viewer being removed */ _removeManagedViewerSubscriptions(managedViewer) { - managedViewer._roiAddedSubscription && managedViewer._roiAddedSubscription.unsubscribe(); - managedViewer._roiModifiedSubscription && managedViewer._roiModifiedSubscription.unsubscribe(); - managedViewer._roiRemovedSubscription && managedViewer._roiRemovedSubscription.unsubscribe(); - managedViewer._roiUpdatedSubscription && managedViewer._roiUpdatedSubscription.unsubscribe(); - managedViewer._roiSelectedSubscription && managedViewer._roiSelectedSubscription.unsubscribe(); + managedViewer._roiAddedSubscription && + managedViewer._roiAddedSubscription.unsubscribe(); + managedViewer._roiModifiedSubscription && + managedViewer._roiModifiedSubscription.unsubscribe(); + managedViewer._roiRemovedSubscription && + managedViewer._roiRemovedSubscription.unsubscribe(); + managedViewer._roiUpdatedSubscription && + managedViewer._roiUpdatedSubscription.unsubscribe(); + managedViewer._roiSelectedSubscription && + managedViewer._roiSelectedSubscription.unsubscribe(); managedViewer._roiAddedSubscription = null; managedViewer._roiModifiedSubscription = null; @@ -460,7 +490,9 @@ export default class MicroscopyService extends PubSubService { * @param {RoiAnnotation} roiAnnotation The instance to be selected */ selectAnnotation(roiAnnotation) { - if (this.selectedAnnotation) this.clearSelection(); + if (this.selectedAnnotation) { + this.clearSelection(); + } this.selectedAnnotation = roiAnnotation; this._broadcastEvent(EVENTS.ANNOTATION_SELECTED, roiAnnotation); diff --git a/extensions/dicom-microscopy/src/utils/constructSR.ts b/extensions/dicom-microscopy/src/utils/constructSR.ts index ff78f13fe34..604bc6c6b46 100644 --- a/extensions/dicom-microscopy/src/utils/constructSR.ts +++ b/extensions/dicom-microscopy/src/utils/constructSR.ts @@ -83,7 +83,9 @@ export default function constructSR( console.debug('[SR] storing evaluations...', evaluations); console.debug('[SR] storing presentation state...', presentationState); - if (presentationState) presentationState.marker = marker; + if (presentationState) { + presentationState.marker = marker; + } /** Avoid incompatibility with dcmjs */ measurements = measurements.map((measurement: any) => { diff --git a/extensions/dicom-microscopy/src/utils/coordinateFormatScoord3d2Geometry.js b/extensions/dicom-microscopy/src/utils/coordinateFormatScoord3d2Geometry.js index 70b6e42d54f..de5c4771d18 100644 --- a/extensions/dicom-microscopy/src/utils/coordinateFormatScoord3d2Geometry.js +++ b/extensions/dicom-microscopy/src/utils/coordinateFormatScoord3d2Geometry.js @@ -38,7 +38,9 @@ export default function coordinateFormatScoord3d2Geometry( } function _getPixelSpacing(metadata) { - if (metadata.PixelSpacing) return metadata.PixelSpacing; + if (metadata.PixelSpacing) { + return metadata.PixelSpacing; + } const functionalGroup = metadata.SharedFunctionalGroupsSequence[0]; const pixelMeasures = functionalGroup.PixelMeasuresSequence[0]; return pixelMeasures.PixelSpacing; diff --git a/extensions/dicom-microscopy/src/utils/saveByteArray.ts b/extensions/dicom-microscopy/src/utils/saveByteArray.ts index d264fe7cda9..123f1c17f42 100644 --- a/extensions/dicom-microscopy/src/utils/saveByteArray.ts +++ b/extensions/dicom-microscopy/src/utils/saveByteArray.ts @@ -4,8 +4,8 @@ * @param filename */ export function saveByteArray(buffer: ArrayBuffer, filename: string) { - var blob = new Blob([buffer], { type: 'application/dicom' }); - var link = document.createElement('a'); + const blob = new Blob([buffer], { type: 'application/dicom' }); + const link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = filename; link.click(); diff --git a/extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/index.tsx b/extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/index.tsx index 9b0a8c56269..ac73a58101f 100644 --- a/extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/index.tsx +++ b/extensions/measurement-tracking/src/panels/PanelMeasurementTableTracking/index.tsx @@ -344,7 +344,9 @@ function _mapMeasurementToDisplay(measurement, types, displaySetService) { if (findingSites) { const siteText = []; findingSites.forEach(site => { - if (site?.text !== label) siteText.push(site.text); + if (site?.text !== label) { + siteText.push(site.text); + } }); displayText = [...siteText, ...displayText]; } diff --git a/extensions/test-extension/src/custom-attribute/maxNumImageFrames.ts b/extensions/test-extension/src/custom-attribute/maxNumImageFrames.ts index 13293f3d0c8..72b115253e3 100644 --- a/extensions/test-extension/src/custom-attribute/maxNumImageFrames.ts +++ b/extensions/test-extension/src/custom-attribute/maxNumImageFrames.ts @@ -1 +1,4 @@ -export default (study, extraData) => Math.max(...(extraData?.displaySets?.map?.(ds => (ds.numImageFrames ?? 0))) || [0]); \ No newline at end of file +export default (study, extraData) => + Math.max( + ...(extraData?.displaySets?.map?.(ds => ds.numImageFrames ?? 0) || [0]) + ); diff --git a/extensions/test-extension/src/custom-attribute/numberOfDisplaySets.ts b/extensions/test-extension/src/custom-attribute/numberOfDisplaySets.ts index 1fdbc17e456..d4a8ae4062e 100644 --- a/extensions/test-extension/src/custom-attribute/numberOfDisplaySets.ts +++ b/extensions/test-extension/src/custom-attribute/numberOfDisplaySets.ts @@ -1 +1 @@ -export default (study, extraData) => extraData?.displaySets?.length; \ No newline at end of file +export default (study, extraData) => extraData?.displaySets?.length; diff --git a/extensions/test-extension/src/custom-attribute/sameAs.ts b/extensions/test-extension/src/custom-attribute/sameAs.ts index da836c635c5..dd385e9e2d8 100644 --- a/extensions/test-extension/src/custom-attribute/sameAs.ts +++ b/extensions/test-extension/src/custom-attribute/sameAs.ts @@ -4,30 +4,37 @@ * From 'this', it uses: * `sameAttribute` as the attribute name to look for * `sameDisplaySetId` as the display set id to look for - * From `options`, it looks for + * From `options`, it looks for */ -export default function (displaySet, options) { +export default function(displaySet, options) { const { sameAttribute, sameDisplaySetId } = this; - if( !sameAttribute ) { - console.log("sameAttribute not defined in", this); + if (!sameAttribute) { + console.log('sameAttribute not defined in', this); return `sameAttribute not defined in ${this.id}`; } - if( !sameDisplaySetId ) { - console.log("sameDisplaySetId not defined in", this); + if (!sameDisplaySetId) { + console.log('sameDisplaySetId not defined in', this); return `sameDisplaySetId not defined in ${this.id}`; } const { displaySetMatchDetails, displaySets } = options; const match = displaySetMatchDetails.get(sameDisplaySetId); - if( !match ) { - console.log("No match for display set", sameDisplaySetId); + if (!match) { + console.log('No match for display set', sameDisplaySetId); return false; } const { displaySetInstanceUID } = match; - const altDisplaySet = displaySets.find(it => it.displaySetInstanceUID==displaySetInstanceUID); - if( !altDisplaySet ) { - console.log("No display set found with", displaySetInstanceUID, "in", displaySets); + const altDisplaySet = displaySets.find( + it => it.displaySetInstanceUID == displaySetInstanceUID + ); + if (!altDisplaySet) { + console.log( + 'No display set found with', + displaySetInstanceUID, + 'in', + displaySets + ); return false; } const testValue = altDisplaySet[sameAttribute]; - return testValue===displaySet[sameAttribute]; -} \ No newline at end of file + return testValue === displaySet[sameAttribute]; +} diff --git a/extensions/test-extension/src/custom-context-menu/contextMenuCodeItem.ts b/extensions/test-extension/src/custom-context-menu/contextMenuCodeItem.ts index aa13c27ee2a..a0b9e1a1af7 100644 --- a/extensions/test-extension/src/custom-context-menu/contextMenuCodeItem.ts +++ b/extensions/test-extension/src/custom-context-menu/contextMenuCodeItem.ts @@ -2,9 +2,11 @@ const codeMenuItem = { id: '@ohif/contextMenuAnnotationCode', /** Applies the code value setup for this item */ - transform: function (customizationService) { + transform: function(customizationService) { const { code: codeRef } = this; - if (!codeRef) throw new Error(`item ${this} has no code ref`); + if (!codeRef) { + throw new Error(`item ${this} has no code ref`); + } const codingValues = customizationService.get('codingValues'); const code = codingValues[codeRef]; return { diff --git a/extensions/tmtv/src/utils/calculateSUVPeak.ts b/extensions/tmtv/src/utils/calculateSUVPeak.ts index 982c4a18e4f..5638cab1e3d 100644 --- a/extensions/tmtv/src/utils/calculateSUVPeak.ts +++ b/extensions/tmtv/src/utils/calculateSUVPeak.ts @@ -117,7 +117,7 @@ function calculateSuvPeak( const secondaryCircleWorld = vec3.create(); const bottomWorld = vec3.create(); const topWorld = vec3.create(); - referenceVolumeImageData.indexToWorld(maxIJK, secondaryCircleWorld); + referenceVolumeImageData.indexToWorld(maxIJK as vec3, secondaryCircleWorld); vec3.scaleAndAdd(bottomWorld, secondaryCircleWorld, direction, -diameter / 2); vec3.scaleAndAdd(topWorld, secondaryCircleWorld, direction, diameter / 2); const suvPeakCirclePoints = [bottomWorld, topWorld] as [ diff --git a/package.json b/package.json index c14ea82d728..aa12b1d780f 100644 --- a/package.json +++ b/package.json @@ -78,8 +78,8 @@ "@babel/preset-react": "^7.16.7", "@babel/preset-typescript": "^7.13.0", "@types/jest": "^27.5.0", - "@typescript-eslint/eslint-plugin": "^4.19.0", - "@typescript-eslint/parser": "^4.19.0", + "@typescript-eslint/eslint-plugin": "^6.3.0", + "@typescript-eslint/parser": "^6.3.0", "autoprefixer": "^10.4.4", "babel-eslint": "9.x", "babel-loader": "^8.2.4", diff --git a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js index 76c3fa2e4ad..316b072a404 100644 --- a/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js +++ b/platform/app/cypress/integration/measurement-tracking/OHIFCornerstoneToolbar.spec.js @@ -71,6 +71,7 @@ describe('OHIF Cornerstone Toolbar', () => { it('checks if Levels tool will change the window width and center of an image', () => { //Click on button and verify if icon is active on toolbar + cy.waitDicomImage(); cy.get('@wwwcBtnPrimary') .click() .then($wwwcBtn => { diff --git a/platform/app/cypress/support/commands.js b/platform/app/cypress/support/commands.js index 0f22951ee73..0585c803481 100644 --- a/platform/app/cypress/support/commands.js +++ b/platform/app/cypress/support/commands.js @@ -60,7 +60,7 @@ Cypress.Commands.add( cy.location('pathname').then($url => { cy.log($url); if ( - $url == 'blank' || + $url === 'blank' || !$url.includes(`/basic-test/${StudyInstanceUID}${otherParams}`) ) { cy.openStudyInViewer(StudyInstanceUID, otherParams); @@ -158,10 +158,10 @@ Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => { // TODO: Added a wait which appears necessary in Cornerstone Tools >4? cy.wrap($viewport) - .click(x1, y1) + .click(x1, y1, { force: true }) .wait(100) .trigger('mousemove', { clientX: x2, clientY: y2 }) - .click(x2, y2) + .click(x2, y2, { force: true }) .wait(100); }); }); diff --git a/platform/app/src/__tests__/globalSetup.js b/platform/app/src/__tests__/globalSetup.js index 0fecec0801d..0845b9659ac 100644 --- a/platform/app/src/__tests__/globalSetup.js +++ b/platform/app/src/__tests__/globalSetup.js @@ -4,6 +4,8 @@ const originalConsoleError = console.error; // JSDom's CSS Parser has limited support for certain features // This supresses error warnings caused by it console.error = function(msg) { - if (_.startsWith(msg, 'Error: Could not parse CSS stylesheet')) return; + if (_.startsWith(msg, 'Error: Could not parse CSS stylesheet')) { + return; + } originalConsoleError(msg); }; diff --git a/platform/app/src/appInit.js b/platform/app/src/appInit.js index 041ac2dfec7..e7c548c2e6e 100644 --- a/platform/app/src/appInit.js +++ b/platform/app/src/appInit.js @@ -103,7 +103,9 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) { const modesById = new Set(); for (let i = 0; i < loadedModes.length; i++) { let mode = loadedModes[i]; - if (!mode) continue; + if (!mode) { + continue; + } const { id } = mode; if (mode.modeFactory) { @@ -116,10 +118,14 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) { mode = mode.modeFactory({ modeConfiguration }); } - if (modesById.has(id)) continue; + if (modesById.has(id)) { + continue; + } // Prevent duplication modesById.add(id); - if (!mode || typeof mode !== 'object') continue; + if (!mode || typeof mode !== 'object') { + continue; + } appConfig.loadedModes.push(mode); } // Hack alert - don't touch the original modes definition, diff --git a/platform/app/src/components/ViewportGrid.tsx b/platform/app/src/components/ViewportGrid.tsx index 67d3280412c..f3cead76a90 100644 --- a/platform/app/src/components/ViewportGrid.tsx +++ b/platform/app/src/components/ViewportGrid.tsx @@ -145,7 +145,9 @@ function ViewerViewportGrid(props) { const { unsubscribe } = measurementService.subscribe( MeasurementService.EVENTS.JUMP_TO_MEASUREMENT_LAYOUT, ({ viewportIndex, measurement, isConsumed }) => { - if (isConsumed) return; + if (isConsumed) { + return; + } // This occurs when no viewport has elected to consume the event // so we need to change layouts into a layout which can consume // the event. @@ -292,7 +294,9 @@ function ViewerViewportGrid(props) { }); const onInteractionHandler = event => { - if (isActive) return; + if (isActive) { + return; + } if (event) { event.preventDefault(); diff --git a/platform/app/src/routes/Local/fileLoader.js b/platform/app/src/routes/Local/fileLoader.js index 75378689598..71bda527914 100644 --- a/platform/app/src/routes/Local/fileLoader.js +++ b/platform/app/src/routes/Local/fileLoader.js @@ -1,6 +1,6 @@ export default class FileLoader { fileType; - loadFile(file, imageId) { } - getDataset(image, imageId) { } - getStudies(dataset, imageId) { } + loadFile(file, imageId) {} + getDataset(image, imageId) {} + getStudies(dataset, imageId) {} } diff --git a/platform/app/src/routes/Mode/studiesList.ts b/platform/app/src/routes/Mode/studiesList.ts index ff45f8cc01d..9f9a515dcdb 100644 --- a/platform/app/src/routes/Mode/studiesList.ts +++ b/platform/app/src/routes/Mode/studiesList.ts @@ -11,8 +11,12 @@ type StudyMetadata = Types.StudyMetadata; * @returns - compare a and b, returning 1 if ab and defaultCompare otherwise */ const compare = (a, b, defaultCompare = 0): number => { - if (a === b) return defaultCompare; - if (a < b) return 1; + if (a === b) { + return defaultCompare; + } + if (a < b) { + return 1; + } return -1; }; @@ -49,7 +53,9 @@ const getStudiesfromDisplaySets = (displaysets): StudyMetadata[] => { * in the original order, as specified. */ const getStudiesFromUIDs = (studyUids: string[]): StudyMetadata[] => { - if (!studyUids?.length) return; + if (!studyUids?.length) { + return; + } return studyUids.map(uid => DicomMetadataStore.getStudy(uid)); }; diff --git a/platform/app/src/routes/WorkList/WorkList.tsx b/platform/app/src/routes/WorkList/WorkList.tsx index 6f2ae6446ee..64616d9a896 100644 --- a/platform/app/src/routes/WorkList/WorkList.tsx +++ b/platform/app/src/routes/WorkList/WorkList.tsx @@ -361,32 +361,35 @@ function WorkList({ query.append('configUrl', filterValues.configUrl); } query.append('StudyInstanceUIDs', studyInstanceUid); - return mode.displayName && ( - { - // In case any event bubbles up for an invalid mode, prevent the navigation. - // For example, the event bubbles up when the icon embedded in the disabled button is clicked. - if (!isValidMode) { - event.preventDefault(); - } - }} - // to={`${mode.routeName}/dicomweb?StudyInstanceUIDs=${studyInstanceUid}`} - > - {/* TODO revisit the completely rounded style of buttons used for launching a mode from the worklist later - for now use LegacyButton*/} - } // launch-arrow | launch-info - onClick={() => {}} + return ( + mode.displayName && ( + { + // In case any event bubbles up for an invalid mode, prevent the navigation. + // For example, the event bubbles up when the icon embedded in the disabled button is clicked. + if (!isValidMode) { + event.preventDefault(); + } + }} + // to={`${mode.routeName}/dicomweb?StudyInstanceUIDs=${studyInstanceUid}`} > - {t(`Modes:${mode.displayName}`)} - - + {/* TODO revisit the completely rounded style of buttons used for launching a mode from the worklist later - for now use LegacyButton*/} + } // launch-arrow | launch-info + onClick={() => {}} + > + {t(`Modes:${mode.displayName}`)} + + + ) ); })} diff --git a/platform/cli/src/commands/createPackage.js b/platform/cli/src/commands/createPackage.js index 84fa7d45492..b5dac86ed88 100644 --- a/platform/cli/src/commands/createPackage.js +++ b/platform/cli/src/commands/createPackage.js @@ -10,7 +10,7 @@ import { initGit, } from './utils/index.js'; -const createPackage = async (options) => { +const createPackage = async options => { const { packageType } = options; // extension or mode if (fs.existsSync(options.targetDir)) { diff --git a/platform/cli/src/commands/utils/createDirectoryContents.js b/platform/cli/src/commands/utils/createDirectoryContents.js index 90a9329c64a..7f160541674 100644 --- a/platform/cli/src/commands/utils/createDirectoryContents.js +++ b/platform/cli/src/commands/utils/createDirectoryContents.js @@ -22,7 +22,9 @@ const createDirectoryContents = ( const contents = fs.readFileSync(origFilePath, 'utf8'); // Rename - if (file === '.npmignore') file = '.gitignore'; + if (file === '.npmignore') { + file = '.gitignore'; + } const writePath = `${targetDirPath}/${file}`; fs.writeFileSync(writePath, contents, 'utf8'); diff --git a/platform/cli/src/commands/utils/findRequiredOhifExtensionsForMode.js b/platform/cli/src/commands/utils/findRequiredOhifExtensionsForMode.js index c907a56b0e5..f895abdd05b 100644 --- a/platform/cli/src/commands/utils/findRequiredOhifExtensionsForMode.js +++ b/platform/cli/src/commands/utils/findRequiredOhifExtensionsForMode.js @@ -11,7 +11,7 @@ export default async function findRequiredOhifExtensionsForMode(yarnInfo) { const dependencies = []; const ohifExtensions = []; - Object.keys(peerDependencies).forEach((packageName) => { + Object.keys(peerDependencies).forEach(packageName => { dependencies.push({ packageName, version: peerDependencies[packageName], diff --git a/platform/cli/src/commands/utils/validate.js b/platform/cli/src/commands/utils/validate.js index bd782a73edc..d091b3926cc 100644 --- a/platform/cli/src/commands/utils/validate.js +++ b/platform/cli/src/commands/utils/validate.js @@ -77,14 +77,14 @@ function getVersion(json, version) { const [majorVersion] = version .split('^')[1] .split('.') - .map((v) => parseInt(v)); + .map(v => parseInt(v)); // Find the version that matches the major version, but is the latest minor version versions - .filter((version) => parseInt(version.split('.')[0]) === majorVersion) + .filter(version => parseInt(version.split('.')[0]) === majorVersion) .sort((a, b) => { - const [majorA, minorA, patchA] = a.split('.').map((v) => parseInt(v)); - const [majorB, minorB, patchB] = b.split('.').map((v) => parseInt(v)); + const [majorA, minorA, patchA] = a.split('.').map(v => parseInt(v)); + const [majorB, minorB, patchB] = b.split('.').map(v => parseInt(v)); if (majorA === majorB) { if (minorA === minorB) { @@ -110,13 +110,16 @@ function validate(packageName, version, keyword) { // Gets the registry of the package. Scoped packages may not be using the global default. const registryUrlOfPackage = registryUrl(scope); - let options = {} - if (process.env.NPM_TOKEN){ + let options = {}; + if (process.env.NPM_TOKEN) { options['headers'] = { - 'Authorization': `Bearer ${process.env.NPM_TOKEN}`, - } + Authorization: `Bearer ${process.env.NPM_TOKEN}`, + }; } - const response = await fetch(`${registryUrlOfPackage}${packageName}`, options); + const response = await fetch( + `${registryUrlOfPackage}${packageName}`, + options + ); const json = await response.json(); if (json.error && json.error === NOT_FOUND) { diff --git a/platform/core/src/DICOMWeb/getAttribute.js b/platform/core/src/DICOMWeb/getAttribute.js index ae6b34b056c..b07f3cd8cd2 100644 --- a/platform/core/src/DICOMWeb/getAttribute.js +++ b/platform/core/src/DICOMWeb/getAttribute.js @@ -25,10 +25,18 @@ function convertToInt(input) { function padFour(input) { const l = input.length; - if (l == 0) return '0000'; - if (l == 1) return '000' + input; - if (l == 2) return '00' + input; - if (l == 3) return '0' + input; + if (l === 0) { + return '0000'; + } + if (l === 1) { + return '000' + input; + } + if (l === 2) { + return '00' + input; + } + if (l === 3) { + return '0' + input; + } return input; } diff --git a/platform/core/src/DICOMWeb/getAuthorizationHeader.js b/platform/core/src/DICOMWeb/getAuthorizationHeader.js index a154b746274..4d996bb97d6 100644 --- a/platform/core/src/DICOMWeb/getAuthorizationHeader.js +++ b/platform/core/src/DICOMWeb/getAuthorizationHeader.js @@ -1,4 +1,4 @@ -import 'isomorphic-base64' +import 'isomorphic-base64'; import user from '../user'; /** diff --git a/platform/core/src/classes/CommandsManager.ts b/platform/core/src/classes/CommandsManager.ts index 34a825c4d32..15ddf523eee 100644 --- a/platform/core/src/classes/CommandsManager.ts +++ b/platform/core/src/classes/CommandsManager.ts @@ -175,7 +175,9 @@ export class CommandsManager { toRun: Command | Commands | Command[] | undefined, options?: Record ): unknown { - if (!toRun) return; + if (!toRun) { + return; + } const commands = (Array.isArray(toRun) && toRun) || ((toRun as Command).commandName && [toRun]) || diff --git a/platform/core/src/classes/MetadataProvider.js b/platform/core/src/classes/MetadataProvider.js index 9c09bba1f10..cf3eb9df7d9 100644 --- a/platform/core/src/classes/MetadataProvider.js +++ b/platform/core/src/classes/MetadataProvider.js @@ -454,7 +454,9 @@ class MetadataProvider { } getUIDsFromImageID(imageId) { - if (!imageId) throw new Error('MetadataProvider::Empty imageId'); + if (!imageId) { + throw new Error('MetadataProvider::Empty imageId'); + } // TODO: adding csiv here is not really correct. Probably need to use // metadataProvider.addImageIdToUIDs(imageId, { // StudyInstanceUID, diff --git a/platform/core/src/object.js b/platform/core/src/object.js index 030793f52b5..6201b212ca4 100644 --- a/platform/core/src/object.js +++ b/platform/core/src/object.js @@ -2,7 +2,9 @@ function getNestedObject(shallowObject) { const nestedObject = {}; for (let key in shallowObject) { - if (!shallowObject.hasOwnProperty(key)) continue; + if (!shallowObject.hasOwnProperty(key)) { + continue; + } const value = shallowObject[key]; const propertyArray = key.split('.'); let currentObject = nestedObject; @@ -28,7 +30,9 @@ function getShallowObject(nestedObject) { const shallowObject = {}; const putValues = (baseKey, nestedObject, resultObject) => { for (let key in nestedObject) { - if (!nestedObject.hasOwnProperty(key)) continue; + if (!nestedObject.hasOwnProperty(key)) { + continue; + } let currentKey = baseKey ? `${baseKey}.${key}` : key; const currentValue = nestedObject[key]; if (typeof currentValue === 'object') { diff --git a/platform/core/src/services/CustomizationService/CustomizationService.test.js b/platform/core/src/services/CustomizationService/CustomizationService.test.js index 959816ea576..4eb5ee679a7 100644 --- a/platform/core/src/services/CustomizationService/CustomizationService.test.js +++ b/platform/core/src/services/CustomizationService/CustomizationService.test.js @@ -11,7 +11,7 @@ const extensionManager = { registeredExtensionIds: [], moduleEntries: {}, - getModuleEntry: function (id) { + getModuleEntry: function(id) { return this.moduleEntries[id]; }, }; @@ -20,7 +20,7 @@ const commandsManager = {}; const ohifOverlayItem = { id: 'ohif.overlayItem', - content: function (props) { + content: function(props) { return { label: this.label, value: props[this.attribute], diff --git a/platform/core/src/services/CustomizationService/CustomizationService.ts b/platform/core/src/services/CustomizationService/CustomizationService.ts index cf3ee6a5f27..074a1c0b35e 100644 --- a/platform/core/src/services/CustomizationService/CustomizationService.ts +++ b/platform/core/src/services/CustomizationService/CustomizationService.ts @@ -12,8 +12,12 @@ const flattenNestedStrings = ( strs: NestedStrings | string, ret?: Record ): Record => { - if (!ret) ret = {}; - if (!strs) return ret; + if (!ret) { + ret = {}; + } + if (!strs) { + return ret; + } if (Array.isArray(strs)) { for (const val of strs) { flattenNestedStrings(val, ret); @@ -81,7 +85,9 @@ export default class CustomizationService extends PubSubService { this.extensionManager.registeredExtensionIds.forEach(extensionId => { const key = `${extensionId}.customizationModule.default`; const defaultCustomizations = this.findExtensionValue(key); - if (!defaultCustomizations) return; + if (!defaultCustomizations) { + return; + } const { value } = defaultCustomizations; this.addReference(value, true); }); @@ -172,9 +178,13 @@ export default class CustomizationService extends PubSubService { * type into the new type, allowing default behaviour to be configured. */ public transform(customization: Customization): Customization { - if (!customization) return customization; + if (!customization) { + return customization; + } const { customizationType } = customization; - if (!customizationType) return customization; + if (!customizationType) { + return customization; + } const parent = this.getCustomization(customizationType); const result = parent ? Object.assign(Object.create(parent), customization) @@ -242,7 +252,9 @@ export default class CustomizationService extends PubSubService { * or a customization itself. */ addReference(value?: Obj | string, isGlobal = true, id?: string): void { - if (!value) return; + if (!value) { + return; + } if (typeof value === 'string') { const extensionValue = this.findExtensionValue(value); // The child of a reference is only a set of references when an array, @@ -265,7 +277,9 @@ export default class CustomizationService extends PubSubService { * or customization. */ addReferences(references?: Obj | Obj[], isGlobal = true): void { - if (!references) return; + if (!references) { + return; + } if (Array.isArray(references)) { references.forEach(item => { this.addReference(item, isGlobal); diff --git a/platform/core/src/services/DisplaySetService/DisplaySetService.ts b/platform/core/src/services/DisplaySetService/DisplaySetService.ts index f95e793c635..5b0dd138cad 100644 --- a/platform/core/src/services/DisplaySetService/DisplaySetService.ts +++ b/platform/core/src/services/DisplaySetService/DisplaySetService.ts @@ -157,7 +157,9 @@ export default class DisplaySetService extends PubSubService { } public deleteDisplaySet(displaySetInstanceUID) { - if (!displaySetInstanceUID) return; + if (!displaySetInstanceUID) { + return; + } const { activeDisplaySets, activeDisplaySetsMap } = this; const activeDisplaySetsIndex = activeDisplaySets.findIndex( @@ -314,7 +316,9 @@ export default class DisplaySetService extends PubSubService { } // This means that all instances already existed or got added to // existing display sets, and had an invalidated event fired - if (!instances.length) return allDisplaySets; + if (!instances.length) { + return allDisplaySets; + } } if (!instances.length) { @@ -329,7 +333,9 @@ export default class DisplaySetService extends PubSubService { // creating additional display sets using the sop class handler displaySets = handler.getDisplaySetsFromSeries(instances); - if (!displaySets || !displaySets.length) continue; + if (!displaySets || !displaySets.length) { + continue; + } // applying hp-defined viewport settings to the displaysets displaySets.forEach(ds => { diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js b/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js index 1af19950b16..e85dd136589 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.test.js @@ -134,7 +134,7 @@ function checkHpsBestMatch(hps) { displaySetOptions: { id: 'displaySetSelector', options: {}, - }, + }, }, ], }); @@ -192,6 +192,6 @@ describe('HangingProtocolService', () => { it('matches best image match', () => { checkHpsBestMatch(hangingProtocolService); }); - }); }); }); +}); diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts index 37dacef2180..fe71fd150f7 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts @@ -86,7 +86,9 @@ export default class HangingProtocolService extends PubSubService { metadata.ModalitiesInStudy ?? (metadata.series || []).reduce((prev, curr) => { const { Modality } = curr; - if (Modality && prev.indexOf(Modality) == -1) prev.push(Modality); + if (Modality && prev.indexOf(Modality) == -1) { + prev.push(Modality); + } return prev; }, []), }, @@ -200,7 +202,9 @@ export default class HangingProtocolService extends PubSubService { * protocolId, stageIndex, stageId and activeStudyUID */ public getState(): HangingProtocol.HPInfo { - if (!this.protocol) return; + if (!this.protocol) { + return; + } return { protocolId: this.protocol.id, stageIndex: this.stageIndex, @@ -257,8 +261,12 @@ export default class HangingProtocolService extends PubSubService { * @returns protocol - the protocol with the given id */ public getProtocolById(protocolId: string): HangingProtocol.Protocol { - if (!protocolId) return; - if (protocolId === this.protocol?.id) return this.protocol; + if (!protocolId) { + return; + } + if (protocolId === this.protocol?.id) { + return this.protocol; + } const protocol = this.protocols.get(protocolId); if (!protocol) { throw new Error(`No protocol ${protocolId} found`); @@ -697,7 +705,9 @@ export default class HangingProtocolService extends PubSubService { const { id } = displaySet; const displaySetMatchDetail = displaySetMatchDetails.get(id); - const { displaySetInstanceUID: oldDisplaySetInstanceUID } = displaySetMatchDetail; + const { + displaySetInstanceUID: oldDisplaySetInstanceUID, + } = displaySetMatchDetail; const displaySetInstanceUID = displaySet.id === displaySetSelectorId @@ -730,8 +740,12 @@ export default class HangingProtocolService extends PubSubService { ); } - if (options === null) return options; - if (typeof options !== 'object') return options; + if (options === null) { + return options; + } + if (typeof options !== 'object') { + return options; + } // If options is an object with a custom attribute, compute a new options object if (options.custom) { @@ -892,7 +906,9 @@ export default class HangingProtocolService extends PubSubService { if (stageId) { for (let i = 0; i < stages.length; i++) { const stage = stages[i]; - if (stage.id === stageId && stage.status !== 'disabled') return i; + if (stage.id === stageId && stage.status !== 'disabled') { + return i; + } } return; } @@ -905,7 +921,9 @@ export default class HangingProtocolService extends PubSubService { let firstNotDisabled: number; for (let i = 0; i < stages.length; i++) { - if (stages[i].status === 'enabled') return i; + if (stages[i].status === 'enabled') { + return i; + } if (firstNotDisabled === undefined && stages[i].status !== 'disabled') { firstNotDisabled = i; } @@ -979,7 +997,9 @@ export default class HangingProtocolService extends PubSubService { if (stageId !== undefined) { return protocol.stages.findIndex(it => it.id === stageId); } - if (stageIndex !== undefined) return stageIndex; + if (stageIndex !== undefined) { + return stageIndex; + } return 0; } @@ -1030,7 +1050,9 @@ export default class HangingProtocolService extends PubSubService { const protocol = this.protocol; const stage = protocol.stages[stageIdx]; const defaultViewport = stage.defaultViewport || protocol.defaultViewport; - if (!defaultViewport) return; + if (!defaultViewport) { + return; + } const useViewport = { ...defaultViewport }; return this._matchViewport(useViewport, options); @@ -1152,12 +1174,18 @@ export default class HangingProtocolService extends PubSubService { offset: number, options: HangingProtocol.SetProtocolOptions = {} ): HangingProtocol.DisplaySetMatchDetails { - if (!matchDetails) return; - if (offset === 0) return matchDetails; + if (!matchDetails) { + return; + } + if (offset === 0) { + return matchDetails; + } const { matchingScores = [] } = matchDetails; if (offset === -1) { const { inDisplay } = options; - if (!inDisplay) return matchDetails; + if (!inDisplay) { + return matchDetails; + } for (let i = 0; i < matchDetails.matchingScores.length; i++) { if ( inDisplay.indexOf( @@ -1184,12 +1212,16 @@ export default class HangingProtocolService extends PubSubService { id: string, displaySetUID: string ): void { - if (match.displaySetInstanceUID === displaySetUID) return; + if (match.displaySetInstanceUID === displaySetUID) { + return; + } if (!match.matchingScores) { throw new Error('No matchingScores found in ' + match); } for (const subMatch of match.matchingScores) { - if (subMatch.displaySetInstanceUID === displaySetUID) return; + if (subMatch.displaySetInstanceUID === displaySetUID) { + return; + } } throw new Error( `Reused viewport details ${id} with ds ${displaySetUID} not valid` @@ -1391,21 +1423,23 @@ export default class HangingProtocolService extends PubSubService { const matchActiveOnly = this.protocol.numberOfPriorsReferenced === -1; this.studies.forEach(study => { // Skip non-active if active only - if (matchActiveOnly && this.activeStudy !== study) return; + if (matchActiveOnly && this.activeStudy !== study) { + return; + } const studyDisplaySets = this.displaySets.filter( - it => it.StudyInstanceUID === study.StudyInstanceUID + it => it.StudyInstanceUID === study.StudyInstanceUID ); const studyMatchDetails = this.protocolEngine.findMatch( - study, - studyMatchingRules, - { - studies: this.studies, - displaySets: studyDisplaySets, - allDisplaySets: this.displaySets, - displaySetMatchDetails: this.displaySetMatchDetails, - } + study, + studyMatchingRules, + { + studies: this.studies, + displaySets: studyDisplaySets, + allDisplaySets: this.displaySets, + displaySetMatchDetails: this.displaySetMatchDetails, + } ); // Prevent bestMatch from being updated if the matchDetails' required attribute check has failed @@ -1414,10 +1448,10 @@ export default class HangingProtocolService extends PubSubService { } this.debug( - 'study', - study.StudyInstanceUID, - 'display sets #', - studyDisplaySets.length + 'study', + study.StudyInstanceUID, + 'display sets #', + studyDisplaySets.length ); studyDisplaySets.forEach(displaySet => { const { @@ -1426,15 +1460,15 @@ export default class HangingProtocolService extends PubSubService { displaySetInstanceUID, } = displaySet; const seriesMatchDetails = this.protocolEngine.findMatch( - displaySet, - seriesMatchingRules, - // Todo: why we have images here since the matching type does not have it - { - studies: this.studies, - instance: displaySet.images?.[0], - displaySetMatchDetails: this.displaySetMatchDetails, - displaySets: studyDisplaySets, - } + displaySet, + seriesMatchingRules, + // Todo: why we have images here since the matching type does not have it + { + studies: this.studies, + instance: displaySet.images?.[0], + displaySetMatchDetails: this.displaySetMatchDetails, + displaySets: studyDisplaySets, + } ); // Prevent bestMatch from being updated if the matchDetails' required attribute check has failed diff --git a/platform/core/src/services/HangingProtocolService/custom-attribute/isDisplaySetFromUrl.ts b/platform/core/src/services/HangingProtocolService/custom-attribute/isDisplaySetFromUrl.ts index d1626919da9..bdb37ac5c46 100644 --- a/platform/core/src/services/HangingProtocolService/custom-attribute/isDisplaySetFromUrl.ts +++ b/platform/core/src/services/HangingProtocolService/custom-attribute/isDisplaySetFromUrl.ts @@ -13,7 +13,9 @@ const isDisplaySetFromUrl = (displaySet): boolean => { params ); const initialSOPInstanceUID = getSplitParam('initialsopinstanceuid', params); - if (!initialSeriesInstanceUID && !initialSOPInstanceUID) return false; + if (!initialSeriesInstanceUID && !initialSOPInstanceUID) { + return false; + } const isSeriesMatch = !initialSeriesInstanceUID || initialSeriesInstanceUID.some( @@ -32,9 +34,13 @@ const isDisplaySetFromUrl = (displaySet): boolean => { */ function sopInstanceLocation(displaySets) { const displaySet = displaySets?.[0]; - if (!displaySet) return; + if (!displaySet) { + return; + } const initialSOPInstanceUID = getSplitParam('initialsopinstanceuid'); - if (!initialSOPInstanceUID) return; + if (!initialSOPInstanceUID) { + return; + } const index = displaySet.instances.findIndex(instance => initialSOPInstanceUID.includes(instance.SOPInstanceUID) diff --git a/platform/core/src/services/HangingProtocolService/custom-attribute/numberOfDisplaySetsWithImages.ts b/platform/core/src/services/HangingProtocolService/custom-attribute/numberOfDisplaySetsWithImages.ts index 75c3d969c6e..2dac79bc859 100644 --- a/platform/core/src/services/HangingProtocolService/custom-attribute/numberOfDisplaySetsWithImages.ts +++ b/platform/core/src/services/HangingProtocolService/custom-attribute/numberOfDisplaySetsWithImages.ts @@ -1,5 +1,6 @@ export default (study, extraData) => { - const ret = extraData?.displaySets?.filter(ds => ds.numImageFrames>0)?.length; - console.log("number of display sets with images", ret); + const ret = extraData?.displaySets?.filter(ds => ds.numImageFrames > 0) + ?.length; + console.log('number of display sets with images', ret); return ret; -}; \ No newline at end of file +}; diff --git a/platform/core/src/services/HangingProtocolService/custom-attribute/seriesDescriptionsFromDisplaySets.ts b/platform/core/src/services/HangingProtocolService/custom-attribute/seriesDescriptionsFromDisplaySets.ts index 445fb6dd218..b412af75a20 100644 --- a/platform/core/src/services/HangingProtocolService/custom-attribute/seriesDescriptionsFromDisplaySets.ts +++ b/platform/core/src/services/HangingProtocolService/custom-attribute/seriesDescriptionsFromDisplaySets.ts @@ -1 +1,2 @@ -export default (study, extraData) => extraData?.displaySets?.map(ds => ds.SeriesDescription); \ No newline at end of file +export default (study, extraData) => + extraData?.displaySets?.map(ds => ds.SeriesDescription); diff --git a/platform/core/src/services/HangingProtocolService/lib/validator.js b/platform/core/src/services/HangingProtocolService/lib/validator.js index 3be5b16de9f..1e7d44442d8 100644 --- a/platform/core/src/services/HangingProtocolService/lib/validator.js +++ b/platform/core/src/services/HangingProtocolService/lib/validator.js @@ -111,10 +111,12 @@ validate.validators.includes = function(value, options, key) { const includedValues = testValue.filter(el => dicomArrayValue.includes(el)); if (includedValues.length === 0) { return `${key} must include at least one of the following values: ${testValue.join( - ', ' + ', ' )}`; } - } else return `${key} ${testValue} must be an array`; + } else { + return `${key} ${testValue} must be an array`; + } // else if (!value.includes(testValue)) { // return `${key} ${value} must include ${testValue}`; // } @@ -151,7 +153,9 @@ validate.validators.doesNotInclude = function(value, options, key) { if (includedValues.length > 0) { return `${key} must not include the following value: ${includedValues}`; } - } else return `${key} ${testValue} must be an array`; + } else { + return `${key} ${testValue} must be an array`; + } }; // Ignore case contains. // options testValue MUST be in lower case already, otherwise it won't match @@ -175,31 +179,31 @@ validate.validators.containsI = function(value, options, key) { const testValue = getTestValue(options); if (Array.isArray(value)) { if ( - value.some( - item => !validate.validators.containsI(item.toLowerCase(), options, key) - ) + value.some( + item => !validate.validators.containsI(item.toLowerCase(), options, key) + ) ) { return undefined; } return `No item of ${value.join(',')} contains ${JSON.stringify( - testValue + testValue )}`; } if (Array.isArray(testValue)) { if ( - testValue.some( - subTest => - !validate.validators.containsI(value, subTest.toLowerCase(), key) - ) + testValue.some( + subTest => + !validate.validators.containsI(value, subTest.toLowerCase(), key) + ) ) { return; } return `${key} must contain at least one of ${testValue.join(',')}`; } if ( - testValue && - value.indexOf && - value.toLowerCase().indexOf(testValue.toLowerCase()) === -1 + testValue && + value.indexOf && + value.toLowerCase().indexOf(testValue.toLowerCase()) === -1 ) { return key + 'must contain any case of' + testValue; } @@ -227,14 +231,14 @@ validate.validators.contains = function(value, options, key) { return undefined; } return `No item of ${value.join(',')} contains ${JSON.stringify( - testValue + testValue )}`; } if (Array.isArray(testValue)) { if ( - testValue.some( - subTest => !validate.validators.contains(value, subTest, key) - ) + testValue.some( + subTest => !validate.validators.contains(value, subTest, key) + ) ) { return; } @@ -454,11 +458,13 @@ validate.validators.range = function(value, options, key) { if (value === undefined || value < min || value > max) { return `${key} with value ${value} must be between ${min} and ${max}`; } - } else return `${key} must be an array of length 2`; + } else { + return `${key} must be an array of length 2`; + } }; validate.validators.notNull = value => - value === null || value === undefined ? 'Value is null' : undefined; + value === null || value === undefined ? 'Value is null' : undefined; const getTestValue = options => { if (Array.isArray(options)) { return options.map(option => option?.value ?? option); diff --git a/platform/core/src/services/HangingProtocolService/lib/validator.test.js b/platform/core/src/services/HangingProtocolService/lib/validator.test.js index da6f46f04e2..8950aacfd60 100644 --- a/platform/core/src/services/HangingProtocolService/lib/validator.test.js +++ b/platform/core/src/services/HangingProtocolService/lib/validator.test.js @@ -1,570 +1,570 @@ import validate from './validator.js'; describe('validator', () => { - const attributeMap = { - str: 'Attenuation Corrected', - upper: 'UPPER', - num: 3, - nullValue: null, - list: ['abc', 'def', 'GHI'], - listStr: ['Attenuation Corrected'], - }; + const attributeMap = { + str: 'Attenuation Corrected', + upper: 'UPPER', + num: 3, + nullValue: null, + list: ['abc', 'def', 'GHI'], + listStr: ['Attenuation Corrected'], + }; - const options = { - format: 'grouped', - }; + const options = { + format: 'grouped', + }; - describe('equals', () => { - it('returned undefined on strictly equals', () => { - expect( - validate(attributeMap, { listStr: { equals: ['Attenuation'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { listStr: { equals: 'Attenuation' } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { equals: 'Attenuation Corrected' } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { equals: ['Attenuation Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { equals: 'Attenuation Corrected' } }, [ - options, - ]) - ).toBeUndefined(); + describe('equals', () => { + it('returned undefined on strictly equals', () => { + expect( + validate(attributeMap, { listStr: { equals: ['Attenuation'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { listStr: { equals: 'Attenuation' } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { equals: 'Attenuation Corrected' } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { equals: ['Attenuation Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { equals: 'Attenuation Corrected' } }, [ + options, + ]) + ).toBeUndefined(); - expect( - validate( - attributeMap, - { str: { equals: { value: 'Attenuation Corrected' } } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { equals: ['Attenuation Corrected'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { equals: ['Attenuation'] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { equals: ['abc', 'def', 'GHI'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { equals: ['abc', 'GHI', 'def'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { list: { equals: { value: ['abc', 'def', 'GHI'] } } }, - [options] - ) - ).toBeUndefined(); - }); + expect( + validate( + attributeMap, + { str: { equals: { value: 'Attenuation Corrected' } } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { equals: ['Attenuation Corrected'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { equals: ['Attenuation'] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { equals: ['abc', 'def', 'GHI'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { equals: ['abc', 'GHI', 'def'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { list: { equals: { value: ['abc', 'def', 'GHI'] } } }, + [options] + ) + ).toBeUndefined(); }); - describe('doesNotEqual', () => { - it('returns undefined if value does not equal ', () => { - expect( - validate( - attributeMap, - { listStr: { doesNotEqual: 'Attenuation Corrected' } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { doesNotEqual: ['Attenuation Corrected'] } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { listStr: { doesNotEqual: 'Attenuation' } }, [ - options, - ]) - ).toBeUndefined(); + }); + describe('doesNotEqual', () => { + it('returns undefined if value does not equal ', () => { + expect( + validate( + attributeMap, + { listStr: { doesNotEqual: 'Attenuation Corrected' } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { doesNotEqual: ['Attenuation Corrected'] } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { listStr: { doesNotEqual: 'Attenuation' } }, [ + options, + ]) + ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotEqual: 'Attenuation' } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { str: { doesNotEqual: { value: 'Attenuation' } } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotEqual: ['Attenuation'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotEqual: ['abc', 'def'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { list: { doesNotEqual: ['abc', 'GHI', 'def'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { list: { doesNotEqual: ['abc', 'def', 'GHI'] } }, - [options] - ) - ).not.toBeUndefined(); - }); + expect( + validate(attributeMap, { str: { doesNotEqual: 'Attenuation' } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { str: { doesNotEqual: { value: 'Attenuation' } } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotEqual: ['Attenuation'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotEqual: ['abc', 'def'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { list: { doesNotEqual: ['abc', 'GHI', 'def'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { list: { doesNotEqual: ['abc', 'def', 'GHI'] } }, + [options] + ) + ).not.toBeUndefined(); }); - describe('includes', () => { - it('returns match any list includes', () => { - expect( - validate( - attributeMap, - { listStr: { includes: 'Attenuation Corrected' } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { includes: ['Attenuation Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { includes: ['Attenuation Corrected', 'Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { includes: ['Attenuation', 'Corrected'] } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { str: { includes: ['Attenuation Corrected', 'Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { str: { includes: ['Attenuation', 'Corrected'] } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { includes: ['abc'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { includes: ['GHI', 'HI'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { includes: ['HI', 'bye'] } }, [options]) - ).not.toBeUndefined(); - }); + }); + describe('includes', () => { + it('returns match any list includes', () => { + expect( + validate( + attributeMap, + { listStr: { includes: 'Attenuation Corrected' } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { includes: ['Attenuation Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { includes: ['Attenuation Corrected', 'Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { includes: ['Attenuation', 'Corrected'] } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { str: { includes: ['Attenuation Corrected', 'Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { str: { includes: ['Attenuation', 'Corrected'] } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { includes: ['abc'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { includes: ['GHI', 'HI'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { includes: ['HI', 'bye'] } }, [options]) + ).not.toBeUndefined(); }); - describe('doesNotInclude', () => { - it('returns undefined if list does not includes', () => { - expect( - validate( - attributeMap, - { listStr: { doesNotInclude: 'Attenuation Corrected' } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { - listStr: { doesNotInclude: ['Attenuation Corrected', 'Corrected'] }, - }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { listStr: { doesNotInclude: ['Attenuation', 'Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { str: { doesNotInclude: ['Attenuation Corrected', 'Corrected'] } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { str: { doesNotInclude: ['Attenuation', 'Corrected'] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotInclude: ['Corr'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotInclude: 'abc' } }, [options]) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { list: { doesNotInclude: { value: ['abc'] } } }, - [options] - ) - ).not.toBeUndefined(); - expect( - validate( - attributeMap, - { list: { doesNotInclude: { value: ['att', 'cor'] } } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { list: { doesNotInclude: { value: ['abc', 'def', 'dog'] } } }, - [options] - ) - ).not.toBeUndefined(); - }); + }); + describe('doesNotInclude', () => { + it('returns undefined if list does not includes', () => { + expect( + validate( + attributeMap, + { listStr: { doesNotInclude: 'Attenuation Corrected' } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { + listStr: { doesNotInclude: ['Attenuation Corrected', 'Corrected'] }, + }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { listStr: { doesNotInclude: ['Attenuation', 'Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { str: { doesNotInclude: ['Attenuation Corrected', 'Corrected'] } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { str: { doesNotInclude: ['Attenuation', 'Corrected'] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotInclude: ['Corr'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotInclude: 'abc' } }, [options]) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { list: { doesNotInclude: { value: ['abc'] } } }, + [options] + ) + ).not.toBeUndefined(); + expect( + validate( + attributeMap, + { list: { doesNotInclude: { value: ['att', 'cor'] } } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { list: { doesNotInclude: { value: ['abc', 'def', 'dog'] } } }, + [options] + ) + ).not.toBeUndefined(); }); - describe('containsI', () => { - it('returns match any list contains case insensitive', () => { - expect( - validate(attributeMap, { upper: { containsI: ['hi', 'pre'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { containsI: 'hi' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { containsI: ['ghi', 'bye'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { containsI: ['bye', 'hi'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { containsI: ['ig', 'hi'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { upper: { containsI: ['bye', 'per'] } }, [ - options, - ]) - ).toBeUndefined(); - }); + }); + describe('containsI', () => { + it('returns match any list contains case insensitive', () => { + expect( + validate(attributeMap, { upper: { containsI: ['hi', 'pre'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { containsI: 'hi' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { containsI: ['ghi', 'bye'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { containsI: ['bye', 'hi'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { containsI: ['ig', 'hi'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { upper: { containsI: ['bye', 'per'] } }, [ + options, + ]) + ).toBeUndefined(); }); - describe('contains', () => { - it('returns match any list contains', () => { - expect( - validate(attributeMap, { str: { contains: 'Corr' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { contains: { value: 'Corr' } } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { contains: ['Corr'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { contains: ['corr'] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { contains: ['Att', 'Wall'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { contains: 'GH' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { contains: ['ab'] } }, [options]) - ).toBeUndefined(); + }); + describe('contains', () => { + it('returns match any list contains', () => { + expect( + validate(attributeMap, { str: { contains: 'Corr' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { contains: { value: 'Corr' } } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { contains: ['Corr'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { contains: ['corr'] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { contains: ['Att', 'Wall'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { contains: 'GH' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { contains: ['ab'] } }, [options]) + ).toBeUndefined(); - expect( - validate(attributeMap, { list: { contains: ['z', 'bc'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { contains: ['z'] } }, [options]) - ).not.toBeUndefined(); - }); + expect( + validate(attributeMap, { list: { contains: ['z', 'bc'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { contains: ['z'] } }, [options]) + ).not.toBeUndefined(); }); + }); - describe('doesNotContain', () => { - it('returns undefined if string does not contain specified value', () => { - expect( - validate(attributeMap, { str: { doesNotContain: ['att', 'wall'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: 'Corr' } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: 'corr' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: { value: 'corr' } } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: ['att', 'cor'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: ['Att', 'cor'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContain: ['bye', 'hi'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotContain: ['GHI', 'hi'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotContain: ['hi'] } }, [options]) - ).toBeUndefined(); - }); + describe('doesNotContain', () => { + it('returns undefined if string does not contain specified value', () => { + expect( + validate(attributeMap, { str: { doesNotContain: ['att', 'wall'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: 'Corr' } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: 'corr' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: { value: 'corr' } } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: ['att', 'cor'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: ['Att', 'cor'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContain: ['bye', 'hi'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotContain: ['GHI', 'hi'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotContain: ['hi'] } }, [options]) + ).toBeUndefined(); }); - describe('doesNotContainI', () => { - it('returns undefined if string does not contain specified value', () => { - expect( - validate(attributeMap, { str: { doesNotContainI: 'corr' } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContainI: 'Corr' } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContainI: ['att', 'cor'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContainI: ['Att', 'wall'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { doesNotContainI: ['bye', 'hi'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotContainI: ['bye', 'ABC'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotContainI: 'bye' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { doesNotContainI: ['bye', 'ABC'] } }, [ - options, - ]) - ).not.toBeUndefined(); - }); + }); + describe('doesNotContainI', () => { + it('returns undefined if string does not contain specified value', () => { + expect( + validate(attributeMap, { str: { doesNotContainI: 'corr' } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContainI: 'Corr' } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContainI: ['att', 'cor'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContainI: ['Att', 'wall'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { doesNotContainI: ['bye', 'hi'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotContainI: ['bye', 'ABC'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotContainI: 'bye' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { doesNotContainI: ['bye', 'ABC'] } }, [ + options, + ]) + ).not.toBeUndefined(); }); - describe('startsWith', () => { - it('returns undefined if string starts with specified value', () => { - expect( - validate(attributeMap, { str: { startsWith: { value: 'Atte' } } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { startsWith: 'Att' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { startsWith: ['cat', 'dog', 'Att'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { startsWith: ['cat', 'dog'] } }, [ - options, - ]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { list: { startsWith: ['GH'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { startsWith: ['de', 'bye'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { startsWith: ['hi', 'bye'] } }, [ - options, - ]) - ).not.toBeUndefined(); - }); + }); + describe('startsWith', () => { + it('returns undefined if string starts with specified value', () => { + expect( + validate(attributeMap, { str: { startsWith: { value: 'Atte' } } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { startsWith: 'Att' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { startsWith: ['cat', 'dog', 'Att'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { startsWith: ['cat', 'dog'] } }, [ + options, + ]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { list: { startsWith: ['GH'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { startsWith: ['de', 'bye'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { startsWith: ['hi', 'bye'] } }, [ + options, + ]) + ).not.toBeUndefined(); }); - describe('endsWith', () => { - it('returns undefined if string ends with specified value', () => { - expect( - validate(attributeMap, { str: { endsWith: 'ted' } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { endsWith: { value: 'ted' } } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { endsWith: ['ted'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { str: { endsWith: ['Att'] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { str: { endsWith: ['cat', 'dog', 'ted'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { endsWith: ['HI'] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { endsWith: ['bc', 'dog', 'ted'] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { list: { endsWith: ['bye', 'dog'] } }, [ - options, - ]) - ).not.toBeUndefined(); - }); + }); + describe('endsWith', () => { + it('returns undefined if string ends with specified value', () => { + expect( + validate(attributeMap, { str: { endsWith: 'ted' } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { endsWith: { value: 'ted' } } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { endsWith: ['ted'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { str: { endsWith: ['Att'] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { str: { endsWith: ['cat', 'dog', 'ted'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { endsWith: ['HI'] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { endsWith: ['bc', 'dog', 'ted'] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { list: { endsWith: ['bye', 'dog'] } }, [ + options, + ]) + ).not.toBeUndefined(); }); + }); - describe('greaterThan', () => { - it('returns undefined on greaterThan', () => { - expect( - validate( - attributeMap, - { num: { greaterThan: { value: attributeMap.num - 1 } } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { greaterThan: attributeMap.num - 1 } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { num: { greaterThan: [attributeMap.num - 1] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate( - attributeMap, - { num: { greaterThan: [attributeMap.num + 1] } }, - [options] - ) - ).not.toBeUndefined(); - }); + describe('greaterThan', () => { + it('returns undefined on greaterThan', () => { + expect( + validate( + attributeMap, + { num: { greaterThan: { value: attributeMap.num - 1 } } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { greaterThan: attributeMap.num - 1 } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { num: { greaterThan: [attributeMap.num - 1] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate( + attributeMap, + { num: { greaterThan: [attributeMap.num + 1] } }, + [options] + ) + ).not.toBeUndefined(); }); - describe('lessThan', () => { - it('returns undefined on lessThan', () => { - expect( - validate( - attributeMap, - { num: { lessThan: { value: attributeMap.num + 1 } } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { lessThan: attributeMap.num + 1 } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { lessThan: [attributeMap.num + 1] } }, [ - options, - ]) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { lessThan: [attributeMap.num - 1] } }, [ - options, - ]) - ).not.toBeUndefined(); - }); + }); + describe('lessThan', () => { + it('returns undefined on lessThan', () => { + expect( + validate( + attributeMap, + { num: { lessThan: { value: attributeMap.num + 1 } } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { lessThan: attributeMap.num + 1 } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { lessThan: [attributeMap.num + 1] } }, [ + options, + ]) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { lessThan: [attributeMap.num - 1] } }, [ + options, + ]) + ).not.toBeUndefined(); }); - describe('range', () => { - it('returns undefined if the value is between', () => { - expect( - validate( - attributeMap, - { num: { range: [attributeMap.num + 1, attributeMap.num - 1] } }, - [options] - ) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { range: [1, 4] } }, [options]) - ).toBeUndefined(); - expect( - validate(attributeMap, { num: { range: [1, 2] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { num: { range: [4, 5] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { num: { range: [5] } }, [options]) - ).not.toBeUndefined(); - expect( - validate(attributeMap, { num: { range: 5 } }, [options]) - ).not.toBeUndefined(); - }); + }); + describe('range', () => { + it('returns undefined if the value is between', () => { + expect( + validate( + attributeMap, + { num: { range: [attributeMap.num + 1, attributeMap.num - 1] } }, + [options] + ) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { range: [1, 4] } }, [options]) + ).toBeUndefined(); + expect( + validate(attributeMap, { num: { range: [1, 2] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { num: { range: [4, 5] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { num: { range: [5] } }, [options]) + ).not.toBeUndefined(); + expect( + validate(attributeMap, { num: { range: 5 } }, [options]) + ).not.toBeUndefined(); }); + }); }); diff --git a/platform/core/src/services/StateSyncService/StateSyncService.ts b/platform/core/src/services/StateSyncService/StateSyncService.ts index 5a28bc04165..aead030eb4d 100644 --- a/platform/core/src/services/StateSyncService/StateSyncService.ts +++ b/platform/core/src/services/StateSyncService/StateSyncService.ts @@ -40,7 +40,7 @@ export default class StateSyncService extends PubSubService { this.configuration = configuration || {}; } - public init(extensionManager: ExtensionManager): void { } + public init(extensionManager: ExtensionManager): void {} /** Registers a new sync store called `id`. The state * defines how the state is stored, and any default clearing of the diff --git a/platform/core/src/services/ToolBarService/ToolbarService.ts b/platform/core/src/services/ToolBarService/ToolbarService.ts index 4a3cf2429e9..2e893cf6e7c 100644 --- a/platform/core/src/services/ToolBarService/ToolbarService.ts +++ b/platform/core/src/services/ToolBarService/ToolbarService.ts @@ -66,7 +66,9 @@ export default class ToolbarService extends PubSubService { * called with {...commandOptions,...options} */ recordInteraction(interaction, options?: Record) { - if (!interaction) return; + if (!interaction) { + return; + } const commandsManager = this._commandsManager; const { groupId, itemId, interactionType, commands } = interaction; diff --git a/platform/core/src/services/ViewportGridService/getPresentationIds.ts b/platform/core/src/services/ViewportGridService/getPresentationIds.ts index decbb01167d..e832b800abd 100644 --- a/platform/core/src/services/ViewportGridService/getPresentationIds.ts +++ b/platform/core/src/services/ViewportGridService/getPresentationIds.ts @@ -35,10 +35,16 @@ const addUniqueIndex = (arr, key, viewports, isUpdatingSameViewport) => { }; const getLutId = (ds): string => { - if (!ds || !ds.options) return DEFAULT; - if (ds.options.id) return ds.options.id; + if (!ds || !ds.options) { + return DEFAULT; + } + if (ds.options.id) { + return ds.options.id; + } const arr = Object.entries(ds.options).map(([key, val]) => `${key}=${val}`); - if (!arr.length) return DEFAULT; + if (!arr.length) { + return DEFAULT; + } return arr.join(JOIN_STR); }; @@ -93,7 +99,9 @@ export type PresentationIds = { * @returns PresentationIds */ const getPresentationIds = (viewport, viewports): PresentationIds => { - if (!viewport) return; + if (!viewport) { + return; + } const { viewportOptions, displaySetInstanceUIDs, @@ -108,7 +116,9 @@ const getPresentationIds = (viewport, viewports): PresentationIds => { const lutPresentationArr = [lutId]; const positionPresentationArr = [orientation || 'acquisition']; - if (id) positionPresentationArr.push(id); + if (id) { + positionPresentationArr.push(id); + } for (const uid of displaySetInstanceUIDs) { positionPresentationArr.push(uid); diff --git a/platform/core/src/utils/absoluteUrl.js b/platform/core/src/utils/absoluteUrl.js index faf2369be7c..7fb9fd9168a 100644 --- a/platform/core/src/utils/absoluteUrl.js +++ b/platform/core/src/utils/absoluteUrl.js @@ -1,7 +1,9 @@ const absoluteUrl = path => { let absolutePath = '/'; - if (!path) return absolutePath; + if (!path) { + return absolutePath; + } // TODO: Find another way to get root url const absoluteUrl = window.location.origin; diff --git a/platform/core/src/utils/debounce.js b/platform/core/src/utils/debounce.js index 83a16b0990a..d71793c0fc7 100644 --- a/platform/core/src/utils/debounce.js +++ b/platform/core/src/utils/debounce.js @@ -9,12 +9,16 @@ function debounce(func, wait, immediate) { args = arguments; var later = function() { timeout = null; - if (!immediate) func.apply(context, args); + if (!immediate) { + func.apply(context, args); + } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); + if (callNow) { + func.apply(context, args); + } }; } diff --git a/platform/core/src/utils/isImage.js b/platform/core/src/utils/isImage.js index 525e6ccd957..373abce9958 100644 --- a/platform/core/src/utils/isImage.js +++ b/platform/core/src/utils/isImage.js @@ -58,6 +58,8 @@ const imagesTypes = [ * @returns {boolean} - true if it has image data */ export const isImage = SOPClassUID => { - if (!SOPClassUID) return false; + if (!SOPClassUID) { + return false; + } return imagesTypes.indexOf(SOPClassUID) !== -1; }; diff --git a/platform/core/src/utils/isLowPriorityModality.js b/platform/core/src/utils/isLowPriorityModality.js index 54024d5a051..aebb450ffb1 100644 --- a/platform/core/src/utils/isLowPriorityModality.js +++ b/platform/core/src/utils/isLowPriorityModality.js @@ -1,4 +1,10 @@ -const LOW_PRIORITY_MODALITIES = Object.freeze(['SEG', 'KO', 'PR', 'SR', 'RTSTRUCT']); +const LOW_PRIORITY_MODALITIES = Object.freeze([ + 'SEG', + 'KO', + 'PR', + 'SR', + 'RTSTRUCT', +]); export default function isLowPriorityModality(Modality) { return LOW_PRIORITY_MODALITIES.includes(Modality); diff --git a/platform/core/src/utils/makeCancelable.js b/platform/core/src/utils/makeCancelable.js index 11e507103ad..1ca58ff204d 100644 --- a/platform/core/src/utils/makeCancelable.js +++ b/platform/core/src/utils/makeCancelable.js @@ -2,11 +2,15 @@ export default function makeCancelable(thenable) { let isCanceled = false; const promise = Promise.resolve(thenable).then( function(result) { - if (isCanceled) throw Object.freeze({ isCanceled }); + if (isCanceled) { + throw Object.freeze({ isCanceled }); + } return result; }, function(error) { - if (isCanceled) throw Object.freeze({ isCanceled, error }); + if (isCanceled) { + throw Object.freeze({ isCanceled, error }); + } throw error; } ); diff --git a/platform/core/src/utils/metadataProvider/fetchPaletteColorLookupTableData.js b/platform/core/src/utils/metadataProvider/fetchPaletteColorLookupTableData.js index 1975b3942f6..f08d6d347ed 100644 --- a/platform/core/src/utils/metadataProvider/fetchPaletteColorLookupTableData.js +++ b/platform/core/src/utils/metadataProvider/fetchPaletteColorLookupTableData.js @@ -18,8 +18,9 @@ export default function fetchPaletteColorLookupTableData( ) { const { PaletteColorLookupTableUID } = item; const paletteData = item[tag]; - if (paletteData === undefined && PaletteColorLookupTableUID === undefined) + if (paletteData === undefined && PaletteColorLookupTableUID === undefined) { return; + } // performance optimization - read UID and cache by UID return _getPaletteColor(item[tag], item[descriptorTag]); } @@ -28,7 +29,9 @@ function _getPaletteColor(paletteColorLookupTableData, lutDescriptor) { const numLutEntries = lutDescriptor[0]; const bits = lutDescriptor[2]; - if (!paletteColorLookupTableData) return undefined; + if (!paletteColorLookupTableData) { + return undefined; + } const arrayBufferToPaletteColorLUT = arraybuffer => { const lut = []; diff --git a/platform/core/src/utils/progressTrackingUtils.js b/platform/core/src/utils/progressTrackingUtils.js index efc3447d4a0..629ad60ce4d 100644 --- a/platform/core/src/utils/progressTrackingUtils.js +++ b/platform/core/src/utils/progressTrackingUtils.js @@ -124,7 +124,9 @@ function getOverallProgress(list) { status.total++; if (isValidProgress(task.progress)) { status.partial += task.progress; - if (task.progress === 1.0 && task.failed) status.failures++; + if (task.progress === 1.0 && task.failed) { + status.failures++; + } } task = task.next; } diff --git a/platform/core/src/utils/sortStudy.ts b/platform/core/src/utils/sortStudy.ts index a39c8a16a63..527eac3145c 100644 --- a/platform/core/src/utils/sortStudy.ts +++ b/platform/core/src/utils/sortStudy.ts @@ -13,7 +13,9 @@ const compareSeriesDateTime = (a, b) => { const defaultSeriesSort = (a, b) => { const seriesNumberA = a.SeriesNumber ?? a.seriesNumber; const seriesNumberB = b.SeriesNumber ?? b.seriesNumber; - if (seriesNumberA === seriesNumberB) return compareSeriesDateTime(a, b); + if (seriesNumberA === seriesNumberB) { + return compareSeriesDateTime(a, b); + } return seriesNumberA - seriesNumberB; }; @@ -67,8 +69,11 @@ const sortStudySeries = ( seriesSortingCriteria = seriesSortCriteria.default, sortFunction = null ) => { - if (typeof sortFunction === 'function') return sortFunction(series); - else return series.sort(seriesSortingCriteria); + if (typeof sortFunction === 'function') { + return sortFunction(series); + } else { + return series.sort(seriesSortingCriteria); + } }; /** diff --git a/platform/core/src/utils/splitComma.ts b/platform/core/src/utils/splitComma.ts index 4354e0ce0bf..5dc5d892c61 100644 --- a/platform/core/src/utils/splitComma.ts +++ b/platform/core/src/utils/splitComma.ts @@ -1,6 +1,8 @@ /** Splits a list of stirngs by commas within the strings */ const splitComma = (strings: string[]): string[] => { - if (!strings) return null; + if (!strings) { + return null; + } for (let i = 0; i < strings.length; i++) { const comma = strings[i].indexOf(','); if (comma !== -1) { @@ -24,7 +26,9 @@ const getSplitParam = ( const sourceKey = [...params.keys()].find( it => it.toLowerCase() === lowerCaseKey ); - if (!sourceKey) return; + if (!sourceKey) { + return; + } return splitComma(params.getAll(sourceKey)); }; diff --git a/platform/docs/sidebars.js b/platform/docs/sidebars.js index 981a73cd7a8..de26dde1e1a 100644 --- a/platform/docs/sidebars.js +++ b/platform/docs/sidebars.js @@ -11,7 +11,7 @@ module.exports = { // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], // But you can create a sidebar manually /* diff --git a/platform/i18n/src/config.js b/platform/i18n/src/config.js index e9e1c168536..d7864c21b01 100644 --- a/platform/i18n/src/config.js +++ b/platform/i18n/src/config.js @@ -4,7 +4,15 @@ const debugMode = !!( const detectionOptions = { // order and from where user language should be detected - order: ['querystring', 'cookie', 'localStorage', 'navigator', 'htmlTag', 'path', 'subdomain'], + order: [ + 'querystring', + 'cookie', + 'localStorage', + 'navigator', + 'htmlTag', + 'path', + 'subdomain', + ], // keys or params to lookup language from lookupQuerystring: 'lng', @@ -18,7 +26,7 @@ const detectionOptions = { excludeCacheFor: ['cimode'], // languages to not persist (cookie, localStorage) // optional htmlTag with lang attribute, the default is: - htmlTag: document.documentElement + htmlTag: document.documentElement, }; export { debugMode, detectionOptions }; diff --git a/platform/i18n/src/index.js b/platform/i18n/src/index.js index 482b53b7e94..f510e8b2160 100644 --- a/platform/i18n/src/index.js +++ b/platform/i18n/src/index.js @@ -128,7 +128,7 @@ function initI18n( }); } - return initialized.then(function (t) { + return initialized.then(function(t) { i18n.T = t; customDebug(`T function available.`, 'info'); }); @@ -140,7 +140,13 @@ i18n.initializing = initI18n(); i18n.initI18n = initI18n; i18n.addLocales = addLocales; i18n.availableLanguages = getAvailableLanguagesInfo(locales); -i18n.defaultLanguage = { label: getLanguageLabel(DEFAULT_LANGUAGE), value: DEFAULT_LANGUAGE }; -i18n.currentLanguage = () => ({ label: getLanguageLabel(i18n.language), value: i18n.language }); +i18n.defaultLanguage = { + label: getLanguageLabel(DEFAULT_LANGUAGE), + value: DEFAULT_LANGUAGE, +}; +i18n.currentLanguage = () => ({ + label: getLanguageLabel(i18n.language), + value: i18n.language, +}); export default i18n; diff --git a/platform/i18n/src/locales/index.js b/platform/i18n/src/locales/index.js index b950f9ab882..dcfc9ba85e6 100644 --- a/platform/i18n/src/locales/index.js +++ b/platform/i18n/src/locales/index.js @@ -19,5 +19,5 @@ export default { ...pt_BR, ...vi, ...zh, - ...test_lng + ...test_lng, }; diff --git a/platform/i18n/src/locales/test-LNG/index.js b/platform/i18n/src/locales/test-LNG/index.js index 315deb5d363..f39132793b7 100644 --- a/platform/i18n/src/locales/test-LNG/index.js +++ b/platform/i18n/src/locales/test-LNG/index.js @@ -32,6 +32,6 @@ export default { PatientInfo, Modes, SidePanel, - Modals + Modals, }, }; diff --git a/platform/i18n/src/utils.js b/platform/i18n/src/utils.js index 245013dac09..93e368cd113 100644 --- a/platform/i18n/src/utils.js +++ b/platform/i18n/src/utils.js @@ -57,7 +57,7 @@ const languagesMap = { 'test-LNG': 'Test Language', }; -const getLanguageLabel = (language) => { +const getLanguageLabel = language => { return languagesMap[language]; }; diff --git a/platform/i18n/writeLocaleIndexFiles.js b/platform/i18n/writeLocaleIndexFiles.js index 9996c0efbd2..12e7c3ad628 100644 --- a/platform/i18n/writeLocaleIndexFiles.js +++ b/platform/i18n/writeLocaleIndexFiles.js @@ -21,7 +21,9 @@ const directories = getDirectories(directoryPath); function writeFile(filepath, name, content) { fs.writeFile(path.join(filepath, name), content, err => { - if (err) throw err; + if (err) { + throw err; + } }); } diff --git a/platform/ui/src/components/DateRange/DateRange.tsx b/platform/ui/src/components/DateRange/DateRange.tsx index ee333c716dc..03b098c4b2f 100644 --- a/platform/ui/src/components/DateRange/DateRange.tsx +++ b/platform/ui/src/components/DateRange/DateRange.tsx @@ -45,7 +45,7 @@ const renderYearsOptions = () => { return options; }; -const DateRange = (props) => { +const DateRange = props => { const { id, onChange, startDate, endDate } = props; const [focusedInput, setFocusedInput] = useState(null); const renderYearsOptionsCallback = useCallback(renderYearsOptions, []); @@ -81,15 +81,15 @@ const DateRange = (props) => { onYearSelect: PropTypes.func, }; - const handleMonthChange = (event) => { + const handleMonthChange = event => { onMonthSelect(month, event.target.value); }; - const handleYearChange = (event) => { + const handleYearChange = event => { onYearSelect(month, event.target.value); }; - const handleOnBlur = () => { }; + const handleOnBlur = () => {}; return (
@@ -136,10 +136,10 @@ const DateRange = (props) => { onChange({ startDate: newStartDate ? newStartDate.format('YYYYMMDD') : undefined, endDate: newEndDate ? newEndDate.format('YYYYMMDD') : undefined, - }) + }); }} focusedInput={focusedInput} - onFocusChange={(updatedVal) => setFocusedInput(updatedVal)} + onFocusChange={updatedVal => setFocusedInput(updatedVal)} /** OPTIONAL */ renderCalendarInfo={renderDatePresets} renderMonthElement={renderMonthElement} @@ -149,7 +149,7 @@ const DateRange = (props) => { closeDatePicker: 'Close', clearDates: 'Clear dates', }} - isOutsideRange={(day) => !isInclusivelyBeforeDay(day, moment())} + isOutsideRange={day => !isInclusivelyBeforeDay(day, moment())} hideKeyboardShortcutsPanel={true} numberOfMonths={1} showClearDates={false} diff --git a/platform/ui/src/components/HotkeyField/HotkeyField.tsx b/platform/ui/src/components/HotkeyField/HotkeyField.tsx index 9124573f466..c9e7fb822c0 100644 --- a/platform/ui/src/components/HotkeyField/HotkeyField.tsx +++ b/platform/ui/src/components/HotkeyField/HotkeyField.tsx @@ -15,7 +15,14 @@ import { getKeys, formatKeysForInput } from './utils'; * @param {string} props.className input classes * @param {Array[]} props.modifierKeys */ -const HotkeyField = ({ disabled, keys, onChange, className, modifierKeys, hotkeys }) => { +const HotkeyField = ({ + disabled, + keys, + onChange, + className, + modifierKeys, + hotkeys, +}) => { const inputValue = formatKeysForInput(keys); const onInputKeyDown = event => { @@ -55,11 +62,11 @@ HotkeyField.propTypes = { unpause: PropTypes.func.isRequired, startRecording: PropTypes.func.isRequired, record: PropTypes.func.isRequired, - }).isRequired + }).isRequired, }; HotkeyField.defaultProps = { - disabled: false + disabled: false, }; export default HotkeyField; diff --git a/platform/ui/src/components/HotkeyField/utils.js b/platform/ui/src/components/HotkeyField/utils.js index fe1c7d0649c..deb3f3c2840 100644 --- a/platform/ui/src/components/HotkeyField/utils.js +++ b/platform/ui/src/components/HotkeyField/utils.js @@ -25,7 +25,4 @@ const getKeys = ({ sequence, modifierKeys }) => { return [...modifiers, ...keys]; }; -export { - getKeys, - formatKeysForInput -}; +export { getKeys, formatKeysForInput }; diff --git a/platform/ui/src/components/HotkeysPreferences/hotkeysValidators.js b/platform/ui/src/components/HotkeysPreferences/hotkeysValidators.js index fbb2c1004e1..92ffa197eaf 100644 --- a/platform/ui/src/components/HotkeysPreferences/hotkeysValidators.js +++ b/platform/ui/src/components/HotkeysPreferences/hotkeysValidators.js @@ -72,7 +72,9 @@ const disallowedValidator = ({ pressedKeys = [] }) => { if (hasDisallowedCombinations) { return { - error: `"${formatPressedKeys(pressedKeys)}" shortcut combination is not allowed`, + error: `"${formatPressedKeys( + pressedKeys + )}" shortcut combination is not allowed`, }; } }; diff --git a/platform/ui/src/components/Input/Input.tsx b/platform/ui/src/components/Input/Input.tsx index 2940348b85f..7652915e5f3 100644 --- a/platform/ui/src/components/Input/Input.tsx +++ b/platform/ui/src/components/Input/Input.tsx @@ -13,8 +13,8 @@ const transparentClasses = { const smallInputClasses = { true: 'input-small', - false: '' -} + false: '', +}; const Input = ({ id, diff --git a/platform/ui/src/components/InputNumber/InputNumber.tsx b/platform/ui/src/components/InputNumber/InputNumber.tsx index a29792f7f8f..87dcb912c81 100644 --- a/platform/ui/src/components/InputNumber/InputNumber.tsx +++ b/platform/ui/src/components/InputNumber/InputNumber.tsx @@ -82,45 +82,46 @@ const InputNumber: React.FC<{ ); return ( -
+
{label && } -
-
- + > +
+ -
- - - - - - +
+ + + + + + +
-
); }; diff --git a/platform/ui/src/components/LayoutSelector/LayoutSelector.tsx b/platform/ui/src/components/LayoutSelector/LayoutSelector.tsx index c4769e47358..a95eeea10a2 100644 --- a/platform/ui/src/components/LayoutSelector/LayoutSelector.tsx +++ b/platform/ui/src/components/LayoutSelector/LayoutSelector.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; -function LayoutSelector({ onSelection, rows, columns}) { +function LayoutSelector({ onSelection, rows, columns }) { const [hoveredIndex, setHoveredIndex] = useState(); const hoverX = hoveredIndex % columns; const hoverY = Math.floor(hoveredIndex / columns); @@ -12,7 +12,7 @@ function LayoutSelector({ onSelection, rows, columns}) { return x <= hoverX && y <= hoverY; }; - const gridSize = '20px ' + const gridSize = '20px '; return (
- {Array.apply(null, Array(rows*columns)).map(function (_, i) {return i;}).map(index => ( -
{ - const x = index % columns; - const y = Math.floor(index / columns); + {Array.apply(null, Array(rows * columns)) + .map(function(_, i) { + return i; + }) + .map(index => ( +
{ + const x = index % columns; + const y = Math.floor(index / columns); - onSelection({ - numRows: y + 1, - numCols: x + 1, - }); - }} - onMouseEnter={() => setHoveredIndex(index)} - onMouseLeave={() => setHoveredIndex(-1)} - >
- ))} + onSelection({ + numRows: y + 1, + numCols: x + 1, + }); + }} + onMouseEnter={() => setHoveredIndex(index)} + onMouseLeave={() => setHoveredIndex(-1)} + >
+ ))}
); } @@ -51,7 +55,7 @@ function LayoutSelector({ onSelection, rows, columns}) { LayoutSelector.defaultProps = { onSelection: () => {}, columns: 3, - rows: 3 + rows: 3, }; LayoutSelector.propTypes = { diff --git a/platform/ui/src/components/ListMenu/ListMenu.tsx b/platform/ui/src/components/ListMenu/ListMenu.tsx index 013d88fbaca..80e3fa63201 100644 --- a/platform/ui/src/components/ListMenu/ListMenu.tsx +++ b/platform/ui/src/components/ListMenu/ListMenu.tsx @@ -12,11 +12,17 @@ const ListMenu = ({ items = [], renderer, onClick }) => { const onClickHandler = () => { setSelectedIndex(index); onClick({ item, selectedIndex: index }); - if (item.onClick) item.onClick({ ...item, index, isSelected }); + if (item.onClick) { + item.onClick({ ...item, index, isSelected }); + } }; return ( -
+
{renderer && renderer({ ...item, index, isSelected })}
); @@ -38,16 +44,16 @@ const ListMenu = ({ items = [], renderer, onClick }) => { ); }; -const noop = () => { }; +const noop = () => {}; ListMenu.propTypes = { items: PropTypes.array.isRequired, renderer: PropTypes.func.isRequired, - onClick: PropTypes.func + onClick: PropTypes.func, }; ListMenu.defaultProps = { - onClick: noop + onClick: noop, }; export default ListMenu; diff --git a/platform/ui/src/components/TableHead/TableHead.tsx b/platform/ui/src/components/TableHead/TableHead.tsx index a14ec798b6d..aea5135ce2a 100644 --- a/platform/ui/src/components/TableHead/TableHead.tsx +++ b/platform/ui/src/components/TableHead/TableHead.tsx @@ -26,9 +26,9 @@ TableHead.defaultProps = { }; TableHead.propTypes = { - children: function (props, propName, componentName) { + children: function(props, propName, componentName) { const elements = React.Children.toArray(props.children); - const isString = elements.some((child) => typeof child === 'string'); + const isString = elements.some(child => typeof child === 'string'); if (isString) { return new Error( @@ -37,7 +37,7 @@ TableHead.propTypes = { } const isInvalidElement = elements.some( - (child) => !React.isValidElement(child) + child => !React.isValidElement(child) ); if (isInvalidElement) { diff --git a/platform/ui/src/components/Viewport/Viewport.tsx b/platform/ui/src/components/Viewport/Viewport.tsx index 5f8f2c5001b..17626f39674 100644 --- a/platform/ui/src/components/Viewport/Viewport.tsx +++ b/platform/ui/src/components/Viewport/Viewport.tsx @@ -43,7 +43,9 @@ const Viewport = ({ }, ]} onSubmit={value => { - if (typeof window !== 'undefined') window.alert(value); + if (typeof window !== 'undefined') { + window.alert(value); + } }} />
diff --git a/platform/ui/src/components/WindowLevelMenuItem/WindowLevelMenuItem.tsx b/platform/ui/src/components/WindowLevelMenuItem/WindowLevelMenuItem.tsx index ff479568e75..0a80f5dfdf5 100644 --- a/platform/ui/src/components/WindowLevelMenuItem/WindowLevelMenuItem.tsx +++ b/platform/ui/src/components/WindowLevelMenuItem/WindowLevelMenuItem.tsx @@ -4,18 +4,21 @@ import classNames from 'classnames'; const WindowLevelMenuItem = ({ title, subtitle, isSelected, index }) => ( <> -
- + {title} - + {subtitle} - {index + 1} + + {index + 1} +
); diff --git a/platform/ui/src/contextProviders/CineProvider.tsx b/platform/ui/src/contextProviders/CineProvider.tsx index 8db53ec2afc..5ed5ce8bf3a 100644 --- a/platform/ui/src/contextProviders/CineProvider.tsx +++ b/platform/ui/src/contextProviders/CineProvider.tsx @@ -27,7 +27,9 @@ export default function CineProvider({ children, service }) { const { id, frameRate, isPlaying = undefined } = action.payload; const cines = state.cines; - if (!cines[id]) cines[id] = { id, ...DEFAULT_CINE }; + if (!cines[id]) { + cines[id] = { id, ...DEFAULT_CINE }; + } cines[id].frameRate = frameRate || cines[id].frameRate; cines[id].isPlaying = isPlaying !== undefined ? isPlaying : cines[id].isPlaying; diff --git a/platform/ui/src/contextProviders/ViewportDialogProvider.tsx b/platform/ui/src/contextProviders/ViewportDialogProvider.tsx index 4d95a0c01e3..37ebf5ac0c7 100644 --- a/platform/ui/src/contextProviders/ViewportDialogProvider.tsx +++ b/platform/ui/src/contextProviders/ViewportDialogProvider.tsx @@ -19,7 +19,7 @@ const DEFAULT_STATE = { console.log('btn value?'); }, onOutsideClick: () => { - console.warn('default: onOutsideClick') + console.warn('default: onOutsideClick'); }, onDismiss: () => { console.log('dismiss? -1'); diff --git a/platform/ui/src/contextProviders/ViewportGridProvider.tsx b/platform/ui/src/contextProviders/ViewportGridProvider.tsx index 1ac89e51917..0818a4c7c6f 100644 --- a/platform/ui/src/contextProviders/ViewportGridProvider.tsx +++ b/platform/ui/src/contextProviders/ViewportGridProvider.tsx @@ -135,7 +135,9 @@ export function ViewportGridProvider({ children, service }) { // Have the initial id set contain all viewports not updated here const viewportIdSet = new Set(); viewports.forEach((viewport, index) => { - if (!viewport.viewportId) return; + if (!viewport.viewportId) { + return; + } const isUpdated = payload.find( newViewport => newViewport.viewportIndex === index ); @@ -228,7 +230,9 @@ export function ViewportGridProvider({ children, service }) { activeViewportIndexToSet = pos; } const viewport = findOrCreateViewport(pos, positionId, options); - if (!viewport) continue; + if (!viewport) { + continue; + } viewport.positionId = positionId; // Create a new viewport object as it is getting updated here // and it is part of the read only state diff --git a/platform/ui/src/storybook/components/link-component/link-component.tsx b/platform/ui/src/storybook/components/link-component/link-component.tsx index 52b42447e06..56ddefc0493 100644 --- a/platform/ui/src/storybook/components/link-component/link-component.tsx +++ b/platform/ui/src/storybook/components/link-component/link-component.tsx @@ -6,7 +6,7 @@ export const LinkComponent = ({ target: originalTarget, rel, }) => { - const onClick = (event) => { + const onClick = event => { if (originalTarget) { return; } diff --git a/platform/ui/src/storybook/functions/create-component-story.tsx b/platform/ui/src/storybook/functions/create-component-story.tsx index 07f27dcae85..99723768dbb 100644 --- a/platform/ui/src/storybook/functions/create-component-story.tsx +++ b/platform/ui/src/storybook/functions/create-component-story.tsx @@ -32,7 +32,9 @@ export function createStoryMetaSettings({ } }); - if (component === Avatar) console.log(argTypes); + if (component === Avatar) { + console.log(argTypes); + } // set icon allowed values inside argsTypes object iconPropNamesArray?.forEach(propName => { diff --git a/yarn.lock b/yarn.lock index efb420662cd..d21f7634832 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2331,6 +2331,18 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.17.tgz#bcb2e042631b3c15792058e189ed879a22b2968b" integrity sha512-fGEb8f2BSA3CW7riJVurug65ACLuQAzKq0SSqkY2b2yHHH0MzDfbLyKIGzHwOI/gkHcxM/leuSW6D5w/LMNitA== +"@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.6.2.tgz#1816b5f6948029c5eaacb0703b850ee0cb37d8f8" + integrity sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw== + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -4897,7 +4909,7 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.12", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.12" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb" integrity sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA== @@ -5110,7 +5122,7 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5" integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ== -"@types/semver@^7.3.4": +"@types/semver@^7.3.4", "@types/semver@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== @@ -5247,75 +5259,91 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^4.19.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz#c24dc7c8069c7706bc40d99f6fa87edcb2005276" - integrity sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg== +"@typescript-eslint/eslint-plugin@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.3.0.tgz#e751e148aab7ccaf8a7bfd370f7ce9e6bdd1f3f4" + integrity sha512-IZYjYZ0ifGSLZbwMqIip/nOamFiWJ9AH+T/GYNZBWkVcyNQOFGtSMoWV7RvY4poYCMZ/4lHzNl796WOSNxmk8A== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/type-utils" "6.3.0" + "@typescript-eslint/utils" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + natural-compare-lite "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.3.0.tgz#359684c443f4f848db3c4f14674f544f169c8f46" + integrity sha512-ibP+y2Gr6p0qsUkhs7InMdXrwldjxZw66wpcQq9/PzAroM45wdwyu81T+7RibNCh8oc0AgrsyCwJByncY0Ongg== dependencies: - "@typescript-eslint/experimental-utils" "4.33.0" - "@typescript-eslint/scope-manager" "4.33.0" - debug "^4.3.1" - functional-red-black-tree "^1.0.1" - ignore "^5.1.8" - regexpp "^3.1.0" - semver "^7.3.5" - tsutils "^3.21.0" + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/typescript-estree" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" -"@typescript-eslint/experimental-utils@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz#6f2a786a4209fa2222989e9380b5331b2810f7fd" - integrity sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q== +"@typescript-eslint/scope-manager@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.3.0.tgz#6b74e338c4b88d5e1dfc1a28c570dd5cf8c86b09" + integrity sha512-WlNFgBEuGu74ahrXzgefiz/QlVb+qg8KDTpknKwR7hMH+lQygWyx0CQFoUmMn1zDkQjTBBIn75IxtWss77iBIQ== dependencies: - "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/parser@^4.19.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899" - integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA== - dependencies: - "@typescript-eslint/scope-manager" "4.33.0" - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/typescript-estree" "4.33.0" - debug "^4.3.1" - -"@typescript-eslint/scope-manager@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3" - integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - -"@typescript-eslint/types@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" - integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== - -"@typescript-eslint/typescript-estree@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" - integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== - dependencies: - "@typescript-eslint/types" "4.33.0" - "@typescript-eslint/visitor-keys" "4.33.0" - debug "^4.3.1" - globby "^11.0.3" - is-glob "^4.0.1" - semver "^7.3.5" - tsutils "^3.21.0" + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" -"@typescript-eslint/visitor-keys@4.33.0": - version "4.33.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" - integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== +"@typescript-eslint/type-utils@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.3.0.tgz#3bf89ccd36621ddec1b7f8246afe467c67adc247" + integrity sha512-7Oj+1ox1T2Yc8PKpBvOKWhoI/4rWFd1j7FA/rPE0lbBPXTKjdbtC+7Ev0SeBjEKkIhKWVeZSP+mR7y1Db1CdfQ== dependencies: - "@typescript-eslint/types" "4.33.0" - eslint-visitor-keys "^2.0.0" + "@typescript-eslint/typescript-estree" "6.3.0" + "@typescript-eslint/utils" "6.3.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/types@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.3.0.tgz#84517f1427923e714b8418981e493b6635ab4c9d" + integrity sha512-K6TZOvfVyc7MO9j60MkRNWyFSf86IbOatTKGrpTQnzarDZPYPVy0oe3myTMq7VjhfsUAbNUW8I5s+2lZvtx1gg== + +"@typescript-eslint/typescript-estree@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.3.0.tgz#20e1e10e2f51cdb9e19a2751215cac92c003643c" + integrity sha512-Xh4NVDaC4eYKY4O3QGPuQNp5NxBAlEvNQYOqJquR2MePNxO11E5K3t5x4M4Mx53IZvtpW+mBxIT0s274fLUocg== + dependencies: + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/visitor-keys" "6.3.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.3.0.tgz#0898c5e374372c2092ca1b979ea7ee9cc020ce84" + integrity sha512-hLLg3BZE07XHnpzglNBG8P/IXq/ZVXraEbgY7FM0Cnc1ehM8RMdn9mat3LubJ3KBeYXXPxV1nugWbQPjGeJk6Q== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.3.0" + "@typescript-eslint/types" "6.3.0" + "@typescript-eslint/typescript-estree" "6.3.0" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.3.0.tgz#8d09aa3e389ae0971426124c155ac289afbe450a" + integrity sha512-kEhRRj7HnvaSjux1J9+7dBen15CdWmDnwrpyiHsFX6Qx2iW5LOBUgNefOFeh2PjWPlNwN8TOn6+4eBU3J/gupw== + dependencies: + "@typescript-eslint/types" "6.3.0" + eslint-visitor-keys "^3.4.1" "@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" @@ -8245,7 +8273,7 @@ debug@2.6.9, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4: +debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -9401,13 +9429,6 @@ eslint-utils@^2.0.0, eslint-utils@^2.1.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" @@ -9418,6 +9439,11 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.2" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" + integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== + eslint-webpack-plugin@^2.5.3: version "2.7.0" resolved "https://registry.yarnpkg.com/eslint-webpack-plugin/-/eslint-webpack-plugin-2.7.0.tgz#0525793a4f8c652c1c6d863995ce1e0f2dcbd143" @@ -10817,6 +10843,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" @@ -11392,7 +11423,7 @@ ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.0.0, ignore@^5.0.4, ignore@^5.1.1, ignore@^5.1.8, ignore@^5.2.0, ignore@^5.2.4: +ignore@^5.0.0, ignore@^5.0.4, ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== @@ -14447,6 +14478,11 @@ napi-build-utils@^1.0.1: resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -18180,7 +18216,7 @@ semver@^6.0.0, semver@^6.1.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.1, semver@^7.5.3: +semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.1, semver@^7.5.3, semver@^7.5.4: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -19538,6 +19574,11 @@ trough@^2.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-2.1.0.tgz#0f7b511a4fde65a46f18477ab38849b22c554876" integrity sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g== +ts-api-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.1.tgz#8144e811d44c749cd65b2da305a032510774452d" + integrity sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A== + ts-dedent@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.2.0.tgz#39e4bd297cd036292ae2394eb3412be63f563bb5" @@ -19562,7 +19603,7 @@ tsconfig-paths@^4.1.2: minimist "^1.2.6" strip-bom "^3.0.0" -tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.13.0, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== @@ -19572,13 +19613,6 @@ tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4 resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - tuf-js@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-1.1.7.tgz#21b7ae92a9373015be77dfe0cb282a80ec3bbe43"