mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Prep admin JS
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
%head
|
||||
= render :partial => 'spree/admin/shared/head'
|
||||
|
||||
%body.admin
|
||||
%body.admin{ "data-turbo": "false" }
|
||||
- if content_for?(:main_ng_app_name)
|
||||
- if content_for?(:main_ng_ctrl_name)
|
||||
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe, "ng-controller" => yield(:main_ng_ctrl_name).strip.html_safe }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
%html{ lang: "en", "ng-csp": "no-unsafe-eval" }
|
||||
%head= render :partial => 'spree/admin/shared/head'
|
||||
%body.admin{"data-ajax-root-path" => main_app.root_path}
|
||||
%body.admin{"data-turbo": "false", "data-ajax-root-path": main_app.root_path}
|
||||
#wrapper
|
||||
- if flash[:error]
|
||||
.flash.error= flash[:error]
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import { Application } from "stimulus";
|
||||
import { definitionsFromContext } from "stimulus/webpack-helpers";
|
||||
import "controllers";
|
||||
import "channels";
|
||||
|
||||
const application = Application.start();
|
||||
const context = require.context("controllers", true, /.js$/);
|
||||
application.load(definitionsFromContext(context));
|
||||
import "@hotwired/turbo";
|
||||
import CableReady from "cable_ready";
|
||||
import mrujs from "mrujs";
|
||||
import { CableCar } from "mrujs/plugins";
|
||||
|
||||
import StimulusReflex from "stimulus_reflex";
|
||||
import consumer from "../channels/consumer";
|
||||
import controller from "../controllers/application_controller";
|
||||
|
||||
application.consumer = consumer;
|
||||
StimulusReflex.initialize(application, { controller, isolate: true });
|
||||
StimulusReflex.debug = process.env.RAILS_ENV === "development";
|
||||
CableReady.initialize({ consumer });
|
||||
mrujs.start({
|
||||
plugins: [new CableCar(CableReady, { mimeType: "text/vnd.cable-ready.json" })],
|
||||
});
|
||||
|
||||
import debounced from "debounced";
|
||||
debounced.initialize({ input: { wait: 300 } });
|
||||
|
||||
Reference in New Issue
Block a user