From 9ae2d54a5e1959c5df72dd33a01b5d7e44cad24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Carodej?= Date: Thu, 10 Mar 2022 16:23:13 +0100 Subject: [PATCH] team invitation notification with broadcasting --- config/broadcasting.php | 8 +-- config/vuefilemanager.php | 4 +- config/websockets.php | 16 +++-- public/mix-manifest.json | 6 +- .../components/Notifications/Notification.vue | 29 ++++++++- .../Notifications/NotificationCenter.vue | 41 ------------- resources/js/store/modules/userAuth.js | 17 ++++++ routes/admin.php | 4 +- routes/user.php | 6 +- routes/web.php | 3 +- .../Console/Commands/SetupDevEnvironment.php | 6 +- src/App/Http/Kernel.php | 1 - src/App/Providers/RouteServiceProvider.php | 4 +- .../AccountAccessTokenController.php | 1 - src/App/Users/Resources/UserResource.php | 17 +++--- .../Users/Resources/UserStorageResource.php | 27 ++++----- .../Dashboard/GetDashboardDataController.php | 2 +- .../Actions/StoreFileExifMetadataAction.php | 45 +++++++------- src/Domain/Files/Actions/UploadFileAction.php | 1 - src/Domain/Files/Models/Exif.php | 8 +-- src/Domain/Files/Models/File.php | 6 +- src/Domain/Files/Resources/FileResource.php | 6 +- .../FlushUserNotificationsController.php | 5 +- .../GetUserNotificationsController.php | 3 +- .../MarkUserNotificationsAsReadController.php | 5 +- .../Notifications/Events/TestUpdate.php | 2 +- .../Resources/NotificationResource.php | 1 - .../Controllers/DownloadLogController.php | 11 ++-- .../StoreStorageCredentialsController.php | 5 +- .../StoreEnvironmentSettingsController.php | 2 +- ...arActionInInvitationNotificationAction.php | 38 ++++++++++++ .../InviteMembersIntoTeamFolderAction.php | 17 +++++- .../ConvertFolderIntoTeamFolderController.php | 1 - .../Controllers/InvitationsController.php | 40 ++++++++++--- .../Controllers/TeamFoldersController.php | 2 +- .../InvitationIntoTeamFolder.php | 23 ++++++- .../CreateUploadRequestController.php | 1 - .../SetUploadRequestAsFilledController.php | 4 +- .../UploadFilesForUploadRequestController.php | 4 +- .../UploadRequestFulfilledNotification.php | 6 +- .../Requests/StoreUploadRequest.php | 1 - .../Resources/UploadRequestResource.php | 4 +- src/Support/Middleware/AdminCheck.php | 3 +- src/Support/Middleware/TrustProxies.php | 2 +- src/Support/helpers.php | 13 ++-- tests/Domain/Files/FileTest.php | 8 +-- .../Notifications/NotificationsTest.php | 9 ++- tests/Domain/Settings/SettingsTest.php | 1 - tests/Domain/Teams/TeamManagementTest.php | 60 +++++++++++++++++++ .../UploadRequest/UploadRequestTest.php | 3 +- 50 files changed, 331 insertions(+), 201 deletions(-) create mode 100644 src/Domain/Teams/Actions/ClearActionInInvitationNotificationAction.php diff --git a/config/broadcasting.php b/config/broadcasting.php index cea9e7d3..ae00e4cc 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -34,11 +34,11 @@ return [ 'secret' => env('PUSHER_APP_SECRET'), 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'cluster' => env('PUSHER_APP_CLUSTER'), + 'cluster' => env('PUSHER_APP_CLUSTER'), 'encrypted' => true, - 'host' => '192.168.1.112', - 'port' => 6001, - 'scheme' => 'http' + 'host' => '192.168.1.112', + 'port' => 6001, + 'scheme' => 'http', ], ], diff --git a/config/vuefilemanager.php b/config/vuefilemanager.php index fdbafd41..7ac11824 100644 --- a/config/vuefilemanager.php +++ b/config/vuefilemanager.php @@ -5,8 +5,8 @@ return [ 'is_demo' => env('APP_DEMO', false), - 'is_setup_wizard_demo' => env('IS_SETUP_WIZARD_DEMO', false), - 'is_setup_wizard_debug' => env('IS_SETUP_WIZARD_DEBUG', false), + 'is_setup_wizard_demo' => env('IS_SETUP_WIZARD_DEMO', false), + 'is_setup_wizard_debug' => env('IS_SETUP_WIZARD_DEBUG', false), 'is_admin_vuefilemanager_bar' => env('IS_ADMIN_VUEFILEMANAGER_BAR', true), // Define size of chunk uploaded by MB. diff --git a/config/websockets.php b/config/websockets.php index 45415d76..98ec5d8d 100644 --- a/config/websockets.php +++ b/config/websockets.php @@ -3,7 +3,6 @@ use BeyondCode\LaravelWebSockets\Dashboard\Http\Middleware\Authorize; return [ - /* * Set a custom dashboard configuration */ @@ -23,14 +22,14 @@ return [ */ 'apps' => [ [ - 'id' => env('PUSHER_APP_ID'), - 'name' => env('APP_NAME'), - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'path' => env('PUSHER_APP_PATH'), - 'capacity' => null, + 'id' => env('PUSHER_APP_ID'), + 'name' => env('APP_NAME'), + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'path' => env('PUSHER_APP_PATH'), + 'capacity' => null, 'enable_client_messages' => false, - 'enable_statistics' => true, + 'enable_statistics' => true, ], ], @@ -48,7 +47,6 @@ return [ * Leave this empty if you want to accept requests from all hosts. */ 'allowed_origins' => [ - // ], /* diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 4abd01ca..db4e59fc 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -15,7 +15,7 @@ "/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=92c75a6c77689046", "/chunks/not-found.js": "/chunks/not-found.js?id=36763aa314e00327", "/chunks/temporary-unavailable.js": "/chunks/temporary-unavailable.js?id=a3906226272982b1", - "/chunks/admin.js": "/chunks/admin.js?id=920613c2b7236639", + "/chunks/admin.js": "/chunks/admin.js?id=a9cc617d7342978a", "/chunks/dashboard.js": "/chunks/dashboard.js?id=e7c6001687e641eb", "/chunks/invoices.js": "/chunks/invoices.js?id=85fd4514d3d85a71", "/chunks/subscriptions.js": "/chunks/subscriptions.js?id=9f970bdfc7583080", @@ -57,12 +57,12 @@ "/chunks/sign-up.js": "/chunks/sign-up.js?id=098d7f41b85066bf", "/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=d6193ed0b07e7957", "/chunks/create-new-password.js": "/chunks/create-new-password.js?id=d00212636148a14b", - "/chunks/settings.js": "/chunks/settings.js?id=f4a7bce3ff4c61a9", + "/chunks/settings.js": "/chunks/settings.js?id=71ee8010419a7b69", "/chunks/profile.js": "/chunks/profile.js?id=1217f457145491ec", "/chunks/settings-password.js": "/chunks/settings-password.js?id=b6704f4cbf14c67d", "/chunks/settings-storage.js": "/chunks/settings-storage.js?id=90ba712f3728443b", "/chunks/billing.js": "/chunks/billing.js?id=27957f2477fdd121", - "/chunks/platform.js": "/chunks/platform.js?id=85ee6709fe4e3b7e", + "/chunks/platform.js": "/chunks/platform.js?id=4001e2c2fd8b27ce", "/chunks/files.js": "/chunks/files.js?id=0d4e7a1330328eae", "/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=2362f8fa4e3392e9", "/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=25e9d29dd3c29338", diff --git a/resources/js/components/Notifications/Notification.vue b/resources/js/components/Notifications/Notification.vue index ac475417..5aa547b8 100644 --- a/resources/js/components/Notifications/Notification.vue +++ b/resources/js/components/Notifications/Notification.vue @@ -23,7 +23,7 @@ {{ notification.data.attributes.description }}

-
+
-
+
@@ -42,6 +43,7 @@
@@ -69,6 +71,7 @@