Skip to content
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

fix(material/table): cleanup legacy usage #25525

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/dev-app/table-scroll-container/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ng_module(
"//src/cdk-experimental/table-scroll-container",
"//src/material/button",
"//src/material/button-toggle",
"//src/material/legacy-table",
"//src/material/table",
"@npm//@angular/common",
"@npm//@angular/core",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
overflow: auto;
}

.mat-table-sticky {
.mat-mdc-table-sticky, .mat-mdc-table-sticky.mat-mdc-header-cell {
background: #59abfd;
opacity: 1;
}
Expand All @@ -18,7 +18,7 @@
text-align: center;
}

.mat-header-cell, .mat-footer-cell, .mat-cell {
.mat-mdc-header-cell, .mat-mdc-footer-cell, .mat-mdc-cell {
min-width: 80px;
box-sizing: border-box;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {CommonModule} from '@angular/common';
import {CdkTableScrollContainerModule} from '@angular/cdk-experimental/table-scroll-container';
import {MatButtonModule} from '@angular/material/button';
import {MatButtonToggleGroup, MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatLegacyTableModule} from '@angular/material/legacy-table';
import {MatTableModule} from '@angular/material/table';

/**
* @title Tables with toggle-able sticky headers, footers, and columns
Expand All @@ -26,7 +26,7 @@ import {MatLegacyTableModule} from '@angular/material/legacy-table';
CommonModule,
MatButtonModule,
MatButtonToggleModule,
MatLegacyTableModule,
MatTableModule,
],
})
export class TableScrollContainerDemo {
Expand Down
13 changes: 1 addition & 12 deletions src/material/legacy-table/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,16 @@ filegroup(
srcs = glob(["**/*.ts"]),
)

ng_test_library(
name = "harness_tests_lib",
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/legacy-table",
],
)

ng_test_library(
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["shared.spec.ts"],
),
deps = [
":harness_tests_lib",
":testing",
"//src/material/legacy-table",
"//src/material/table/testing:harness_tests_lib",
],
)

Expand Down
4 changes: 2 additions & 2 deletions src/material/legacy-table/testing/table-harness.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {MatLegacyTableModule} from '@angular/material/legacy-table';
import {runHarnessTests} from '@angular/material/legacy-table/testing/shared.spec';
import {runHarnessTests} from '@angular/material/table/testing/shared.spec';
import {MatLegacyTableHarness} from './table-harness';

describe('Non-MDC-based MatTableHarness', () => {
runHarnessTests(MatLegacyTableModule, MatLegacyTableHarness);
runHarnessTests(MatLegacyTableModule, MatLegacyTableHarness as any);
});
18 changes: 16 additions & 2 deletions src/material/table/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,26 @@ filegroup(
srcs = glob(["**/*.ts"]),
)

ng_test_library(
name = "harness_tests_lib",
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/table",
],
)

ng_test_library(
name = "unit_tests_lib",
srcs = glob(["**/*.spec.ts"]),
srcs = glob(
["**/*.spec.ts"],
exclude = ["shared.spec.ts"],
),
deps = [
":harness_tests_lib",
":testing",
"//src/material/legacy-table/testing:harness_tests_lib",
"//src/material/table",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import {HarnessLoader, parallel} from '@angular/cdk/testing';
import {TestbedHarnessEnvironment} from '@angular/cdk/testing/testbed';
import {Component} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatLegacyTableModule} from '@angular/material/legacy-table';
import {MatLegacyTableHarness} from './table-harness';
import {MatTableModule} from '../module';
import {MatTableHarness} from './table-harness';

/** Shared tests to run on both the original and MDC-based table. */
export function runHarnessTests(
tableModule: typeof MatLegacyTableModule,
tableHarness: typeof MatLegacyTableHarness,
tableModule: typeof MatTableModule,
tableHarness: typeof MatTableHarness,
) {
let fixture: ComponentFixture<TableHarnessTest>;
let loader: HarnessLoader;
Expand Down
4 changes: 2 additions & 2 deletions src/material/table/testing/table-harness.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {MatTableModule} from '@angular/material/table';
import {runHarnessTests} from '@angular/material/legacy-table/testing/shared.spec';
import {runHarnessTests} from './shared.spec';
import {MatTableHarness} from './table-harness';

describe('MDC-based MatTableHarness', () => {
runHarnessTests(MatTableModule, MatTableHarness as any);
runHarnessTests(MatTableModule, MatTableHarness);
});