Auto open log view in NextScaffolderPage
Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -241,6 +241,7 @@ const routes = (
|
||||
path="/create"
|
||||
element={
|
||||
<NextScaffolderPage
|
||||
logs={{ autoOpen: true }}
|
||||
groups={[
|
||||
{
|
||||
title: 'Recommended',
|
||||
|
||||
@@ -52,6 +52,9 @@ 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();
|
||||
@@ -69,7 +72,7 @@ export const OngoingTask = (props: {
|
||||
[taskStream],
|
||||
);
|
||||
|
||||
const [logsVisible, setLogVisibleState] = useState(false);
|
||||
const [logsVisible, setLogVisibleState] = useState(props.logs?.autoOpen);
|
||||
const [buttonBarVisible, setButtonBarVisibleState] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -65,6 +65,9 @@ export type NextRouterProps = {
|
||||
TemplateListPageComponent?: React.ComponentType<TemplateListPageProps>;
|
||||
TemplateWizardPageComponent?: React.ComponentType<TemplateWizardPageProps>;
|
||||
};
|
||||
logs?: {
|
||||
autoOpen?: boolean;
|
||||
};
|
||||
groups?: TemplateGroupFilter[];
|
||||
templateFilter?: (entity: TemplateEntityV1beta3) => boolean;
|
||||
// todo(blam): rename this to formProps
|
||||
@@ -139,6 +142,7 @@ export const Router = (props: PropsWithChildren<NextRouterProps>) => {
|
||||
path={scaffolderTaskRouteRef.path}
|
||||
element={
|
||||
<TaskPageComponent
|
||||
logs={props.logs}
|
||||
TemplateOutputsComponent={TemplateOutputsComponent}
|
||||
/>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user