File tree Expand file tree Collapse file tree 2 files changed +10
-36
lines changed
ui/src/components/form/docker_image_combo_box Expand file tree Collapse file tree 2 files changed +10
-36
lines changed Original file line number Diff line number Diff line change 1- import React , { useState } from "react" ;
2- import { EuiButtonEmpty , EuiContextMenu , EuiPopover } from "@elastic/eui" ;
3- import { flattenPanelTree } from "@caraml-dev/ui-lib" ;
1+ import { EuiSuperSelect } from "@elastic/eui" ;
42
53export const DockerRegistryPopover = ( { value, registryOptions, onChange } ) => {
6- const [ isOpen , setOpen ] = useState ( false ) ;
7-
8- const panels = flattenPanelTree ( {
9- id : 0 ,
10- items : registryOptions . map ( ( registry ) => ( {
11- name : registry . inputDisplay ,
12- value : registry . value ,
13- icon : "logoDocker" ,
14- onClick : ( ) => {
15- togglePopover ( ) ;
16- onChange ( registry . value ) ;
17- } ,
18- } ) ) ,
19- } ) ;
20-
21- const togglePopover = ( ) => setOpen ( ! isOpen ) ;
224
235 return (
24- < EuiPopover
25- button = {
26- < EuiButtonEmpty
27- size = "xs"
28- iconType = "arrowDown"
29- iconSide = "right"
30- onClick = { togglePopover } >
31- { ( registryOptions . find ( ( o ) => o . value === value ) || { } ) . inputDisplay }
32- </ EuiButtonEmpty >
33- }
34- isOpen = { isOpen }
35- closePopover = { togglePopover }
36- panelPaddingSize = "s" >
37- < EuiContextMenu initialPanelId = { 0 } panels = { panels } />
38- </ EuiPopover >
6+ < EuiSuperSelect
7+ fullWidth
8+ options = { registryOptions }
9+ valueOfSelected = { value }
10+ itemLayoutAlign = "top"
11+ onChange = { onChange }
12+ />
3913 ) ;
40- } ;
14+ } ;
Original file line number Diff line number Diff line change 11import React from "react" ;
2- import { DockerRegistryPopover } from "./DockerRegistryPopover" ;
32import "./SelectDockerImageComboBox.scss" ;
43import { EuiComboBoxSelect } from "../combo_box/EuiComboBoxSelect" ;
4+ import { DockerRegistryPopover } from "./DockerRegistryPopover" ;
55
66const extractRegistry = ( image , registries ) => {
77 if ( image ) {
You can’t perform that action at this time.
0 commit comments