Przeglądaj źródła

Fix SourceEditorDocker not updating on revision change.

jnfrati 3 lat temu
rodzic
commit
0ea57c70ed

+ 8 - 1
dashboard/src/main/home/cluster-dashboard/stacks/ExpandedStack/components/SourceEditorDocker.tsx

@@ -37,6 +37,13 @@ const SourceEditorDocker = ({
     return image.replace(registry.url + "/", "");
     return image.replace(registry.url + "/", "");
   }, [image, registry]);
   }, [image, registry]);
 
 
+  useEffect(() => {
+    if (sourceConfig.image_repo_uri) {
+      setImage(sourceConfig.image_repo_uri);
+      setTag(sourceConfig.image_tag);
+    }
+  }, [sourceConfig]);
+
   useEffect(() => {
   useEffect(() => {
     const newSourceConfig: SourceConfig = {
     const newSourceConfig: SourceConfig = {
       ...sourceConfig,
       ...sourceConfig,
@@ -126,7 +133,7 @@ const _DockerRepositorySelector = ({
         }
         }
         setIsLoading(false);
         setIsLoading(false);
       });
       });
-  }, []);
+  }, [currentImageUrl]);
 
 
   const handleChange = (newRegistry: DockerRegistry) => {
   const handleChange = (newRegistry: DockerRegistry) => {
     onChange(newRegistry);
     onChange(newRegistry);