diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a350a3a08..5af0b742b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ and this project adheres to ### Fixed +- Fix vanishing Docs panel when Editor panel is collapsed and opened again + [#2195](https://github.com/OpenFn/lightning/issues/2195) + ## [v2.6.1] - 2024-06-12 ### Changed diff --git a/assets/js/adaptor-docs/components/DocsPanel.tsx b/assets/js/adaptor-docs/components/DocsPanel.tsx index 9724dd2177..7ea458814b 100644 --- a/assets/js/adaptor-docs/components/DocsPanel.tsx +++ b/assets/js/adaptor-docs/components/DocsPanel.tsx @@ -6,27 +6,37 @@ import Function from './render/Function'; type DocsPanelProps = { specifier?: string; onInsert?: (text: string) => void; -} +}; -const docsLink = (

You can check the external docs site at -docs.openfn.org/adaptors. -

) +const docsLink = ( +

+ You can check the external docs site at + + docs.openfn.org/adaptors + + . +

+); const DocsPanel = ({ specifier, onInsert }: DocsPanelProps) => { - if (!specifier) {; + if (!specifier) { return
Nothing selected
; } - + const pkg = useDocs(specifier); - + if (pkg === null) { - return
Loading docs...
+ return
Loading docs...
; } if (pkg === false) { return (

Sorry, an error occurred loading the docs for this adaptor.

- {docsLink} + {docsLink}
); } @@ -35,26 +45,34 @@ const DocsPanel = ({ specifier, onInsert }: DocsPanelProps) => { if (functions.length === 0) { return (
-

{name} ({version})

+

+ {name} ({version}) +

Sorry, docs are unavailable for this adaptor.

- {docsLink} + {docsLink}
); } - + return ( -
-

{name} ({version})

-
These are the operations available for this adaptor:
+
+

+ {name} ({version}) +

+
+ These are the operations available for this adaptor: +
{functions .sort((a, b) => { if (a.name > b.name) return 1; else if (a.name < b.name) return -1; return 0; }) - .map((fn) => )} + .map(fn => ( + + ))}
- ); + ); }; -export default DocsPanel; \ No newline at end of file +export default DocsPanel; diff --git a/assets/js/job-editor/JobEditor.tsx b/assets/js/job-editor/JobEditor.tsx index fb77eadab1..afdb2684b8 100644 --- a/assets/js/job-editor/JobEditor.tsx +++ b/assets/js/job-editor/JobEditor.tsx @@ -155,7 +155,7 @@ export default ({ <>
-
+
{selectedTab === 'docs' && } {selectedTab === 'metadata' && (