-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
HParams: Create filter dialog component #6493
Conversation
62ac08a
to
f672689
Compare
tensorboard/webapp/runs/views/runs_table/runs_table_container.ts
Outdated
Show resolved
Hide resolved
).find((elem) => | ||
elem.nativeElement.innerHTML.includes('Include Undefined') | ||
)!; | ||
includeUndefinedCheckbox.query(By.css('label')).nativeElement.click(); |
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.
Is there a way to use Component Harnesses in the tests? Its current best practice but will also possibly make it easier to switch to the new components introduced in Angular 15.
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.
Did you give Component Harnesses a try?
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 did manage to get this working with harnesses
f672689
to
153a878
Compare
).find((elem) => | ||
elem.nativeElement.innerHTML.includes('Include Undefined') | ||
)!; | ||
includeUndefinedCheckbox.query(By.css('label')).nativeElement.click(); |
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.
Did you give Component Harnesses a try?
tensorboard/webapp/runs/views/runs_table/runs_table_container.ts
Outdated
Show resolved
Hide resolved
77b371d
to
16105dc
Compare
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.
Thanks its looking pretty good. All that remains are some requests for increased test coverage and clarity.
fixture.componentInstance.discreteValueFilter = 'ba'; | ||
fixture.detectChanges(); | ||
expect( | ||
(await rootLoader.getAllHarnesses(MatCheckboxHarness)).length |
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 would be more confident in the test if you actually checked that it's the 'bar' and 'baz' boxes shown.
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.
This would still make me more confident. (You resolved this but I didn't see corresponding changes).
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.
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.
A few more comments to be addressed, please.
); | ||
await checkbox.uncheck(); | ||
|
||
expect(filterValues).toEqual([2, 2, 4]); |
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 would be more confident in the test if you confirmed the output of the EventEmitter after every click. You say "Unchecking an unchecked box should not trigger an event" but the test does not prove this - it actually allows for the possibility of "Checking an unchecked box does not trigger an event" (which is a bug).
Alternatively, another way to make me more confident in the test is to just get rid of L166,167 and then we have only three uncheck/check calls and its a bit easier to conclude that the filterValues on L175 correspond to those three clicks. In which case, if you think the test on L167 is important to test, consider moving it to its own test case.
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.
This is my second draft of this. In the original I did check after each event but I thought the amount of setup required for each action made it hard to read. I'm going to put this in a loop instead but I plan to maintain the practice of checking the values in an array as I do find it more readable.
tensorboard/defs/defs.bzl
Outdated
@@ -72,8 +71,8 @@ def tf_js_binary( | |||
# the global level and tends to overwrite `window` functions. "iife" is | |||
# just a thin wrapper around "esm" (it adds 11 bytes) and doesn't | |||
# suffer from the same overwriting problem. | |||
format="iife", | |||
minify= False if dev_mode_only else True, | |||
format = "iife", |
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.
You have unrelated changes here.
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.
The observer effect (aka ide autoformat) is alive and strong. Sorry I missed this.
fixture.componentInstance.discreteValueFilter = 'ba'; | ||
fixture.detectChanges(); | ||
expect( | ||
(await rootLoader.getAllHarnesses(MatCheckboxHarness)).length |
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.
This would still make me more confident. (You resolved this but I didn't see corresponding changes).
## Motivation for features / changes #6493 Broke our internal sync Googlers see [cl/557499468](http://cl/557499468) The issue is related to our internal Angular component migration. New components are not allowed to rely on the legacy components. Due to this the new component added in #6493 uses the non legacy checkbox. However, our dependency remapping always remaps dependencies on material_checkbox to legacy_material_checkbox. To fix this I am changing the name of the remapping rule in [cl/557515881](http://cl/557515881) and adjusting all the OSS usage EXCEPT for the usage in filter_dialog. [cl/557590954](http://cl/557590954) is also required to map the testing dependency needed to use `MatCheckboxHarness`
…6553) ## Motivation for features / changes Now that the filter dialog is merged #6493 we need to add support for filtering by hparams. However, #6544 changed the way hparam values are read. This change adds a new property to state in which to store dashboard related hparam and metric filters. See #6488 for the WIP integration with the runs_table_container + tb_data_table -> common_selectors + hparam_selectors.
## Motivation for features / changes We want to be able to filter the runs table by hparam. The existing logic for this is handled by a bunch of inner components found in the runs_table_component which makes it hard to share. In this PR I am replicating that UI with some enhancements in a standalone component which will later be used by the data_table_component. See tensorflow#6488 for screenshots and a more complete description of what is being added ## Alternate designs / implementations considered (or N/A) I'm not sure that this component should be part of the data table but that is simplest place to put it for now.
…low#6547) ## Motivation for features / changes tensorflow#6493 Broke our internal sync Googlers see [cl/557499468](http://cl/557499468) The issue is related to our internal Angular component migration. New components are not allowed to rely on the legacy components. Due to this the new component added in tensorflow#6493 uses the non legacy checkbox. However, our dependency remapping always remaps dependencies on material_checkbox to legacy_material_checkbox. To fix this I am changing the name of the remapping rule in [cl/557515881](http://cl/557515881) and adjusting all the OSS usage EXCEPT for the usage in filter_dialog. [cl/557590954](http://cl/557590954) is also required to map the testing dependency needed to use `MatCheckboxHarness`
…ensorflow#6553) ## Motivation for features / changes Now that the filter dialog is merged tensorflow#6493 we need to add support for filtering by hparams. However, tensorflow#6544 changed the way hparam values are read. This change adds a new property to state in which to store dashboard related hparam and metric filters. See tensorflow#6488 for the WIP integration with the runs_table_container + tb_data_table -> common_selectors + hparam_selectors.
Motivation for features / changes
We want to be able to filter the runs table by hparam. The existing logic for this is handled by a bunch of inner components found in the runs_table_component which makes it hard to share. In this PR I am replicating that UI with some enhancements in a standalone component which will later be used by the data_table_component.
See #6488 for screenshots and a more complete description of what is being added
Alternate designs / implementations considered (or N/A)
I'm not sure that this component should be part of the data table but that is simplest place to put it for now.