diff --git a/.changeset/four-donuts-switch.md b/.changeset/four-donuts-switch.md
new file mode 100644
index 0000000000..bb876a4341
--- /dev/null
+++ b/.changeset/four-donuts-switch.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-scaffolder': patch
+---
+
+enable resizing of the task log stream viewer
diff --git a/.changeset/witty-keys-share.md b/.changeset/witty-keys-share.md
new file mode 100644
index 0000000000..0ef89e56e2
--- /dev/null
+++ b/.changeset/witty-keys-share.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-scaffolder-react': patch
+---
+
+disables rendering of output box if no output is returned
diff --git a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.test.tsx b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.test.tsx
index 4c631b86b0..7ec3b0867c 100644
--- a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.test.tsx
+++ b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.test.tsx
@@ -31,7 +31,7 @@ describe('', () => {
],
};
- const { getByRole } = await renderInTestApp(
+ const { getByRole, queryByTestId } = await renderInTestApp(
,
{
mountedRoutes: {
@@ -39,7 +39,8 @@ describe('', () => {
},
},
);
-
+ expect(queryByTestId('output-box')).not.toBeNull();
+ expect(queryByTestId('text-output-box')).not.toBeNull();
// first text output default visible
expect(getByRole('heading', { level: 2 }).innerHTML).toBe(
output.text[0].title,
@@ -61,4 +62,20 @@ describe('', () => {
expect(getByRole('heading', { level: 2 }).innerHTML).toBe(text.title);
}
});
+ it('should not render anything when output is empty', async () => {
+ // This is the default case when no output field is present in the template
+ const output = {};
+ const { queryByTestId } = await renderInTestApp(
+ ,
+ {
+ mountedRoutes: {
+ '/catalog/:namespace/:kind/:name': entityRouteRef,
+ },
+ },
+ );
+
+ // Ensure that nothing renders from this component
+ expect(queryByTestId('output-box')).toBeNull();
+ expect(queryByTestId('text-output-box')).toBeNull();
+ });
});
diff --git a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx
index 7d90623077..cbc299bf1c 100644
--- a/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx
+++ b/plugins/scaffolder-react/src/next/components/TemplateOutputs/DefaultTemplateOutputs.tsx
@@ -56,22 +56,31 @@ export const DefaultTemplateOutputs = (props: {
return null;
}
+ const emptyOutput = Object.keys(output).length === 0;
+
return (
<>
-
-
-
-
-
-
-
-
+ {!emptyOutput ? (
+
+
+
+
+
+
+
+
+ ) : null}
{textOutput ? (
-
+
+
-
+
) : null}
diff --git a/yarn.lock b/yarn.lock
index afe89e4263..b0bff82017 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7314,6 +7314,7 @@ __metadata:
"@types/humanize-duration": ^3.18.1
"@types/json-schema": ^7.0.9
"@types/react": ^16.13.1 || ^17.0.0 || ^18.0.0
+ "@types/react-resizable": ^3.0.8
"@types/react-window": ^1.8.8
"@uiw/react-codemirror": ^4.9.3
classnames: ^2.2.6
@@ -7326,6 +7327,7 @@ __metadata:
luxon: ^3.0.0
msw: ^1.0.0
qs: ^6.9.4
+ react-resizable: ^3.0.5
react-use: ^17.2.4
react-window: ^1.8.10
swr: ^2.0.0
@@ -18461,6 +18463,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/react-resizable@npm:^3.0.8":
+ version: 3.0.8
+ resolution: "@types/react-resizable@npm:3.0.8"
+ dependencies:
+ "@types/react": "*"
+ checksum: aabdef8056bbab3065559bce7ce93232e645fb4f915fd55f0903a2f4df5d2395762dfd75bb0242d5a73d39461e8c062d81eaab87b91213dddfd973ff908f79e4
+ languageName: node
+ linkType: hard
+
"@types/react-sparklines@npm:^1.7.0":
version: 1.7.5
resolution: "@types/react-sparklines@npm:1.7.5"
@@ -38371,7 +38382,7 @@ __metadata:
languageName: node
linkType: hard
-"react-resizable@npm:^3.0.4":
+"react-resizable@npm:^3.0.4, react-resizable@npm:^3.0.5":
version: 3.0.5
resolution: "react-resizable@npm:3.0.5"
dependencies: