diff --git a/ProcessMaker/Http/Controllers/CasesController.php b/ProcessMaker/Http/Controllers/CasesController.php
index 942c87ac95..f96d6cdc1a 100644
--- a/ProcessMaker/Http/Controllers/CasesController.php
+++ b/ProcessMaker/Http/Controllers/CasesController.php
@@ -20,10 +20,12 @@ class CasesController extends Controller
*/
public function index()
{
+ $manager = app(ScreenBuilderManager::class);
+ event(new ScreenBuilderStarting($manager, 'FORM'));
$currentUser = Auth::user()->only(['id', 'username', 'fullname', 'firstname', 'lastname', 'avatar']);
// This is a temporary API the engine team will provide the new
- return view('cases.casesMain', compact('currentUser'));
+ return view('cases.casesMain', compact('currentUser', 'manager'));
}
/**
diff --git a/resources/js/components/TreeView.vue b/resources/js/components/TreeView.vue
index e60a779c4e..459fdcdcb6 100644
--- a/resources/js/components/TreeView.vue
+++ b/resources/js/components/TreeView.vue
@@ -37,7 +37,7 @@ export default {
},
},
mounted() {
- const jsonCrackEmbed = this.$refs.jsonCrackEmbed;
+ const { jsonCrackEmbed } = this.$refs;
const json = this.jsonData === "" ? "{}" : this.jsonData;
const options = {
theme: "light",
diff --git a/resources/js/next/badPractices.js b/resources/js/next/badPractices.js
new file mode 100644
index 0000000000..36307e2b89
--- /dev/null
+++ b/resources/js/next/badPractices.js
@@ -0,0 +1,53 @@
+/**
+ * BAD PRACTICES
+ */
+
+// Use multiple forms of an event bus.
+window.ProcessMaker = {
+ EventBus: new Vue(),
+ events: new Vue()
+};
+
+// Force to overload the vue object
+window.Vue.prototype.moment = moment;
+
+// Load all statements in a single file bootstrap.js
+
+// Overload the window.ProcessMaker variable without using the setGlobalVariable function
+
+// Use local variables instead of window.ProcessMaker
+window.ProcessMaker.removeNotifications = (messageIds = [], urls = []) => {
+ return window.ProcessMaker.apiClient.put("/read_notifications", { message_ids: messageIds, routes: urls }).then(() => {
+ messageIds.forEach((messageId) => {
+ ProcessMaker.notifications.splice(ProcessMaker.notifications.findIndex((x) => x.id === messageId), 1);
+ });
+
+ urls.forEach((url) => {
+ const messageIndex = ProcessMaker.notifications.findIndex((x) => x.url === url);
+ if (messageIndex >= 0) {
+ ProcessMaker.removeNotification(ProcessMaker.notifications[messageIndex].id);
+ }
+ });
+ });
+};
+
+// Remove the saved search unneeded
+class InjectJavascript
+{
+ public function handle($request, Closure $next)
+ {
+ $response = $next($request);
+ if (get_class($response) !== Response::class) {
+ return $response;
+ }
+ $content = $response->getContent();
+ $tag = '';
+ $tag .= '';
+ $tag .= '';
+ $content = str_replace('