-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #2238, to add a deprecation warning banner to the Kedro-Viz experiment tracking page
- Loading branch information
Showing
10 changed files
with
204 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import React, { useState } from 'react'; | ||
import Modal from '../ui/modal'; | ||
import Button from '../ui/button'; | ||
import { localStorageETDeprecationBannerSeen } from '../../config'; | ||
|
||
import './deprecation-banner.scss'; | ||
|
||
export const DeprecationBanner = () => { | ||
const visible = !window.localStorage.getItem( | ||
localStorageETDeprecationBannerSeen | ||
); | ||
const [showModal, setShowModal] = useState(visible); | ||
|
||
const handleAcknowledgeAndDismiss = () => { | ||
window.localStorage.setItem(localStorageETDeprecationBannerSeen, true); | ||
setShowModal(false); | ||
}; | ||
|
||
const handleProvideFeedbackClick = () => { | ||
window.open('https://github.com/kedro-org/kedro-viz/issues/2247', '_blank'); | ||
}; | ||
|
||
const renderLink = (url, text) => ( | ||
<a | ||
href={url} | ||
className="deprecation-banner-modal__link" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
{text} | ||
</a> | ||
); | ||
|
||
return ( | ||
<Modal | ||
className="deprecation-banner-modal" | ||
title="Experiment tracking will be disabled soon." | ||
visible={showModal} | ||
> | ||
<div className="deprecation-banner-modal__message-wrapper"> | ||
<p> | ||
We have decided to deprecate experiment tracking feature from | ||
Kedro-Viz version 11.0.0 | ||
</p> | ||
|
||
<p className="deprecation-banner-modal__secondary-text"> | ||
Find out more from{' '} | ||
{renderLink( | ||
'https://kedro.org/blog/deprecate-experiment-tracking-kedro-viz', | ||
'this blog post' | ||
)} | ||
. | ||
</p> | ||
|
||
<p className="deprecation-banner-modal__secondary-text"> | ||
Our documentation explains{' '} | ||
{renderLink( | ||
'https://docs.kedro.org/en/stable/integrations/mlflow.html', | ||
'how to continue using Kedro with MLflow for experiment tracking ' | ||
)} | ||
and{' '} | ||
{renderLink( | ||
'https://docs.kedro.org/projects/kedro-viz/en/latest/migrate_experiment_tracking.html', | ||
'how to migrate a Kedro project accordingly' | ||
)} | ||
. | ||
</p> | ||
|
||
<p className="deprecation-banner-modal__secondary-text"> | ||
If you have any further feedback for us, feel free to share your | ||
thoughts below. | ||
</p> | ||
</div> | ||
|
||
<div className="deprecation-banner-modal__button-wrapper"> | ||
<Button | ||
mode="secondary" | ||
onClick={handleProvideFeedbackClick} | ||
size="small" | ||
className="deprecation-banner-modal__provide-feedback-btn" | ||
dataTest="deprecation-banner-modal__provide-feedback-btn" | ||
> | ||
Provide feedback | ||
</Button> | ||
<Button | ||
size="small" | ||
onClick={handleAcknowledgeAndDismiss} | ||
className="deprecation-banner-modal--acknowledge-and-dismiss-btn" | ||
dataTest="deprecation-banner-modal--acknowledge-and-dismiss-btn" | ||
> | ||
Acknowledge and dismiss | ||
</Button> | ||
</div> | ||
</Modal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
@use '../../styles/variables' as variables; | ||
|
||
$modal-height: 416px; | ||
$modal-margin: 48px; | ||
$modal-width: 446px; | ||
$text-margin: 24px; | ||
|
||
.kui-theme--light { | ||
--secondary-text-color: #{variables.$black-500}; | ||
--primary-button-background: #{variables.$black-900}; | ||
--primary-button-text-color: #{variables.$white-0}; | ||
} | ||
|
||
.kui-theme--dark { | ||
--secondary-text-color: #{variables.$white-900}; | ||
--primary-button-background: #{variables.$white-0}; | ||
--primary-button-text-color: #{variables.$black-900}; | ||
} | ||
|
||
.deprecation-banner-modal { | ||
.modal__content { | ||
max-width: calc(#{$modal-width} + 2 * #{$modal-margin}); | ||
} | ||
|
||
.modal__wrapper { | ||
width: $modal-width; | ||
padding: 0; | ||
margin: $modal-margin; | ||
} | ||
|
||
.modal__title { | ||
text-align: left; | ||
margin-bottom: 0; | ||
} | ||
|
||
.deprecation-banner-modal__message-wrapper { | ||
p { | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 20px; | ||
margin-bottom: 0; | ||
margin-top: $text-margin; | ||
text-align: left; | ||
} | ||
|
||
.deprecation-banner-modal__secondary-text { | ||
color: var(--secondary-text-color); | ||
} | ||
} | ||
|
||
.deprecation-banner-modal__button-wrapper { | ||
align-items: center; | ||
display: flex; | ||
justify-content: space-between; | ||
margin-top: $modal-margin; | ||
width: 100%; | ||
|
||
.button__btn--secondary { | ||
padding-left: 0; | ||
text-decoration: underline; | ||
text-underline-offset: 3px; | ||
|
||
&:hover::after { | ||
background-color: transparent; | ||
} | ||
} | ||
|
||
.button__btn--primary { | ||
border-color: var(--primary-button-background); | ||
|
||
&:hover { | ||
background-color: var(--primary-button-background); | ||
color: var(--primary-button-text-color); | ||
} | ||
} | ||
} | ||
|
||
.deprecation-banner-modal__link { | ||
color: var(--secondary-text-color); | ||
text-decoration: underline; | ||
text-underline-offset: 3px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters