From 230f3bf8a60ee696e6ccc59cba3d6fd148ab7e79 Mon Sep 17 00:00:00 2001 From: Bogdan Nechyporenko Date: Tue, 3 Oct 2023 15:00:21 +0200 Subject: [PATCH] Added a visibility log button to a panel Signed-off-by: Bogdan Nechyporenko --- .changeset/many-timers-double.md | 5 ----- packages/app/src/App.tsx | 1 - plugins/scaffolder/alpha-api-report.md | 3 --- .../src/next/OngoingTask/OngoingTask.tsx | 16 ++++++++++++---- plugins/scaffolder/src/next/Router/Router.tsx | 4 ---- 5 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 .changeset/many-timers-double.md diff --git a/.changeset/many-timers-double.md b/.changeset/many-timers-double.md deleted file mode 100644 index 27d569ba8f..0000000000 --- a/.changeset/many-timers-double.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder': patch ---- - -Added a possibility to open logs view in a scaffolder execution panel automatically diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index 8757367338..f2b7d66b21 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -241,7 +241,6 @@ const routes = ( path="/create" element={ ; TemplateWizardPageComponent?: React_2.ComponentType; }; - logs?: { - autoOpen?: boolean; - }; groups?: TemplateGroupFilter[]; templateFilter?: (entity: TemplateEntityV1beta3) => boolean; FormProps?: FormProps_2; diff --git a/plugins/scaffolder/src/next/OngoingTask/OngoingTask.tsx b/plugins/scaffolder/src/next/OngoingTask/OngoingTask.tsx index e856076908..b483cd27cb 100644 --- a/plugins/scaffolder/src/next/OngoingTask/OngoingTask.tsx +++ b/plugins/scaffolder/src/next/OngoingTask/OngoingTask.tsx @@ -46,15 +46,15 @@ const useStyles = makeStyles(theme => ({ cancelButton: { marginRight: theme.spacing(1), }, + logsVisibilityButton: { + marginRight: theme.spacing(1), + }, })); export const OngoingTask = (props: { TemplateOutputsComponent?: React.ComponentType<{ output?: ScaffolderTaskOutput; }>; - logs?: { - autoOpen?: boolean; - }; }) => { // todo(blam): check that task Id actually exists, and that it's valid. otherwise redirect to something more useful. const { taskId } = useParams(); @@ -72,7 +72,7 @@ export const OngoingTask = (props: { [taskStream], ); - const [logsVisible, setLogVisibleState] = useState(props.logs?.autoOpen ?? false); + const [logsVisible, setLogVisibleState] = useState(false); const [buttonBarVisible, setButtonBarVisibleState] = useState(true); useEffect(() => { @@ -191,6 +191,14 @@ export const OngoingTask = (props: { > Cancel +