Skip to content

Commit f6b1ec2

Browse files
committed
Cleanup
1 parent ca1704d commit f6b1ec2

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

assets/studio/js/src/modules/data-importer/components/tabs/data-setup-tab.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import React, { useState } from 'react'
12+
import cn from 'classnames'
1213
import { Steps, type StepItem, Flex } from '@pimcore/studio-ui-bundle/components'
1314
import { useTranslation } from '@pimcore/studio-ui-bundle/app'
1415
import { DataSourceStep } from './steps/data-source-step'
@@ -65,32 +66,32 @@ export const DataSetupTab = ({ configName }: DataSetupTabProps): React.JSX.Eleme
6566
/>
6667
</Box>
6768

68-
<div className={ `${styles.stepContentMapping}${isMappingStep ? '' : ` ${styles.stepContentMappingHidden}`}` }>
69+
<div className={ cn(styles.stepContentMapping, !isMappingStep && styles.stepContentMappingHidden) }>
6970
<MappingStep
7071
configName={ configName }
7172
isActive={ isMappingStep }
7273
/>
7374
</div>
7475

75-
<div className={ `${styles.stepContent}${currentStep === 0 ? '' : ` ${styles.stepContentHidden}`}` }>
76+
<div className={ cn(styles.stepContent, currentStep !== 0 && styles.stepContentHidden) }>
7677
<DataSourceStep configName={ configName } />
7778
</div>
7879

79-
<div className={ `${styles.stepContent}${currentStep === 1 ? '' : ` ${styles.stepContentHidden}`}` }>
80+
<div className={ cn(styles.stepContent, currentStep !== 1 && styles.stepContentHidden) }>
8081
<PreviewImportStep
8182
configName={ configName }
8283
isActive={ currentStep === 1 }
8384
/>
8485
</div>
8586

86-
<div className={ `${styles.stepContent}${currentStep === 2 ? '' : ` ${styles.stepContentHidden}`}` }>
87+
<div className={ cn(styles.stepContent, currentStep !== 2 && styles.stepContentHidden) }>
8788
<ResolverStep
8889
columnHeaderOptions={ columnHeaderOptions }
8990
configName={ configName }
9091
/>
9192
</div>
9293

93-
<div className={ `${styles.stepContent}${currentStep === 4 ? '' : ` ${styles.stepContentHidden}`}` }>
94+
<div className={ cn(styles.stepContent, currentStep !== 4 && styles.stepContentHidden) }>
9495
<ProcessingSettingsStep configName={ configName } />
9596
</div>
9697
</Flex>

assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/dnd-class-div/dnd-class-div.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import React from 'react'
12+
import cn from 'classnames'
1213
import { useDroppable } from '@pimcore/studio-ui-bundle/components'
1314

1415
// Generic div that reads the nearest Droppable context and applies the
@@ -22,10 +23,9 @@ export interface DndClassDivProps {
2223

2324
export const DndClassDiv = ({ children, className }: DndClassDivProps): React.JSX.Element => {
2425
const { getStateClasses } = useDroppable()
25-
const combinedClass = [className, ...getStateClasses()].filter(Boolean).join(' ')
2626

2727
return (
28-
<div className={ combinedClass }>
28+
<div className={ cn(className, ...getStateClasses()) }>
2929
{ children }
3030
</div>
3131
)

assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/mapping-item/arrow-column/arrow-column.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import React from 'react'
12+
import cn from 'classnames'
1213
import { theme } from 'antd'
1314
import { Flex, Icon } from '@pimcore/studio-ui-bundle/components'
1415
import { useStyles } from '../../mapping-step.styles'
@@ -48,7 +49,7 @@ export const ArrowColumn = (props: ArrowColumnProps): React.JSX.Element => {
4849
if (isComplex) {
4950
return (
5051
<Flex
51-
className={ [styles.arrowCol, styles.arrowColAdvanced].join(' ') }
52+
className={ cn(styles.arrowCol, styles.arrowColAdvanced) }
5253
gap={ 10 }
5354
justify="center"
5455
vertical
@@ -70,7 +71,7 @@ export const ArrowColumn = (props: ArrowColumnProps): React.JSX.Element => {
7071

7172
return (
7273
<Flex
73-
className={ [styles.arrowCol, styles.arrowColSimple].join(' ') }
74+
className={ cn(styles.arrowCol, styles.arrowColSimple) }
7475
justify="flex-start"
7576
vertical
7677
>

assets/studio/js/src/modules/data-importer/components/tabs/steps/mapping-step/sources-panel/sources-panel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import React, { useMemo } from 'react'
12+
import cn from 'classnames'
1213
import {
1314
Badge,
1415
Button,
@@ -128,7 +129,7 @@ export const SourcesPanel = ({
128129

129130
return (
130131
<div
131-
className={ `${styles.sourceRowOuter}${isMapped ? ` ${styles.sourceRowOuterMapped}` : ''}${isFaded ? ` ${styles.sourceRowOuterFaded}` : ''}` }
132+
className={ cn(styles.sourceRowOuter, { [styles.sourceRowOuterMapped]: isMapped, [styles.sourceRowOuterFaded]: isFaded }) }
132133
key={ row.dataIndex }
133134
>
134135
<Draggable
@@ -141,7 +142,7 @@ export const SourcesPanel = ({
141142
>
142143
<Flex
143144
align="center"
144-
className={ `${styles.sourceRowInner}${isMapped ? ` ${styles.sourceRowInnerMapped}` : ` ${styles.sourceRowInnerUnmapped}`}` }
145+
className={ cn(styles.sourceRowInner, isMapped ? styles.sourceRowInnerMapped : styles.sourceRowInnerUnmapped) }
145146
onClick={ handleRowClick }
146147
>
147148
<Flex

assets/studio/package-lock.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/studio/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@reduxjs/toolkit": "^2.3.0",
6666
"@tanstack/react-table": "^8.20.5",
6767
"antd-style": "3.7.x",
68+
"classnames": "^2.5.1",
6869
"lodash": "^4.17.21",
6970
"quill": "^2.0.3",
7071
"quill-table-better": "^1.1.6",

0 commit comments

Comments
 (0)