Files
ltbxd-actorle/assets/bootstrap.js
thibaud-leclere 6a844542ad feat: replace notifications with import status in profile dropdown
Remove the notification system entirely and show import progress
directly in the user dropdown menu. Block new imports while one
is already running.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 21:34:05 +02:00

26 lines
1.2 KiB
JavaScript

import { startStimulusApp } from 'vite-plugin-symfony/stimulus/helpers';
import DropdownController from './controllers/dropdown_controller.js';
import ImportModalController from './controllers/import_modal_controller.js';
import ImportStatusController from './controllers/import_status_controller.js';
const app = startStimulusApp();
app.register('dropdown', DropdownController);
app.register('import-modal', ImportModalController);
app.register('import-status', ImportStatusController);
// Register React components for {{ react_component() }} Twig function.
// We register them manually because @symfony/ux-react's registerReactControllerComponents
// expects Webpack's require.context API, which is not available in Vite.
const reactControllers = import.meta.glob('./react/controllers/**/*.jsx', { eager: true });
window.resolveReactComponent = (name) => {
const key = `./react/controllers/${name}.jsx`;
const module = reactControllers[key];
if (!module) {
const available = Object.keys(reactControllers)
.map(k => k.replace('./react/controllers/', '').replace('.jsx', ''));
throw new Error(`React controller "${name}" does not exist. Possible values: ${available.join(', ')}`);
}
return module;
};