-
Notifications
You must be signed in to change notification settings - Fork 513
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
Revisions for search and trace detail embed mode #286
Conversation
Mostly from prior comments. - Rename query parameter for embedding to start with "ui" and use the page as the first word, e.g. "uiSearchHideGraph" - Change query parameters for the minimap and trace details from hiding to showing, e.g. "hidemap" -> "uiTimelineShowMap" - Save the embed query params in Redux state instead of passing them around - Use a Link with an icon instead of text buttons for opening the standalone view of the page - Propagate whether the trace detail page is from the search page or not via the Location#state member on the React Router Location - When returning to the search page use the previous results instead of executing a new search. This is done by storing the query with the search results. - Adjusted aesthetic of "Back to Search" button on trace detail page - Sequester parsing and stripping query parameters for the embed mode to a util - In various places switch to using the component/*/url.js#getUrl functions instead of prefixUrl(...) Signed-off-by: Joe Farro <[email protected]>
Signed-off-by: Joe Farro <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #286 +/- ##
==========================================
+ Coverage 81.76% 82.19% +0.42%
==========================================
Files 139 141 +2
Lines 3066 3100 +34
Branches 633 645 +12
==========================================
+ Hits 2507 2548 +41
+ Misses 448 438 -10
- Partials 111 114 +3
Continue to review full report at Codecov.
|
- Keep redux search query synced with redux search result (and their processing). Also fixes #288. - Bolster unit tests Signed-off-by: Joe Farro <[email protected]>
Signed-off-by: Joe Farro <[email protected]>
// uiEmbed=v0 | ||
// uiSearchHideGraph=1 | ||
// uiTimelineHideMap | ||
// uiTimelineHideDetails |
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.
// uiTimelineShowMap=1 to enable
// uiTimelineShowDetails=1 to enable
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js
Outdated
Show resolved
Hide resolved
packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js
Show resolved
Hide resolved
{embed ? ( | ||
<TracePageHeaderEmbed {...tracePageProps} {...tracePageEmbedProps} /> | ||
{embedded ? ( | ||
<TracePageHeaderEmbed {...headerProps} {...headerEmbeddedProps} /> |
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 component be renamed to TracePageHeaderEmbedded
to match general change from embed
to embedded
?
Hi @tiffon , I am working in one of the use of case with this...I wonder if for example in this gif if user navigate from search results to the trave view (inside an iframe) he can't change preferences to show details or minimap. What do you think about to add some buttons in the UI to enable/disable this too? |
@aljesusg Thanks for the suggestion! How about we default the minimap and details to collapsed but the user can expand the trace name to show them. This would be the default. We can also have a mode where the embed params can either disable showing the minimap and details, entirely, (each independently) or have them showing, by default? |
Maybe we should show them by default, anyway from searchtraces page you can pass the query Params related with trace pages like uiShowDetails and the UI propagate this param to the view when the user click a trace in the result. |
- Reconfigured embed query parameters for timeline: - uiTimelineCollapseTitle=1 - TracePageHeader starts out collapsed - uiTimelineHideMinimap=1 - TracePageHeader does not show the minimap - uiTimelineHideSummary=1 - TracePageHeader does not show the trace summary - Consolidate TracePageHeader and TracePageHeaderEmbed - Style changes to TracePageHeader - Embedded TracePageHeader can now be expanded and collapsed - Misc cleanup in TracePageHeader - Better comparisons for search page query to prevent re-fetching when returning to the search page Signed-off-by: Joe Farro <[email protected]>
Signed-off-by: Joe Farro <[email protected]>
Signed-off-by: Joe Farro <[email protected]>
@aljesusg Thanks for the suggestions! @everett980 Thanks for the review! I've made the following changes to the embedded mode:
Here are a few screenshots. The search page hasn't changed. Normal, header is openNormal, header is collapsedNormal with back button to return to search results, header is openNormal with back button, header is collapsedEmbedded with back button, header is openEmbedded with back button, header is collapsedEmbedded with back button, summary is hiddenEmbedded with back button, minimap is hiddenEmbedded with back button, both summary and minimap are hiddenEmbedded without a back button, collapsed |
Hi @tiffon , I tested it, nice refactor and enhancement. Thanks !!! |
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.
Looks good! There are two it specs that could hardened. Additionally, we should commit to the premise of "versioned embedding" with regards to properties such as showHortcutsHelp
. Also, there are some test data that could be a little clearer but aren't terrible as is. Aside from that, it seems ready to merge imo.
packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.test.js
Show resolved
Hide resolved
onGoFullViewClicked: this.goFullView, | ||
resultCount: findMatchesIDs ? findMatchesIDs.size : 0, | ||
showArchiveButton: !isEmbedded && archiveEnabled, | ||
showShortcutsHelp: !isEmbedded, |
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.
to follow the idea of versioned embedding, should these properties be part of the embedded state so that future versions of embedded could affect these separately? i.e.: showShortCutsHelp = embedded.showShortCutsHelp,
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.
Right now, their visibility is implicit in uiEmbed=v0
.
Down the road, if we make them configurable, then we would either add new properties to show the (but leave the default the same, which would not be a breaking change) or show them by default and add a property to hide them. The second scenario would require uiEmbed=v1
, and uiEmbed=v0
would not change.
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.
Or do you mean the properties would not be configurable but they would be in the embedded state?
|
||
it('handles a failed request', () => { | ||
const error = 'error-info'; | ||
const traces = { preExisting: Math.random() }; |
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.
here and other places:
why use Math.random()
as "filler data"? It seems as though it'd be clearer to simply write { preExistingID: 'preExistingTraceData' }
const id = 'abc'; | ||
const trace = {}; | ||
const state = { | ||
const id = 'abc'; |
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.
clearer variable names and values in such a large file could help. since this is a traceID (I believe), the variable name and value could be traceID. It interferes with object shorthand below but is clearer if there are errors.
const state = { | ||
const id = 'abc'; | ||
const trace = {}; | ||
const embedded = Math.random(); |
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 mentioned this below as well, why use Math.random()
, an equally valid, but easier to debug test value could be const embedded = 'truthy embedded value';
Signed-off-by: Joe Farro <[email protected]>
Signed-off-by: Joe Farro <[email protected]>
* Misc tweaks for search and trace detail embed mode Mostly from prior comments. - Rename query parameter for embedding to start with "ui" and use the page as the first word, e.g. "uiSearchHideGraph" - Change query parameters for the minimap and trace details from hiding to showing, e.g. "hidemap" -> "uiTimelineShowMap" - Save the embed query params in Redux state instead of passing them around - Use a Link with an icon instead of text buttons for opening the standalone view of the page - Propagate whether the trace detail page is from the search page or not via the Location#state member on the React Router Location - When returning to the search page use the previous results instead of executing a new search. This is done by storing the query with the search results. - Adjusted aesthetic of "Back to Search" button on trace detail page - Sequester parsing and stripping query parameters for the embed mode to a util - In various places switch to using the component/*/url.js#getUrl functions instead of prefixUrl(...) Signed-off-by: Joe Farro <[email protected]> * Fix test break from merging master Signed-off-by: Joe Farro <[email protected]> * Keep redux search query synced with results - Keep redux search query synced with redux search result (and their processing). Also fixes jaegertracing#288. - Bolster unit tests Signed-off-by: Joe Farro <[email protected]> * Fix typo Signed-off-by: Joe Farro <[email protected]> * Make TracePageHeader collapsible when embedded - Reconfigured embed query parameters for timeline: - uiTimelineCollapseTitle=1 - TracePageHeader starts out collapsed - uiTimelineHideMinimap=1 - TracePageHeader does not show the minimap - uiTimelineHideSummary=1 - TracePageHeader does not show the trace summary - Consolidate TracePageHeader and TracePageHeaderEmbed - Style changes to TracePageHeader - Embedded TracePageHeader can now be expanded and collapsed - Misc cleanup in TracePageHeader - Better comparisons for search page query to prevent re-fetching when returning to the search page Signed-off-by: Joe Farro <[email protected]> * Fix typo disableComparisions Signed-off-by: Joe Farro <[email protected]> * Use public registry to newly installed packages Signed-off-by: Joe Farro <[email protected]> * Test improvements Signed-off-by: Joe Farro <[email protected]> Signed-off-by: Everett Ross <[email protected]>
* Misc tweaks for search and trace detail embed mode Mostly from prior comments. - Rename query parameter for embedding to start with "ui" and use the page as the first word, e.g. "uiSearchHideGraph" - Change query parameters for the minimap and trace details from hiding to showing, e.g. "hidemap" -> "uiTimelineShowMap" - Save the embed query params in Redux state instead of passing them around - Use a Link with an icon instead of text buttons for opening the standalone view of the page - Propagate whether the trace detail page is from the search page or not via the Location#state member on the React Router Location - When returning to the search page use the previous results instead of executing a new search. This is done by storing the query with the search results. - Adjusted aesthetic of "Back to Search" button on trace detail page - Sequester parsing and stripping query parameters for the embed mode to a util - In various places switch to using the component/*/url.js#getUrl functions instead of prefixUrl(...) Signed-off-by: Joe Farro <[email protected]> * Fix test break from merging master Signed-off-by: Joe Farro <[email protected]> * Keep redux search query synced with results - Keep redux search query synced with redux search result (and their processing). Also fixes jaegertracing#288. - Bolster unit tests Signed-off-by: Joe Farro <[email protected]> * Fix typo Signed-off-by: Joe Farro <[email protected]> * Make TracePageHeader collapsible when embedded - Reconfigured embed query parameters for timeline: - uiTimelineCollapseTitle=1 - TracePageHeader starts out collapsed - uiTimelineHideMinimap=1 - TracePageHeader does not show the minimap - uiTimelineHideSummary=1 - TracePageHeader does not show the trace summary - Consolidate TracePageHeader and TracePageHeaderEmbed - Style changes to TracePageHeader - Embedded TracePageHeader can now be expanded and collapsed - Misc cleanup in TracePageHeader - Better comparisons for search page query to prevent re-fetching when returning to the search page Signed-off-by: Joe Farro <[email protected]> * Fix typo disableComparisions Signed-off-by: Joe Farro <[email protected]> * Use public registry to newly installed packages Signed-off-by: Joe Farro <[email protected]> * Test improvements Signed-off-by: Joe Farro <[email protected]> Signed-off-by: vvvprabhakar <[email protected]>
* Misc tweaks for search and trace detail embed mode Mostly from prior comments. - Rename query parameter for embedding to start with "ui" and use the page as the first word, e.g. "uiSearchHideGraph" - Change query parameters for the minimap and trace details from hiding to showing, e.g. "hidemap" -> "uiTimelineShowMap" - Save the embed query params in Redux state instead of passing them around - Use a Link with an icon instead of text buttons for opening the standalone view of the page - Propagate whether the trace detail page is from the search page or not via the Location#state member on the React Router Location - When returning to the search page use the previous results instead of executing a new search. This is done by storing the query with the search results. - Adjusted aesthetic of "Back to Search" button on trace detail page - Sequester parsing and stripping query parameters for the embed mode to a util - In various places switch to using the component/*/url.js#getUrl functions instead of prefixUrl(...) Signed-off-by: Joe Farro <[email protected]> * Fix test break from merging master Signed-off-by: Joe Farro <[email protected]> * Keep redux search query synced with results - Keep redux search query synced with redux search result (and their processing). Also fixes jaegertracing#288. - Bolster unit tests Signed-off-by: Joe Farro <[email protected]> * Fix typo Signed-off-by: Joe Farro <[email protected]> * Make TracePageHeader collapsible when embedded - Reconfigured embed query parameters for timeline: - uiTimelineCollapseTitle=1 - TracePageHeader starts out collapsed - uiTimelineHideMinimap=1 - TracePageHeader does not show the minimap - uiTimelineHideSummary=1 - TracePageHeader does not show the trace summary - Consolidate TracePageHeader and TracePageHeaderEmbed - Style changes to TracePageHeader - Embedded TracePageHeader can now be expanded and collapsed - Misc cleanup in TracePageHeader - Better comparisons for search page query to prevent re-fetching when returning to the search page Signed-off-by: Joe Farro <[email protected]> * Fix typo disableComparisions Signed-off-by: Joe Farro <[email protected]> * Use public registry to newly installed packages Signed-off-by: Joe Farro <[email protected]> * Test improvements Signed-off-by: Joe Farro <[email protected]> Signed-off-by: Everett Ross <[email protected]> Signed-off-by: vvvprabhakar <[email protected]>
Tweaks to the search page and trace timeline embedded view. Mostly from prior comments.
Rename query parameter for embedding to start with
ui
and use thepage as the first word, e.g.
uiSearchHideGraph
Change query parameters for the minimap and trace details from hiding
to showing, e.g.
hidemap
->uiTimelineShowMap
Require query parameters to configure embedded to have value=1
Save the embed query params in Redux state instead of passing them
around. Fixes [embed] Enable configuration of any view when in embed mode #279.
Use a
Link
with an icon instead of text buttons for opening thestandalone view of the page
Propagate whether the trace detail page is from the search page or
not via the
Location#state
member on the React RouterLocation
When returning to the search page use the previous results instead
of executing a new search. This is done by storing the query with
the search results.
Adjusted aesthetic of "Back to Search" button on trace detail page
Sequester parsing and stripping query parameters for the embed mode
to a util
In various places switch to using the
component/*/url.js#getUrl
functions instead of
prefixUrl(...)
Rename various component props
Keep redux search query synced with redux search result (and their
processing). Also fixes [Search] Multiple searches can cause the wrong results to show #288.
TODO
Screenshots
cc @aljesusg