PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.2.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.2.0
2.2.0 2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 All 43 releases
← All changes | app/Services/Intergrations/FluentCRM/Init.php +48 -20 1.35 → 2.2.0 View file →
@@ -2,9 +2,9 @@
2 2
3 3 namespace FluentBoards\App\Services\Intergrations\FluentCRM;
4 4
5 5 use FluentBoards\App\App;
6 -use FluentBoards\App\Hooks\Handlers\FluentCrmIntegration;
6 +use FluentBoards\App\Vite;
7 7 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\ContactAddedBoardTrigger;
8 8 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\ContactAddedTaskTrigger;
9 9 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\StageChangedTrigger;
10 10 use FluentBoards\App\Services\Intergrations\FluentCRM\Automations\TaskCreateAction;
@@ -28,29 +28,57 @@
28 28 }
29 29
30 30 public function registerToContactSection()
31 31 {
32 -// (new FluentCrmIntegration())->registerCustomSection();
33 - add_action( 'fluent_crm/global_appjs_loaded', function () {
34 - $app = App::getInstance();
32 + add_action('fluent_crm/global_app_boot_loaded', function () {
33 + $this->enqueueCrmContactApp3();
34 + });
35 + }
35 36
36 - $assets = $app['url.assets'];
37 + /**
38 + * Enqueue the FluentCRM contact app bundle.
39 + *
40 + * @return void
41 + */
42 + protected function enqueueCrmContactApp3()
43 + {
44 + $app = App::getInstance();
45 + $assets = $app['url.assets'];
46 + $slug = $app->config->get('app.slug');
47 + $handle = $slug . '_in_crm_contact_app3';
48 + $dependencies = wp_script_is('fluentcrm_admin_app_boot', 'registered') || wp_script_is('fluentcrm_admin_app_boot', 'enqueued')
49 + ? ['fluentcrm_admin_app_boot']
50 + : [];
37 51
38 - $slug = $app->config->get('app.slug');
39 - wp_enqueue_script( $slug . '_in_crm', FLUENT_BOARDS_PLUGIN_URL . 'assets/crm-contact-app.js', [], FLUENT_BOARDS_PLUGIN_VERSION);
40 - wp_enqueue_style($slug . '_in_crm', FLUENT_BOARDS_PLUGIN_URL . 'assets/admin/crm-contact-app.css', [], FLUENT_BOARDS_PLUGIN_VERSION);
41 - wp_localize_script($slug . '_in_crm', 'fluentAddonVars', [
42 - 'slug' => $slug = $app->config->get('app.slug'),
43 - 'nonce' => wp_create_nonce($slug),
44 - 'rest' => $this->getRestInfo($app),
45 - 'ajaxurl' => admin_url('admin-ajax.php'),
46 - 'asset_url' => $assets,
47 - 'trans' => TransStrings::getStrings(),
48 - 'base_url' => fluent_boards_page_url(),
49 - 'admin_url' => admin_url('admin.php'),
50 - 'render_in' => is_admin() ? 'admin' : 'front',
51 - ]);
52 - });
52 + Vite::injectViteClient();
53 +
54 + Vite::enqueueScript(
55 + $handle,
56 + 'admin/crm-contact-app3/app.js',
57 + $dependencies,
58 + FLUENT_BOARDS_PLUGIN_VERSION,
59 + true
60 + );
61 +
62 + wp_localize_script(
63 + $handle,
64 + 'fluentBoardsCrmContactApp',
65 + [
66 + 'slug' => $slug,
67 + 'nonce' => wp_create_nonce($slug),
68 + 'rest' => $this->getRestInfo($app),
69 + 'ajaxurl' => admin_url('admin-ajax.php'),
70 + 'asset_url' => $assets,
71 + 'trans' => TransStrings::getStrings(),
72 + 'base_url' => fluent_boards_page_url(),
73 + 'admin_app_url' => admin_url('admin.php?page=fluent-boards#/'),
74 + 'admin_url' => admin_url('admin.php'),
75 + 'render_in' => is_admin() ? 'admin' : 'front',
76 + 'has_pro' => defined('FLUENT_BOARDS_PRO_VERSION'),
77 + 'advanced_modules' => fluent_boards_get_pref_settings(),
78 + 'features' => fluent_boards_get_features_config(),
79 + ]
80 + );
53 81 }
54 82
55 83 public function registerAutomationFunnels()
56 84 {