@@ -268,14 +268,18 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement<
268
268
${ when (
269
269
dataTypesEntries . length > 0 ,
270
270
( ) =>
271
- html ` <h5 class= "choice-type-headline" > Available configurations </ h5>
271
+ html ` <h5 class= "choice-type-headline" >
272
+ <umb- localize key= "contentTypeEditor_searchResultSettings" > Available configurations </ umb- localize>
273
+ </ h5>
272
274
${ this . _renderDataTypes ( ) } ${ this . #renderLoadMore( ) } ` ,
273
275
) }
274
276
${ when (
275
277
editorUIEntries . length > 0 ,
276
278
( ) =>
277
- html ` <h5 class= "choice-type-headline" > Create a new configuration </ h5>
278
- ${ this . _renderUIs ( ) } ` ,
279
+ html ` <h5 class= "choice-type-headline" >
280
+ <umb- localize key= "contentTypeEditor_searchResultEditors" > Create a new configuration </ umb- localize>
281
+ </ h5>
282
+ ${ this . _renderUIs ( true ) } ` ,
279
283
) }
280
284
` ;
281
285
}
@@ -298,41 +302,54 @@ export class UmbDataTypePickerFlowModalElement extends UmbModalBaseElement<
298
302
) ;
299
303
}
300
304
301
- private _renderUIs ( ) {
305
+ private _renderUIs ( createAsNewOnPick ?: boolean ) {
302
306
if ( ! this . _groupedPropertyEditorUIs ) return nothing ;
303
307
304
308
const entries = Object . entries ( this . _groupedPropertyEditorUIs ) ;
305
309
306
310
return entries . map (
307
311
( [ key , value ] ) =>
308
312
html ` <h5 class= "category-name" > ${ key === 'undefined' ? 'Uncategorized' : key } </ h5>
309
- ${ this . _renderGroupUIs ( value ) } ` ,
313
+ ${ this . _renderGroupUIs ( value , createAsNewOnPick ) } ` ,
310
314
) ;
311
315
}
312
316
313
- private _renderGroupUIs ( uis : Array < ManifestPropertyEditorUi > ) {
317
+ private _renderGroupUIs ( uis : Array < ManifestPropertyEditorUi > , createAsNewOnPick ?: boolean ) {
314
318
return html ` <ul id= "item-grid" >
315
319
${ this . _dataTypePickerModalRouteBuilder
316
320
? repeat (
317
321
uis ,
318
322
( propertyEditorUI ) => propertyEditorUI . alias ,
319
- ( propertyEditorUI ) =>
320
- html ` <li class= "item" >
321
- <uui- butto n
322
- type= "button"
323
- label = "${ propertyEditorUI . meta . label || propertyEditorUI . name } "
324
- href= ${ this . _dataTypePickerModalRouteBuilder ! ( { uiAlias : propertyEditorUI . alias } ) } >
325
- <div class= "item-content" >
326
- <umb- icon name= "${ propertyEditorUI . meta . icon } " class = "icon"> </ umb- icon>
327
- ${ propertyEditorUI . meta . label || propertyEditorUI . name }
328
- </ div>
329
- </ uui- butto n>
330
- </ li> ` ,
323
+ ( propertyEditorUI ) => {
324
+ return html ` <li class= "item" > ${ this . _renderDataTypeButton ( propertyEditorUI , createAsNewOnPick ) } </ li> ` ;
325
+ } ,
331
326
)
332
327
: '' }
333
328
</ ul> ` ;
334
329
}
335
330
331
+ private _renderDataTypeButton ( propertyEditorUI : ManifestPropertyEditorUi , createAsNewOnPick ?: boolean ) {
332
+ if ( createAsNewOnPick ) {
333
+ return html ` <uui- butto n
334
+ label= "${ propertyEditorUI . meta . label || propertyEditorUI . name } "
335
+ @click = ${ ( ) => this . _createDataType ( propertyEditorUI . alias ) } >
336
+ ${ this . _renderItemContent ( propertyEditorUI ) }
337
+ </ uui- butto n> ` ;
338
+ } else {
339
+ return html ` <uui- butto n
340
+ label= "${ propertyEditorUI . meta . label || propertyEditorUI . name } "
341
+ href = ${ this . _dataTypePickerModalRouteBuilder ! ( { uiAlias : propertyEditorUI . alias } ) } >
342
+ ${ this . _renderItemContent ( propertyEditorUI ) }
343
+ </ uui- butto n> ` ;
344
+ }
345
+ }
346
+ private _renderItemContent ( propertyEditorUI : ManifestPropertyEditorUi ) {
347
+ return html `<div class= "item-content" >
348
+ <umb- icon name= "${ propertyEditorUI . meta . icon } " class = "icon"> </ umb- icon>
349
+ ${ propertyEditorUI . meta . label || propertyEditorUI . name }
350
+ </ div> ` ;
351
+ }
352
+
336
353
private _renderGroupDataTypes ( dataTypes : Array < UmbDataTypeItemModel > ) {
337
354
return html ` <ul id= "item-grid" >
338
355
${ repeat (
0 commit comments