Skip to content

Commit 7f083ee

Browse files
refactor(report): migrate to lit.js (#567)
* refactor(report): migrate to lit.js * Update public/components/views/home/report/report.js Co-authored-by: PierreDemailly <[email protected]> --------- Co-authored-by: PierreDemailly <[email protected]>
1 parent 0b7bf73 commit 7f083ee

File tree

5 files changed

+271
-214
lines changed

5 files changed

+271
-214
lines changed

public/components/views/home/home.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import url("./maintainers/maintainers.css");
2-
@import url("./report/report.css");
32

43
#home--view {
54
z-index: 10;

public/components/views/home/home.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { fetchScorecardData, getScorecardLink } from "../../../common/scorecard.
1212

1313
// Import Components
1414
import { Maintainers } from "./maintainers/maintainers.js";
15-
import { PopupReport } from "./report/report.js";
15+
import "./report/report.js";
1616

1717
// CONSTANTS
1818
const kFlagsToWatch = new Set([
@@ -390,9 +390,14 @@ export class HomeView {
390390

391391
handleReport() {
392392
document.querySelector(".home--header--report").addEventListener("click", async() => {
393+
const popupReport = document.createElement("popup-report");
394+
popupReport.rootDependencyName = this.secureDataSet.data.rootDependencyName;
395+
popupReport.theme = this.secureDataSet.theme;
396+
const fragment = document.createDocumentFragment();
397+
fragment.appendChild(popupReport);
393398
window.dispatchEvent(new CustomEvent(EVENTS.MODAL_OPENED, {
394399
detail: {
395-
content: new PopupReport(this.secureDataSet.data.rootDependencyName).render()
400+
content: fragment
396401
}
397402
}));
398403
});

public/components/views/home/report/report.css

Lines changed: 0 additions & 138 deletions
This file was deleted.

public/components/views/home/report/report.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)