Skip to content

Commit

Permalink
open in visualizer
Browse files Browse the repository at this point in the history
Signed-off-by: CodeSafari <[email protected]>
  • Loading branch information
codeSafari10 committed Jun 7, 2024
1 parent 76709ad commit b3c324b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
14 changes: 12 additions & 2 deletions ui/components/DesignLifeCycle/DeployStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const StepContent = styled('div', {
backgroundColor: backgroundColor || theme.palette.background.default,
}));

export const FinishDeploymentStep = ({ perform_deployment, deployment_type }) => {
export const FinishDeploymentStep = ({ perform_deployment, deployment_type, autoOpenView }) => {
const { operationsCenterActorRef } = useContext(NotificationCenterContext);

const [isDeploying, setIsDeploying] = useState(false);
Expand All @@ -81,6 +81,9 @@ export const FinishDeploymentStep = ({ perform_deployment, deployment_type }) =>
if (serverEvent.action === deployment_type) {
setIsDeploying(false);
setDeployEvent(serverEvent);
if (autoOpenView) {
window.open(serverEvent.metadata.viewUrl, '_blank');
}
}
},
);
Expand Down Expand Up @@ -178,6 +181,7 @@ export const UpdateDeploymentStepper = ({
}) => {
const [includeDependencies, setIncludeDependencies] = useState(false);
const [bypassDryRun, setBypassDryRun] = useState(false);
const [openInVisualizer, setOpenInVisualizer] = useState(false);

const selectedEnvironments = useSelectorRtk(selectSelectedEnvs);
const selectedEnvCount = Object.keys(selectedEnvironments).length;
Expand Down Expand Up @@ -250,7 +254,12 @@ export const UpdateDeploymentStepper = ({
{
component: (
<StepContent backgroundColor={FinalizeBackgroundColor}>
<FinalizeDeployment design={design} deployment_type={deployment_type} />
<FinalizeDeployment
design={design}
deployment_type={deployment_type}
openInVisualizer={openInVisualizer}
setOpenInVisualizer={setOpenInVisualizer}
/>
</StepContent>
),
helpText:
Expand All @@ -265,6 +274,7 @@ export const UpdateDeploymentStepper = ({
design={design}
deployment_type={deployment_type}
perform_deployment={actionFunction}
autoOpenView={openInVisualizer}
/>{' '}
</StepContent>
),
Expand Down
8 changes: 6 additions & 2 deletions ui/components/DesignLifeCycle/finalizeDeployment.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const StyledEnvironment = styled(Box)(({ theme }) => ({
color: theme.palette.text.neutral.default,
}));

export const FinalizeDeployment = ({ design }) => {
export const FinalizeDeployment = ({ design, openInVisualizer, setOpenInVisualizer }) => {
const { configurableComponents } = processDesign(design);
const selectedEnvironments = useSelectorRtk(selectSelectedEnvs);
const envNames = Object.values(selectedEnvironments).map((env) => env.name);
Expand Down Expand Up @@ -66,7 +66,11 @@ export const FinalizeDeployment = ({ design }) => {
</StyledSummaryItem>
</Box>
<Stack mt={3} gap={1}>
<CheckBoxField label="Open in Visualizer" checked={false} onChange={() => {}} />
<CheckBoxField
label="Open in Visualizer"
checked={openInVisualizer}
onChange={() => setOpenInVisualizer(!openInVisualizer)}
/>
<CheckBoxField label="Schedule Deployment" checked={false} onChange={() => {}} disabled />
</Stack>
</Box>
Expand Down

0 comments on commit b3c324b

Please sign in to comment.