Skip to content

Commit 17b5fdf

Browse files
authored
Merge pull request #2109 from devtron-labs/fix/select-picker-ui
fix: select picker UI
2 parents aa2dfc5 + b1da545 commit 17b5fdf

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "0.4.4",
7+
"@devtron-labs/devtron-fe-common-lib": "0.4.5",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const EnvironmentOverrideRouter = () => {
225225
const list = []
226226
envListMinRes?.forEach((env) => {
227227
if (env.cluster_name !== 'default_cluster' && env.isClusterCdActive) {
228-
list.push({ id: env.id, clusterName: env.cluster_name, name: env.environment_name })
228+
list.push({ ...env, value: env.id, clusterName: env.cluster_name, label: env.environment_name })
229229
}
230230
})
231231
setEnvironmentOptions(createClusterEnvGroup(list, 'clusterName'))

src/components/CIPipelineN/TaskTypeDetailComponent.tsx

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React, { useContext, useState, useEffect } from 'react'
17+
import { useContext, useState, useEffect } from 'react'
1818
import Tippy from '@tippyjs/react'
1919
import {
2020
Checkbox,
@@ -25,6 +25,7 @@ import {
2525
ScriptType,
2626
CustomInput,
2727
ClipboardButton,
28+
SelectPicker,
2829
} from '@devtron-labs/devtron-fe-common-lib'
2930
import { components } from 'react-select'
3031
import { TaskFieldDescription, TaskFieldLabel } from '../ciPipeline/types'
@@ -39,9 +40,6 @@ import { OptionType } from '../app/types'
3940
import { ValidationRules } from '../ciPipeline/validationRules'
4041
import { ReactComponent as Info } from '../../assets/icons/ic-info-filled.svg'
4142
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'
4543

4644
export const TaskTypeDetailComponent = () => {
4745
const {
@@ -211,17 +209,6 @@ export const TaskTypeDetailComponent = () => {
211209
}
212210
}
213211

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-
225212
const renderMenuListFooter = () => (
226213
<div className="cn-5 pl-12 pt-4 pb-4 dc__italic-font-style">
227214
Type to enter a custom value. Press Enter to accept.
@@ -240,26 +227,17 @@ export const TaskTypeDetailComponent = () => {
240227
/>
241228

242229
<div className="dc__position-rel">
243-
<CreatableSelect
244-
tabIndex={1}
230+
<SelectPicker
231+
inputId="containerImage"
245232
value={selectedContainerImage}
246233
options={containerImageOptions}
247234
placeholder="Select container image or input value"
248235
onChange={handleContainerImageSelector}
249-
styles={containerImageSelectStyles}
250236
classNamePrefix="select"
251-
components={{
252-
MenuList: menuList,
253-
Option,
254-
IndicatorSeparator: null,
255-
ValueContainer,
256-
}}
257-
noOptionsMessage={(): string => {
258-
return 'No matching options'
259-
}}
260237
onBlur={handleCreatableBlur}
261-
isValidNewOption={() => false}
262238
onKeyDown={handleKeyDown}
239+
isCreatable
240+
renderMenuListFooter={renderMenuListFooter}
263241
/>
264242
{selectedContainerImage?.label && (
265243
<div className="flex icon-dim-32 dc__position-abs dc__top-0 dc__right-20">

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,10 +1346,10 @@
13461346
dependencies:
13471347
"@jridgewell/trace-mapping" "0.3.9"
13481348

1349-
"@devtron-labs/[email protected].4":
1350-
version "0.4.4"
1351-
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-0.4.4.tgz#2b2dbe17d82628017334ea0c3292127563dba863"
1352-
integrity sha512-G8QRY+gHN9IH1NG7L8+1etDjbbdgy2Waw344xOJcebEgFuN8ZBTtIREzgAC+QZp2qUiYmn4wA2fNWf30A1ywhw==
1349+
"@devtron-labs/[email protected].5":
1350+
version "0.4.5"
1351+
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-0.4.5.tgz#55d4ff6174a84af9c4a08f6ba73a0178dde56529"
1352+
integrity sha512-6Rtzxk7UavWoXh2MaJDL+FQXcJN9idv9xfrEhL+vdbjmGwFqYsDmikt8DOxFyMVtjVORqkzhG425GAzm7ZoQFg==
13531353
dependencies:
13541354
"@types/react-dates" "^21.8.6"
13551355
ansi_up "^5.2.1"

0 commit comments

Comments
 (0)