Skip to content

Adding tag descriptions to tooltips#2612

Merged
phixMe merged 6 commits into
MarquezProject:mainfrom
davidsharp7:web/enhance_tags
Sep 13, 2023
Merged

Adding tag descriptions to tooltips#2612
phixMe merged 6 commits into
MarquezProject:mainfrom
davidsharp7:web/enhance_tags

Conversation

@davidsharp7

@davidsharp7 davidsharp7 commented Sep 12, 2023

Copy link
Copy Markdown
Member

Problem

Currently tags displayed at the column level show the tag but not the description which can help the end user understand what the tag means

Closes: #2611

Solution

Get the tag descriptions from the tags end point and when a column has a tag display the corresponding description on hover over.(https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) for context.

One-line summary:

add hover over to each column level tag which displays the tag description.

Screenshot 2023-09-12 at 15 41 20

Checklist

  • You've signed-off your work
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • You've included a one-line summary of your change for the CHANGELOG.md (Depending on the change, this may not be necessary).
  • You've versioned your .sql database schema migration according to Flyway's naming convention (if relevant)
  • You've included a header in any source code files (if relevant)

Signed-off-by: sharpd <number6labs@gmail.com>
@boring-cyborg boring-cyborg Bot added the web label Sep 12, 2023
davidsharp7 and others added 2 commits September 12, 2023 15:44
@codecov

codecov Bot commented Sep 12, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2612 (236d1d1) into main (3243a0f) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #2612   +/-   ##
=========================================
  Coverage     83.31%   83.31%           
  Complexity     1289     1289           
=========================================
  Files           243      243           
  Lines          5940     5940           
  Branches        280      280           
=========================================
  Hits           4949     4949           
  Misses          844      844           
  Partials        147      147           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Signed-off-by: sharpd <number6labs@gmail.com>
@wslulciuc wslulciuc requested a review from phixMe September 12, 2023 14:30
Comment on lines 72 to 75
useEffect(() => {
run && fetchJobFacets(run.id)
fetchTags()
}, [])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This depends on the run You'll want to rerun this if the run changes.


// tags
export const FETCH_TAGS = 'FETCH_TAGS'
export const FETCH_TAGS_SUCCESS = 'FETCH_TAGS_SUCCESS' No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've got a few newline issues. The project has a formatter that should help you in your IDE.

<>
{tags.map((tag, index) => {
const tagDescription = tag_desc.find((tagItem) => tagItem.name === tag)
const tooltipTitle = tagDescription ? (tagDescription.description || 'No Tag Description') : 'No Tag Description'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to clean up this ternary to not have the same false clause twice here. You can use the ? syntax at the end of object properties.

Signed-off-by: sharpd <number6labs@gmail.com>
useEffect(() => {
run && fetchJobFacets(run.id)
run && fetchJobFacets(run.id) && fetchTags()
}, [])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you would need to add [run] to the dependencies list. An empty list runs on the component mount. I think it should work for you.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sorry misunderstood what you were saying - rookie error!

Signed-off-by: sharpd <number6labs@gmail.com>
@phixMe phixMe merged commit d1d47e2 into MarquezProject:main Sep 13, 2023
@davidsharp7 davidsharp7 deleted the web/enhance_tags branch December 31, 2023 00:09
jonathanpmoraes referenced this pull request in nubank/NuMarquez Feb 6, 2025
* add tag descriptions to tooltips

Signed-off-by: sharpd <number6labs@gmail.com>

* remove tag import after linting

Signed-off-by: sharpd <number6labs@gmail.com>

* remove comments

Signed-off-by: sharpd <number6labs@gmail.com>

* ran linter over impacted files and changed code based on feedback

Signed-off-by: sharpd <number6labs@gmail.com>

* add [run] as dependency based on feedback

Signed-off-by: sharpd <number6labs@gmail.com>

---------

Signed-off-by: sharpd <number6labs@gmail.com>
Co-authored-by: sharpd <number6labs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show column level tag descriptions

2 participants