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

refactor(ui/v2): Update icons and search bars on schema tab, glossary search, domain search #12740

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asikowitz
Copy link
Collaborator

@asikowitz asikowitz commented Feb 26, 2025

Also:

  • Refactors debounce logic
  • Changes Button and Input components to take all IconProps, so they can use phosphor icons
  • Replaces all SearchOutlined icons with Icon component: phosphor MagnifyingGlass

Screenshot 2025-02-26 at 3 30 51 PM
Screenshot 2025-02-26 at 3 31 00 PM
Screenshot 2025-02-26 at 3 30 56 PM

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Feb 26, 2025
@@ -43,7 +46,7 @@ const meta = {
},
color: {
description: 'The color of the Button.',
options: ['violet', 'green', 'red', 'blue', 'gray'],
options: ['violet', 'green', 'red', 'gray'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Request from Anna (no blue buttons)

table: {
defaultValue: { summary: buttonDefaults.size },
},
control: {
type: 'select',
},
},
iconSize: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Attached to icon now. Unfortunately, storybook doesn't have great support for nested fields: storybookjs/storybook#12078

icon: {
description: 'The icon to display in the Button.',
type: 'string',
options: AVAILABLE_ICONS,
mapping: Object.fromEntries([
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maps options to props for Button component

@@ -167,7 +161,7 @@ type Story = StoryObj<typeof meta>;
// Pass props to this so that it can be customized via the UI props panel
export const sandbox: Story = {
tags: ['dev'],
render: (props) => <Button {...props}>Button</Button>,
render: (props) => <Button {...props} />,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Properly set children

@@ -81,7 +81,7 @@ const getButtonColorStyles = (variant: ButtonVariant, color: ColorOptions): Colo

bgColor: colors.transparent,
borderColor: colors.transparent,
hoverBgColor: colors.transparent,
hoverBgColor: colors.gray[1500],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Request from Anna: adds light gray on hover of "text" buttons

Comment on lines +170 to +171
vertical: 6,
horizontal: 6,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not actually used but this seems more appropriate

if (isCircle) return { padding: spacing.xsm };
if (!hasChildren) return { padding: spacing.xsm };
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Custom padding for buttons that are just icons

@@ -208,7 +190,7 @@ const getButtonPadding = (size: SizeOptions, variant: ButtonVariant, isCircle: b

const selectedStyle = paddingStyles[size];
const verticalPadding = selectedStyle.vertical;
const horizontalPadding = variant === 'text' ? 0 : selectedStyle.horizontal;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding padding back to text buttons after talking to Anna

import React from 'react';
import { StyledSearchBar } from './components';
import { SearchBarProps } from './types';

export const searchBarDefaults: SearchBarProps = {
placeholder: 'Search...',
value: '',
width: '272px',
width: '100%',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Default to 100% instead, I do make the corresponding change in StructuredProperties.tsx

Copy link
Collaborator

Choose a reason for hiding this comment

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

anywhere else this was used that was banking on that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just that and SchemaSearchInput which now passes in width=300px

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ignore me, I just added that too. Only place it was used is StructuredProperties

@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Feb 26, 2025
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

looks good to me!

import React from 'react';
import { StyledSearchBar } from './components';
import { SearchBarProps } from './types';

export const searchBarDefaults: SearchBarProps = {
placeholder: 'Search...',
value: '',
width: '272px',
width: '100%',
Copy link
Collaborator

Choose a reason for hiding this comment

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

anywhere else this was used that was banking on that?

@asikowitz asikowitz added merge-pending-ci A PR that has passed review and should be merged once CI is green. and removed needs-review Label for PRs that need review from a maintainer. labels Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-pending-ci A PR that has passed review and should be merged once CI is green. product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants