Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add key to component & open InputVariables in pre/post build modal #1770

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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