-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
45143: ui: Release notes signup r=dhartunian a=koorosh Resolves: #43912 Depends on: #44744, #44821, #44856 - [x] WIP. Current branch has two branches merged which haven't been approved/merged in master branch yet. - [x] rebase branch to remove merge commits from branches other than master. Add Release notes signup form to Cluster Overview page right after page title. Release Notes signup view is created in `src/views/dashboard` directory because it will be the main page where we display this view. And Cluster Overview page is a temporary place while Dashboard view doesn't exist. These changes integrate three main parts: ReleaseNotesForm, AlertNotification component and custom analytics saga. 45426: coldata: minor tweak of flat bytes r=yuzefovich a=yuzefovich This commit changes `maybeBackfillOffsets` to update `maxSetIndex` accordingly (this might be a minor performance improvement). In a sense, when we're backfilling offsets, we *are* setting indices to point to empty `[]byte` slices. Also, the logic for `Set` method is slightly refactored. Release note: None Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
- Loading branch information
Showing
9 changed files
with
206 additions
and
25 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,79 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
@require '~src/components/core/index.styl' | ||
|
||
$text-width = 352px | ||
|
||
.crl-email-subscription | ||
border-radius 5px | ||
box-shadow: 0 0 1px 0 rgba(67, 90, 111, 0.41) | ||
display flex | ||
flex-direction row | ||
align-items center | ||
justify-content flex-end | ||
height 90px | ||
background-color $colors--white | ||
background-image url("../../../assets/dashboard/email_signup_background.svg") | ||
background-repeat no-repeat | ||
background-position-x $text-width | ||
|
||
&__text | ||
font-size $font-size--large | ||
font-family $font-family--base | ||
line-height 1.6 | ||
letter-spacing -0.2px | ||
color $colors--white | ||
flex-grow 1 | ||
height inherit | ||
border-radius inherit | ||
& > div | ||
max-width $text-width | ||
background $colors--primary-green-3 | ||
padding-left $spacing-large | ||
height inherit | ||
border-bottom-left-radius: inherit; | ||
border-top-left-radius: inherit; | ||
display flex | ||
align-items center | ||
|
||
|
||
&__controls | ||
flex-grow 0 | ||
margin-left $spacing-medium | ||
|
||
&__close-button | ||
flex-grow 0 | ||
color $colors--neutral-7 | ||
align-self flex-start | ||
margin $spacing-smaller $spacing-small $spacing-small $spacing-medium | ||
cursor pointer | ||
font-size $font-size--large | ||
line-height $spacing-smaller | ||
font-weight $font-weight--extra-bold | ||
|
||
|
||
@media (max-width: 1055px) { | ||
background-position center | ||
|
||
.crl-email-subscription__text { | ||
font-size $font-size--tall | ||
font-family $font-family--base | ||
line-height 1.6 | ||
} | ||
} | ||
|
||
@media (max-width: 940px) { | ||
background-position left | ||
|
||
.crl-email-subscription__text { | ||
display none | ||
} | ||
} |
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,87 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
import React from "react"; | ||
import { connect } from "react-redux"; | ||
|
||
import { EmailSubscriptionForm } from "src/views/shared/components/emailSubscriptionForm"; | ||
import { signUpForEmailSubscription } from "src/redux/customAnalytics"; | ||
import { AdminUIState } from "src/redux/state"; | ||
import { clusterIdSelector } from "src/redux/nodes"; | ||
import { LocalSetting } from "src/redux/localsettings"; | ||
|
||
import "./emailSubscription.styl"; | ||
|
||
type EmailSubscriptionProps = MapDispatchToProps & MapStateToProps; | ||
|
||
class EmailSubscription extends React.Component<EmailSubscriptionProps> { | ||
handleEmailSubscriptionSubmit = (email: string) => { | ||
this.props.signUpForEmailSubscription(this.props.clusterId, email); | ||
} | ||
|
||
handlePanelHide = () => { | ||
this.props.hidePanel(); | ||
} | ||
|
||
render() { | ||
const { isHiddenPanel } = this.props; | ||
|
||
if (isHiddenPanel) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<section className="section"> | ||
<div className="crl-email-subscription"> | ||
<div className="crl-email-subscription__text"> | ||
<div> | ||
Keep up-to-date with CockroachDB | ||
software releases and best practices. | ||
</div> | ||
</div> | ||
<div className="crl-email-subscription__controls"> | ||
<EmailSubscriptionForm onSubmit={this.handleEmailSubscriptionSubmit} /> | ||
</div> | ||
<div | ||
onClick={this.handlePanelHide} | ||
className="crl-email-subscription__close-button" | ||
> | ||
× | ||
</div> | ||
</div> | ||
</section> | ||
); | ||
} | ||
} | ||
|
||
const hidePanelLocalSetting = new LocalSetting<AdminUIState, boolean>( | ||
"dashboard/release_notes_signup/hide", (s) => s.localSettings, false, | ||
); | ||
|
||
interface MapDispatchToProps { | ||
signUpForEmailSubscription: (clusterId: string, email: string) => void; | ||
hidePanel: () => void; | ||
} | ||
|
||
const mapDispatchToProps = { | ||
signUpForEmailSubscription, | ||
hidePanel: () => hidePanelLocalSetting.set(true), | ||
}; | ||
|
||
interface MapStateToProps { | ||
isHiddenPanel: boolean; | ||
clusterId: string; | ||
} | ||
const mapStateToProps = (state: AdminUIState) => ({ | ||
isHiddenPanel: hidePanelLocalSetting.selector(state), | ||
clusterId: clusterIdSelector(state), | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(EmailSubscription); |