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

Update d3 to address Dependabot issues #7661

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 0 additions & 2 deletions web/html/src/branding/css/base/visualization.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

.toggle-filter-button {
background: #eff1f3;
margin-top: -30px;
float: right;
padding: 5px 10px;
color: @gray-dark;
border: 1px solid @gray-light;
Expand Down
6 changes: 4 additions & 2 deletions web/html/src/manager/visualization/data-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ declare global {
// - refresh - transforms the data according to current preprocessor, filters
// and partitioning settings and refresh the DOM
//
function dataTree(data, container) {
function dataTree(data: unknown[], container: ReturnType<typeof Utils.prepareDom>) {
let preprocessor = Preprocessing.stratify();
const dimensions = Utils.computeSvgDimensions();

Expand Down Expand Up @@ -153,7 +153,9 @@ function appendPatchStatus(cell, patchCountsArray) {
}
}

function updateDetailBox(d) {
function updateDetailBox(event) {
const target = event.target.closest("g.node");
const [d] = d3.select(target).data() as any;
const data = d.data;

const detailBox = d3.select(".detailBox");
Expand Down
2 changes: 1 addition & 1 deletion web/html/src/manager/visualization/hierarchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ declare global {
}
}

function displayHierarchy(data) {
function displayHierarchy(data: unknown[]) {
// disable the #spacewalk-content observer:
// drawing svg triggers it for every small changes,
// and it is not the desired behaviour/what the observer stands for
Expand Down
8 changes: 5 additions & 3 deletions web/html/src/manager/visualization/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function prepareDom() {
.on("zoom", zoomed) as any
)
.on("dblclick.zoom", null);
function zoomed(d) {
// @ts-expect-error: `d3.event.transform` doesn't seem to be correctly typed in the matching version of types
container.attr("transform", d3.event.transform);

function zoomed(this: Element) {
// See https://github.com/d3/d3-zoom#zoom-transforms
const transform = d3.zoomTransform(this);
container.attr("transform", transform.toString());
}

return container;
Expand Down
4 changes: 2 additions & 2 deletions web/html/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"copy-webpack-plugin": "5.1.2",
"core-js": "^3.8.1",
"css-loader": "^2.1.0",
"d3": "4.5.0",
"d3": "7.7.0",
"dompurify": "^3.0.3",
"eos-ds": "^5.0.0",
"font-awesome": "4.4.0",
Expand Down Expand Up @@ -119,7 +119,7 @@
"devDependencies": {
"@testing-library/react": "^11.1.2",
"@testing-library/user-event": "^12.6.0",
"@types/d3": "4.5.0",
"@types/d3": "7.4.1",
"@types/dompurify": "^3.0.2",
"@types/jest": "^26.0.19",
"@types/jquery": "3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion web/html/src/vendors/npm.licenses.structured.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading