-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
feat: Create dataset header component #21189
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21189 +/- ##
==========================================
- Coverage 66.61% 66.59% -0.02%
==========================================
Files 1791 1791
Lines 68542 68554 +12
Branches 7318 7319 +1
==========================================
- Hits 45656 45653 -3
- Misses 20987 21008 +21
+ Partials 1899 1893 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Storybook has completed and can be viewed at |
/testenv up |
@lyndsiWilliams Ephemeral environment spinning up at http://54.213.235.192:8080. Credentials are |
tooltip={tooltipProps?.text ?? undefined} | ||
placement={tooltipProps?.placement ?? undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tooltip={tooltipProps?.text ?? undefined} | |
placement={tooltipProps?.placement ?? undefined} | |
tooltip={tooltipProps?.text} | |
placement={tooltipProps?.placement} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in this commit
.
@@ -19,6 +19,7 @@ | |||
import React, { ReactNode, ReactElement } from 'react'; | |||
import { css, SupersetTheme, t, useTheme } from '@superset-ui/core'; | |||
import { AntdDropdown, AntdDropdownProps } from 'src/components'; | |||
import { TooltipPlacement } from 'antd/es/tooltip'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind exporting this from the Tooltip component in our components library and then importing it here? I think we should centralize all the components related things and avoid accessing antd directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking! Fixed in this commit
.
import AddDataset from 'src/views/CRUD/data/dataset/AddDataset'; | ||
|
||
describe('AddDataset', () => { | ||
it('renders a blank state AddDataset', () => { | ||
render(<AddDataset />); | ||
const renderAndWait = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the purpose here to wait until the component has finished loading, you can use something like this
const waitForRender = () => waitFor(() => render(<AddDataset />));
await waitForRender();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah that's a lot cleaner! Fixed in this commit
.
|
||
const editableTitleProps = { | ||
title: '', | ||
placeholder: 'Add the name of the dataset', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all the text in this file needs to be localized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, fixed in this commit
.
placement: 'bottomRight', | ||
}; | ||
|
||
const Styles = styled.div` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this go into styles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah good call, fixed in this commit
.
} | ||
`; | ||
|
||
const disabledSaveBtnStyles = (theme: SupersetTheme) => css` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed in this commit
.
|
||
export default function Header() { | ||
return <div>Header</div>; | ||
return ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, quick question in regards to the save button. What happens, currently, when I press save? I believe that we have a state action that is supposed to put the name into state. Does it currently do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I have the data properly flowing now in this commit
.
/testenv up |
@geido Ephemeral environment spinning up at http://35.91.130.23:8080. Credentials are |
expect(saveButton).toBeVisible(); | ||
expect(saveButton).toBeDisabled(); | ||
expect(menuButton).toBeVisible(); | ||
expect(menuButton).toBeDisabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a test for when someone passes in a name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do! Added in this commit
.
expect(screen.getByText(/header/i)).toBeVisible(); | ||
const waitForRender = () => | ||
waitFor(() => | ||
render(<Header setDataset={mockSetDataset} datasetName="" />), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a test to make sure if datasetName
is set that value of the textbox renders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/testenv up |
@jinghua-qa Ephemeral environment spinning up at http://35.91.138.110:8080. Credentials are |
LGTM |
c3a9485
to
1389b8b
Compare
Ephemeral environment shutdown and build artifacts deleted. |
Any possibility this induces #21476? |
SUMMARY
This is the blank state implementation of the header component for the create dataset page. This PR also adds an option tooltip to the button in the
PageHeaderWithActions
component.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:
AFTER:
TESTING INSTRUCTIONS
http://localhost:9000/dataset/add/?testing
enter
or clicking out of the boxADDITIONAL INFORMATION