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

@@ -103,10 +103,7 @@ class DicomMicroscopyViewport extends Component {
// you should only do this once.
async installOpenLayersRenderer(container, displaySet) {
const loadViewer = async metadata => {
const {
viewer: DicomMicroscopyViewer,
metadata: metadataUtils,
} = await import(
const { viewer: DicomMicroscopyViewer, metadata: metadataUtils } = await import(
/* webpackChunkName: "dicom-microscopy-viewer" */ 'dicom-microscopy-viewer'
);
const microscopyViewer = DicomMicroscopyViewer.VolumeImageViewer;
@@ -163,10 +160,7 @@ class DicomMicroscopyViewport extends Component {
metadata.forEach(m => {
// NOTE: depending on different data source, image.ImageType sometimes
// is a string, not a string array.
m.ImageType =
typeof m.ImageType === 'string'
? m.ImageType.split('\\')
: m.ImageType;
m.ImageType = typeof m.ImageType === 'string' ? m.ImageType.split('\\') : m.ImageType;
const inst = cleanDenaturalizedDataset(
dcmjs.data.DicomMetaDictionary.denaturalizeDataset(m),
@@ -211,11 +205,7 @@ class DicomMicroscopyViewport extends Component {
this.viewer = new microscopyViewer(options);
if (
this.overlayElement &&
this.overlayElement.current &&
this.viewer.addViewportOverlay
) {
if (this.overlayElement && this.overlayElement.current && this.viewer.addViewportOverlay) {
this.viewer.addViewportOverlay({
element: this.overlayElement.current,
coordinates: [0, 0], // TODO: dicom-microscopy-viewer documentation says this can be false to be automatically, but it is not.
@@ -263,22 +253,13 @@ class DicomMicroscopyViewport extends Component {
const { viewportId } = viewportOptions;
// Todo-rename: this is always getting the 0
const displaySet = displaySets[0];
this.installOpenLayersRenderer(this.container.current, displaySet).then(
() => {
this.setState({ isLoaded: true });
}
);
this.installOpenLayersRenderer(this.container.current, displaySet).then(() => {
this.setState({ isLoaded: true });
});
}
componentDidUpdate(
prevProps: Readonly<{}>,
prevState: Readonly<{}>,
snapshot?: any
): void {
if (
this.managedViewer &&
prevProps.displaySets !== this.props.displaySets
) {
componentDidUpdate(prevProps: Readonly<{}>, prevState: Readonly<{}>, snapshot?: any): void {
if (this.managedViewer && prevProps.displaySets !== this.props.displaySets) {
const { displaySets } = this.props;
const displaySet = displaySets[0];
@@ -317,9 +298,7 @@ class DicomMicroscopyViewport extends Component {
>
<div style={{ ...style, display: 'none' }}>
<div style={{ ...style }} ref={this.overlayElement}>
<div
style={{ position: 'relative', height: '100%', width: '100%' }}
>
<div style={{ position: 'relative', height: '100%', width: '100%' }}>
{displaySet && firstInstance.imageId && (
<ViewportOverlay
displaySet={displaySet}
@@ -331,11 +310,7 @@ class DicomMicroscopyViewport extends Component {
</div>
</div>
{ReactResizeDetector && (
<ReactResizeDetector
handleWidth
handleHeight
onResize={this.onWindowResize}
/>
<ReactResizeDetector handleWidth handleHeight onResize={this.onWindowResize} />
)}
{this.state.error ? (
<h2>{JSON.stringify(this.state.error)}</h2>
@@ -343,7 +318,7 @@ class DicomMicroscopyViewport extends Component {
<div style={style} ref={this.container} />
)}
{this.state.isLoaded ? null : (
<LoadingIndicatorProgress className={'w-full h-full bg-black'} />
<LoadingIndicatorProgress className={'h-full w-full bg-black'} />
)}
</div>
);