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

Add very basic update notifications #3121

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,18 @@
margin: 0px 8px;
}
.dash-fe-error-top {
height: 20px;
display: flex;
justify-content: space-between;
width: 100%;
cursor: pointer;
border: 1px solid gray;
border-radius: 2px;
}
.dash-debug-menu__error-count {
font-size: 12px;
color: #fff;
background-color: #C73A3A;
padding: 5px;
border-radius: 3px;
margin: 4px;
}
.dash-fe-error-top__group:first-child {
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ class FrontEndErrorContainer extends Component {
}

render() {
const {errors, connected, errorsOpened, clickHandler} = this.props;
const errorsLength = errors.length;
if (errorsLength === 0 || !errorsOpened) {
return null;
}
const {errors, connected} = this.props;

const inAlertsTray = this.props.inAlertsTray;
let cardClasses = 'dash-error-card dash-error-card--container';
Expand All @@ -28,17 +24,8 @@ class FrontEndErrorContainer extends Component {
<div className={cardClasses}>
<div className='dash-error-card__topbar'>
<div className='dash-error-card__message'>
🛑 Errors (
<strong className='test-devtools-error-count'>
{errorsLength}
</strong>
){connected ? null : '\u00a0 🚫 Server Unavailable'}
</div>
<div
className='dash-fe-error__icon-x'
onClick={() => clickHandler()}
>
×
Errors
{connected ? null : '\u00a0 🚫 Server Unavailable'}
</div>
</div>
<div className='dash-error-card__list'>{errorElements}</div>
Expand All @@ -51,9 +38,7 @@ FrontEndErrorContainer.propTypes = {
id: PropTypes.string,
errors: PropTypes.array,
connected: PropTypes.bool,
inAlertsTray: PropTypes.any,
errorsOpened: PropTypes.any,
clickHandler: PropTypes.func
inAlertsTray: PropTypes.any
};

FrontEndErrorContainer.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ class UnconnectedGlobalErrorContainer extends Component {
const {config, error, children} = this.props;
return (
<div id='_dash-global-error-container'>
<DebugMenu error={error} hotReload={Boolean(config.hot_reload)}>
<DebugMenu
config={config}
error={error}
hotReload={Boolean(config.hot_reload)}
>
<div id='_dash-app-content'>{children}</div>
</DebugMenu>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@

.dash-error-card {
box-sizing: border-box;
background: #ffffff;
display: inline-block;
/* shadow-1 */
box-shadow: 0px 6px 16px rgba(80, 103, 132, 0.165),
0px 2px 6px rgba(80, 103, 132, 0.12),
0px 0px 1px rgba(80, 103, 132, 0.32);
border-radius: 4px;
position: fixed;
top: 16px;
right: 16px;
animation: dash-error-card-animation 0.5s;
padding: 24px;
text-align: left;
background-color: white;

background: transparent;
}
.dash-error-card--alerts-tray {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class GlobalErrorOverlay extends Component {
}

render() {
const {visible, error, errorsOpened, clickHandler} = this.props;
const {visible, error, errorsOpened, clickHandler, config} = this.props;

let frontEndErrors;
if (errorsOpened) {
Expand All @@ -21,8 +21,8 @@ export default class GlobalErrorOverlay extends Component {
<FrontEndErrorContainer
errors={errors}
connected={error.backEndConnected}
errorsOpened={errorsOpened}
clickHandler={clickHandler}
config={config}
/>
);
}
Expand All @@ -44,5 +44,6 @@ GlobalErrorOverlay.propTypes = {
visible: PropTypes.bool,
error: PropTypes.object,
errorsOpened: PropTypes.any,
clickHandler: PropTypes.func
clickHandler: PropTypes.func,
config: PropTypes.object
};
4 changes: 2 additions & 2 deletions dash/dash-renderer/src/components/error/icons/CheckIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 31 additions & 79 deletions dash/dash-renderer/src/components/error/menu/DebugMenu.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,18 @@
background-color: #108de4;
}

.dash-debug-menu__icon {
width: auto;
height: 24px;
}

.dash-debug-menu__outer {
transition: 0.3s;
box-sizing: border-box;
position: fixed;
bottom: 27px;
right: 27px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 10000;
height: 80px;
border-radius: 40px;
border-radius: 5px;
padding: 5px 78px 5px 5px;
background-color: #fff;
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.25),
Expand All @@ -51,98 +46,55 @@
padding: 0;
}

.dash-debug-menu__upgrade-tooltip {
position: absolute;
bottom: 100%;
right: 0;
display: flex;
flex-direction: column;
}

.dash-debug-menu__upgrade-tooltip button {
background: none;
border: none;
}

.dash-debug-menu__content {
display: flex;
width: 100%;
height: 100%;
align-items: center;
}

.dash-debug-menu__button-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 74px;
.dash-debug-menu__divider {
width: 1px;
height: 20px;
margin: 10px;
background-color: #e6e6e6;
}

.dash-debug-menu__button {
background: none;
border: none;
box-shadow: 0 1px #D3DAE6;
position: relative;
background-color: #B9C2CE;
border-radius: 100%;
width: 64px;
height: 64px;
font-size: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
transition: background-color 0.2s;
color: #fff;
cursor: pointer;
font-weight: bold;
}
.dash-debug-menu__button:hover {
background-color: #a1a9b5;
}
.dash-debug-menu__button--enabled {
background-color: #00CC96;
}
.dash-debug-menu__button.dash-debug-menu__button--enabled:hover {
background-color: #03bb8a;
color: black;
}

.dash-debug-menu__button-label {
cursor: inherit;
}

.dash-debug-menu__button::before {
visibility: hidden;
pointer-events: none;
position: absolute;
box-sizing: border-box;
bottom: 110%;
left: 50%;
margin-left: -60px;
padding: 7px;
width: 120px;
border-radius: 3px;
background-color: rgba(68,68,68,0.7);
color: #fff;
text-align: center;
font-size: 10px;
line-height: 1.2;
}
.dash-debug-menu__button:hover::before {
visibility: visible;
}
.dash-debug-menu__button--callbacks::before {
content: "Toggle Callback Graph";
}
.dash-debug-menu__button--errors::before {
content: "Toggle Errors";
}
.dash-debug-menu__button--available,
.dash-debug-menu__button--available:hover {
background-color: #00CC96;
cursor: default;
}
.dash-debug-menu__button--available::before {
content: "Server Available";
}
.dash-debug-menu__button--unavailable,
.dash-debug-menu__button--unavailable:hover {
background-color: #F1564E;
cursor: default;
}
.dash-debug-menu__button--unavailable::before {
content: "Server Unavailable. Check if the process has halted or crashed.";
}
.dash-debug-menu__button--cold,
.dash-debug-menu__button--cold:hover {
background-color: #FDDA68;
cursor: default;
.dash-debug-menu__button.dash-debug-menu__button--selected {
color: #7F4BC4;
box-shadow: 0 2px #0071C2;
}
.dash-debug-menu__button--cold::before {
content: "Hot Reload Disabled";
.dash-debug-menu__button.dash-debug-menu__button--selected:hover {
color: #5806c4;
}

.dash-debug-alert {
Expand Down
Loading