Skip to content
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

Merged
merged 11 commits into from
Dec 20, 2018
Merged

Conversation

tiffon
Copy link
Member

@tiffon tiffon commented Nov 30, 2018

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 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

  • 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 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(...)

  • 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

  • Bolster test coverage

Screenshots

screen shot 2018-11-30 at 3 31 52 am

screen shot 2018-11-30 at 3 32 14 am

screen shot 2018-11-30 at 3 33 33 am

screen shot 2018-11-30 at 3 34 00 am

screen shot 2018-11-30 at 3 34 08 am

screen shot 2018-11-30 at 3 34 17 am

screen shot 2018-11-30 at 3 34 56 am

cc @aljesusg

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 <joef@uber.com>
@ghost ghost assigned tiffon Nov 30, 2018
@ghost ghost added the review label Nov 30, 2018
@codecov
Copy link

codecov bot commented Dec 2, 2018

Codecov Report

Merging #286 into master will increase coverage by 0.42%.
The diff coverage is 67.56%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/jaeger-ui/src/components/App/index.js 100% <ø> (ø) ⬆️
...racePage/TracePageHeader/SpanGraph/ViewingLayer.js 92.85% <ø> (ø)
...s/SearchTracePage/SearchResults/ResultItemTitle.js 80% <ø> (ø) ⬆️
...ts/TracePage/TracePageHeader/SpanGraph/Scrubber.js 100% <ø> (ø)
...ePage/TracePageHeader/SpanGraph/CanvasSpanGraph.js 100% <ø> (ø)
...ts/TracePage/TracePageHeader/TracePageSearchBar.js 75% <ø> (ø)
.../TracePage/TracePageHeader/SpanGraph/GraphTicks.js 100% <ø> (ø)
...omponents/TraceDiff/TraceDiffHeader/TraceHeader.js 14.28% <ø> (ø) ⬆️
...nents/TracePage/TracePageHeader/SpanGraph/index.js 76.92% <ø> (ø)
...TracePage/TracePageHeader/TracePageHeader.track.js 80% <ø> (ø)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a36984...1c90199. Read the comment docs.

- Keep redux search query synced with redux search result (and their
  processing). Also fixes #288.

- Bolster unit tests

Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
@tiffon tiffon changed the title [WIP] Misc tweaks for search and trace detail embed mode Misc tweaks for search and trace detail embed mode Dec 2, 2018
@tiffon tiffon changed the title Misc tweaks for search and trace detail embed mode Revisions for search and trace detail embed mode Dec 2, 2018
// uiEmbed=v0
// uiSearchHideGraph=1
// uiTimelineHideMap
// uiTimelineHideDetails
Copy link
Contributor

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

{embed ? (
<TracePageHeaderEmbed {...tracePageProps} {...tracePageEmbedProps} />
{embedded ? (
<TracePageHeaderEmbed {...headerProps} {...headerEmbeddedProps} />
Copy link
Collaborator

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?

packages/jaeger-ui/src/components/TracePage/index.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/App/Page.js Show resolved Hide resolved
packages/jaeger-ui/src/components/TracePage/index.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/TracePage/index.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/TracePage/index.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/components/TracePage/index.test.js Outdated Show resolved Hide resolved
@aljesusg
Copy link
Contributor

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?

peek 2018-12-10 16-16

@tiffon
Copy link
Member Author

tiffon commented Dec 14, 2018

@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?

@aljesusg
Copy link
Contributor

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 <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
@tiffon
Copy link
Member Author

tiffon commented Dec 16, 2018

@aljesusg Thanks for the suggestions!

@everett980 Thanks for the review!

I've made the following changes to the embedded mode:

  • The TracePageHeader is collapsible when embedded, and it defaults to open
    • uiTimelineCollapseTitle=1 will default it to collapsed
  • The summary data (number of services, etc.) and minimap are now shown, by default
    • uiTimelineHideMinimap=1 will hide the minimap
    • uiTimelineHideSummary=1 will hide the trace summary
    • If both are hidden, the title is no longer collapsible because there is nothing to show
  • I've restyled the TracePageHeader; I thought it looked more organized than the current, non-embedded header, so I consolidated the two classes

Here are a few screenshots. The search page hasn't changed.

Normal, header is open

ss-00-normal-open

Normal, header is collapsed

ss-01-normal-collapsed

Normal with back button to return to search results, header is open

ss-02-normal-with-back-open

Normal with back button, header is collapsed

ss-03-normal-with-back-collapsed

Embedded with back button, header is open

ss-04-embedded-with-back-open

Embedded with back button, header is collapsed

ss-05-embedded-with-back-collapsed

Embedded with back button, summary is hidden

ss-06-embedded-with-back-hide-summary

Embedded with back button, minimap is hidden

ss-07-embedded-with-back-hide-map

Embedded with back button, both summary and minimap are hidden

ss-08-embedded-with-back-hide-both

Embedded without a back button, collapsed

ss-09-embedded-no-back-collapsed

@aljesusg
Copy link
Contributor

Hi @tiffon , I tested it, nice refactor and enhancement. Thanks !!!

Copy link
Collaborator

@everett980 everett980 left a 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.

onGoFullViewClicked: this.goFullView,
resultCount: findMatchesIDs ? findMatchesIDs.size : 0,
showArchiveButton: !isEmbedded && archiveEnabled,
showShortcutsHelp: !isEmbedded,
Copy link
Collaborator

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,

Copy link
Member Author

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.

Copy link
Member Author

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() };
Copy link
Collaborator

@everett980 everett980 Dec 18, 2018

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';
Copy link
Collaborator

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();
Copy link
Collaborator

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 <joef@uber.com>
Signed-off-by: Joe Farro <joef@uber.com>
@tiffon tiffon merged commit 53937eb into master Dec 20, 2018
@ghost ghost removed the review label Dec 20, 2018
@tiffon tiffon mentioned this pull request Jan 9, 2019
everett980 pushed a commit to everett980/jaeger-ui that referenced this pull request Jan 16, 2019
* 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 <joef@uber.com>

* Fix test break from merging master

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo disableComparisions

Signed-off-by: Joe Farro <joef@uber.com>

* Use public registry to newly installed packages

Signed-off-by: Joe Farro <joef@uber.com>

* Test improvements

Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>
@yurishkuro yurishkuro deleted the embed-tweaks branch January 29, 2020 15:08
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
* 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 <joef@uber.com>

* Fix test break from merging master

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo disableComparisions

Signed-off-by: Joe Farro <joef@uber.com>

* Use public registry to newly installed packages

Signed-off-by: Joe Farro <joef@uber.com>

* Test improvements

Signed-off-by: Joe Farro <joef@uber.com>

Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
* 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 <joef@uber.com>

* Fix test break from merging master

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo

Signed-off-by: Joe Farro <joef@uber.com>

* 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 <joef@uber.com>

* Fix typo disableComparisions

Signed-off-by: Joe Farro <joef@uber.com>

* Use public registry to newly installed packages

Signed-off-by: Joe Farro <joef@uber.com>

* Test improvements

Signed-off-by: Joe Farro <joef@uber.com>
Signed-off-by: Everett Ross <reverett@uber.com>

Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants