14
14
* limitations under the License.
15
15
*/
16
16
17
- import React , { useContext , useState , useEffect } from 'react'
17
+ import { useContext , useState , useEffect } from 'react'
18
18
import Tippy from '@tippyjs/react'
19
19
import {
20
20
Checkbox ,
@@ -25,6 +25,7 @@ import {
25
25
ScriptType ,
26
26
CustomInput ,
27
27
ClipboardButton ,
28
+ SelectPicker ,
28
29
} from '@devtron-labs/devtron-fe-common-lib'
29
30
import { components } from 'react-select'
30
31
import { TaskFieldDescription , TaskFieldLabel } from '../ciPipeline/types'
@@ -39,9 +40,6 @@ import { OptionType } from '../app/types'
39
40
import { ValidationRules } from '../ciPipeline/validationRules'
40
41
import { ReactComponent as Info } from '../../assets/icons/ic-info-filled.svg'
41
42
import { pipelineContext } from '../workflowEditor/workflowEditor'
42
- import CreatableSelect from 'react-select/creatable'
43
- import { containerImageSelectStyles } from './ciPipeline.utils'
44
- import { ValueContainerImage as ValueContainer } from '@Components/app/details/appDetails/utils'
45
43
46
44
export const TaskTypeDetailComponent = ( ) => {
47
45
const {
@@ -211,17 +209,6 @@ export const TaskTypeDetailComponent = () => {
211
209
}
212
210
}
213
211
214
- const menuList = ( props ) => {
215
- return (
216
- < components . MenuList { ...props } >
217
- < div className = "cn-5 pl-12 pt-4 pb-4 dc__italic-font-style" >
218
- Type to enter a custom value. Press Enter to accept.
219
- </ div >
220
- { props . children }
221
- </ components . MenuList >
222
- )
223
- }
224
-
225
212
const renderMenuListFooter = ( ) => (
226
213
< div className = "cn-5 pl-12 pt-4 pb-4 dc__italic-font-style" >
227
214
Type to enter a custom value. Press Enter to accept.
@@ -240,26 +227,17 @@ export const TaskTypeDetailComponent = () => {
240
227
/>
241
228
242
229
< div className = "dc__position-rel" >
243
- < CreatableSelect
244
- tabIndex = { 1 }
230
+ < SelectPicker
231
+ inputId = "containerImage"
245
232
value = { selectedContainerImage }
246
233
options = { containerImageOptions }
247
234
placeholder = "Select container image or input value"
248
235
onChange = { handleContainerImageSelector }
249
- styles = { containerImageSelectStyles }
250
236
classNamePrefix = "select"
251
- components = { {
252
- MenuList : menuList ,
253
- Option,
254
- IndicatorSeparator : null ,
255
- ValueContainer,
256
- } }
257
- noOptionsMessage = { ( ) : string => {
258
- return 'No matching options'
259
- } }
260
237
onBlur = { handleCreatableBlur }
261
- isValidNewOption = { ( ) => false }
262
238
onKeyDown = { handleKeyDown }
239
+ isCreatable
240
+ renderMenuListFooter = { renderMenuListFooter }
263
241
/>
264
242
{ selectedContainerImage ?. label && (
265
243
< div className = "flex icon-dim-32 dc__position-abs dc__top-0 dc__right-20" >
0 commit comments