From 58425b1c6e76786afeabad59d93d7bffa6628d28 Mon Sep 17 00:00:00 2001 From: inmanturbo Date: Thu, 20 Jun 2024 01:43:38 +0000 Subject: [PATCH 1/6] Update CHANGELOG --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81e0dc7..b2ce260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to `one-app` will be documented in this file. +## v1.0.21 - 2024-06-20 + +### What's Changed + +* Fix installation command by @imanghafoori1 in https://github.com/envor/one-app/pull/26 +* Don't check for team until the payload is being created by @inmanturbo in https://github.com/envor/one-app/pull/27 + +### New Contributors + +* @imanghafoori1 made their first contribution in https://github.com/envor/one-app/pull/26 + +**Full Changelog**: https://github.com/envor/one-app/compare/v1.0.20...v1.0.21 + ## v1.0.20 - 2024-06-04 ### What's Changed From e25766485cc45f4ecb5c57146e67fcc82b4263cb Mon Sep 17 00:00:00 2001 From: inmanturbo <47095624+inmanturbo@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:12:23 -0400 Subject: [PATCH 2/6] Update Team.php --- stubs/one-app/app/Models/Team.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stubs/one-app/app/Models/Team.php b/stubs/one-app/app/Models/Team.php index a6ab9a1..dc7fe84 100644 --- a/stubs/one-app/app/Models/Team.php +++ b/stubs/one-app/app/Models/Team.php @@ -58,6 +58,8 @@ protected function casts(): array protected function configured(): void { app()->forgetInstance('team'); + app()->forgetInstance('datastore_context'); + app()->instance('datastore_context', $this); app()->instance('team', $this); } } From 39504405800cee217602abe227ba2903c5efdc26 Mon Sep 17 00:00:00 2001 From: inmanturbo <47095624+inmanturbo@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:16:10 -0400 Subject: [PATCH 3/6] Update DomainServiceProvider.php --- .../app/Providers/DomainServiceProvider.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/stubs/one-app/app/Providers/DomainServiceProvider.php b/stubs/one-app/app/Providers/DomainServiceProvider.php index 665ce04..dc3e4ae 100644 --- a/stubs/one-app/app/Providers/DomainServiceProvider.php +++ b/stubs/one-app/app/Providers/DomainServiceProvider.php @@ -55,13 +55,21 @@ public function configureRequests() public function configureQueue() { $this->app['queue']->createPayloadUsing(function () { - return isset($this->app['team']) ? [ - 'team_uuid' => $this->app['team']->uuid, - ] : []; + + $datastoreContext = $this->app[HasDatastoreContext::class]->datastoreContext(); + + if(! $datastoreContext) { + return []; + } + + return [ + 'team_uuid' => $datastoreContext->uuid, + ]; + }); $this->app['events']->listen(JobProcessing::class, function ($event) { - if (isset($event->job->payload()['team_uuid'])) { + if(isset($event->job->payload()['team_uuid'])) { $team = Team::where('uuid', $event->job->payload()['team_uuid'])->first(); $team->configure()->use(); } From 849840c485b86fb01b5273ff6fe607238f92a186 Mon Sep 17 00:00:00 2001 From: inmanturbo Date: Thu, 20 Jun 2024 18:16:33 +0000 Subject: [PATCH 4/6] Fix styling --- stubs/one-app/app/Providers/DomainServiceProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/one-app/app/Providers/DomainServiceProvider.php b/stubs/one-app/app/Providers/DomainServiceProvider.php index dc3e4ae..8116df9 100644 --- a/stubs/one-app/app/Providers/DomainServiceProvider.php +++ b/stubs/one-app/app/Providers/DomainServiceProvider.php @@ -56,9 +56,9 @@ public function configureQueue() { $this->app['queue']->createPayloadUsing(function () { - $datastoreContext = $this->app[HasDatastoreContext::class]->datastoreContext(); + $datastoreContext = $this->app[HasDatastoreContext::class]->datastoreContext(); - if(! $datastoreContext) { + if (! $datastoreContext) { return []; } @@ -69,7 +69,7 @@ public function configureQueue() }); $this->app['events']->listen(JobProcessing::class, function ($event) { - if(isset($event->job->payload()['team_uuid'])) { + if (isset($event->job->payload()['team_uuid'])) { $team = Team::where('uuid', $event->job->payload()['team_uuid'])->first(); $team->configure()->use(); } From a176b6456f873f2096d8574fab0be64e5bdc3fc0 Mon Sep 17 00:00:00 2001 From: inmanturbo <47095624+inmanturbo@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:20:34 -0400 Subject: [PATCH 5/6] Update DomainServiceProvider.php --- stubs/one-app/app/Providers/DomainServiceProvider.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stubs/one-app/app/Providers/DomainServiceProvider.php b/stubs/one-app/app/Providers/DomainServiceProvider.php index 8116df9..6b22002 100644 --- a/stubs/one-app/app/Providers/DomainServiceProvider.php +++ b/stubs/one-app/app/Providers/DomainServiceProvider.php @@ -55,7 +55,6 @@ public function configureRequests() public function configureQueue() { $this->app['queue']->createPayloadUsing(function () { - $datastoreContext = $this->app[HasDatastoreContext::class]->datastoreContext(); if (! $datastoreContext) { @@ -65,13 +64,12 @@ public function configureQueue() return [ 'team_uuid' => $datastoreContext->uuid, ]; - }); $this->app['events']->listen(JobProcessing::class, function ($event) { if (isset($event->job->payload()['team_uuid'])) { $team = Team::where('uuid', $event->job->payload()['team_uuid'])->first(); - $team->configure()->use(); + $team?->configure()?->use(); } }); } From c7e7f70a6c56a64ed45186bb307484ceb0350970 Mon Sep 17 00:00:00 2001 From: inmanturbo <47095624+inmanturbo@users.noreply.github.com> Date: Thu, 20 Jun 2024 14:32:01 -0400 Subject: [PATCH 6/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4f4b5cf..a5a6375 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": "^8.2", - "envor/laravel-datastore": "^1.2", + "envor/laravel-datastore": "^1.2.14", "envor/laravel-schema-macros": "^1.1", "envor/platform": "^1.6", "headerx/laravel-jetstream-passport": "^1.0",