This repository was archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Directory sharing menu item #952
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6b5eb60
Adds directory sharing flag to the ACL, protected by a config variable
991b142
Adds a basic structure for the directory sharing menu, updates some e…
237aa3a
updating storybook
1bb13d2
Merge branch 'master' into isaiah/dir-sharing-button
56c8803
reverting 0.3 to .3
ce325f3
adds tooltips
5a92c59
updating snapshots
673b254
cleaning up tdp client api further
cc9c443
adding note to self
7cf9335
adding new icons to storybook
c393f47
Simplifying props
46cb5d7
Merge branch 'master' into isaiah/dir-sharing-button
695b551
simplifying logic
356e911
Merge branch 'master' into isaiah/dir-sharing-button
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -16,12 +16,20 @@ limitations under the License. | |
| import React from 'react'; | ||
| import styled, { useTheme } from 'styled-components'; | ||
| import { Text, TopNav, Flex } from 'design'; | ||
| import { Clipboard } from 'design/Icon'; | ||
| import { Clipboard, FolderShared } from 'design/Icon'; | ||
| import { colors } from 'teleport/Console/colors'; | ||
| import ActionMenu from './ActionMenu'; | ||
|
|
||
| export default function TopBar(props: Props) { | ||
| const { userHost, clipboard, recording, onDisconnect } = props; | ||
| const { | ||
| userHost, | ||
| clipboardSharingEnabled, | ||
| isRecording, | ||
| onDisconnect, | ||
| canShareDirectory, | ||
| isSharingDirectory, | ||
| onShareDirectory, | ||
| } = props; | ||
| const theme = useTheme(); | ||
|
|
||
| const primaryOnTrue = (b: boolean): any => { | ||
|
|
@@ -42,30 +50,45 @@ export default function TopBar(props: Props) { | |
| {userHost} | ||
| </Text> | ||
|
|
||
| <Text | ||
| style={{ | ||
| ...primaryOnTrue(clipboard), | ||
| verticalAlign: 'text-bottom', | ||
| }} | ||
| > | ||
| <StyledClipboard style={primaryOnTrue(clipboard)} pr={2} /> | ||
| Clipboard Sharing {clipboard ? 'Enabled' : 'Disabled'} | ||
| </Text> | ||
|
|
||
| <Flex px={3}> | ||
| <Flex alignItems="center"> | ||
| <StyledRecordingIndicator | ||
| style={{ | ||
| backgroundColor: recording | ||
| ? theme.colors.error.light | ||
| : theme.colors.text.secondary, | ||
| }} | ||
| <StyledFolderShared | ||
| style={primaryOnTrue(isSharingDirectory)} | ||
| pr={3} | ||
| title={ | ||
| isSharingDirectory | ||
| ? 'Directory Sharing Enabled' | ||
| : 'Directory Sharing Disabled' | ||
| } | ||
| /> | ||
| <Text style={primaryOnTrue(recording)}> | ||
| {recording ? '' : 'Not '}Recording | ||
| </Text> | ||
| <StyledClipboard | ||
| style={primaryOnTrue(clipboardSharingEnabled)} | ||
| pr={3} | ||
| title={ | ||
| clipboardSharingEnabled | ||
| ? 'Clipboard Sharing Enabled' | ||
| : 'Clipboard Sharing Disabled' | ||
| } | ||
| /> | ||
| <Flex | ||
| title={isRecording ? 'Recording In Progress' : 'Not Recording'} | ||
| alignItems="center" | ||
| > | ||
| <StyledRecordingIndicator | ||
| style={{ | ||
| backgroundColor: isRecording | ||
| ? theme.colors.error.light | ||
| : theme.colors.text.secondary, | ||
| }} | ||
| /> | ||
| <Text style={primaryOnTrue(isRecording)}>Recording</Text> | ||
| </Flex> | ||
| </Flex> | ||
| <ActionMenu onDisconnect={onDisconnect} /> | ||
| <ActionMenu | ||
| onDisconnect={onDisconnect} | ||
| showShareDirectory={canShareDirectory && !isSharingDirectory} | ||
| onShareDirectory={onShareDirectory} | ||
| /> | ||
| </Flex> | ||
| </TopNav> | ||
| ); | ||
|
|
@@ -79,6 +102,12 @@ const StyledClipboard = styled(Clipboard)` | |
| align-self: 'center'; | ||
| `; | ||
|
|
||
| const StyledFolderShared = styled(FolderShared)` | ||
| font-weight: ${({ theme }) => theme.fontWeights.bold}; | ||
| font-size: ${({ theme }) => theme.fontSizes[6] + 'px'}; | ||
|
Comment on lines
+106
to
+107
Contributor
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 like this, we should be doing this more to keep in line with our theme @rudream |
||
| align-self: 'center'; | ||
| `; | ||
|
|
||
| const StyledRecordingIndicator = styled.div` | ||
| width: 10px; | ||
| height: 10px; | ||
|
|
@@ -89,7 +118,10 @@ const StyledRecordingIndicator = styled.div` | |
|
|
||
| type Props = { | ||
| userHost: string; | ||
| clipboard: boolean; | ||
| recording: boolean; | ||
| clipboardSharingEnabled: boolean; | ||
| isRecording: boolean; | ||
| canShareDirectory: boolean; | ||
| isSharingDirectory: boolean; | ||
| onDisconnect: VoidFunction; | ||
| onShareDirectory: VoidFunction; | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.