From 78f6830622ca32e7ca724fdc814be47cce518e5c Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Wed, 24 Jul 2024 07:58:48 -0400 Subject: [PATCH] add the Force to emails as well --- .../AssistantEmailBoxSourceController.php | 1 + .../Sources/EmailBoxSourceController.php | 2 ++ app/Http/Middleware/HandleInertiaRequests.php | 1 + config/llmlarahub.php | 1 + .../Sources/EmailBoxSource/Components/Card.vue | 4 ++-- .../EmailBoxSource/Components/Resources.vue | 14 ++++++++++++++ .../js/Pages/Sources/EmailBoxSource/Create.vue | 1 + resources/js/Pages/Sources/EmailBoxSource/Edit.vue | 1 + .../Pages/Sources/EmailSource/Components/Card.vue | 2 +- .../Sources/EmailSource/Components/Resources.vue | 13 +++++++++++++ resources/js/Pages/Sources/EmailSource/Create.vue | 1 + resources/js/Pages/Sources/EmailSource/Edit.vue | 1 + 12 files changed, 39 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AssistantEmailBoxSourceController.php b/app/Http/Controllers/AssistantEmailBoxSourceController.php index 53588faa..3d9a5fee 100644 --- a/app/Http/Controllers/AssistantEmailBoxSourceController.php +++ b/app/Http/Controllers/AssistantEmailBoxSourceController.php @@ -31,6 +31,7 @@ protected function makeSource(array $validated, Collection $collection): void 'details' => $validated['details'], 'recurring' => $validated['recurring'], 'active' => $validated['active'], + 'force' => data_get($validated, 'force', false), 'collection_id' => $collection->id, 'user_id' => $this->getUserId($collection), 'type' => $this->sourceTypeEnum, diff --git a/app/Http/Controllers/Sources/EmailBoxSourceController.php b/app/Http/Controllers/Sources/EmailBoxSourceController.php index b2c1212d..b1e86444 100644 --- a/app/Http/Controllers/Sources/EmailBoxSourceController.php +++ b/app/Http/Controllers/Sources/EmailBoxSourceController.php @@ -36,6 +36,7 @@ protected function makeSource(array $validated, Collection $collection): void 'details' => $validated['details'], 'recurring' => $validated['recurring'], 'active' => $validated['active'], + 'force' => data_get($validated, 'force', false), 'user_id' => $this->getUserId($collection), 'collection_id' => $collection->id, 'type' => $this->sourceTypeEnum, @@ -77,6 +78,7 @@ protected function updateSource(Source $source, array $validated): void $source->update([ 'title' => $validated['title'], 'details' => $validated['details'], + 'force' => data_get($validated, 'force', false), 'recurring' => $validated['recurring'], 'active' => $validated['active'], ]); diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index c12c4140..e33213b7 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -39,6 +39,7 @@ public function version(Request $request): ?string public function share(Request $request): array { return array_merge(parent::share($request), [ + 'email_name' => config('llmlarahub.email_name'), 'steps' => Setting::createNewSetting()->steps, 'llms' => Setting::getLlms(), 'active_llms' => Setting::getAllActiveLlms(), diff --git a/config/llmlarahub.php b/config/llmlarahub.php index e42a1975..d6f711e2 100644 --- a/config/llmlarahub.php +++ b/config/llmlarahub.php @@ -1,6 +1,7 @@ env('LARALAMMA_EMAIL_NAME', 'assistant'), 'domain' => env('LARALAMMA_DOMAIN', 'larallama.io'), 'collection' => [ 'system_prompt' => 'This is a collection of data the user has imported that they will diff --git a/resources/js/Pages/Sources/EmailBoxSource/Components/Card.vue b/resources/js/Pages/Sources/EmailBoxSource/Components/Card.vue index 13230afa..a06f7ee0 100644 --- a/resources/js/Pages/Sources/EmailBoxSource/Components/Card.vue +++ b/resources/js/Pages/Sources/EmailBoxSource/Components/Card.vue @@ -1,6 +1,6 @@