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

ui: Release notes signup - Show Alert notification after signup #44856

Merged

Conversation

koorosh
Copy link
Collaborator

@koorosh koorosh commented Feb 7, 2020

Resolves: #43912

Existing AlertBox component doesn't fit to new designs from Design system,
so new one is added as a wrapper on top of Ant design component.
The major problem which occur is how to integrate new AlertMessage component
to live with old one and do not affect each other behaviour.
To achieve this:

  • AlertMessage component (new one) has the same set of properties. As result it will allow easily consume old alert messages by new component.
  • To preserve old messages without any changes, one additional property is
    added to specify which Alert component to show, old or new one.
  • Current implementation reuses existing logic where we store state of alert in
    local settings instead of redux store.

@koorosh koorosh requested a review from a team February 7, 2020 13:37
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Existing AlertBox component doesn't fit to new designs from Design system,
so new one is added as a wrapper on top of Ant design component.
The major problem which occur is how to integrate new AlertMessage component
to live with old one and do not affect each other behaviour.
To achieve this:
- AlertMessage component (new one) has the same set of properties. As result it will allow easily consume old alert messages by new component.
- To preserve old messages without any changes, one additional property is
added to specify which Alert component to show, old or new one.
- Current implementation reuses existing logic where we store state of alert in
local settings instead of redux store.

Release note: None
Create localSetting selector to preserve alert state (open/closed) for
email subscription notification.
Selector is added to the `bannerAlertsSelector` because it is used to
display global alerts.

Release note: None
@koorosh koorosh force-pushed the ui-release-notes-signup__alert-notification branch from 437fc01 to 6404cd1 Compare February 17, 2020 10:28
And alerts by default is positioned on the top left
and this position is overridden with margin values
to put alert on right side. But after user closes alert,
it's closing with animation and new margins which
make alert jump from right to left side.
To fix this, we need to override margins with !important.

Release note: None
@koorosh koorosh mentioned this pull request Feb 18, 2020
2 tasks
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

import React from "react";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused as to which new components go in src/views/shared/components and which ones in /src/components? I assumed all new work would go in the second directory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dhartunian , I also thought it has to be in /src/components, but this component is implemented in such a way to be compatible (reuse the same interface as another AlertBox component).
This required to use react-router-dom lib and reference to import { AlertInfo, AlertLevel } from "src/redux/alerts" inside component.
With all of this dependencies it doesn't look like pure component so I decided to put in shared components.

};

export class AlertMessage extends React.Component<AlertMessageProps> {
static defaultProps: Partial<AlertMessageProps> = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this defaultProps necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, not necessary! Has to be cleaned up.

@@ -50,6 +51,9 @@ export interface Alert extends AlertInfo {
// ThunkAction which will result in this alert being dismissed. This
// function will be dispatched to the redux store when the alert is dismissed.
dismiss: ThunkAction<Promise<void>, AdminUIState, void>;
// Makes alert to be positioned in the top right corner of the screen instead of
// stretching to full width.
showAsAlert?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this be a bit more specific? maybe say showAsAlertMessage. This is a bit vague and confusing since the word alert appears everywhere.

// dismiss alert
const alert = emailSubscriptionAlertSelector(state());
await alert.dismiss(dispatch, state);
const dismissedState = emailSubscriptionAlertLocalSetting.selector(state());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think this should also be openState? It reads a bit weird to dismiss the alert and then check that dismissedState isFalse. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hah, good point! Thank you!

@dhartunian
Copy link
Collaborator

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 25, 2020

Build succeeded

@craig craig bot merged commit 7b4af8c into cockroachdb:master Feb 25, 2020
craig bot pushed a commit that referenced this pull request Feb 28, 2020
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

45455: clusterversion: significantly rework cluster version handling r=tbg a=irfansharif

We split off ClusterVersion out of pkg/settings/cluster into a dedicated
pkg/clusterversion. This is to pave the way for #39182 where we
introduce long running version migration infrastructure.

We then introduce clusterversion.Handle as a read only view to the
active cluster version and this binary's version details. We similarly
fold in the actual global cluster version setting into
pkg/clusterversion, and enforce all external usage to go through
clusterversion.Handle. We can also hide away external usage of the baked
in cluster.Binary{,MinimumSupported}Version constants. Instead we have
the implementation of clusterversion.Handle allow for tests to override
binary and minimum supported versions as needed.

Along the way we clean up Settings.Initialized, as it is not really
used. We document all the various "versions" in play ("binary version",
    "minimum supported version", "active version") and change usage of what
was previously "serverVersion" to simply be "binaryVersion", because
that's what it is. We also clean up the Settings constructors into
Test/Non-Test types that differ in cluster version setting
initialization behaviour.

---

For reviewers: It's probably easiest to start with what 
pkg/settings/cluster/cluster_settings.go looks like, then following into
pkg/clusterversion/cluster_version.go and then pkg/clusterversion/setting.go.

---

I still don't like the following detail about our pkg structure:

- pkg/settings/cluster depends on it's "parent" pkg, pkg/settings
- pkg/settings/cluster depends pkg/clusterversion, which in turn depends
on pkg/settings

Naively, pkg/settings/cluster should be a top level package, but I'm not
making that change in this PR. For now I've renamed the settings.go file
to cluster_settings.go.

Release note: None


45535: Revert "storage,libroach: update MVCCIncrementalIterator to look at every updated key" r=pbardea a=pbardea

Reverts #45163

To stop the errors we're seeing on #45524. Will investigate further once it's off master.

Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
Co-authored-by: Daniel Harrison <daniel.harrison@gmail.com>
Co-authored-by: Paul Bardea <pbardea@gmail.com>
craig bot pushed a commit that referenced this pull request Feb 28, 2020
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: add release notes signup to admin UI
3 participants