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

v2.9.1 #75

Merged
merged 2 commits into from
Jul 23, 2024
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
11 changes: 5 additions & 6 deletions lib/components/Documents/PdfDocumentViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var PDFJSViewer = _interopRequireWildcard(require("pdfjs-dist/legacy/web/pdf_viewer"));
var pdfjs = _interopRequireWildcard(require("pdfjs-dist"));
var PDFJSViewer = _interopRequireWildcard(require("pdfjs-dist/web/pdf_viewer.mjs"));
var _styles = require("@material-ui/core/styles");
var _DocumentService = _interopRequireDefault(require("../../service/DocumentService"));
var _ErrorCard = _interopRequireDefault(require("../Card/ErrorCard"));
Expand All @@ -17,10 +18,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
// Pull in PDF JS and set up a reference to the worker source
const pdfjs = require('pdfjs-dist/legacy/build/pdf');
// eslint-disable-next-line import/no-webpack-loader-syntax, import/no-unresolved
const PdfjsWorker = require('worker-loader?esModule=false&filename=static/js/workers/[name].[contenthash].js!pdfjs-dist/legacy/build/pdf.worker');
pdfjs.GlobalWorkerOptions.workerPort = new PdfjsWorker();
pdfjs.GlobalWorkerOptions.workerPort = new Worker(new URL('pdfjs-dist/build/pdf.worker.mjs', import.meta.url), {
type: 'module'
});
const useStyles = (0, _styles.makeStyles)(muiTheme =>
// eslint-disable-next-line implicit-arrow-linebreak
(0, _styles.createStyles)({
Expand Down Expand Up @@ -141,7 +141,6 @@ const PdfDocumentViewer = props => {
const pdfViewerOptions = {
container: pdfContainerElement,
linkService: pdfLinkService,
l10n: PDFJSViewer.NullL10n,
textLayerMode: 0,
eventBus
};
Expand Down
23 changes: 23 additions & 0 deletions lib/components/TimeSeriesViewer/TimeSeriesViewerGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,29 @@ function TimeSeriesViewerGraph() {
dygraphRef.current.updateOptions(_extends({
file: state.graphData.data
}, graphOptions));
// Detecting an out of bounds date window requires the data
// to have been updated prior to getting the current axes
// xAxisRange is the current date window selected by the range selector
// xAxisExtremes is the date window bounds of the current data
// If the range selector window no long applies to the viewable data,
// reset the range selector bounds to the current data
const xAxisRange = dygraphRef.current.xAxisRange();
const xAxisExtremes = dygraphRef.current.xAxisExtremes();
const isLeftBoundValid = xAxisRange[0] >= xAxisExtremes[0] && xAxisRange[0] <= xAxisExtremes[1];
const isRightBoundValid = xAxisRange[1] >= xAxisExtremes[0] && xAxisRange[1] <= xAxisExtremes[1];
if (!isLeftBoundValid || !isRightBoundValid) {
let updatedDateWindow;
if (!isLeftBoundValid && !isRightBoundValid) {
updatedDateWindow = [...xAxisExtremes];
} else if (!isLeftBoundValid) {
updatedDateWindow = [xAxisExtremes[0], xAxisRange[1]];
} else if (!isRightBoundValid) {
updatedDateWindow = [xAxisRange[0], xAxisExtremes[1]];
}
dygraphRef.current.updateOptions({
dateWindow: updatedDateWindow
});
}
// Dygraphs has a bug where the canvas isn't cleared properly when dynamically changing
// the y-axis count. We can force a canvas refresh by cycling the range selector. This
// is not clean, but it is at least minimally invasive.
Expand Down
2 changes: 1 addition & 1 deletion lib/remoteAssets/drupal-header.html.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/remoteAssets/drupal-header.html.js

Large diffs are not rendered by default.

Loading