Skip to content

Conversation

anandtiwary
Copy link
Contributor

@anandtiwary anandtiwary commented Apr 2, 2021

Description

Please include a summary of the change, motivation and context.
Fix: Separating Table Expander and checkbox header renderers

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

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

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@anandtiwary anandtiwary requested a review from a team as a code owner April 2, 2021 22:22
@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #738 (d6c1475) into main (d113815) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #738      +/-   ##
==========================================
- Coverage   85.20%   85.18%   -0.02%     
==========================================
  Files         786      786              
  Lines       16097    16097              
  Branches     2053     2051       -2     
==========================================
- Hits        13715    13713       -2     
- Misses       2349     2350       +1     
- Partials       33       34       +1     
Impacted Files Coverage Δ
...components/src/table/data/table-cdk-data-source.ts 83.96% <ø> (ø)
...ble/cells/state-parsers/table-cell-state-parser.ts 71.42% <100.00%> (-28.58%) ⬇️
projects/components/src/table/table.component.ts 91.01% <100.00%> (ø)
projects/components/src/table/table.service.ts 95.45% <0.00%> (-4.55%) ⬇️
...ta-renderers/table-data-cell-renderer.component.ts 75.00% <0.00%> (+2.77%) ⬆️

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 d113815...d6c1475. Read the comment docs.

tap(() => this.loadingStateSubject.next({ loading$: NEVER })),
/**
* Below debouce is needed to handle multiple emission from buildChangeObservable.
* Below debounce is needed to handle multiple emission from buildChangeObservable.
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this is the real reason for the PR and all this other stuff is just because you were working in the area.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Totally

jake-bassett
jake-bassett previously approved these changes Apr 2, 2021
Copy link
Contributor

@jake-bassett jake-bassett left a comment

Choose a reason for hiding this comment

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

lgtm

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

lgtm will let @jake-bassett take a look since he's more familiar

@aaron-steinfeld
Copy link
Contributor

lgtm will let @jake-bassett take a look since he's more familiar

damn, he beat me

})
export class TableCellStateParserCheckbox extends TableCellParserBase<TableRowState, TableRowState, undefined> {
public parseValue(_: TableRowState, rowData: StatefulTableRow): TableRowState {
return rowData.$$state;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure how this is working. Shouldn't you need to map this to the specific property you are looking for? In this case, the boolean for selected?

Copy link
Contributor

@jake-bassett jake-bassett Apr 2, 2021

Choose a reason for hiding this comment

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

This approach looks right, so if its working, all good - approved. Just curious where the final mapping to the property is happening.

Copy link
Contributor Author

@anandtiwary anandtiwary Apr 2, 2021

Choose a reason for hiding this comment

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

The renderer actually depends on the entire state. I didn't change that part. Just using the row to find state object instead of depending on the cell value and deal with id conflicts

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool. Run with it.

@TableCellParser({
type: CoreTableCellParserType.RowExpander
})
export class TableCellStateParserExpander extends TableCellParserBase<TableRowState, TableRowState, undefined> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these two parsers the same? Do we need to dupe it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are same right now. I wanted to get feedback on whether I should make this return the whole object (more safer) or make it return the specific property. I can update this PR depending on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with either:

  • one copy of this
  • no copies (and just use the no-op parser and update the renderers to read state off the row)

I think splitting to two specific ones is overkill - it's not really safer because the renderer has the row anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will move to one copy. Don't want to remove the parser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@github-actions

This comment has been minimized.

@anandtiwary anandtiwary merged commit e40cae9 into main Apr 2, 2021
@anandtiwary anandtiwary deleted the table-expander-checkbox branch April 2, 2021 23:25
@github-actions
Copy link

github-actions bot commented Apr 2, 2021

Unit Test Results

    4 files  ±0  246 suites  ±0   14m 3s ⏱️ -58s
884 tests ±0  884 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
888 runs  ±0  888 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit e40cae9. ± Comparison against base commit d113815.

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