Skip to content

Conversation

arjunlalb
Copy link
Contributor

@arjunlalb arjunlalb commented Mar 3, 2021

Description

Cell renderer for string arrays.

Expected behaviour:
Should show the first item in the cell, along with a +x representing the number of remaining values. Tooltip should show a list of these values on hovering on +x.

Screenshot 2021-03-03 at 2 02 22 PM

Overflow
Screenshot 2021-03-03 at 8 26 23 PM

Testing

Manually verified. Added UTs.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

@arjunlalb arjunlalb requested a review from a team as a code owner March 3, 2021 08:41
@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #655 (cac12b5) into main (797268e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #655      +/-   ##
==========================================
+ Coverage   85.20%   85.22%   +0.02%     
==========================================
  Files         777      778       +1     
  Lines       16017    16030      +13     
  Branches     2066     2068       +2     
==========================================
+ Hits        13647    13662      +15     
+ Misses       2335     2333       -2     
  Partials       35       35              
Impacted Files Coverage Δ
...rray/string-array-table-cell-renderer.component.ts 100.00% <100.00%> (ø)
...s/components/src/table/cells/table-cells.module.ts 100.00% <100.00%> (ø)
...able/cells/data-parsers/table-cell-no-op-parser.ts 55.55% <0.00%> (+22.22%) ⬆️

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 797268e...cac12b5. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

Please investigate how we can share this pattern with #615 (either by using that component inside this renderer, or pulling a base component out of the two of them)

template: `
<div class="string-array-cell">
<span class="first-item">{{ this.firstItem }}</span>
<span class="summary-text" [htTooltip]="this.summaryTooltip">{{ this.summaryText }}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

So I think the tooltip should be across the whole cell, and show all values. This actually just came up when @anandtiwary implemented basically exactly this component... can we share an underlying component? let me go find it

Copy link
Contributor

Choose a reason for hiding this comment

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

Linked in the summary comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaron-steinfeld the link you used is for this PR. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so? Linked to #615, this is #655 no matter how similar they might look :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. My browser was not redirecting when I clicked on the link. So I assumed its this page. I'll check that PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaron-steinfeld Checked that PR. I'm not sure if we should use that here. #655 adds them as summary values which has a certain format. If there are no icons present, it shows a dot. To circumvent that usecase we'll have to modify the summary value component's behaviour. Also override fonts etc. I don't think we should do that just to reuse it. Our usecase here is plain string array display.

We cannot take this out into a component and have it used there either because that component is built for summary values usecase. The API is more complex with optional icons, labels etc.

One thing we can do is to write a wrapper which covers both cases that'd use summary value / plain text based on requirement. But then we'd be writing a component with a pretty confusing/complicated API to share one template and couple lines of code.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK - definitely not worth maintaining that level of difference in one component. I just wish we'd stop using similar but slightly unique components everywhere...

Copy link
Contributor

Choose a reason for hiding this comment

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

We should really consolidate the two styles. I think per michael it is the same component. This would lead to inconsistency, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

What if we pull this one out into a standalone, simple component that we use in the renderer? We can then leave it as tech debt to make the summaries component use that too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll file a tech debt for this.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@arjunlalb arjunlalb merged commit b43ce2e into main Mar 4, 2021
@arjunlalb arjunlalb deleted the string-array-cell-renderer branch March 4, 2021 04:22
@github-actions
Copy link

github-actions bot commented Mar 4, 2021

Unit Test Results

    4 files  ±0  242 suites  +1   13m 57s ⏱️ - 1m 20s
869 tests +3  869 ✔️ +3  0 💤 ±0  0 ❌ ±0 
873 runs  +3  873 ✔️ +3  0 💤 ±0  0 ❌ ±0 

Results for commit b43ce2e. ± Comparison against base commit 797268e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants