chore(prettier): full repo linting and code reformatting once and for all (#3627)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-01 16:19:39 -04:00
1 parent 01500a2d4c
commit 9045ddaedc
656 files changed
+21737 -20628

No files matched your search

@@ -3,8 +3,7 @@ const { merge } = require('webpack-merge');
const path = require('path');
const webpackCommon = require('./../../../.webpack/webpack.base.js');
const pkg = require('./../package.json');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin;
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ROOT_DIR = path.join(__dirname, './..');
const SRC_DIR = path.join(__dirname, '../src');
@@ -38,13 +37,7 @@ module.exports = (env, argv) => {
libraryTarget: 'umd',
filename: pkg.main,
},
externals: [
/\b(vtk.js)/,
/\b(dcmjs)/,
/\b(gl-matrix)/,
/^@ohif/,
/^@cornerstonejs/,
],
externals: [/\b(vtk.js)/, /\b(dcmjs)/, /\b(gl-matrix)/, /^@ohif/, /^@cornerstonejs/],
plugins: [
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
@@ -7,8 +7,7 @@ const SOP_CLASS_UIDS = {
VIDEO_ENDOSCOPIC_IMAGE_STORAGE: '1.2.840.10008.5.1.4.1.1.77.1.1.1',
/** Need to use fallback, could be video or image */
SECONDARY_CAPTURE_IMAGE_STORAGE: '1.2.840.10008.5.1.4.1.1.7',
MULTIFRAME_TRUE_COLOR_SECONDARY_CAPTURE_IMAGE_STORAGE:
'1.2.840.10008.5.1.4.1.1.7.4',
MULTIFRAME_TRUE_COLOR_SECONDARY_CAPTURE_IMAGE_STORAGE: '1.2.840.10008.5.1.4.1.1.7.4',
};
const sopClassUids = Object.values(SOP_CLASS_UIDS);
@@ -29,49 +28,31 @@ const SupportedTransferSyntaxes = {
const supportedTransferSyntaxUIDs = Object.values(SupportedTransferSyntaxes);
const _getDisplaySetsFromSeries = (
instances,
servicesManager,
extensionManager
) => {
const _getDisplaySetsFromSeries = (instances, servicesManager, extensionManager) => {
const dataSource = extensionManager.getActiveDataSource()[0];
return instances
.filter(metadata => {
const tsuid =
metadata.AvailableTransferSyntaxUID ||
metadata.TransferSyntaxUID ||
metadata['00083002'];
metadata.AvailableTransferSyntaxUID || metadata.TransferSyntaxUID || metadata['00083002'];
if (supportedTransferSyntaxUIDs.includes(tsuid)) {
return true;
}
if (
metadata.SOPClassUID === SOP_CLASS_UIDS.VIDEO_PHOTOGRAPHIC_IMAGE_STORAGE
) {
if (metadata.SOPClassUID === SOP_CLASS_UIDS.VIDEO_PHOTOGRAPHIC_IMAGE_STORAGE) {
return true;
}
// Assume that an instance with one of the secondary capture SOPClassUIDs and
// with at least 90 frames (i.e. typically 3 seconds of video) is indeed a video.
return (
secondaryCaptureSopClassUids.includes(metadata.SOPClassUID) &&
metadata.NumberOfFrames >= 90
secondaryCaptureSopClassUids.includes(metadata.SOPClassUID) && metadata.NumberOfFrames >= 90
);
})
.map(instance => {
const {
Modality,
SOPInstanceUID,
SeriesDescription = 'VIDEO',
} = instance;
const {
SeriesNumber,
SeriesDate,
SeriesInstanceUID,
StudyInstanceUID,
NumberOfFrames,
} = instance;
const { Modality, SOPInstanceUID, SeriesDescription = 'VIDEO' } = instance;
const { SeriesNumber, SeriesDate, SeriesInstanceUID, StudyInstanceUID, NumberOfFrames } =
instance;
const displaySet = {
//plugin: id,
Modality,
@@ -107,16 +88,9 @@ const _getDisplaySetsFromSeries = (
});
};
export default function getSopClassHandlerModule({
servicesManager,
extensionManager,
}) {
export default function getSopClassHandlerModule({ servicesManager, extensionManager }) {
const getDisplaySetsFromSeries = instances => {
return _getDisplaySetsFromSeries(
instances,
servicesManager,
extensionManager
);
return _getDisplaySetsFromSeries(instances, servicesManager, extensionManager);
};
return [
+2 -6
View File
@@ -3,9 +3,7 @@ import getSopClassHandlerModule from './getSopClassHandlerModule';
import { id } from './id';
const Component = React.lazy(() => {
return import(
/* webpackPrefetch: true */ './viewports/OHIFCornerstoneVideoViewport'
);
return import(/* webpackPrefetch: true */ './viewports/OHIFCornerstoneVideoViewport');
});
const OHIFCornerstoneVideoViewport = props => {
@@ -42,9 +40,7 @@ const dicomVideoExtension = {
);
};
return [
{ name: 'dicom-video', component: ExtendedOHIFCornerstoneVideoViewport },
];
return [{ name: 'dicom-video', component: ExtendedOHIFCornerstoneVideoViewport }];
},
// getCommandsModule({ servicesManager }) {
// return {
@@ -22,17 +22,23 @@ function OHIFCornerstoneVideoViewport({ displaySets }) {
// Need to copies of the source to fix a firefox bug
return (
<div className="bg-primary-black w-full h-full">
<div className="bg-primary-black h-full w-full">
<video
src={url}
controls
controlsList="nodownload"
preload="auto"
className="w-full h-full"
className="h-full w-full"
crossOrigin="anonymous"
>
<source src={url} type={mimeType} />
<source src={url} type={mimeType} />
<source
src={url}
type={mimeType}
/>
<source
src={url}
type={mimeType}
/>
Video src/type not supported:{' '}
<a href={url}>
{url} of type {mimeType}