2023-05-04 14:01:35 +02:00
|
|
|
import 'core-js/proposals/relative-indexing-method';
|
2019-07-02 14:38:42 +02:00
|
|
|
import Rails from '@rails/ujs';
|
|
|
|
import * as ActiveStorage from '@rails/activestorage';
|
2022-04-29 18:13:59 +02:00
|
|
|
import * as Turbo from '@hotwired/turbo';
|
2022-06-23 11:28:31 +02:00
|
|
|
import { Application } from '@hotwired/stimulus';
|
2022-08-31 14:49:53 +02:00
|
|
|
import '@gouvfr/dsfr/dist/dsfr.module.js';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2019-02-13 14:16:22 +01:00
|
|
|
import '../shared/activestorage/ujs';
|
2022-07-19 12:22:43 +02:00
|
|
|
import '../shared/safari-11-empty-file-workaround';
|
2019-02-19 14:29:06 +01:00
|
|
|
import '../shared/toggle-target';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2022-06-23 11:28:31 +02:00
|
|
|
import { registerControllers } from '../shared/stimulus-loader';
|
2022-04-20 11:14:48 +02:00
|
|
|
|
2018-07-12 11:50:47 +02:00
|
|
|
import '../new_design/form-validation';
|
2019-04-01 15:04:11 +02:00
|
|
|
import '../new_design/procedure-context';
|
2019-10-21 18:12:57 +02:00
|
|
|
import '../new_design/procedure-form';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2023-01-12 18:34:45 +01:00
|
|
|
import { toggleCondidentielExplanation } from '../new_design/avis';
|
2019-02-18 17:52:15 +01:00
|
|
|
import {
|
|
|
|
showMotivation,
|
|
|
|
motivationCancel,
|
2023-03-29 10:26:03 +02:00
|
|
|
motivationCancelBatchDropdown,
|
2023-03-27 16:07:24 +02:00
|
|
|
showImportJustificatif,
|
|
|
|
showDeleteJustificatif,
|
|
|
|
deleteJustificatif
|
2023-02-23 11:04:15 +01:00
|
|
|
} from '../new_design/instruction-button';
|
2022-07-13 14:03:41 +02:00
|
|
|
import { showFusion, showNewAccount } from '../new_design/fc-fusion';
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2022-06-23 11:28:31 +02:00
|
|
|
const application = Application.start();
|
|
|
|
registerControllers(application);
|
|
|
|
|
2018-07-12 11:50:47 +02:00
|
|
|
// This is the global application namespace where we expose helpers used from rails views
|
|
|
|
const DS = {
|
|
|
|
toggleCondidentielExplanation,
|
|
|
|
showMotivation,
|
|
|
|
motivationCancel,
|
2023-03-29 10:26:03 +02:00
|
|
|
motivationCancelBatchDropdown,
|
2019-02-18 17:52:15 +01:00
|
|
|
showImportJustificatif,
|
2023-03-27 16:07:24 +02:00
|
|
|
showDeleteJustificatif,
|
|
|
|
deleteJustificatif,
|
2021-10-13 09:23:40 +02:00
|
|
|
showFusion,
|
2023-01-12 18:34:45 +01:00
|
|
|
showNewAccount
|
2018-07-12 11:50:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Start Rails helpers
|
|
|
|
ActiveStorage.start();
|
2022-06-27 13:40:59 +02:00
|
|
|
if (!window._rails_loaded) {
|
|
|
|
Rails.start();
|
|
|
|
}
|
2022-04-20 14:17:40 +02:00
|
|
|
Turbo.session.drive = false;
|
2018-07-12 11:50:47 +02:00
|
|
|
|
2019-12-03 16:13:20 +01:00
|
|
|
// Expose globals
|
|
|
|
window.DS = window.DS || DS;
|
2022-06-17 12:36:21 +02:00
|
|
|
|
2022-09-07 15:50:57 +02:00
|
|
|
// enable legacy mode of DSFR when vite is not detectde as modern browser
|
|
|
|
window.addEventListener('load', function () {
|
|
|
|
if (!window.__vite_is_modern_browser) {
|
|
|
|
window.dsfr.internals.legacy.setLegacy();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-07-01 10:07:39 +02:00
|
|
|
import('../shared/track/matomo');
|
|
|
|
import('../shared/track/sentry');
|