Skip to content

Commit

Permalink
Update to use util function from @grafana/data package instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarrs committed Feb 4, 2023
1 parent bfcb535 commit 277d493
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"webpack-cli": "^3.1.2"
},
"dependencies": {
"@braintree/sanitize-url": "6.0.1",
"lodash": "^4.17.11",
"package.json": "^2.0.1"
}
Expand Down
8 changes: 4 additions & 4 deletions src/worldmap_ctrl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MetricsPanelCtrl } from "grafana/app/plugins/sdk";
import TimeSeries from "grafana/app/core/time_series2";
import appEvents from "grafana/app/core/app_events";
import { sanitizeUrl } from "@braintree/sanitize-url";
import { textUtil } from "@grafana/data";

import * as _ from "lodash";
import DataFormatter from "./data_formatter";
Expand Down Expand Up @@ -112,8 +112,8 @@ export default class WorldmapCtrl extends MetricsPanelCtrl {
return;
}

this.panel.jsonpUrl = sanitizeUrl(this.panel.jsonpUrl);
this.panel.jsonpCallback = sanitizeUrl(this.panel.jsonpCallback);
this.panel.jsonpUrl = textUtil.sanitizeUrl(this.panel.jsonpUrl);
this.panel.jsonpCallback = textUtil.sanitizeUrl(this.panel.jsonpCallback);

$.ajax({
type: "GET",
Expand All @@ -131,7 +131,7 @@ export default class WorldmapCtrl extends MetricsPanelCtrl {
return;
}

this.panel.jsonUrl = sanitizeUrl(this.panel.jsonUrl);
this.panel.jsonUrl = textUtil.sanitizeUrl(this.panel.jsonUrl);

$.getJSON(this.panel.jsonUrl).then((res) => {
this.locations = res;
Expand Down

0 comments on commit 277d493

Please sign in to comment.