lint(curly): consistent use of curly brackets in codebase (#3584)
This commit is contained in:
1 parent
9ae3d9f769
commit
5d435424e2
113 files changed
+1501
-1056
No files matched your search
@@ -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 => {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {}
|
||||
}
|
||||
@@ -11,8 +11,12 @@ type StudyMetadata = Types.StudyMetadata;
|
||||
* @returns - compare a and b, returning 1 if a<b -1 if a>b 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));
|
||||
};
|
||||
|
||||
|
||||
@@ -361,32 +361,35 @@ function WorkList({
|
||||
query.append('configUrl', filterValues.configUrl);
|
||||
}
|
||||
query.append('StudyInstanceUIDs', studyInstanceUid);
|
||||
return mode.displayName && (
|
||||
<Link
|
||||
className={isValidMode ? '' : 'cursor-not-allowed'}
|
||||
key={i}
|
||||
to={`${dataPath ? '../../' : ''}${mode.routeName}${dataPath ||
|
||||
''}?${query.toString()}`}
|
||||
onClick={event => {
|
||||
// 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*/}
|
||||
<LegacyButton
|
||||
rounded="full"
|
||||
variant={isValidMode ? 'contained' : 'disabled'}
|
||||
disabled={!isValidMode}
|
||||
endIcon={<Icon name="launch-arrow" />} // launch-arrow | launch-info
|
||||
onClick={() => {}}
|
||||
return (
|
||||
mode.displayName && (
|
||||
<Link
|
||||
className={isValidMode ? '' : 'cursor-not-allowed'}
|
||||
key={i}
|
||||
to={`${dataPath ? '../../' : ''}${
|
||||
mode.routeName
|
||||
}${dataPath || ''}?${query.toString()}`}
|
||||
onClick={event => {
|
||||
// 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}`)}
|
||||
</LegacyButton>
|
||||
</Link>
|
||||
{/* TODO revisit the completely rounded style of buttons used for launching a mode from the worklist later - for now use LegacyButton*/}
|
||||
<LegacyButton
|
||||
rounded="full"
|
||||
variant={isValidMode ? 'contained' : 'disabled'}
|
||||
disabled={!isValidMode}
|
||||
endIcon={<Icon name="launch-arrow" />} // launch-arrow | launch-info
|
||||
onClick={() => {}}
|
||||
>
|
||||
{t(`Modes:${mode.displayName}`)}
|
||||
</LegacyButton>
|
||||
</Link>
|
||||
)
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user