Fix dragula import, remove conflicting global

This commit is contained in:
Alexander Brandon Coles
2025-07-14 21:26:34 +01:00
parent 8c780ca160
commit 1ea7b92fa8
2 changed files with 4 additions and 7 deletions
@@ -29,6 +29,7 @@
*/
import { Controller } from '@hotwired/stimulus';
import dragula from 'dragula';
import jQuery from 'jquery';
import 'tablesorter';
@@ -565,10 +566,9 @@ export default class PageController extends Controller {
}
private recreateSortables() {
const containers = jQuery('.group-by--selected-elements').toArray();
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any
(dragula as any)(containers, {
mirrorContainer: document.getElementById('group-by--area'),
const containers = Array.from(document.querySelectorAll('.group-by--selected-elements'));
dragula(containers, {
mirrorContainer: document.getElementById('group-by--area')!,
});
}
-3
View File
@@ -11,14 +11,12 @@
/// <reference path="../../node_modules/@types/moment-timezone/index.d.ts" />
/// <reference path="../../node_modules/@types/urijs/index.d.ts" />
/// <reference path="../../node_modules/@types/webpack-env/index.d.ts" />
/// <reference path="../../node_modules/@types/dragula/index.d.ts" />
/// <reference path="../../node_modules/@types/resize-observer-browser/index.d.ts" />
import { Injector } from '@angular/core';
import { OpenProject } from 'core-app/core/setup/globals/openproject';
import * as TLodash from 'lodash';
import { Dragula } from 'dragula';
import { Screenfull } from 'screenfull';
import { ErrorReporterBase } from 'core-app/core/errors/error-reporter-base';
import { I18n } from 'i18n-js';
@@ -57,7 +55,6 @@ declare module '@hotwired/turbo' {
declare global {
const _:typeof TLodash;
const I18n:I18n;
const dragula:Dragula;
}
declare global {