Skip to content

Commit

Permalink
Renames HparamsFilterbar to Filterbar
Browse files Browse the repository at this point in the history
  • Loading branch information
hoonji committed Dec 5, 2023
1 parent a4bbf7f commit deb02fd
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 31 deletions.
14 changes: 7 additions & 7 deletions tensorboard/webapp/runs/views/runs_table/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ tf_sass_binary(
)

tf_sass_binary(
name = "hparam_filterbar_styles",
src = "hparam_filterbar_component.scss",
name = "filterbar_styles",
src = "filterbar_component.scss",
strict_deps = False,
deps = ["//tensorboard/webapp/theme"],
)
Expand Down Expand Up @@ -53,8 +53,8 @@ tf_ts_library(
tf_ng_module(
name = "runs_table",
srcs = [
"hparam_filterbar_component.ts",
"hparam_filterbar_container.ts",
"filterbar_component.ts",
"filterbar_container.ts",
"regex_edit_dialog_component.ts",
"regex_edit_dialog_container.ts",
"runs_data_table.ts",
Expand All @@ -66,10 +66,10 @@ tf_ng_module(
],
assets = [
":regex_edit_dialog_styles",
":hparam_filterbar_styles",
":filterbar_styles",
":runs_data_table_styles",
":runs_group_menu_button_styles",
"hparam_filterbar_component.ng.html",
"filterbar_component.ng.html",
"regex_edit_dialog.ng.html",
"runs_data_table.ng.html",
"runs_group_menu_button_component.ng.html",
Expand Down Expand Up @@ -130,7 +130,7 @@ tf_ts_library(
name = "runs_table_test",
testonly = True,
srcs = [
"hparam_filterbar_test.ts",
"filterbar_test.ts",
"regex_edit_dialog_test.ts",
"runs_data_table_test.ts",
"runs_table_test.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import {RangeValues} from '../../../widgets/range_input/types';
import {CustomModalComponent} from '../../../widgets/custom_modal/custom_modal_component';

@Component({
selector: 'hparam-filterbar-component',
templateUrl: 'hparam_filterbar_component.ng.html',
styleUrls: ['hparam_filterbar_component.css'],
selector: 'filterbar-component',
templateUrl: 'filterbar_component.ng.html',
styleUrls: ['filterbar_component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HparamFilterbarComponent {
export class FilterbarComponent {
@Input() filters!: Map<string, DiscreteFilter | IntervalFilter>;

@Output() removeHparamFilter = new EventEmitter<string>();
Expand All @@ -57,8 +57,6 @@ export class HparamFilterbarComponent {
return this.filters.get(this.selectedFilterName);
}

constructor() {}

openFilterMenu(event: MouseEvent, filterName: string) {
this.selectedFilterName = filterName;
const rect = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ import {
import {FilterAddedEvent} from '../../../widgets/data_table/types';

@Component({
selector: 'hparam-filterbar',
template: `<hparam-filterbar-component
selector: 'filterbar',
template: `<filterbar-component
[filters]="filters$ | async"
(removeHparamFilter)="removeHparamFilter($event)"
(addFilter)="addHparamFilter($event)"
>
</hparam-filterbar-component>`,
</filterbar-component>`,
styles: [``],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HparamFilterbarContainer implements OnDestroy {
export class FilterbarContainer implements OnDestroy {
filters$ = this.store.select(hparamsSelectors.getDashboardHparamFilterMap);

private readonly ngUnsubscribe = new Subject<void>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ limitations under the License.
==============================================================================*/
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {NO_ERRORS_SCHEMA} from '@angular/core';
import {HparamFilterbarComponent} from './hparam_filterbar_component';
import {HparamFilterbarContainer} from './hparam_filterbar_container';
import {FilterbarComponent} from './filterbar_component';
import {FilterbarContainer} from './filterbar_container';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {provideMockTbStore} from '../../../testing/utils';
import {MockStore} from '@ngrx/store/testing';
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('hparam_filterbar', () => {
MatIconTestingModule,
FilterDialogModule,
],
declarations: [HparamFilterbarComponent, HparamFilterbarContainer],
declarations: [FilterbarComponent, FilterbarContainer],
providers: [provideMockTbStore()],
schemas: [NO_ERRORS_SCHEMA],
}).compileComponents();
Expand All @@ -85,23 +85,21 @@ describe('hparam_filterbar', () => {
store?.resetSelectors();
});

function createComponent(): ComponentFixture<HparamFilterbarContainer> {
function createComponent(): ComponentFixture<FilterbarContainer> {
store = TestBed.inject<Store<State>>(Store) as MockStore<State>;
actualActions = [];
dispatchSpy = spyOn(store, 'dispatch').and.callFake((action: Action) => {
actualActions.push(action);
});

return TestBed.createComponent(HparamFilterbarContainer);
return TestBed.createComponent(FilterbarContainer);
}

it('renders hparam filterbar', () => {
const fixture = createComponent();
fixture.detectChanges();

const dialog = fixture.debugElement.query(
By.directive(HparamFilterbarComponent)
);
const dialog = fixture.debugElement.query(By.directive(FilterbarComponent));

expect(dialog).toBeTruthy();
});
Expand Down Expand Up @@ -164,7 +162,7 @@ describe('hparam_filterbar', () => {
fakeFilterMap
);
const component = fixture.debugElement.query(
By.directive(HparamFilterbarComponent)
By.directive(FilterbarComponent)
).componentInstance;
const openAtPositionSpy = spyOn(
CustomModalComponent.prototype,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
placeholder="Filter runs (regex)"
></tb-filter-input>
</div>
<hparam-filterbar></hparam-filterbar>
<filterbar></filterbar>
<div class="table-container">
<tb-data-table
[headers]="headers"
Expand Down
8 changes: 4 additions & 4 deletions tensorboard/webapp/runs/views/runs_table/runs_table_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import {FilterDialogModule} from '../../../widgets/data_table/filter_dialog_modu
import {RangeInputModule} from '../../../widgets/range_input/range_input_module';
import {RegexEditDialogComponent} from './regex_edit_dialog_component';
import {RegexEditDialogContainer} from './regex_edit_dialog_container';
import {HparamFilterbarComponent} from './hparam_filterbar_component';
import {HparamFilterbarContainer} from './hparam_filterbar_container';
import {FilterbarComponent} from './filterbar_component';
import {FilterbarContainer} from './filterbar_container';
import {RunsGroupMenuButtonComponent} from './runs_group_menu_button_component';
import {RunsGroupMenuButtonContainer} from './runs_group_menu_button_container';
import {CustomModalModule} from '../../../widgets/custom_modal/custom_modal_module';
Expand Down Expand Up @@ -75,8 +75,8 @@ import {RunsTableContainer} from './runs_table_container';
declarations: [
RegexEditDialogComponent,
RegexEditDialogContainer,
HparamFilterbarComponent,
HparamFilterbarContainer,
FilterbarComponent,
FilterbarContainer,
RunsDataTable,
RunsGroupMenuButtonComponent,
RunsGroupMenuButtonContainer,
Expand Down

0 comments on commit deb02fd

Please sign in to comment.