mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-10 16:32:26 +00:00
fix(ui ingestion): fixing issue where stale fields could stick around when changing recipes (#8421)
This commit is contained in:
parent
620d23d623
commit
cf8e44b69a
@ -45,12 +45,14 @@ export const DefineRecipeStep = ({ state, updateState, goTo, prev, ingestionSour
|
|||||||
const placeholderRecipe = getPlaceholderRecipe(ingestionSources, type);
|
const placeholderRecipe = getPlaceholderRecipe(ingestionSources, type);
|
||||||
|
|
||||||
const [stagedRecipeYml, setStagedRecipeYml] = useState(existingRecipeYaml || placeholderRecipe);
|
const [stagedRecipeYml, setStagedRecipeYml] = useState(existingRecipeYaml || placeholderRecipe);
|
||||||
|
const [stagedRecipeName, setStagedRecipeName] = useState(state.name);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (existingRecipeYaml) {
|
if (existingRecipeYaml) {
|
||||||
|
setStagedRecipeName(state.name);
|
||||||
setStagedRecipeYml(existingRecipeYaml);
|
setStagedRecipeYml(existingRecipeYaml);
|
||||||
}
|
}
|
||||||
}, [existingRecipeYaml]);
|
}, [existingRecipeYaml, state.name]);
|
||||||
|
|
||||||
const [stepComplete, setStepComplete] = useState(false);
|
const [stepComplete, setStepComplete] = useState(false);
|
||||||
|
|
||||||
@ -97,6 +99,7 @@ export const DefineRecipeStep = ({ state, updateState, goTo, prev, ingestionSour
|
|||||||
if (type && CONNECTORS_WITH_FORM.has(type)) {
|
if (type && CONNECTORS_WITH_FORM.has(type)) {
|
||||||
return (
|
return (
|
||||||
<RecipeBuilder
|
<RecipeBuilder
|
||||||
|
key={stagedRecipeName}
|
||||||
state={state}
|
state={state}
|
||||||
isEditing={isEditing}
|
isEditing={isEditing}
|
||||||
displayRecipe={displayRecipe}
|
displayRecipe={displayRecipe}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user