From 4dd49ee34a788ccf1217d7775fe1fa2bcefa6b5f Mon Sep 17 00:00:00 2001
From: Henry Jonas
Date: Mon, 9 Dec 2024 09:29:26 -0400
Subject: [PATCH 1/9] FOUR-20583: A tests
---
.../Http/Controllers/CasesController.php | 4 +-
resources/js/next/badPractices.js | 53 +++++
resources/js/next/config/accesibility.js | 3 +
resources/js/next/config/i18n.js | 41 ++++
resources/js/next/config/modals.js | 34 +++
resources/js/next/config/momentConfig.js | 11 +
resources/js/next/config/notifications.js | 66 ++++++
resources/js/next/config/openAI.js | 11 +
resources/js/next/config/processmaker.js | 134 +++++++++++
resources/js/next/config/session.js | 79 +++++++
resources/js/next/config/user.js | 31 +++
resources/js/next/layout/navbar.js | 212 ++++++++++++++++++
resources/js/next/layout/sidebar.js | 31 +++
resources/js/next/libraries/bootstrap.js | 4 +
resources/js/next/libraries/broadcast.js | 12 +
resources/js/next/libraries/jquery.js | 1 +
resources/js/next/libraries/lodash.js | 3 +
resources/js/next/libraries/popper.js | 1 +
resources/js/next/libraries/vueCookies.js | 3 +
resources/js/next/libraries/vueDeepset.js | 3 +
.../js/next/libraries/vueFormElements.js | 3 +
resources/js/next/libraries/vueRouter.js | 11 +
resources/js/next/libraries/vueTable.js | 3 +
resources/js/next/libraries/vuex.js | 5 +
resources/js/next/modeler.js | 6 +
resources/js/next/monaco.js | 5 +
resources/js/next/screenBuilder.js | 48 ++++
.../jscomposition/cases/casesMain/loader.js | 49 ++++
resources/views/cases/casesMain.blade.php | 11 +-
resources/views/layouts/layout.blade.php | 2 +-
resources/views/layouts/layoutnext.blade.php | 155 +++++++++++++
webpack.mix.js | 1 +
32 files changed, 1032 insertions(+), 4 deletions(-)
create mode 100644 resources/js/next/badPractices.js
create mode 100644 resources/js/next/config/accesibility.js
create mode 100644 resources/js/next/config/i18n.js
create mode 100644 resources/js/next/config/modals.js
create mode 100644 resources/js/next/config/momentConfig.js
create mode 100644 resources/js/next/config/notifications.js
create mode 100644 resources/js/next/config/openAI.js
create mode 100644 resources/js/next/config/processmaker.js
create mode 100644 resources/js/next/config/session.js
create mode 100644 resources/js/next/config/user.js
create mode 100644 resources/js/next/layout/navbar.js
create mode 100644 resources/js/next/layout/sidebar.js
create mode 100644 resources/js/next/libraries/bootstrap.js
create mode 100644 resources/js/next/libraries/broadcast.js
create mode 100644 resources/js/next/libraries/jquery.js
create mode 100644 resources/js/next/libraries/lodash.js
create mode 100644 resources/js/next/libraries/popper.js
create mode 100644 resources/js/next/libraries/vueCookies.js
create mode 100644 resources/js/next/libraries/vueDeepset.js
create mode 100644 resources/js/next/libraries/vueFormElements.js
create mode 100644 resources/js/next/libraries/vueRouter.js
create mode 100644 resources/js/next/libraries/vueTable.js
create mode 100644 resources/js/next/libraries/vuex.js
create mode 100644 resources/js/next/modeler.js
create mode 100644 resources/js/next/monaco.js
create mode 100644 resources/js/next/screenBuilder.js
create mode 100644 resources/jscomposition/cases/casesMain/loader.js
create mode 100644 resources/views/layouts/layoutnext.blade.php
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/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('
+@{{ __('Skip to Content') }}
+
+ @if (shouldShow('leftSideBar'))
+
+ @else
+
+ @endif
+
+
+ @include('layouts.navbar')
+
+
+
+ @yield('content')
+
+
+
+
+
+
+
@{{__('Sorry! API failed to load')}}
+
@{{__('Something went wrong. Try refreshing the application')}}
+
+
+
+@if(config('broadcasting.default') == 'redis')
+
+@endif
+{{-- --}}
+
+ @yield('js')
+
+
+
+
+ {{-- @isset($addons)
+ @foreach ($addons as $addon)
+ @if (!empty($addon['script_mix']))
+
+ @endif
+ @if (!empty($addon['script_mix_module']))
+
+ @endif
+ @endforeach
+ @endisset
+
+ @if (hasPackage('package-accessibility'))
+ @include('package-accessibility::userway')
+ @endif --}}
+
+