Skip to content

Commit 16ba348

Browse files
authored
add path via manytoonerelationpath (#604)
1 parent cd33087 commit 16ba348

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

assets/studio/js/src/modules/data-importer/dynamic-types/transformer/import-asset/import-asset-transformer-form.tsx

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

1111
import React from 'react'
12-
import { Input, Form, Switch } from '@pimcore/studio-ui-bundle/components'
12+
import { Input, Form, ManyToOneRelationPath, Switch } from '@pimcore/studio-ui-bundle/components'
1313
import { TransformerSettingsLayout } from '../transformer-settings-layout'
1414

1515
interface ImportAssetTransformerConfig {
@@ -35,9 +35,12 @@ export const ImportAssetTransformerForm = ({ settings, onChange }: ImportAssetTr
3535
className={ styles.formItem }
3636
label={ <span className={ styles.label }>Parent folder</span> }
3737
>
38-
<Input
39-
onChange={ (e) => { update('parentFolder', e.target.value) } }
40-
placeholder="/"
38+
<ManyToOneRelationPath
39+
allowPathTextInput
40+
allowToClearRelation
41+
allowedAssetTypes={ ['folder'] }
42+
assetsAllowed
43+
onChange={ (val) => { update('parentFolder', val ?? '/') } }
4144
value={ settings.parentFolder ?? '/' }
4245
/>
4346
</Form.Item>
@@ -53,7 +56,7 @@ export const ImportAssetTransformerForm = ({ settings, onChange }: ImportAssetTr
5356

5457
<Form.Item className={ styles.formItemSwitch }>
5558
<Switch
56-
checked={ settings.overwriteExisting !== false }
59+
checked={ settings.overwriteExisting === true }
5760
labelRight="Overwrite existing"
5861
onChange={ (v) => { update('overwriteExisting', v) } }
5962
size="small"

0 commit comments

Comments
 (0)