diff --git a/composer.json b/composer.json index 62b9e754..b3ec0fcf 100644 --- a/composer.json +++ b/composer.json @@ -10,44 +10,44 @@ "require": { "php": "^8.0", "ext-json": "*", - "brianium/paratest": "^6.3", + "brianium/paratest": "^6.3.2", "cartalyst/stripe-laravel": "^13.1", "cocur/slugify": "^4.0", - "doctrine/dbal": "^2.13.2", + "doctrine/dbal": "^2.13.4", "fideloper/proxy": "^4.4.1", "fruitcake/laravel-cors": "^2.0.4", "gabrielelana/byte-units": "^0.5.0", - "guzzlehttp/guzzle": "^7.3.0", - "intervention/image": "^2.6.0", + "guzzlehttp/guzzle": "^7.4.0", + "intervention/image": "^2.7.0", "jaybizzle/laravel-crawler-detect": "^1.2", "kyslik/column-sortable": "^6.4.1", "laravel/cashier": "^12.15.0", - "laravel/fortify": "^1.7.14", - "laravel/framework": "^8.50.0", - "laravel/sanctum": "^2.11.2", - "laravel/tinker": "^2.6.1", - "laravel/ui": "^3.2.0", + "laravel/fortify": "^1.8.3", + "laravel/framework": "^8.69.0", + "laravel/sanctum": "^2.12.1", + "laravel/tinker": "^2.6.2", + "laravel/ui": "^3.3.1", "league/flysystem-aws-s3-v3": "^1.0.29", "league/flysystem-cached-adapter": "^1.1.0", - "spatie/data-transfer-object": "^3.6", - "spatie/laravel-backup": "^6.16.1", - "spatie/laravel-query-builder": "^3.5", + "spatie/data-transfer-object": "^3.7.2", + "spatie/laravel-backup": "^6.16.5", + "spatie/laravel-query-builder": "^3.6", "spatie/laravel-queueable-action": "^2.12", "spatie/laravel-tail": "^4.3.3", - "stechstudio/laravel-zipstream": "^4.4", + "stechstudio/laravel-zipstream": "^4.5", "teamtnt/laravel-scout-tntsearch-driver": "^11.5.0.0", - "vimeo/psalm": "^4.8.1" + "vimeo/psalm": "^4.11.2" }, "require-dev": { "ext-json": "*", "barryvdh/laravel-ide-helper": "^2.10", - "facade/ignition": "^2.11.0", - "fakerphp/faker": "^1.15.0", - "friendsofphp/php-cs-fixer": "^3.0.0", - "mockery/mockery": "^1.4.3", - "nunomaduro/collision": "^5.5.0", - "nunomaduro/larastan": "^0.7.12", - "phpunit/phpunit": "^9.5.6" + "facade/ignition": "^2.16.0", + "fakerphp/faker": "^1.16.0", + "friendsofphp/php-cs-fixer": "^3.2.1", + "mockery/mockery": "^1.4.4", + "nunomaduro/collision": "^5.10.0", + "nunomaduro/larastan": "^0.7.15", + "phpunit/phpunit": "^9.5.10" }, "config": { "optimize-autoloader": true, diff --git a/composer.lock b/composer.lock index b003b21d..a31daf42 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cc6fc3139c683c235e4ceb5158a91874", + "content-hash": "c617bc30d5d9ccd44d3ec626ca2670d9", "packages": [ { "name": "amphp/amp", diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 393ad24e..34bb8678 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -8,7 +8,7 @@ "/chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/~3e4fdd8b.js": "/chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/~3e4fdd8b.js?id=1d731f1c4a9daecb2a99", "/chunks/admin~chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-item~9b68162c.js": "/chunks/admin~chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-item~9b68162c.js?id=5841d65172536a8a9bdc", "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~673d1ac3.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~673d1ac3.js?id=d00148360f3d89f2791e", - "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.js?id=242a9e122b975c48009d", + "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.js?id=87c5115ea4a36da1ad72", "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~1bec6fe4.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~1bec6fe4.js?id=510e6c1b1017a73a40a6", "/chunks/admin~chunks/platform.js": "/chunks/admin~chunks/platform.js?id=90270d0c5aeb5c50dacf", "/chunks/admin~chunks/platform~chunks/settings.js": "/chunks/admin~chunks/platform~chunks/settings.js?id=61e970ffb679245686c3", @@ -57,7 +57,7 @@ "/chunks/plan-settings.js": "/chunks/plan-settings.js?id=19c260a6aa85d20c8042", "/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=99854b8b4518fbebc79f", "/chunks/plans.js": "/chunks/plans.js?id=6fca685daa45f22e4c8f", - "/chunks/platform.js": "/chunks/platform.js?id=7e53bcf8da2d3f9ce731", + "/chunks/platform.js": "/chunks/platform.js?id=1863e0b77ad5c26a05bc", "/chunks/platform~chunks/settings-subscription~chunks/shared~chunks/user-subscription.js": "/chunks/platform~chunks/settings-subscription~chunks/shared~chunks/user-subscription.js?id=8656b69a97cace919251", "/chunks/platform~chunks/shared.js": "/chunks/platform~chunks/shared.js?id=1bb410d04a3fb0bdd15c", "/chunks/profile.js": "/chunks/profile.js?id=022c1617a575d4aab4e1", @@ -84,7 +84,7 @@ "/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=6b94c5fda72871b8d2bd", "/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=63e8e2a410ab48102b0c", "/chunks/subscription-service.js": "/chunks/subscription-service.js?id=8ac19b3fcfd57d79e5b1", - "/chunks/team-folders.js": "/chunks/team-folders.js?id=0e8376e1e1873c78181b", + "/chunks/team-folders.js": "/chunks/team-folders.js?id=4296ed55f1daeb78a0b9", "/chunks/trash.js": "/chunks/trash.js?id=5fe84aadd8729e68849e", "/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=2bffa85e82a5cda1dcd2", "/chunks/upgrade-billing~chunks/upgrade-plan.js": "/chunks/upgrade-billing~chunks/upgrade-plan.js?id=f59d97c1cbf6649b7057", @@ -577,7 +577,7 @@ "/chunks/admin~chunks/files~chunks/invitation~chunks/my-shared-items~chunks/platform~chunks/recent-upl~dfa67595.js": "/chunks/admin~chunks/files~chunks/invitation~chunks/my-shared-items~chunks/platform~chunks/recent-upl~dfa67595.js?id=bcec1c96b2248aa0d451", "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.3e07bae3987249743b99.hot-update.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.3e07bae3987249743b99.hot-update.js", "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~34b5eb22.3e07bae3987249743b99.hot-update.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~34b5eb22.3e07bae3987249743b99.hot-update.js", - "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.js?id=0380cf3f45f87d9ea5b8", + "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.js?id=44dd372c3414f407ed37", "/chunks/shared/single-file.3e07bae3987249743b99.hot-update.js": "/chunks/shared/single-file.3e07bae3987249743b99.hot-update.js", "/chunks/shared/single-file.f6729672ce5f9ec91bba.hot-update.js": "/chunks/shared/single-file.f6729672ce5f9ec91bba.hot-update.js", "/chunks/shared/single-file.269aae12674c0fa0ba78.hot-update.js": "/chunks/shared/single-file.269aae12674c0fa0ba78.hot-update.js", @@ -1299,5 +1299,13 @@ "/chunks/shared-with-me.6254b2b076cc0856e739.hot-update.js": "/chunks/shared-with-me.6254b2b076cc0856e739.hot-update.js", "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.9145f557db6631ef7534.hot-update.js": "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.9145f557db6631ef7534.hot-update.js", "/chunks/shared-with-me.4e39e4f244eb1f730c36.hot-update.js": "/chunks/shared-with-me.4e39e4f244eb1f730c36.hot-update.js", - "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.df58e82a175e60d205da.hot-update.js": "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.df58e82a175e60d205da.hot-update.js" + "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.df58e82a175e60d205da.hot-update.js": "/chunks/admin~chunks/platform~chunks/settings~chunks/shared.df58e82a175e60d205da.hot-update.js", + "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.407befa17c0dcc62f73b.hot-update.js": "/chunks/admin~chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/settin~97130d1f.407befa17c0dcc62f73b.hot-update.js", + "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.a056d9307680f36d13a8.hot-update.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared-with-me~chunks/shared/files~~bf3ddedc.a056d9307680f36d13a8.hot-update.js", + "/chunks/team-folders.79f381ca990e9e328f62.hot-update.js": "/chunks/team-folders.79f381ca990e9e328f62.hot-update.js", + "/js/main.91e94acefef83ccf5dfa.hot-update.js": "/js/main.91e94acefef83ccf5dfa.hot-update.js", + "/chunks/platform.1404c3bbd03d3ac785d0.hot-update.js": "/chunks/platform.1404c3bbd03d3ac785d0.hot-update.js", + "/chunks/platform.d3cd8571252f98c491a3.hot-update.js": "/chunks/platform.d3cd8571252f98c491a3.hot-update.js", + "/chunks/platform.2120515bd993063e5031.hot-update.js": "/chunks/platform.2120515bd993063e5031.hot-update.js", + "/chunks/platform.38e194e8e770d529cae1.hot-update.js": "/chunks/platform.38e194e8e770d529cae1.hot-update.js" } diff --git a/resources/js/components/FilesView/ItemGrid.vue b/resources/js/components/FilesView/ItemGrid.vue index 46bab7c7..31177cde 100644 --- a/resources/js/components/FilesView/ItemGrid.vue +++ b/resources/js/components/FilesView/ItemGrid.vue @@ -17,7 +17,7 @@ -
+
element.data.id === this.entry.data.id) }, + isAudio() { + return this.entry.data.type === 'audio' + }, isVideo() { return this.entry.data.type === 'video' }, diff --git a/resources/js/components/FilesView/ItemList.vue b/resources/js/components/FilesView/ItemList.vue index 3c126cb2..4a9c65bd 100644 --- a/resources/js/components/FilesView/ItemList.vue +++ b/resources/js/components/FilesView/ItemList.vue @@ -20,7 +20,7 @@ - + @@ -110,6 +110,9 @@ isVideo() { return this.entry.data.type === 'video' }, + isAudio() { + return this.entry.data.type === 'audio' + }, isFile() { return this.entry.data.type === 'file' }, diff --git a/resources/js/components/Others/Notifications/ToasterItem.vue b/resources/js/components/Others/Notifications/ToasterItem.vue index d594dd0d..60cec8fa 100644 --- a/resources/js/components/Others/Notifications/ToasterItem.vue +++ b/resources/js/components/Others/Notifications/ToasterItem.vue @@ -36,7 +36,7 @@ created() { this.isActive = 1 - setTimeout(() => (this.isActive = 0), 5000) + setTimeout(() => (this.isActive = 0), 6000) } } @@ -74,7 +74,7 @@ width: 0; height: 3px; display: block; - animation: progressbar 5s linear; + animation: progressbar 6s linear; } &.success span { diff --git a/resources/js/components/Teams/CreateTeamFolderPopup.vue b/resources/js/components/Teams/CreateTeamFolderPopup.vue index 0e2c59ac..188378bf 100644 --- a/resources/js/components/Teams/CreateTeamFolderPopup.vue +++ b/resources/js/components/Teams/CreateTeamFolderPopup.vue @@ -166,6 +166,15 @@ this.$router.push({name: 'TeamFolders'}) } + let toasterMessage = this.isNewFolderTeamCreation + ? this.$t('Your Team was invited successfully.') + : this.$t('Your Team was invited and folder was moved into Team Folders section.') + + events.$emit('toaster', { + type: 'success', + message: toasterMessage, + }) + this.$store.dispatch('getAppData') }) .catch(() => this.$isSomethingWrong()) diff --git a/resources/js/views/FileView/TeamFolders.vue b/resources/js/views/FileView/TeamFolders.vue index 13b437b7..c51a41bf 100644 --- a/resources/js/views/FileView/TeamFolders.vue +++ b/resources/js/views/FileView/TeamFolders.vue @@ -247,6 +247,11 @@ } else { this.$store.commit('REMOVE_ITEM', data.id) } + + events.$emit('toaster', { + type: 'success', + message: this.$t('Your Team Folder was moved into your files.'), + }) }) .catch(() => this.$isSomethingWrong()) }) diff --git a/src/App/Console/Commands/SetupDevEnvironment.php b/src/App/Console/Commands/SetupDevEnvironment.php index a61a8579..2b86d6b3 100644 --- a/src/App/Console/Commands/SetupDevEnvironment.php +++ b/src/App/Console/Commands/SetupDevEnvironment.php @@ -723,16 +723,18 @@ class SetupDevEnvironment extends Command Folder::factory() ->create([ - 'user_id' => $user->id, - 'parent_id' => $companyProjectFolder->id, - 'name' => 'Presentation Materials', + 'user_id' => $user->id, + 'parent_id' => $companyProjectFolder->id, + 'name' => 'Presentation Materials', + 'team_folder' => true, ]); Folder::factory() ->create([ - 'user_id' => $user->id, - 'parent_id' => $companyProjectFolder->id, - 'name' => 'Team Gallery', + 'user_id' => $user->id, + 'parent_id' => $companyProjectFolder->id, + 'name' => 'Team Gallery', + 'team_folder' => true, ]); $financeDocumentsFolder = Folder::factory() @@ -798,18 +800,20 @@ class SetupDevEnvironment extends Command 'name' => "Alice's Project Files", ]); - $memes = Folder::factory() + Folder::factory() ->create([ - 'user_id' => $owner->id, - 'parent_id' => $folder->id, - 'name' => '9 Gag', + 'user_id' => $owner->id, + 'parent_id' => $folder->id, + 'name' => '9 Gag', + 'team_folder' => true, ]); $hug = Folder::factory() ->create([ - 'user_id' => $owner->id, - 'parent_id' => $folder->id, - 'name' => 'Digital Hug', + 'user_id' => $owner->id, + 'parent_id' => $folder->id, + 'name' => 'Digital Hug', + 'team_folder' => true, ]); DB::table('team_folder_members') diff --git a/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php b/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php new file mode 100644 index 00000000..978959e7 --- /dev/null +++ b/src/Domain/Teams/Actions/SetTeamFolderPropertyForAllChildrenAction.php @@ -0,0 +1,23 @@ +where('id', $folder->id) + ->get('id'); + + // Set all children as team_folder = true + DB::table('folders') + ->whereIn('id', Arr::flatten([filter_folders_ids($childrenFolderIds)])) + ->update(['team_folder' => $isTeamFolder]); + } +} \ No newline at end of file diff --git a/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php b/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php index e6ae4af2..4f82889e 100644 --- a/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php +++ b/src/Domain/Teams/Controllers/ConvertFolderIntoTeamFolderController.php @@ -1,6 +1,8 @@ update([ 'team_folder' => 1, 'parent_id' => null, ]); + ($this->setTeamFolderPropertyForAllChildren)($folder, true); + // Attach owner into members DB::table('team_folder_members') ->insert([ diff --git a/src/Domain/Teams/Controllers/TeamFoldersController.php b/src/Domain/Teams/Controllers/TeamFoldersController.php index d9b00a69..cd06f8d4 100644 --- a/src/Domain/Teams/Controllers/TeamFoldersController.php +++ b/src/Domain/Teams/Controllers/TeamFoldersController.php @@ -1,6 +1,7 @@ where('team_folder', ! Str::isUuid($id)) + ->where('team_folder', true) ->where('user_id', Auth::id()) ->sortable() ->get(); @@ -111,6 +113,8 @@ class TeamFoldersController extends Controller ->where('parent_id', $folder->id) ->delete(); + ($this->setTeamFolderPropertyForAllChildren)($folder, false); + $folder->update([ 'team_folder' => 0, ]); diff --git a/tests/Domain/Teams/TeamManagementTest.php b/tests/Domain/Teams/TeamManagementTest.php index e7937692..e21a9fdc 100644 --- a/tests/Domain/Teams/TeamManagementTest.php +++ b/tests/Domain/Teams/TeamManagementTest.php @@ -1,4 +1,5 @@ 1, ]); + $folderWithin = Folder::factory() + ->create([ + 'parent_id' => $folder->id, + 'user_id' => $user->id, + 'team_folder' => 1, + ]); + TeamFolderInvitation::factory() ->create([ 'parent_id' => $folder->id, @@ -542,7 +550,15 @@ class TeamManagementTest extends TestCase $this ->assertDatabaseCount('team_folder_members', 0) - ->assertDatabaseCount('team_folder_invitations', 0); + ->assertDatabaseCount('team_folder_invitations', 0) + ->assertDatabaseHas('folders', [ + 'id' => $folder->id, + 'team_folder' => 0, + ]) + ->assertDatabaseHas('folders', [ + 'id' => $folderWithin->id, + 'team_folder' => 0, + ]); } /** diff --git a/tests/Domain/Teams/TeamsTest.php b/tests/Domain/Teams/TeamsTest.php index 328fb904..a336b380 100644 --- a/tests/Domain/Teams/TeamsTest.php +++ b/tests/Domain/Teams/TeamsTest.php @@ -122,6 +122,12 @@ class TeamsTest extends TestCase 'user_id' => $user->id, ]); + $folderWithin = Folder::factory() + ->create([ + 'parent_id' => $folder->id, + 'user_id' => $user->id, + ]); + $this ->actingAs($user) ->post("/api/teams/folders/{$folder->id}/convert", [ @@ -142,7 +148,7 @@ class TeamsTest extends TestCase ]); $this->assertDatabaseHas('folders', [ - 'id' => $folder->id, + 'id' => $folderWithin->id, 'team_folder' => 1, ]);