Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
chore: isolate the one actual jquery dependency (#1339)
Browse files Browse the repository at this point in the history
  • Loading branch information
suddjian committed Sep 8, 2021
1 parent dfd0967 commit 19f8f6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions plugins/legacy-plugin-chart-pivot-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@superset-ui/core": "0.18.2",
"d3": "^3.5.17",
"datatables.net-bs": "^1.10.15",
"jquery": "^3.6.0",
"prop-types": "^15.6.2"
}
}
6 changes: 2 additions & 4 deletions plugins/legacy-plugin-chart-pivot-table/src/PivotTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/* eslint-disable react/sort-prop-types */
import dt from 'datatables.net-bs';
import PropTypes from 'prop-types';
import $ from 'jquery';
import {
getTimeFormatter,
getTimeFormatterForGranularity,
Expand All @@ -28,10 +29,7 @@ import { formatCellValue, formatDateCellValue } from './utils/formatCells';
import fixTableHeight from './utils/fixTableHeight';
import 'datatables.net-bs/css/dataTables.bootstrap.css';

if (window.$) {
dt(window, window.$);
}
const $ = window.$ || dt.$;
dt(window, $);

const propTypes = {
data: PropTypes.shape({
Expand Down

1 comment on commit 19f8f6a

@vercel
Copy link

@vercel vercel bot commented on 19f8f6a Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.