Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e52b41
adjust some spacings and alignment around the dividers in the lower s…
dantovska Oct 30, 2025
3ef2e68
increase footer button sizes
dantovska Oct 30, 2025
38f1b91
replace the hard coded asterisk with required; add space between forms
dantovska Oct 30, 2025
8965d43
replace the Arrow Left icon <- with Chevron icon <
dantovska Oct 30, 2025
e22c169
add the info icon
dantovska Oct 30, 2025
d066e33
attempt to fix the double scroll layout issue
dantovska Oct 31, 2025
405b66b
remove unused divider class
dantovska Oct 31, 2025
1d5f455
fix margin for tls details
dantovska Oct 31, 2025
558dc4f
fix spacing around security items
dantovska Oct 31, 2025
30b8d09
adjust decompression and formatters tab spacing
dantovska Oct 31, 2025
f2a8aec
adjust spacings and required fields in ssh and tls details
dantovska Oct 31, 2025
b8df8c7
adjust spacings in the edit db connectivity settings
dantovska Oct 31, 2025
81fb8c8
decrease spacer below private key / pass radio
dantovska Oct 31, 2025
ee2bd6e
adjust spacings and dividers to reduce space and not cause extra scrolls
dantovska Nov 3, 2025
9c61a9d
use text for the label to make the format match the designs
dantovska Nov 3, 2025
a1f6f1b
decrease some spacings
dantovska Nov 3, 2025
31352be
remove the "should not exceed constraint"
dantovska Nov 3, 2025
7a82d82
wrap the checkbox in form field
dantovska Nov 3, 2025
3b5cc8f
add styles to modal content to spread through the whole content conta…
dantovska Nov 3, 2025
b9b7538
revert accidentally commited default formatter settings
dantovska Nov 3, 2025
560c00d
fix tests
dantovska Nov 3, 2025
ff95d79
refactor the Divider component to be styled and replace all its occur…
dantovska Nov 4, 2025
d7acc15
move the flex:1 style to the modal body instead of compose
dantovska Nov 3, 2025
db7066a
remove not needed important
dantovska Nov 3, 2025
9b74ea8
change the info icon props interface import to come from LabelProps p…
dantovska Nov 3, 2025
7aef523
make divider props optional
dantovska Nov 4, 2025
501dcf7
create host info tooltip content component
dantovska Nov 4, 2025
8be608b
reaplce the new tooltip content in all occurences
dantovska Nov 4, 2025
5692f71
get rid of unneeded classes
dantovska Nov 4, 2025
9591d7a
fix test Database Alias -> Database alias
dantovska Nov 4, 2025
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
18 changes: 13 additions & 5 deletions redisinsight/ui/src/components/base/forms/FormField.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import React, { ComponentProps } from 'react'
import { FormField as RedisFormField, TooltipProvider } from '@redis-ui/components'
import {
FormField as RedisFormField,
TooltipProvider,
LabelProps,
} from '@redis-ui/components'

export type RiInfoIconProps = LabelProps['infoIconProps']

export type RedisFormFieldProps = ComponentProps<typeof RedisFormField> & {
infoIconProps?: any
infoIconProps?: RiInfoIconProps
}

export function FormField(props: RedisFormFieldProps) {
// eslint-disable-next-line react/destructuring-assignment
if (props.infoIconProps) {
return <TooltipProvider>
<RedisFormField {...props} />
</TooltipProvider>
return (
<TooltipProvider>
<RedisFormField {...props} />
</TooltipProvider>
)
}
return <RedisFormField {...props} />
}
4 changes: 2 additions & 2 deletions redisinsight/ui/src/components/divider/Divider.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { instance, mock } from 'ts-mockito'
import { render } from 'uiSrc/utils/test-utils'
import Divider, { Props } from './Divider'
import Divider, { DividerProps } from './Divider'

const mockedProps = mock<Props>()
const mockedProps = mock<DividerProps>()

describe('Divider', () => {
it('should render', () => {
Expand Down
57 changes: 57 additions & 0 deletions redisinsight/ui/src/components/divider/Divider.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { HTMLAttributes } from 'react'
import styled, { css } from 'styled-components'

export type DividerVariant = 'fullWidth' | 'half'
export type DividerOrientation = 'horizontal' | 'vertical'

const dividerStyles = {
orientation: {
horizontal: css`
width: 100%;
height: 1px;
`,
vertical: css`
width: 1px;
height: 100%;
`,
},
variant: {
fullWidth: {
horizontal: css``,
vertical: css``,
},
half: {
horizontal: css`
width: 50%;
`,
vertical: css`
height: 50%;
`,
},
},
}

export interface StyledDividerProps extends HTMLAttributes<HTMLHRElement> {
$color?: string
$orientation?: DividerOrientation
$variant?: DividerVariant
}

export const StyledDividerWrapper = styled.div<HTMLAttributes<HTMLDivElement>>`
display: flex;
align-items: center;
justify-content: center;
`

export const StyledDivider = styled.hr<StyledDividerProps>`
border: none;
background-color: ${({
theme,
$color = theme.semantic.color.background.neutral500,
}) => $color};

${({ $orientation = 'horizontal' }) =>
dividerStyles.orientation[$orientation]}
${({ $variant = 'fullWidth', $orientation = 'horizontal' }) =>
dividerStyles.variant[$variant][$orientation]}
`
43 changes: 17 additions & 26 deletions redisinsight/ui/src/components/divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
import React from 'react'
import cx from 'classnames'

import styles from './styles.module.scss'
import {
StyledDividerWrapper,
StyledDivider,
DividerVariant,
DividerOrientation,
} from './Divider.styles'

export interface Props {
export interface DividerProps {
orientation?: DividerOrientation
variant?: DividerVariant
color?: string
colorVariable?: string
orientation?: 'horizontal' | 'vertical'
variant?: 'fullWidth' | 'middle' | 'half'
className?: string
style?: any
}

const Divider = ({
orientation,
variant,
className,
color,
colorVariable,
className,
...props
}: Props) => (
<div
className={cx(
styles.divider,
styles[`divider-${variant || 'fullWidth'}`],
styles[`divider-${orientation || 'horizontal'}`],
className,
)}
{...props}
>
<hr
style={
color || colorVariable
? { backgroundColor: color ?? `var(--${colorVariable})` }
: {}
}
}: DividerProps) => (
<StyledDividerWrapper {...props}>
<StyledDivider
$variant={variant}
$orientation={orientation}
$color={color}
/>
</div>
</StyledDividerWrapper>
)

export default Divider
39 changes: 0 additions & 39 deletions redisinsight/ui/src/components/divider/styles.module.scss

This file was deleted.

15 changes: 15 additions & 0 deletions redisinsight/ui/src/components/form-dialog/FormDialog.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import styled from 'styled-components'
import { Modal } from 'uiSrc/components/base/display/modal'

export const StyledFormDialogContent = styled(Modal.Content.Compose)`
width: 900px;
height: 700px;

max-width: calc(100vw - 120px);
max-height: calc(100vh - 120px);
`

export const StyledFormDialogContentBody = styled(Modal.Content.Body)`
flex: 1;
min-height: 0;
`
14 changes: 8 additions & 6 deletions redisinsight/ui/src/components/form-dialog/FormDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react'
import cx from 'classnames'

import { Nullable } from 'uiSrc/utils'
import { CancelIcon } from 'uiSrc/components/base/icons'
import { Modal } from 'uiSrc/components/base/display'
import styles from './styles.module.scss'
import {
StyledFormDialogContent,
StyledFormDialogContentBody,
} from './FormDialog.styles'

export interface Props {
isOpen: boolean
Expand All @@ -22,16 +24,16 @@ const FormDialog = (props: Props) => {

return (
<Modal.Compose open={isOpen}>
<Modal.Content.Compose
<StyledFormDialogContent
persistent
className={cx(styles.modal, className)}
className={className}
onCancel={onClose}
>
<Modal.Content.Close icon={CancelIcon} onClick={onClose} />
<Modal.Content.Header.Title>{header}</Modal.Content.Header.Title>
<Modal.Content.Body content={children} />
<StyledFormDialogContentBody content={children} />
<Modal.Content.Footer.Compose>{footer}</Modal.Content.Footer.Compose>
</Modal.Content.Compose>
</StyledFormDialogContent>
</Modal.Compose>
)
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const INFINITE_MESSAGES: InfiniteMessagesType = {
{!!details && (
<>
<Spacer size="m" />
<Divider variant="fullWidth" />
<Divider />
<Spacer size="m" />
<Row className={styles.detailsRow} justify="between">
<FlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const BulkActionsInfo = (props: Props) => {
)}
</Row>
</Col>
<Divider colorVariable="separatorColor" />
<Divider />
{loading && (
<BulkActionsProgressLine data-testid="progress-line">
<div style={{ width: `${(total ? scanned / total : 0) * 100}%` }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const HashDetails = (props: Props) => {
/>
<Divider
className={styles.divider}
colorVariable="separatorColor"
orientation="vertical"
/>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const KeyDetailsSubheader = ({ keyType, Actions }: Props) => (
</FlexItem>
<Divider
className={styles.divider}
colorVariable="separatorColor"
orientation="vertical"
/>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,28 @@
import React from 'react'
import styled from 'styled-components'

import { FormField } from 'uiSrc/components/base/forms/FormField'
import {
FormField,
RiInfoIconProps,
} from 'uiSrc/components/base/forms/FormField'
import { TextArea } from 'uiSrc/components/base/inputs'
import { RiIcon } from 'uiSrc/components/base/icons/RiIcon'
import { RiTooltip } from 'uiSrc/components'
import { FlexGroup, FlexItem } from 'uiSrc/components/base/layout/flex'
import { Text } from 'uiSrc/components/base/text'

const PointerIcon = styled(RiIcon)`
cursor: pointer;
`
import { HostInfoTooltipContent } from '../../../host-info-tooltip-content/HostInfoTooltipContent'

export interface Props {
value: string
onChange: (e: React.ChangeEvent<any>) => void
}

const connectionUrlInfo: RiInfoIconProps = {
content: HostInfoTooltipContent({ includeAutofillInfo: false }),
placement: 'right',
maxWidth: '100%',
}

const ConnectionUrl = ({ value, onChange }: Props) => (
<FormField
label={
<FlexGroup gap="s" align="center">
<Text>Connection URL</Text>
<RiTooltip
title="The following connection URLs are supported:"
className="homePage_tooltip"
position="right"
content={
<ul className="homePage_toolTipUl">
<li>
<span className="dot" />
redis://[[username]:[password]]@host:port
</li>
<li>
<span className="dot" />
rediss://[[username]:[password]]@host:port
</li>
<li>
<span className="dot" />
host:port
</li>
</ul>
}
>
<FlexItem>
<PointerIcon type="InfoIcon" />
</FlexItem>
</RiTooltip>
</FlexGroup>
}
label={<Text>Connection URL</Text>}
infoIconProps={connectionUrlInfo}
>
<TextArea
name="connectionURL"
Expand Down
Loading
Loading