Skip to content

Commit 1e0b905

Browse files
Merge pull request #1039 from devtron-labs/chore/merge-release-candidate-v0.46.0
fix: update version to 1.24.0 in package.json and package-lock.json
2 parents 05e28e6 + cc254a6 commit 1e0b905

4 files changed

Lines changed: 35 additions & 7 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.23.5-pre-3",
3+
"version": "1.24.0",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/Plugin/types.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { MutableRefObject } from 'react'
1818

19-
import { ConsequenceType, ServerErrors, VariableType } from '../../../Common'
19+
import { ConditionDetails, ConsequenceType, ServerErrors, VariableType } from '../../../Common'
2020
import { BaseFilterQueryParams } from '../../types'
2121
import { ImageWithFallbackProps } from '../ImageWithFallback'
2222
import { getPluginStoreData } from './service'
@@ -50,10 +50,19 @@ interface MinimalPluginVersionDataDTO {
5050
isLatest: boolean
5151
}
5252

53+
export interface PluginStepConditionDTO extends Pick<ConditionDetails, 'conditionType' | 'conditionalValue'> {
54+
conditionalOperator: ConditionDetails['conditionOperator']
55+
id: number
56+
}
57+
58+
interface PluginVariableType extends VariableType {
59+
pluginStepCondition?: PluginStepConditionDTO[]
60+
}
61+
5362
interface DetailedPluginVersionDTO extends MinimalPluginVersionDataDTO {
5463
tags: string[]
55-
inputVariables: VariableType[]
56-
outputVariables: VariableType[]
64+
inputVariables: PluginVariableType[]
65+
outputVariables: PluginVariableType[]
5766
/**
5867
* Present in case of shared plugin
5968
*/
@@ -112,7 +121,7 @@ export interface ParentPluginType extends Pick<
112121
pluginVersions: MinimalPluginVersionDataDTO[]
113122
}
114123

115-
interface DetailedPluginVersionType
124+
export interface DetailedPluginVersionType
116125
extends
117126
Pick<MinimalPluginVersionDataDTO, 'id' | 'description' | 'name' | 'pluginVersion'>,
118127
Pick<DetailedPluginVersionDTO, 'tags' | 'inputVariables' | 'outputVariables' | 'updatedBy' | 'docLink'>,

src/Shared/Components/SelectPicker/SelectPickerTextArea.component.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ export const SelectPickerTextArea = ({
3232
maxHeight,
3333
refVar,
3434
dependentRefs,
35+
filterOption: filterOptionProp,
3536
...props
3637
}: SelectPickerTextAreaProps) => {
3738
// STATES
3839
const [inputValue, setInputValue] = useState((value as SingleValue<SelectPickerOptionType<string>>)?.value || '')
40+
const [isInputDirty, setIsInputDirty] = useState(false)
3941

4042
// REFS
4143
const selectRef = useRef<SelectInstance<SelectPickerOptionType<string>>>(null)
@@ -50,6 +52,7 @@ export const SelectPickerTextArea = ({
5052
useEffect(() => {
5153
const selectValue = value as SingleValue<SelectPickerOptionType<string>>
5254
setInputValue(selectValue?.value || '')
55+
setIsInputDirty(false)
5356
}, [value])
5457

5558
// METHODS
@@ -120,9 +123,23 @@ export const SelectPickerTextArea = ({
120123
return false
121124
}
122125

126+
const filterOption: SelectPickerTextAreaProps['filterOption'] = (...filterOptionArgs) => {
127+
if (!isInputDirty) {
128+
return true
129+
}
130+
131+
if (filterOptionProp) {
132+
return filterOptionProp(...filterOptionArgs)
133+
}
134+
135+
const [option, rawInput] = filterOptionArgs
136+
return option.label.toLowerCase().includes(rawInput.toLowerCase())
137+
}
138+
123139
const onInputChange = (newValue: string, { action }: InputActionMeta) => {
124140
if (action === ReactSelectInputAction.inputChange) {
125141
setInputValue(newValue)
142+
setIsInputDirty(true)
126143

127144
if (!newValue) {
128145
onChange?.(null, {
@@ -137,6 +154,7 @@ export const SelectPickerTextArea = ({
137154
const selectValue = value as SingleValue<SelectPickerOptionType<string>>
138155
// Reverting input to previously selected value in case of blur event. (no-selection)
139156
setInputValue(selectValue?.value || '')
157+
setIsInputDirty(false)
140158
}
141159
}
142160

@@ -195,6 +213,7 @@ export const SelectPickerTextArea = ({
195213
selectRef={selectRef}
196214
inputValue={inputValue}
197215
value={value}
216+
filterOption={filterOption}
198217
onInputChange={onInputChange}
199218
controlShouldRenderValue={false}
200219
onChange={onChange}

0 commit comments

Comments
 (0)