-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add description to explorative annotations view #3035
Merged
MichaelBuessemeyer
merged 6 commits into
master
from
add-discription-to-explorative-view
Aug 13, 2018
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2328289
added a popover-link to the name of explorative annotations in the ex…
MichaelBuessemeyer a10f81c
updated changelog
MichaelBuessemeyer 1c456e9
changed changelog entry and added a tooltip to hint at the descriptio…
MichaelBuessemeyer 8585de3
Merge branch 'master' into add-discription-to-explorative-view
MichaelBuessemeyer ae849b5
fixed flow errors
MichaelBuessemeyer 77577f9
Merge branch 'master' into add-discription-to-explorative-view
MichaelBuessemeyer 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 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 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 |
---|---|---|
|
@@ -6,7 +6,7 @@ import * as React from "react"; | |
import { Link, withRouter } from "react-router-dom"; | ||
import Request from "libs/request"; | ||
import { AsyncLink } from "components/async_clickables"; | ||
import { Spin, Input, Table, Button, Modal, Tag, Icon } from "antd"; | ||
import { Spin, Input, Table, Button, Modal, Tag, Icon, Popover } from "antd"; | ||
import FormatUtils from "libs/format_utils"; | ||
import Toast from "libs/toast"; | ||
import Utils from "libs/utils"; | ||
|
@@ -336,6 +336,30 @@ class ExplorativeAnnotationsView extends React.PureComponent<Props, State> { | |
); | ||
} | ||
|
||
renderNameWithDescription(tracing: APIAnnotationType) { | ||
return ( | ||
<Popover | ||
title="Description" | ||
trigger="hover" | ||
content={ | ||
<div style={{ maxWidth: 400 }}> | ||
{tracing.description && tracing.description !== "" | ||
? tracing.description | ||
: "<no description>"} | ||
</div> | ||
} | ||
placement="topLeft" | ||
> | ||
<div> | ||
<EditableTextLabel | ||
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. Works well! However, I find it a bit weird from a UX perspective, that the popover always shows when you hover over the edit button or the name input. I'd change the structure as follows:
That way, the description is a separate thing. |
||
value={tracing.name} | ||
onChange={newName => this.renameTracing(tracing, newName)} | ||
/> | ||
</div> | ||
</Popover> | ||
); | ||
} | ||
|
||
renderTable() { | ||
return ( | ||
<Table | ||
|
@@ -356,12 +380,9 @@ class ExplorativeAnnotationsView extends React.PureComponent<Props, State> { | |
title="Name" | ||
dataIndex="name" | ||
sorter={Utils.localeCompareBy(typeHint, "name")} | ||
render={(name: string, tracing: APIAnnotationType) => ( | ||
<EditableTextLabel | ||
value={name} | ||
onChange={newName => this.renameTracing(tracing, newName)} | ||
/> | ||
)} | ||
render={(name: string, tracing: APIAnnotationType) => | ||
this.renderNameWithDescription(tracing) | ||
} | ||
/> | ||
<Column | ||
title="Stats" | ||
|
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.
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, this is a bit too detailed. I'd change it to "Added the possibility to see the description of a tracing within the dashboard."