refactor(frontend): update imports of tether-drop to point to vendor directory
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { each } from 'lodash';
|
||||
// @ts-ignore
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
import coreModule from 'app/angular/core_module';
|
||||
|
||||
// @ts-ignore
|
||||
import Drop from '../../../vendor/tether-drop';
|
||||
|
||||
export function infoPopover() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
@@ -54,6 +55,7 @@ export function infoPopover() {
|
||||
|
||||
// Create drop in next digest after directive content is rendered.
|
||||
scope.$applyAsync(() => {
|
||||
// @ts-ignore
|
||||
const drop = new Drop(dropOptions);
|
||||
|
||||
const unbind = scope.$on('$destroy', () => {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { extend } from 'lodash';
|
||||
// @ts-ignore
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
import { GrafanaRootScope } from 'app/angular/GrafanaCtrl';
|
||||
import coreModule from 'app/angular/core_module';
|
||||
|
||||
// @ts-ignore
|
||||
import Drop from '../../../vendor/tether-drop';
|
||||
|
||||
coreModule.service('popoverSrv', ['$compile', '$rootScope', '$timeout', popoverSrv]);
|
||||
|
||||
function popoverSrv(this: any, $compile: any, $rootScope: GrafanaRootScope, $timeout: any) {
|
||||
@@ -51,6 +52,7 @@ function popoverSrv(this: any, $compile: any, $rootScope: GrafanaRootScope, $tim
|
||||
$compile(contentElement)(scope);
|
||||
|
||||
$timeout(() => {
|
||||
// @ts-ignore
|
||||
drop = new Drop({
|
||||
target: options.element,
|
||||
content: contentElement,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Suspense, useEffect, useLayoutEffect } from 'react';
|
||||
import { Navigate, useLocation } from 'react-router-dom-v5-compat';
|
||||
// @ts-ignore
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
import { locationSearchToObject, navigationLogger, reportPageview } from '@grafana/runtime';
|
||||
import { ErrorBoundary } from '@grafana/ui';
|
||||
|
||||
// @ts-ignore
|
||||
import Drop from '../../../vendor/tether-drop';
|
||||
import { useGrafana } from '../context/GrafanaContext';
|
||||
import { contextSrv } from '../services/context_srv';
|
||||
|
||||
@@ -102,7 +102,8 @@ function cleanupDOM() {
|
||||
|
||||
// cleanup tether-drop
|
||||
// TODO: Vite doesn't like this. Pretty sure the lib is incompatible with Vite.
|
||||
// for (const drop of Drop.drops) {
|
||||
// drop.destroy();
|
||||
// }
|
||||
// @ts-ignore
|
||||
for (const drop of Drop.drops) {
|
||||
drop.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import 'jquery';
|
||||
import { partition, each } from 'lodash';
|
||||
//@ts-ignore
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
import { CreatePlotOverlay } from '@grafana/data';
|
||||
import { getLegacyAngularInjector } from '@grafana/runtime';
|
||||
|
||||
//@ts-ignore
|
||||
import Drop from '../../../vendor/tether-drop';
|
||||
|
||||
const createAnnotationToolip: CreatePlotOverlay = (element, event, plot) => {
|
||||
const injector = getLegacyAngularInjector();
|
||||
const content = document.createElement('div');
|
||||
|
||||
Reference in New Issue
Block a user