Skip to content

Commit

Permalink
Merge pull request #1770 from devtron-labs/fix/pre-build
Browse files Browse the repository at this point in the history
fix: add key to component & open InputVariables in pre/post build modal
  • Loading branch information
Elessar1802 authored May 21, 2024
2 parents 694eca0 + 7d54f4d commit 3804c4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/CIPipelineN/PreBuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { importComponentFromFELibrary } from '../common'
import { pipelineContext } from '../workflowEditor/workflowEditor'

const isRequired = importComponentFromFELibrary('isRequired', null, 'function')
export function PreBuild({ presetPlugins, sharedPlugins, mandatoryPluginsMap, isJobView }: PreBuildType) {
export const PreBuild: React.FC<PreBuildType> = ({ presetPlugins, sharedPlugins, mandatoryPluginsMap, isJobView }) => {
const {
formData,
isCdPipeline,
Expand Down Expand Up @@ -223,5 +223,5 @@ export function PreBuild({ presetPlugins, sharedPlugins, mandatoryPluginsMap, is
)
}

return renderComponent()
return <React.Fragment key={activeStageName}>{renderComponent()}</React.Fragment>
}
2 changes: 1 addition & 1 deletion src/components/CIPipelineN/VariableContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ReactComponent as AlertTriangle } from '../../assets/icons/ic-alert-tri
import { pipelineContext } from '../workflowEditor/workflowEditor'

export const VariableContainer = ({ type }: { type: PluginVariableType }) => {
const [collapsedSection, setCollapsedSection] = useState<boolean>(true)
const [collapsedSection, setCollapsedSection] = useState<boolean>(type !== PluginVariableType.INPUT)
const { formData, selectedTaskIndex, activeStageName, formDataErrorObj } = useContext(pipelineContext)
const variableLength =
formData[activeStageName].steps[selectedTaskIndex].pluginRefStepDetail[
Expand Down

0 comments on commit 3804c4f

Please sign in to comment.