Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix button for large pipeline warning #1428

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions src/components/pipeline-warning/pipeline-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export const PipelineWarning = ({
a while to render. You can use the sidebar controls to select a
smaller graph.
</p>
<Button onClick={onHide}>Render it anyway</Button>
<Button mode="secondary" onClick={onDisable} size="small">
Don't show this again
</Button>
<div className="pipeline-warning__button-wrapper">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @rashidakanchwala Do we not need any styling for this new classname ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, this div basically ensures that the buttons are not next to each other ... just followed this way (https://github.com/kedro-org/kedro-viz/blob/main/src/components/settings-modal/settings-modal.js#L149)

<Button onClick={onHide}>Render it anyway</Button>
<Button mode="secondary" onClick={onDisable} size="small">
Don't show this again
</Button>
</div>
</div>
)}
{isEmptyPipeline && componentLoaded && (
Expand All @@ -70,14 +72,9 @@ export const PipelineWarning = ({
)}
{invalidUrl && componentLoaded && (
<div
className={classnames(
'kedro',
'pipeline-warning',
'pipeline-warning--invalid-url',
{
'pipeline-warning--sidebar-visible': sidebarVisible,
}
)}
className={classnames('kedro', 'pipeline-warning', {
'pipeline-warning--sidebar-visible': sidebarVisible,
})}
>
<h2 className="pipeline-warning__title">
Oops, this URL isn't valid
Expand Down
5 changes: 0 additions & 5 deletions src/components/pipeline-warning/pipeline-warning.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,3 @@
.pipeline-warning .button:first-of-type {
margin-bottom: 1.2em;
}

.pipeline-warning--invalid-url .button {
display: flex;
justify-content: center;
}
2 changes: 0 additions & 2 deletions src/components/ui/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ $secondary-underline-offset-hover: 4px;
box-shadow: none;
color: var(--color-button__text);
cursor: pointer;
display: flex;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this, otherwise it alters the Apply changes and close button:

Screenshot 2023-06-30 at 11 45 58

font-family: inherit;
font-size: 1.6em;
font-weight: 600;
Expand Down Expand Up @@ -139,7 +138,6 @@ $secondary-underline-offset-hover: 4px;

.success-check-mark {
animation: grow 0.35s 0.4s ease forwards;
display: block;
margin-left: 0.5em;
transform: scale(0);
}
Expand Down