-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Fix CodeLocationSource in flex container (#24422)
## Summary & Motivation The CodeLocationSource button is stretching when rendered in a flex container. Wrap it in a div. Created a storybook example to demo the different possibilities of the component. <img width="209" alt="Screenshot 2024-09-11 at 16 44 00" src="https://github.com/user-attachments/assets/6f736caf-915b-4993-b7f1-1f6ab74475c8"> ## How I Tested These Changes Storybook ## Changelog - [ ] `BUGFIX` [ui] Fixed broken code location URL button rendering.
- Loading branch information
Showing
2 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
24 changes: 24 additions & 0 deletions
24
...ules/dagster-ui/packages/ui-core/src/workspace/__stories__/CodeLocationSource.stories.tsx
This file contains 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,24 @@ | ||
import {Box} from '@dagster-io/ui-components'; | ||
import {Meta} from '@storybook/react'; | ||
|
||
import {CodeLocationSource} from '../CodeLocationSource'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default { | ||
title: 'CodeLocationSource', | ||
component: CodeLocationSource, | ||
} as Meta; | ||
|
||
export const Default = () => { | ||
return ( | ||
<Box flex={{direction: 'column', gap: 20}}> | ||
<CodeLocationSource metadata={[]} /> | ||
<CodeLocationSource metadata={[{key: 'url', value: 'not-a-url'}]} /> | ||
<CodeLocationSource | ||
metadata={[{key: 'url', value: 'https://github.com/dagster-io/dagster'}]} | ||
/> | ||
<CodeLocationSource metadata={[{key: 'url', value: 'https://gitlab.com/foo-bar'}]} /> | ||
<CodeLocationSource metadata={[{key: 'url', value: 'https://zombo.com'}]} /> | ||
</Box> | ||
); | ||
}; |
54a8201
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.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-j79yinq7c-elementl.vercel.app
Built with commit 54a8201.
This pull request is being automatically deployed with vercel-action