-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix UI issues after introducing new button design system #43663
Changes from all commits
41cd936
1c9ab9d
c4834fd
b7ef80e
e9c95c2
533b16c
fe80e7a
78aa18e
2858d89
9f8af87
22bcef5
da09e04
9567f03
82fc8d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import ConsoleContextProvider from 'teleport/Console/consoleContextProvider'; | ||
import ConsoleContext from 'teleport/Console/consoleContext'; | ||
import { FileTransferRequest } from 'teleport/Console/DocumentSsh/useFileTransfer'; | ||
|
||
import { FileTransferRequests } from './'; | ||
|
||
export default { | ||
title: 'Shared/FileTransfer', | ||
}; | ||
|
||
export const Requests = () => { | ||
const conCtx = new ConsoleContext(); | ||
conCtx.storeUser.setState({ username: 'bob' }); | ||
return ( | ||
<ConsoleContextProvider value={conCtx}> | ||
<FileTransferRequests | ||
requests={requests} | ||
onApprove={() => {}} | ||
onDeny={() => {}} | ||
/> | ||
</ConsoleContextProvider> | ||
); | ||
}; | ||
|
||
const requests: FileTransferRequest[] = [ | ||
{ | ||
sid: 'dummy-sid', | ||
requestID: 'dummy-request-id', | ||
requester: 'alice', | ||
approvers: [], | ||
location: '/etc/teleport.yaml', | ||
download: true, | ||
}, | ||
{ | ||
sid: 'dummy-sid', | ||
requestID: 'dummy-request-id', | ||
requester: 'john', | ||
approvers: ['bob'], | ||
location: '/home/alice/.ssh/config', | ||
download: true, | ||
}, | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,14 +59,13 @@ export default class MenuActionIcon extends React.Component< | |
return ( | ||
<> | ||
<ButtonBorder | ||
height="24px" | ||
size="small" | ||
setRef={e => (this.anchorEl = e)} | ||
onClick={this.onOpen} | ||
{...buttonProps} | ||
> | ||
{this.props.buttonText || 'OPTIONS'} | ||
<ChevronDown ml={2} mr={-2} size="small" color="text.slightlyMuted" /> | ||
{this.props.buttonText || 'Options'} | ||
Comment on lines
61
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just my opinion, but it's quite distracting for me how |
||
<ChevronDown ml={2} size="small" color="text.slightlyMuted" /> | ||
</ButtonBorder> | ||
<Menu | ||
getContentAnchorEl={null} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,14 +27,7 @@ import React, { | |||||
} from 'react'; | ||||||
|
||||||
import styled from 'styled-components'; | ||||||
import { | ||||||
Box, | ||||||
Flex, | ||||||
ButtonLink, | ||||||
ButtonSecondary, | ||||||
Text, | ||||||
ButtonBorder, | ||||||
} from 'design'; | ||||||
import { Box, Flex, Button, ButtonSecondary, Text, ButtonBorder } from 'design'; | ||||||
import { Icon, Magnifier, PushPin } from 'design/Icon'; | ||||||
import { Danger } from 'design/Alert'; | ||||||
|
||||||
|
@@ -455,7 +448,9 @@ export function UnifiedResources(props: UnifiedResourcesProps) { | |||||
{resourcesFetchAttempt.statusCode !== 400 && | ||||||
resourcesFetchAttempt.statusCode !== 403 && ( | ||||||
<Box flex="0 0 auto" ml={2}> | ||||||
<ButtonLink onClick={onRetryClicked}>Retry</ButtonLink> | ||||||
<Button type="button" onClick={onRetryClicked}> | ||||||
Retry | ||||||
</Button> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This button didn't look quite right. I changed it a little bit, but it still doesn't look the best. idk what to do here, as we can't use @gzdunek Do you remember if there was a reason
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hmm it wasn't me who added that button 😅 but I agree, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I just did a quick There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to leave it as is, since it's exactly how it looks now, and one of the next steps on my roadmap is to deal with the error banners, which will include modernizing their action buttons: https://www.figma.com/design/Gpjs9vjhzUKF1GDbeG9JGE/Application-Design-System?node-id=8890-5504&m=dev |
||||||
</Box> | ||||||
)} | ||||||
</Danger> | ||||||
|
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 it shouldn't have a background on hover either. The way I think about it is that
ButtonLink
is supposed to behave just likeLink
.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.
You're probably right. I'll change it.
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'm not going to change it right now, because it breaks a bit in places where link buttons are placed on a red background (the text turns illegible). As this coincides with your another comment, I'll fix it properly after I deal with the alert banners.