-
Notifications
You must be signed in to change notification settings - Fork 419
RI-7693: Change visuals of Pub/Sub #5164
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
91d81cd
everything
pawelangelow bd947a7
remove leftover file
pawelangelow 06bce10
address styles issues
pawelangelow 9ab3bfc
use gap instead of spacers
pawelangelow 4a04e6d
more issues addressed
pawelangelow 6bcaf83
ternary instead of different component
pawelangelow 50b2e35
remove unnecessary evaluations
pawelangelow 22cf87c
RI-7693: Add patterns counting in Pub/Sub (#5165)
pawelangelow 8dc5b00
RI-7693: Add subscribe patterns explanation (#5166)
pawelangelow 245b2e4
RI-7693: Cleanup of unused components (#5167)
pawelangelow b9a4b26
address PR comments
pawelangelow 59af60d
more fixes
pawelangelow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 hidden or 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,9 @@ | ||
| import styled from 'styled-components' | ||
| import { Col } from 'uiSrc/components/base/layout/flex' | ||
|
|
||
| export const OnboardingWrapper = styled(Col)` | ||
| align-items: flex-end; | ||
| /* Custom margin for onboarding popover */ | ||
| /* TODO: Rework the positioning of the onboarding container in order to remove this */ | ||
| margin-right: 28px; | ||
| ` |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import SubscriptionPanel from './subscription-panel' | ||
| import MessagesListWrapper from './messages-list' | ||
| import PublishMessage from './publish-message' | ||
|
|
||
| export { SubscriptionPanel, MessagesListWrapper, PublishMessage } | ||
| export { MessagesListWrapper, PublishMessage } |
59 changes: 43 additions & 16 deletions
59
...i/src/pages/pub-sub/components/messages-list/EmptyMessagesList/EmptyMessagesList.spec.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -1,44 +1,71 @@ | ||
| import React from 'react' | ||
| import { ConnectionType } from 'uiSrc/slices/interfaces' | ||
| import { render } from 'uiSrc/utils/test-utils' | ||
| import { render, screen } from 'uiSrc/utils/test-utils' | ||
|
|
||
| import EmptyMessagesList from './EmptyMessagesList' | ||
|
|
||
| describe('EmptyMessagesList', () => { | ||
| it('should render', () => { | ||
| expect(render(<EmptyMessagesList isSpublishNotSupported />)).toBeTruthy() | ||
| it('renders base layout and copy', () => { | ||
| render(<EmptyMessagesList isSpublishNotSupported />) | ||
|
|
||
| expect(screen.getByTestId('empty-messages-list')).toBeInTheDocument() | ||
|
|
||
| expect(screen.getByText('You are not subscribed')).toBeInTheDocument() | ||
| expect( | ||
| screen.getByText( | ||
| /Subscribe to the Channel to see all the messages published to your database/i, | ||
| ), | ||
| ).toBeInTheDocument() | ||
|
|
||
| expect( | ||
| screen.getByText( | ||
| /Running in production may decrease performance and memory available\./i, | ||
| ), | ||
| ).toBeInTheDocument() | ||
| }) | ||
|
|
||
| it('should render cluster info for Cluster connection type', () => { | ||
| const { queryByTestId } = render( | ||
| it('shows cluster banner only when Cluster AND isSpublishNotSupported=true', () => { | ||
| // visible when both conditions true | ||
| const { rerender } = render( | ||
| <EmptyMessagesList | ||
| connectionType={ConnectionType.Cluster} | ||
| isSpublishNotSupported | ||
| />, | ||
| ) | ||
| const banner = screen.getByTestId('empty-messages-list-cluster') | ||
| expect(banner).toBeInTheDocument() | ||
| expect( | ||
| screen.getByText( | ||
| /Messages published with SPUBLISH will not appear in this channel/i, | ||
| ), | ||
| ).toBeInTheDocument() | ||
|
|
||
| expect(queryByTestId('empty-messages-list-cluster')).toBeInTheDocument() | ||
| }) | ||
|
|
||
| it(' not render cluster info for Cluster connection type', () => { | ||
| const { queryByTestId } = render( | ||
| // hide when flag is false | ||
| rerender( | ||
| <EmptyMessagesList | ||
| connectionType={ConnectionType.Cluster} | ||
| isSpublishNotSupported={false} | ||
| />, | ||
| ) | ||
| expect( | ||
| screen.queryByTestId('empty-messages-list-cluster'), | ||
| ).not.toBeInTheDocument() | ||
|
|
||
| expect(queryByTestId('empty-messages-list-cluster')).not.toBeInTheDocument() | ||
| }) | ||
|
|
||
| it('should not render cluster info for Cluster connection type', () => { | ||
| const { queryByTestId } = render( | ||
| // hide when connection is not Cluster | ||
| rerender( | ||
| <EmptyMessagesList | ||
| connectionType={ConnectionType.Standalone} | ||
| isSpublishNotSupported | ||
| />, | ||
| ) | ||
| expect( | ||
| screen.queryByTestId('empty-messages-list-cluster'), | ||
| ).not.toBeInTheDocument() | ||
|
|
||
| expect(queryByTestId('empty-messages-list-cluster')).not.toBeInTheDocument() | ||
| // also hide when connectionType is undefined | ||
| rerender(<EmptyMessagesList isSpublishNotSupported />) | ||
| expect( | ||
| screen.queryByTestId('empty-messages-list-cluster'), | ||
| ).not.toBeInTheDocument() | ||
| }) | ||
| }) |
22 changes: 22 additions & 0 deletions
22
...src/pages/pub-sub/components/messages-list/EmptyMessagesList/EmptyMessagesList.styles.tsx
This file contains hidden or 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,22 @@ | ||
| import styled from 'styled-components' | ||
| import { RiImage } from 'uiSrc/components/base/display' | ||
| import { Col, FlexItem } from 'uiSrc/components/base/layout/flex' | ||
|
|
||
| export const HeroImage = styled(RiImage)` | ||
| user-select: none; | ||
| pointer-events: none; | ||
| ` | ||
|
|
||
| export const InnerContainer = styled(Col)` | ||
| background-color: ${({ theme }) => | ||
| theme.semantic.color.background.neutral300}; | ||
| border-radius: ${({ theme }) => theme.core.space.space100}; | ||
| border: 1px solid ${({ theme }) => theme.semantic.color.border.neutral500}; | ||
| padding: ${({ theme }) => theme.core.space.space300}; | ||
| height: 100%; | ||
| ` | ||
|
|
||
| export const Wrapper = styled(FlexItem)` | ||
| margin: ${({ theme }) => theme.core.space.space500}; | ||
| height: 100%; | ||
| ` |
This file contains hidden or 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
83 changes: 0 additions & 83 deletions
83
...nsight/ui/src/pages/pub-sub/components/messages-list/EmptyMessagesList/styles.module.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.