kyma-project / busola

Web based Kubernetes Dashboard with a focus on privacy that requires no active components or special privileges in your cluster.
Apache License 2.0
24 stars 48 forks source link

Add ability to pass schema to EditorWrapper #3291

Open dbadura opened 3 weeks ago

dbadura commented 3 weeks ago

Description In resource form you should be able to pass schema instaed of schemaID, which is used to download schema.

Reasons In non-extensibility forms, the schema is fetched and is available to be taken from context. There is no need to create schemaID and pass it down to EditorWrapper. In the future we can remove fetching of schema from EditorWrapper, which make this component to do one thing less.

Attachments

  // readonly schema ID, set only once
  const resourceSchemaId = useMemo(
    () => resource?.apiVersion + '/' + resource?.kind,
    [], // eslint-disable-line react-hooks/exhaustive-deps
  );

...

    <EditorWrapper
...
      schemaId={resourceSchemaId}
    />