-
Notifications
You must be signed in to change notification settings - Fork 114
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
Feat/add deprecation et #2248
Feat/add deprecation et #2248
Changes from all commits
d804e79
0455db3
c2d5030
3ef0b63
b1c4d37
925910f
8a0b00d
e15d03c
90348ba
b799530
b665506
107a278
0903515
7cfb3e5
105fc7e
c42fcb1
bd85b29
2e7902e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Nit] same as above on the generic deprecation component. I am not sure if the modal design change for each deprecation banner ? But it is worth making a generic banner to extend in future. |
||
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> | ||
); | ||
}; |
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; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nit] If we want this DeprecationBanner to be a generic one in future, may be we get these issue links as props to the banner. For now may be we can go with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully we wont deprecate more features, so this will be a one off thing