Skip to content

Commit 7d6f61b

Browse files
Merge pull request #40 from owncloud/code-style-improvements
Code style improvements
2 parents 9f88909 + 0f11200 commit 7d6f61b

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

src/App.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ if (navigator.hardwareConcurrency) {
123123
maxWebWorkers = Math.min(navigator.hardwareConcurrency, 7)
124124
}
125125
126-
var config = {
126+
const config = {
127127
maxWebWorkers,
128128
startWebWorkersOnDemand: true,
129129
taskConfiguration: {
@@ -281,7 +281,7 @@ export default defineComponent({
281281
console.error('Error initalizing cornerstone core', e)
282282
}
283283
},
284-
addWadouriPrefix(url: string) {
284+
addWadouriPrefix(url: string): string {
285285
return 'wadouri:' + url
286286
},
287287
async fetchVipMetadataInformation(imageId) {
@@ -419,7 +419,7 @@ export default defineComponent({
419419
} else {
420420
// image information from viewport have already been added
421421
// storing elements in temp variable
422-
var tempImageInformation = this.imageInformation
422+
const tempImageInformation = this.imageInformation
423423
// adding image information elements from viewport (tempImageInformation) in proper order
424424
this.imageInformation = tempImageInformation
425425
.slice(0, 1)
@@ -626,7 +626,6 @@ export default defineComponent({
626626
},
627627
setRotation(newRotation) {
628628
this.currentImageRotation = newRotation
629-
const { rotation } = this.viewport.getProperties()
630629
this.viewport.setProperties({ rotation: this.currentImageRotation })
631630
this.viewport.render()
632631
},

src/components/MetadataSidebarTableRow.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<tr class="dicom-metadata-section">
3-
<th colspan="2">
3+
<th colspan="2" scope="colgroup">
44
<p
55
class="oc-py-s oc-font-semibold dicom-metadata-section-title"
66
:class="isFirstSection ? 'dicom-metadata-first-section' : ''"

src/helper/defaultPlugins.ts

-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//import DesignSystem from 'design-system'
21
import { createGettext } from 'vue3-gettext'
32
import { h } from 'vue'
43
import { abilitiesPlugin } from '@casl/vue'
@@ -51,14 +50,6 @@ export const defaultPlugins = ({
5150
}
5251
})
5352

54-
/*
55-
TODO: check if this is needed, if so, try to fix import
56-
57-
if (designSystem) {
58-
plugins.push(DesignSystem)
59-
}
60-
*/
61-
6253
if (gettext) {
6354
plugins.push(createGettext({ translations: {}, silent: true }))
6455
} else {

src/helper/extractMetadata.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ export const findDicomTagByValue = (value: string): string | undefined => {
2020
}
2121

2222
export const formatDateTagChecker = (tag: string): boolean => {
23-
return tag.endsWith('_formatDate') ? true : false
23+
return tag.endsWith('_formatDate')
2424
}
2525

2626
export const formatTimeTagChecker = (tag: string): boolean => {
27-
return tag.endsWith('_formatTime') ? true : false
27+
return tag.endsWith('_formatTime')
2828
}
2929

3030
export const addSopTagChecker = (tag: string): boolean => {
31-
return tag.endsWith('_addSOPuids') ? true : false
31+
return tag.endsWith('_addSOPuids')
3232
}
3333

3434
export const extractDicomMetadata = async (imageData: object, tags: string[], language = 'en') => {
3535
const extractedData: { label: string; value: string }[] = []
3636

3737
// extracting data
38-
for (let i = 0; i < tags.length; ++i) {
38+
for (const tag of tags) {
3939
// check if tag contains an extension for date or time or SOP formatting
40-
const isDate = formatDateTagChecker(tags[i])
41-
const isTime = formatTimeTagChecker(tags[i])
42-
const isSOP = addSopTagChecker(tags[i])
40+
const isDate = formatDateTagChecker(tag)
41+
const isTime = formatTimeTagChecker(tag)
42+
const isSOP = addSopTagChecker(tag)
4343

44-
let metadataLabel = tags[i]
44+
let metadataLabel = tag
4545
if (isDate || isTime || isSOP) {
4646
metadataLabel = metadataLabel.slice(0, -11) // cutting off the add-on (_formatDate or _formatTime or _addSOPuids) from the label
4747
}

0 commit comments

Comments
 (0)