paginator refactoring and implementation into the routes

This commit is contained in:
Čarodej
2022-05-24 18:19:34 +02:00
parent 31218240ae
commit b9975de700
61 changed files with 1215 additions and 829 deletions

View File

@@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:qBL7kIM+I1U3jdkTiAelfVgVOLT3hfu0iOr8bUz2k1I=
APP_KEY=base64:Shf3vEB/Up0FKetshDU3OwCZuv01XG8fb/3k26qHxqg=
APP_DEBUG=true
APP_URL=http://localhost
APP_DEMO=false
@@ -40,3 +40,6 @@ S3_DEFAULT_REGION=us-east-1
S3_BUCKET=
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,127.0.0.1:8000,::1
DB_MYSQLDUMP_PATH="/usr/bin"

199
composer.lock generated
View File

@@ -280,16 +280,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.222.7",
"version": "3.222.18",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "03d35eef5c509798d2c08587cfd9a7c33afe2260"
"reference": "223ca25ed10b4d4a3b1e986795b5aa86f3c04466"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/03d35eef5c509798d2c08587cfd9a7c33afe2260",
"reference": "03d35eef5c509798d2c08587cfd9a7c33afe2260",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/223ca25ed10b4d4a3b1e986795b5aa86f3c04466",
"reference": "223ca25ed10b4d4a3b1e986795b5aa86f3c04466",
"shasum": ""
},
"require": {
@@ -365,9 +365,9 @@
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.222.7"
"source": "https://github.com/aws/aws-sdk-php/tree/3.222.18"
},
"time": "2022-05-06T18:16:59+00:00"
"time": "2022-05-23T18:16:59+00:00"
},
{
"name": "bacon/bacon-qr-code",
@@ -1314,16 +1314,16 @@
},
{
"name": "doctrine/cache",
"version": "2.1.1",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "331b4d5dbaeab3827976273e9356b3b453c300ce"
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce",
"reference": "331b4d5dbaeab3827976273e9356b3b453c300ce",
"url": "https://api.github.com/repos/doctrine/cache/zipball/1ca8f21980e770095a31456042471a57bc4c68fb",
"reference": "1ca8f21980e770095a31456042471a57bc4c68fb",
"shasum": ""
},
"require": {
@@ -1333,18 +1333,12 @@
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"alcaeus/mongo-php-adapter": "^1.1",
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^8.0",
"mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"predis/predis": "~1.0",
"doctrine/coding-standard": "^9",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.2 || ^6.0@dev",
"symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev"
},
"suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
"symfony/cache": "^4.4 || ^5.4 || ^6",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
},
"type": "library",
"autoload": {
@@ -1393,7 +1387,7 @@
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/2.1.1"
"source": "https://github.com/doctrine/cache/tree/2.2.0"
},
"funding": [
{
@@ -1409,7 +1403,7 @@
"type": "tidelift"
}
],
"time": "2021-07-17T14:49:29+00:00"
"time": "2022-05-20T20:07:39+00:00"
},
{
"name": "doctrine/dbal",
@@ -2962,16 +2956,16 @@
},
{
"name": "intervention/image",
"version": "2.7.1",
"version": "2.7.2",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c"
"reference": "04be355f8d6734c826045d02a1079ad658322dad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/744ebba495319501b873a4e48787759c72e3fb8c",
"reference": "744ebba495319501b873a4e48787759c72e3fb8c",
"url": "https://api.github.com/repos/Intervention/image/zipball/04be355f8d6734c826045d02a1079ad658322dad",
"reference": "04be355f8d6734c826045d02a1079ad658322dad",
"shasum": ""
},
"require": {
@@ -3014,8 +3008,8 @@
"authors": [
{
"name": "Oliver Vogel",
"email": "oliver@olivervogel.com",
"homepage": "http://olivervogel.com/"
"email": "oliver@intervention.io",
"homepage": "https://intervention.io/"
}
],
"description": "Image handling and manipulation library with support for Laravel integration",
@@ -3030,11 +3024,11 @@
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/2.7.1"
"source": "https://github.com/Intervention/image/tree/2.7.2"
},
"funding": [
{
"url": "https://www.paypal.me/interventionphp",
"url": "https://paypal.me/interventionio",
"type": "custom"
},
{
@@ -3042,7 +3036,7 @@
"type": "github"
}
],
"time": "2021-12-16T16:49:26+00:00"
"time": "2022-05-21T17:30:32+00:00"
},
{
"name": "jaybizzle/crawler-detect",
@@ -3227,16 +3221,16 @@
},
{
"name": "laravel/fortify",
"version": "v1.12.0",
"version": "v1.13.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/fortify.git",
"reference": "a6caadc80e348755de0e1da221a6253d9f2c48f9"
"reference": "0b8e7a860f0aa4868846555f5d095d7b546ffb9c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/fortify/zipball/a6caadc80e348755de0e1da221a6253d9f2c48f9",
"reference": "a6caadc80e348755de0e1da221a6253d9f2c48f9",
"url": "https://api.github.com/repos/laravel/fortify/zipball/0b8e7a860f0aa4868846555f5d095d7b546ffb9c",
"reference": "0b8e7a860f0aa4868846555f5d095d7b546ffb9c",
"shasum": ""
},
"require": {
@@ -3286,20 +3280,20 @@
"issues": "https://github.com/laravel/fortify/issues",
"source": "https://github.com/laravel/fortify"
},
"time": "2022-03-29T14:37:05+00:00"
"time": "2022-05-05T14:52:14+00:00"
},
{
"name": "laravel/framework",
"version": "v9.11.0",
"version": "v9.13.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "598a8c84d452a66b90a3213b1d67189cc726c728"
"reference": "87b6cc8bc41d1cf85c7c1401cddde8570a3b95bb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/598a8c84d452a66b90a3213b1d67189cc726c728",
"reference": "598a8c84d452a66b90a3213b1d67189cc726c728",
"url": "https://api.github.com/repos/laravel/framework/zipball/87b6cc8bc41d1cf85c7c1401cddde8570a3b95bb",
"reference": "87b6cc8bc41d1cf85c7c1401cddde8570a3b95bb",
"shasum": ""
},
"require": {
@@ -3465,7 +3459,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2022-05-03T14:47:20+00:00"
"time": "2022-05-17T14:07:43+00:00"
},
{
"name": "laravel/sanctum",
@@ -3606,16 +3600,16 @@
},
{
"name": "laravel/serializable-closure",
"version": "v1.1.1",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "9e4b005daa20b0c161f3845040046dc9ddc1d74e"
"reference": "09f0e9fb61829f628205b7c94906c28740ff9540"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/9e4b005daa20b0c161f3845040046dc9ddc1d74e",
"reference": "9e4b005daa20b0c161f3845040046dc9ddc1d74e",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/09f0e9fb61829f628205b7c94906c28740ff9540",
"reference": "09f0e9fb61829f628205b7c94906c28740ff9540",
"shasum": ""
},
"require": {
@@ -3661,7 +3655,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2022-02-11T19:23:53+00:00"
"time": "2022-05-16T17:09:47+00:00"
},
{
"name": "laravel/socialite",
@@ -3863,16 +3857,16 @@
},
{
"name": "league/commonmark",
"version": "2.3.0",
"version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "32a49eb2b38fe5e5c417ab748a45d0beaab97955"
"reference": "cb36fee279f7fca01d5d9399ddd1b37e48e2eca1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/32a49eb2b38fe5e5c417ab748a45d0beaab97955",
"reference": "32a49eb2b38fe5e5c417ab748a45d0beaab97955",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/cb36fee279f7fca01d5d9399ddd1b37e48e2eca1",
"reference": "cb36fee279f7fca01d5d9399ddd1b37e48e2eca1",
"shasum": ""
},
"require": {
@@ -3965,7 +3959,7 @@
"type": "tidelift"
}
],
"time": "2022-04-07T22:37:05+00:00"
"time": "2022-05-14T15:37:39+00:00"
},
{
"name": "league/config",
@@ -4434,29 +4428,31 @@
},
{
"name": "maennchen/zipstream-php",
"version": "2.1.0",
"version": "2.2.1",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58"
"reference": "211e9ba1530ea5260b45d90c9ea252f56ec52729"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/211e9ba1530ea5260b45d90c9ea252f56ec52729",
"reference": "211e9ba1530ea5260b45d90c9ea252f56ec52729",
"shasum": ""
},
"require": {
"myclabs/php-enum": "^1.5",
"php": ">= 7.1",
"php": "^7.4 || ^8.0",
"psr/http-message": "^1.0",
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"ext-zip": "*",
"guzzlehttp/guzzle": ">= 6.3",
"guzzlehttp/guzzle": "^6.5.3 || ^7.2.0",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": ">= 7.5"
"php-coveralls/php-coveralls": "^2.4",
"phpunit/phpunit": "^8.5.8 || ^9.4.2",
"vimeo/psalm": "^4.1"
},
"type": "library",
"autoload": {
@@ -4493,7 +4489,7 @@
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/master"
"source": "https://github.com/maennchen/ZipStream-PHP/tree/2.2.1"
},
"funding": [
{
@@ -4501,7 +4497,7 @@
"type": "open_collective"
}
],
"time": "2020-05-30T13:11:16+00:00"
"time": "2022-05-18T15:52:06+00:00"
},
{
"name": "makingcg/subscription",
@@ -4770,16 +4766,16 @@
},
{
"name": "monolog/monolog",
"version": "2.5.0",
"version": "2.6.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "4192345e260f1d51b365536199744b987e160edc"
"reference": "247918972acd74356b0a91dfaa5adcaec069b6c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/4192345e260f1d51b365536199744b987e160edc",
"reference": "4192345e260f1d51b365536199744b987e160edc",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/247918972acd74356b0a91dfaa5adcaec069b6c0",
"reference": "247918972acd74356b0a91dfaa5adcaec069b6c0",
"shasum": ""
},
"require": {
@@ -4792,18 +4788,23 @@
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"elasticsearch/elasticsearch": "^7",
"elasticsearch/elasticsearch": "^7 || ^8",
"ext-json": "*",
"graylog2/gelf-php": "^1.4.2",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/psr7": "^2.2",
"mongodb/mongodb": "^1.8",
"php-amqplib/php-amqplib": "~2.4 || ^3",
"php-console/php-console": "^3.1.3",
"phpspec/prophecy": "^1.6.1",
"phpspec/prophecy": "^1.15",
"phpstan/phpstan": "^0.12.91",
"phpunit/phpunit": "^8.5",
"phpunit/phpunit": "^8.5.14",
"predis/predis": "^1.1",
"rollbar/rollbar": "^1.3 || ^2 || ^3",
"ruflin/elastica": ">=0.90@dev",
"swiftmailer/swiftmailer": "^5.3|^6.0"
"ruflin/elastica": "^7",
"swiftmailer/swiftmailer": "^5.3|^6.0",
"symfony/mailer": "^5.4 || ^6",
"symfony/mime": "^5.4 || ^6"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
@@ -4853,7 +4854,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/2.5.0"
"source": "https://github.com/Seldaek/monolog/tree/2.6.0"
},
"funding": [
{
@@ -4865,7 +4866,7 @@
"type": "tidelift"
}
],
"time": "2022-04-08T15:43:54+00:00"
"time": "2022-05-10T09:36:00+00:00"
},
{
"name": "mtdowling/jmespath.php",
@@ -9532,16 +9533,16 @@
},
{
"name": "spatie/laravel-queueable-action",
"version": "2.14.1",
"version": "2.14.2",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-queueable-action.git",
"reference": "ce25c279ec0add73c35eae7fd7f1d8fb4da26072"
"reference": "574264fb36fed52d29a1a83dbe2a0a8860cf298b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-queueable-action/zipball/ce25c279ec0add73c35eae7fd7f1d8fb4da26072",
"reference": "ce25c279ec0add73c35eae7fd7f1d8fb4da26072",
"url": "https://api.github.com/repos/spatie/laravel-queueable-action/zipball/574264fb36fed52d29a1a83dbe2a0a8860cf298b",
"reference": "574264fb36fed52d29a1a83dbe2a0a8860cf298b",
"shasum": ""
},
"require": {
@@ -9604,7 +9605,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-queueable-action/issues",
"source": "https://github.com/spatie/laravel-queueable-action/tree/2.14.1"
"source": "https://github.com/spatie/laravel-queueable-action/tree/2.14.2"
},
"funding": [
{
@@ -9612,7 +9613,7 @@
"type": "custom"
}
],
"time": "2022-02-09T07:57:23+00:00"
"time": "2022-05-11T12:54:36+00:00"
},
{
"name": "spatie/laravel-signal-aware-command",
@@ -13683,16 +13684,16 @@
},
{
"name": "composer/spdx-licenses",
"version": "1.5.6",
"version": "1.5.7",
"source": {
"type": "git",
"url": "https://github.com/composer/spdx-licenses.git",
"reference": "a30d487169d799745ca7280bc90fdfa693536901"
"reference": "c848241796da2abf65837d51dce1fae55a960149"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a30d487169d799745ca7280bc90fdfa693536901",
"reference": "a30d487169d799745ca7280bc90fdfa693536901",
"url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149",
"reference": "c848241796da2abf65837d51dce1fae55a960149",
"shasum": ""
},
"require": {
@@ -13743,7 +13744,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/spdx-licenses/issues",
"source": "https://github.com/composer/spdx-licenses/tree/1.5.6"
"source": "https://github.com/composer/spdx-licenses/tree/1.5.7"
},
"funding": [
{
@@ -13759,7 +13760,7 @@
"type": "tidelift"
}
],
"time": "2021-11-18T10:14:14+00:00"
"time": "2022-05-23T07:37:50+00:00"
},
{
"name": "fakerphp/faker",
@@ -14517,16 +14518,16 @@
},
{
"name": "spatie/flare-client-php",
"version": "1.1.0",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/flare-client-php.git",
"reference": "ceab058852a1278d9f57a7b95f1c348e4956d866"
"reference": "86a380f5b1ce839af04a08f1c8f2697184cdf23f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/ceab058852a1278d9f57a7b95f1c348e4956d866",
"reference": "ceab058852a1278d9f57a7b95f1c348e4956d866",
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/86a380f5b1ce839af04a08f1c8f2697184cdf23f",
"reference": "86a380f5b1ce839af04a08f1c8f2697184cdf23f",
"shasum": ""
},
"require": {
@@ -14547,6 +14548,11 @@
"spatie/phpunit-snapshot-assertions": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.1.x-dev"
}
},
"autoload": {
"files": [
"src/helpers.php"
@@ -14569,7 +14575,7 @@
],
"support": {
"issues": "https://github.com/spatie/flare-client-php/issues",
"source": "https://github.com/spatie/flare-client-php/tree/1.1.0"
"source": "https://github.com/spatie/flare-client-php/tree/1.2.0"
},
"funding": [
{
@@ -14577,20 +14583,20 @@
"type": "github"
}
],
"time": "2022-03-11T13:21:28+00:00"
"time": "2022-05-16T12:13:39+00:00"
},
{
"name": "spatie/ignition",
"version": "1.2.9",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/ignition.git",
"reference": "db25202fab2d5c14613b8914a1bb374998bbf870"
"reference": "997363fbcce809b1e55f571997d49017f9c623d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/ignition/zipball/db25202fab2d5c14613b8914a1bb374998bbf870",
"reference": "db25202fab2d5c14613b8914a1bb374998bbf870",
"url": "https://api.github.com/repos/spatie/ignition/zipball/997363fbcce809b1e55f571997d49017f9c623d9",
"reference": "997363fbcce809b1e55f571997d49017f9c623d9",
"shasum": ""
},
"require": {
@@ -14611,6 +14617,11 @@
"symfony/process": "^5.4|^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"Spatie\\Ignition\\": "src"
@@ -14647,7 +14658,7 @@
"type": "github"
}
],
"time": "2022-04-23T20:37:21+00:00"
"time": "2022-05-16T13:16:07+00:00"
},
{
"name": "spatie/laravel-ignition",

View File

@@ -164,7 +164,7 @@ return [
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
],
],
@@ -178,7 +178,7 @@ return [
[
'name' => env('APP_NAME', 'vuefilemanager-backup'),
'disks' => [
env('FILESYSTEM_DISK', 'local')
env('FILESYSTEM_DISK', 'local'),
],
'health_checks' => [
\Spatie\Backup\Tasks\Monitor\HealthChecks\MaximumAgeInDays::class => 1,

View File

@@ -62,7 +62,7 @@ return [
],
'paginate' => [
'perPage' => 8,
'perPage' => env('PAGINATE_RECORDS_PER_PAGE', 25),
],
// The update versions which need to run upgrade process

177
package-lock.json generated
View File

@@ -1231,9 +1231,9 @@
}
},
"@stripe/stripe-js": {
"version": "1.26.0",
"resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-1.26.0.tgz",
"integrity": "sha512-4R1vC75yKaCVFARW3bhelf9+dKt4NP4iZY/sIjGK7AAMBVvZ47eG74NvsAIUdUnhOXSWFMjdFWqv+etk5BDW4g=="
"version": "1.29.0",
"resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-1.29.0.tgz",
"integrity": "sha512-OsUxk0VLlum8E2d6onlEdKuQcvLMs7qTrOXCnl/BGV3fAm65qr6h3e1IZ5AX4lgUlPRrzRcddSOA5DvkKKYLvg=="
},
"@trysound/sax": {
"version": "0.2.0",
@@ -2088,13 +2088,13 @@
"dev": true
},
"autoprefixer": {
"version": "10.4.4",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.4.tgz",
"integrity": "sha512-Tm8JxsB286VweiZ5F0anmbyGiNI3v3wGv3mz9W+cxEDYB/6jbnj6GM9H9mK3wIL8ftgl+C07Lcwb8PG5PCCPzA==",
"version": "10.4.7",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.7.tgz",
"integrity": "sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==",
"dev": true,
"requires": {
"browserslist": "^4.20.2",
"caniuse-lite": "^1.0.30001317",
"browserslist": "^4.20.3",
"caniuse-lite": "^1.0.30001335",
"fraction.js": "^4.2.0",
"normalize-range": "^0.1.2",
"picocolors": "^1.0.0",
@@ -2102,34 +2102,34 @@
},
"dependencies": {
"browserslist": {
"version": "4.20.2",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
"integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==",
"version": "4.20.3",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.3.tgz",
"integrity": "sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001317",
"electron-to-chromium": "^1.4.84",
"caniuse-lite": "^1.0.30001332",
"electron-to-chromium": "^1.4.118",
"escalade": "^3.1.1",
"node-releases": "^2.0.2",
"node-releases": "^2.0.3",
"picocolors": "^1.0.0"
}
},
"caniuse-lite": {
"version": "1.0.30001322",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001322.tgz",
"integrity": "sha512-neRmrmIrCGuMnxGSoh+x7zYtQFFgnSY2jaomjU56sCkTA6JINqQrxutF459JpWcWRajvoyn95sOXq4Pqrnyjew==",
"version": "1.0.30001342",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001342.tgz",
"integrity": "sha512-bn6sOCu7L7jcbBbyNhLg0qzXdJ/PMbybZTH/BA6Roet9wxYRm6Tr9D0s0uhLkOZ6MSG+QU6txUgdpr3MXIVqjA==",
"dev": true
},
"electron-to-chromium": {
"version": "1.4.101",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.101.tgz",
"integrity": "sha512-XJH+XmJjACx1S7ASl/b//KePcda5ocPnFH2jErztXcIS8LpP0SE6rX8ZxiY5/RaDPnaF1rj0fPaHfppzb0e2Aw==",
"version": "1.4.137",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz",
"integrity": "sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA==",
"dev": true
},
"node-releases": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz",
"integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.4.tgz",
"integrity": "sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ==",
"dev": true
}
}
@@ -4794,9 +4794,9 @@
}
},
"immutable": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz",
"integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz",
"integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==",
"dev": true
},
"import-fresh": {
@@ -5285,9 +5285,9 @@
"dev": true
},
"laravel-echo": {
"version": "1.11.4",
"resolved": "https://registry.npmjs.org/laravel-echo/-/laravel-echo-1.11.4.tgz",
"integrity": "sha512-zoWMT7Cb3QVYEq+gyZ/hQvE3sSIiFxZH6c2Wg6tAwg9hukwyOLbDLpy9XT5U1mIC0lK+HFLzetnbfCtrl00jEg==",
"version": "1.11.7",
"resolved": "https://registry.npmjs.org/laravel-echo/-/laravel-echo-1.11.7.tgz",
"integrity": "sha512-LhEZp/RbdtdMlhptJyn452+aXfz+A1UW2bhJM7NROgXhnNgj+6P9BkG9JcPCBMernp5TGkOGI6A0NPbkAWYWGg==",
"dev": true
},
"laravel-mix": {
@@ -6013,9 +6013,9 @@
"integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ=="
},
"nanoid": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.2.tgz",
"integrity": "sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==",
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
"dev": true
},
"negotiator": {
@@ -6292,9 +6292,9 @@
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"object-hash": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz",
"integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
"dev": true
},
"object-is": {
@@ -6690,12 +6690,12 @@
}
},
"postcss": {
"version": "8.4.12",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.12.tgz",
"integrity": "sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==",
"version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
"integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==",
"dev": true,
"requires": {
"nanoid": "^3.3.1",
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
@@ -7080,9 +7080,9 @@
}
},
"prettier-plugin-tailwindcss": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.1.8.tgz",
"integrity": "sha512-hwarSBCswAXa+kqYtaAkFr3Vop9o04WOyZs0qo3NyvW8L7f1rif61wRyq0+ArmVThOuRBcJF5hjGXYk86cwemg==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.1.11.tgz",
"integrity": "sha512-a28+1jvpIZQdZ/W97wOXb6VqI762MKE/TxMMuibMEHhyYsSxQA8Ek30KObd5kJI2HF1ldtSYprFayXJXi3pz8Q==",
"dev": true
},
"pretty-time": {
@@ -7619,9 +7619,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sass": {
"version": "1.49.11",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.49.11.tgz",
"integrity": "sha512-wvS/geXgHUGs6A/4ud5BFIWKO1nKd7wYIGimDk4q4GFkJicILActpv9ueMT4eRGSsp1BdKHuw1WwAHXbhsJELQ==",
"version": "1.52.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.52.1.tgz",
"integrity": "sha512-fSzYTbr7z8oQnVJ3Acp9hV80dM1fkMN7mSD/25mpcct9F7FPBMOI8krEYALgU1aZoqGhQNhTPsuSmxjnIvAm4Q==",
"dev": true,
"requires": {
"chokidar": ">=3.0.0 <4.0.0",
@@ -8230,62 +8230,34 @@
"integrity": "sha512-X324n9OtpTmOMqEgDUEA/RgLrNfBF/jwJdctaPZDzB3mppxJk7TLIDmOreEDm1Bq4R9LSPu4Epf8VSdovNU+iA=="
},
"tailwindcss": {
"version": "3.0.23",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.23.tgz",
"integrity": "sha512-+OZOV9ubyQ6oI2BXEhzw4HrqvgcARY38xv3zKcjnWtMIZstEsXdI9xftd1iB7+RbOnj2HOEzkA0OyB5BaSxPQA==",
"version": "3.0.24",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.0.24.tgz",
"integrity": "sha512-H3uMmZNWzG6aqmg9q07ZIRNIawoiEcNFKDfL+YzOPuPsXuDXxJxB9icqzLgdzKNwjG3SAro2h9SYav8ewXNgig==",
"dev": true,
"requires": {
"arg": "^5.0.1",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"color-name": "^1.1.4",
"cosmiconfig": "^7.0.1",
"detective": "^5.2.0",
"didyoumean": "^1.2.2",
"dlv": "^1.1.3",
"fast-glob": "^3.2.11",
"glob-parent": "^6.0.2",
"is-glob": "^4.0.3",
"lilconfig": "^2.0.5",
"normalize-path": "^3.0.0",
"object-hash": "^2.2.0",
"postcss": "^8.4.6",
"object-hash": "^3.0.0",
"picocolors": "^1.0.0",
"postcss": "^8.4.12",
"postcss-js": "^4.0.0",
"postcss-load-config": "^3.1.0",
"postcss-load-config": "^3.1.4",
"postcss-nested": "5.0.6",
"postcss-selector-parser": "^6.0.9",
"postcss-selector-parser": "^6.0.10",
"postcss-value-parser": "^4.2.0",
"quick-lru": "^5.1.1",
"resolve": "^1.22.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
@@ -8301,19 +8273,30 @@
"is-glob": "^4.0.3"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"lilconfig": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz",
"integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"postcss-load-config": {
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz",
"integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
"lilconfig": "^2.0.5",
"yaml": "^1.10.2"
}
},
"postcss-selector-parser": {
"version": "6.0.10",
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
"integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
"dev": true,
"requires": {
"cssesc": "^3.0.0",
"util-deprecate": "^1.0.2"
}
}
}
@@ -8630,9 +8613,9 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"v-click-outside": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-3.1.2.tgz",
"integrity": "sha512-gMdRqfRE6m6XU6SiFi3dyBlFB2MWogiXpof8Aa3LQysrl9pzTndqp/iEaAphLoadaQUFnQ0ec6fLLaxr7LiY6A=="
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-3.2.0.tgz",
"integrity": "sha512-QD0bDy38SHJXQBjgnllmkI/rbdiwmq9RC+/+pvrFjYJKTn8dtp7Penf9q1lLBta280fYG2q53mgLhQ+3l3z74w=="
},
"validate-npm-package-license": {
"version": "3.0.4",
@@ -8728,9 +8711,9 @@
"integrity": "sha512-W+y2EAI/BxS4Vlcca9scQv8ifeBFck56DRtSwWJ2H4Cw1GLNUYxiZxUHHkuzuI5JPW/cYtL1bPO5xPyEXx4LmQ=="
},
"vue-router": {
"version": "3.5.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.3.tgz",
"integrity": "sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg=="
"version": "3.5.4",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.5.4.tgz",
"integrity": "sha512-x+/DLAJZv2mcQ7glH2oV9ze8uPwcI+H+GgTgTmb5I55bCgY3+vXWIsqbYUzbBSZnwFHEJku4eoaH/x98veyymQ=="
},
"vue-style-loader": {
"version": "4.1.3",

View File

@@ -10,18 +10,18 @@
"production": "mix --production"
},
"devDependencies": {
"autoprefixer": "^10.4.4",
"autoprefixer": "^10.4.7",
"axios": "^0.21.4",
"cross-env": "^5.1",
"laravel-echo": "^1.11.4",
"laravel-echo": "^1.11.7",
"laravel-mix": "^6.0.43",
"postcss": "^8.4.12",
"postcss": "^8.4.14",
"prettier": "^2.6.2",
"prettier-plugin-import-sort": "0.0.7",
"prettier-plugin-tailwindcss": "^0.1.8",
"prettier-plugin-tailwindcss": "^0.1.11",
"pusher-js": "^7.0.6",
"resolve-url-loader": "^2.3.1",
"sass": "^1.49.11",
"sass": "^1.52.1",
"sass-loader": "^8.0.2",
"tailwindcss": "^3.0.24",
"tailwindcss-debug-screens": "^2.2.1",

View File

@@ -1,7 +1,7 @@
{
"/js/main.js": "/js/main.js",
"/chunks/request.js": "/chunks/request.js?id=2bbfd08f4a543123",
"/chunks/request-upload.js": "/chunks/request-upload.js?id=1201e261c848a844",
"/chunks/request.js": "/chunks/request.js?id=ecd05e0b97d63986",
"/chunks/request-upload.js": "/chunks/request-upload.js?id=e1d93f2b44272ed8",
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=19a0784e59d768ec",
"/chunks/status-check.js": "/chunks/status-check.js?id=a5ba5fb895af7040",
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=ba76b9a8adbfdc0b",
@@ -9,13 +9,13 @@
"/chunks/environment.js": "/chunks/environment.js?id=e4fdb87ff173d48a",
"/chunks/app-setup.js": "/chunks/app-setup.js?id=cbe7bfed06400736",
"/chunks/admin-account.js": "/chunks/admin-account.js?id=78d257775f5fc485",
"/chunks/shared.js": "/chunks/shared.js?id=2fd6e7e80c7a6090",
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=ebf193e6828917dc",
"/chunks/shared.js": "/chunks/shared.js?id=0e270aee87fb16d0",
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=f7d5f3af37210b3f",
"/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=f03ab6659c6c1e9b",
"/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=cd743a710a7dd6b4",
"/chunks/not-found.js": "/chunks/not-found.js?id=d31bd699138cf828",
"/chunks/temporary-unavailable.js": "/chunks/temporary-unavailable.js?id=26798085f527d955",
"/chunks/admin.js": "/chunks/admin.js?id=8efc9b42ff0654d9",
"/chunks/admin.js": "/chunks/admin.js?id=7517a25b81c4a59b",
"/chunks/dashboard.js": "/chunks/dashboard.js?id=5ab55a12214433c8",
"/chunks/invoices.js": "/chunks/invoices.js?id=799928609f57ca10",
"/chunks/subscriptions.js": "/chunks/subscriptions.js?id=a0c4f59d0ec4aee0",
@@ -42,7 +42,7 @@
"/chunks/app-settings.js": "/chunks/app-settings.js?id=b0d1082fdcbbd17c",
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=8ba3feb2cc81a2c3",
"/chunks/app-index.js": "/chunks/app-index.js?id=0c50096e8de09288",
"/chunks/app-environment.js": "/chunks/app-environment.js?id=09e6d087847e6057",
"/chunks/app-environment.js": "/chunks/app-environment.js?id=e8c421cddbaa4851",
"/chunks/app-others.js": "/chunks/app-others.js?id=dd23507db4551d0a",
"/chunks/app-sign-in-out.js": "/chunks/app-sign-in-out.js?id=77ac953ce49b5b55",
"/chunks/app-adsense.js": "/chunks/app-adsense.js?id=c7e7dc2975317062",
@@ -58,18 +58,18 @@
"/chunks/sign-up.js": "/chunks/sign-up.js?id=2af6073efe54c560",
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=ff8954243e86c1e1",
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=2f0401ee2fc148c4",
"/chunks/settings.js": "/chunks/settings.js?id=ff0f6e88171fd094",
"/chunks/settings.js": "/chunks/settings.js?id=29b9510ac60fe370",
"/chunks/profile.js": "/chunks/profile.js?id=3e24bb5e1f52d4bb",
"/chunks/settings-password.js": "/chunks/settings-password.js?id=d00bf503d8126dc4",
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=ecfee7f7e98204f8",
"/chunks/billing.js": "/chunks/billing.js?id=91502cb0a5806200",
"/chunks/platform.js": "/chunks/platform.js?id=90d43ec56b62c721",
"/chunks/files.js": "/chunks/files.js?id=5f29f35c280e680b",
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=6f43aea38e0927bc",
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=6e819ffe88a0fd1d",
"/chunks/trash.js": "/chunks/trash.js?id=1885832b8dd60529",
"/chunks/team-folders.js": "/chunks/team-folders.js?id=709509b3e2dd2bf5",
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=e86d3c1f72e6fde2",
"/chunks/billing.js": "/chunks/billing.js?id=6fbcdd34c623b2b3",
"/chunks/platform.js": "/chunks/platform.js?id=0b49a3433770831c",
"/chunks/files.js": "/chunks/files.js?id=22078a3b592b2058",
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=e667aa8fc8646ba4",
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=1accaf0dd4106017",
"/chunks/trash.js": "/chunks/trash.js?id=0039ee3b0e28405d",
"/chunks/team-folders.js": "/chunks/team-folders.js?id=e7d7c1506c565e2f",
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=0ede8351abc1f29f",
"/chunks/invitation.js": "/chunks/invitation.js?id=424b2783d9785a09",
"/css/tailwind.css": "/css/tailwind.css",
"/css/app.css": "/css/app.css"

View File

@@ -41,7 +41,7 @@
import ItemHandler from './ItemHandler'
import { events } from '../../bus'
import { mapGetters } from 'vuex'
import Spinner from './Spinner'
import Spinner from "../UI/Others/Spinner";
import { debounce } from 'lodash'
export default {

View File

@@ -204,7 +204,7 @@ export default {
goToFiles() {
if (this.$route.name !== 'Files') this.$router.push({ name: 'Files' })
this.$store.dispatch('getFolder')
this.$store.dispatch('getFolder', {page: 1})
},
logOut() {
this.$store.dispatch('logOut')

View File

@@ -352,17 +352,17 @@ const FunctionHelpers = {
Vue.prototype.$getDataByLocation = async function (page) {
let routes = {
RequestUpload: ['getUploadRequestFolder', {page:page, id:router.currentRoute.params.id || undefined} ],
Public: ['getSharedFolder', {page:page, id:router.currentRoute.params.id || undefined}],
Files: ['getFolder', {page:page, id:router.currentRoute.params.id || undefined}],
RequestUpload: ['getUploadRequestFolder', {page: page, id: router.currentRoute.params.id || undefined}],
Public: ['getSharedFolder', {page: page, id: router.currentRoute.params.id || undefined}],
Files: ['getFolder', {page: page, id: router.currentRoute.params.id || undefined}],
RecentUploads: ['getRecentUploads', page],
MySharedItems: ['getMySharedItems', page],
Trash: ['getTrash', {page:page , id:router.currentRoute.params.id || undefined}],
TeamFolders: ['getTeamFolder',{page:page, id:router.currentRoute.params.id || undefined}],
SharedWithMe: ['getSharedWithMeFolder',{page:page, id:router.currentRoute.params.id || undefined}],
Trash: ['getTrash', {page: page, id: router.currentRoute.params.id || undefined}],
TeamFolders: ['getTeamFolder', {page: page, id: router.currentRoute.params.id || undefined}],
SharedWithMe: ['getSharedWithMeFolder', {page: page, id: router.currentRoute.params.id || undefined}],
}
await store.dispatch(...routes[router.currentRoute.name])
return await store.dispatch(...routes[router.currentRoute.name])
}
Vue.prototype.$getPaymentLogo = function (driver) {

View File

@@ -18,19 +18,16 @@ const defaultState = {
const actions = {
getFolder: ({ commit, getters },{page, id}) => {
return new Promise ((resolve, reject) => {
if(! page)
commit('LOADING_STATE', { loading: true, data: [] })
if(page === 1)
commit('START_LOADING_VIEW')
axios
.get(`${getters.api}/browse/folders/${id || 'all'}${getters.sorting.URI}&page=${currentPage}`)
.get(`${getters.api}/browse/folders/${id || 'all'}${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_PAGINATE', response.data.meta.paginate)
commit('LOADING_STATE', {
loading: false,
data: response.data.data,
})
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
events.$emit('scrollTop')
@@ -48,62 +45,74 @@ const actions = {
message: i18n.t('popup_error.message'),
})
}
reject(error);
})
})
},
getRecentUploads: ({ commit, getters }) => {
commit('LOADING_STATE', { loading: true, data: [] })
getRecentUploads: ({commit, getters}, page) => {
return new Promise((resolve, reject) => {
if (page === 1)
commit('START_LOADING_VIEW')
axios
.get(getters.api + '/browse/latest')
.then((response) => {
commit('LOADING_STATE', {
loading: false,
data: response.data.files.data,
axios
.get(`${getters.api}/browse/latest?page=${page}`)
.then((response) => {
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('SET_CURRENT_FOLDER', undefined)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
events.$emit('scrollTop')
resolve(response)
})
commit('SET_CURRENT_FOLDER', undefined)
events.$emit('scrollTop')
})
.catch(() => Vue.prototype.$isSomethingWrong())
.catch(() => Vue.prototype.$isSomethingWrong())
})
},
getMySharedItems: ({ commit, getters }) => {
commit('LOADING_STATE', { loading: true, data: [] })
getMySharedItems: ({ commit, getters }, page) => {
return new Promise((resolve, reject) => {
if (page === 1)
commit('START_LOADING_VIEW')
axios
.get(getters.api + '/browse/share' + getters.sorting.URI)
.then((response) => {
let folders = response.data.folders.data
let files = response.data.files.data
axios
.get(`${getters.api}/browse/share${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('SET_CURRENT_FOLDER', undefined)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
events.$emit('scrollTop')
resolve(response)
})
commit('SET_CURRENT_FOLDER', undefined)
events.$emit('scrollTop')
})
.catch(() => Vue.prototype.$isSomethingWrong())
.catch(() => Vue.prototype.$isSomethingWrong())
})
},
getTrash: ({ commit, getters }, id) => {
commit('LOADING_STATE', { loading: true, data: [] })
getTrash: ({ commit, getters }, {page, id}) => {
return new Promise((resolve, reject) => {
if (page === 1)
commit('START_LOADING_VIEW')
axios
.get(`${getters.api}/browse/trash/${id || 'all'}${getters.sorting.URI}`)
.then((response) => {
let folders = response.data.folders.data
let files = response.data.files.data
axios
.get(`${getters.api}/browse/trash/${id || 'all'}${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
events.$emit('scrollTop')
resolve(response)
})
commit('SET_CURRENT_FOLDER', response.data.root)
.catch((error) => {
Vue.prototype.$isSomethingWrong()
events.$emit('scrollTop')
})
.catch(() => Vue.prototype.$isSomethingWrong())
reject(error);
})
})
},
getFolderTree: ({ commit, getters }) => {
return new Promise((resolve, reject) => {
@@ -130,16 +139,15 @@ const actions = {
}
const mutations = {
SET_PAGINATE(state, payload) {
SET_PAGINATOR(state, payload) {
state.paginate = payload
},
LOADING_STATE(state, payload) {
if(payload.data.length === 0) {
state.entries = []
} else {
state.entries.push(...payload.data)
}
state.isLoading = payload.loading
START_LOADING_VIEW(state) {
state.entries = []
state.isLoading = true
},
STOP_LOADING_VIEW(state) {
state.isLoading = false
},
SET_CURRENT_FOLDER(state, folder) {
state.currentFolder = folder

View File

@@ -342,14 +342,14 @@ const actions = {
},
emptyTrash: ({ commit, getters }) => {
// Clear file browser
commit('LOADING_STATE', { loading: true, data: [] })
commit('START_LOADING_VIEW')
axios
.post(getters.api + '/trash/dump', {
_method: 'delete',
})
.then(() => {
commit('LOADING_STATE', { loading: false, data: [] })
commit('STOP_LOADING_VIEW')
events.$emit('scrollTop')
commit('CLIPBOARD_CLEAR')
@@ -363,7 +363,7 @@ const actions = {
})
.then(() => {
if (router.currentRoute.name === 'Trash') {
commit('LOADING_STATE', { loading: false, data: [] })
commit('STOP_LOADING_VIEW')
}
events.$emit('toaster', {

View File

@@ -20,21 +20,19 @@ const defaultState = {
sharedFile: undefined,
}
const actions = {
getSharedFolder: ({ commit, getters }, id) => {
commit('LOADING_STATE', { loading: true, data: [] })
getSharedFolder: ({ commit, getters }, {page, id}) => {
return new Promise((resolve, reject) => {
axios
.get(`/api/sharing/folders/${id}/${router.currentRoute.params.token}${getters.sorting.URI}`)
.then((response) => {
let folders = response.data.folders.data
let files = response.data.files.data
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
})
commit('SET_CURRENT_FOLDER', response.data.root)
if(page === 1)
commit('START_LOADING_VIEW')
axios
.get(`/api/sharing/folders/${id}/${router.currentRoute.params.token}${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
events.$emit('scrollTop')

View File

@@ -1,129 +1,134 @@
import router from '../../router'
import { events } from '../../bus'
import {events} from '../../bus'
import i18n from '../../i18n'
import axios from 'axios'
import Vue from 'vue'
const defaultState = {
currentTeamFolder: undefined,
currentTeamFolder: undefined,
}
const actions = {
getTeamFolder: ({ commit, getters }, id) => {
commit('LOADING_STATE', { loading: true, data: [] })
getTeamFolder: ({commit, getters}, {page, id}) => {
return new Promise((resolve, reject) => {
if (page === 1)
commit('START_LOADING_VIEW')
if (typeof id === 'undefined') {
commit('SET_CURRENT_TEAM_FOLDER', null)
}
if (typeof id === 'undefined')
commit('SET_CURRENT_TEAM_FOLDER', null)
axios
.get(`${getters.api}/teams/folders/${id || 'all'}${getters.sorting.URI}`)
.then((response) => {
let folders = response.data.folders.data
let files = response.data.files.data
axios
.get(`${getters.api}/teams/folders/${id || 'all'}${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
})
commit('SET_CURRENT_FOLDER', response.data.root)
if (
!getters.currentTeamFolder ||
getters.currentTeamFolder.data.id !== response.data.meta.teamFolder.data.id
) {
commit('SET_CURRENT_TEAM_FOLDER', response.data.meta.teamFolder)
}
if (
!getters.currentTeamFolder ||
getters.currentTeamFolder.data.id !== response.data.teamFolder.data.id
) {
commit('SET_CURRENT_TEAM_FOLDER', response.data.teamFolder)
}
events.$emit('scrollTop')
events.$emit('scrollTop')
})
.catch((error) => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({ name: 'SignIn' })
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
})
},
getSharedWithMeFolder: ({ commit, getters }, id) => {
commit('LOADING_STATE', { loading: true, data: [] })
resolve(response)
})
.catch((error) => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
if (typeof id === 'undefined') {
commit('SET_CURRENT_TEAM_FOLDER', null)
}
reject(error)
})
})
},
getSharedWithMeFolder: ({commit, getters}, {page, id}) => {
return new Promise((resolve, reject) => {
if (page === 1)
commit('START_LOADING_VIEW')
axios
.get(`${getters.api}/teams/shared-with-me/${id || 'all'}${getters.sorting.URI}`)
.then((response) => {
let folders = response.data.folders.data
let files = response.data.files.data
if (typeof id === 'undefined') {
commit('SET_CURRENT_TEAM_FOLDER', null)
}
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
})
commit('SET_CURRENT_FOLDER', response.data.root)
axios
.get(`${getters.api}/teams/shared-with-me/${id || 'all'}${getters.sorting.URI}&page=${page}`)
.then((response) => {
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
if (
!getters.currentTeamFolder ||
getters.currentTeamFolder.data.id !== response.data.teamFolder.data.id
) {
commit('SET_CURRENT_TEAM_FOLDER', response.data.teamFolder)
}
if (
!getters.currentTeamFolder ||
getters.currentTeamFolder.data.id !== response.data.meta.teamFolder.data.id
) {
commit('SET_CURRENT_TEAM_FOLDER', response.data.meta.teamFolder)
}
events.$emit('scrollTop')
})
.catch((error) => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({ name: 'SignIn' })
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
})
},
getTeamFolderTree: ({ commit, getters }) => {
return new Promise((resolve, reject) => {
axios
.get(`/api/teams/folders/${getters.currentTeamFolder.data.id}/tree${getters.sorting.URI}`)
.then((response) => {
resolve(response)
events.$emit('scrollTop')
commit('UPDATE_FOLDER_TREE', response.data)
})
.catch((error) => {
reject(error)
resolve(response)
})
.catch((error) => {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
} else {
// Show error message
events.$emit('alert:open', {
title: i18n.t('popup_error.title'),
message: i18n.t('popup_error.message'),
})
}
Vue.prototype.$isSomethingWrong()
})
})
},
reject(error)
})
})
},
getTeamFolderTree: ({commit, getters}) => {
return new Promise((resolve, reject) => {
axios
.get(`/api/teams/folders/${getters.currentTeamFolder.data.id}/tree${getters.sorting.URI}`)
.then((response) => {
resolve(response)
commit('UPDATE_FOLDER_TREE', response.data)
})
.catch((error) => {
reject(error)
Vue.prototype.$isSomethingWrong()
})
})
},
}
const mutations = {
SET_CURRENT_TEAM_FOLDER(state, payload) {
state.currentTeamFolder = payload
},
SET_CURRENT_TEAM_FOLDER(state, payload) {
state.currentTeamFolder = payload
},
}
const getters = {
currentTeamFolder: (state) => state.currentTeamFolder,
currentTeamFolder: (state) => state.currentTeamFolder,
}
export default {
state: defaultState,
getters,
actions,
mutations,
state: defaultState,
getters,
actions,
mutations,
}

View File

@@ -9,20 +9,16 @@ const defaultState = {
const actions = {
getUploadRequestFolder: ({ commit, getters }, id) => {
commit('LOADING_STATE', { loading: true, data: [] })
commit('START_LOADING_VIEW')
return new Promise((resolve, reject) => {
axios
.get(`/api/file-request/${router.currentRoute.params.token}/browse/${id || 'all'}${getters.sorting.URI}`)
.then((response) => {
let folders = response.data.folders
let files = response.data.files
commit('LOADING_STATE', {
loading: false,
data: folders.concat(files),
})
commit('SET_CURRENT_FOLDER', response.data.root)
commit('SET_CURRENT_FOLDER', response.data.meta.root)
commit('SET_PAGINATOR', response.data.meta.paginate)
commit('STOP_LOADING_VIEW')
commit('ADD_NEW_ITEMS', response.data.data)
events.$emit('scrollTop')
@@ -43,7 +39,7 @@ const actions = {
// Stop loading spinner
if (['active', 'filled', 'expired'].includes(response.data.data.attributes.status) )
commit('LOADING_STATE', { loading: false, data: [] })
commit('STOP_LOADING_VIEW')
commit('SET_UPLOAD_REQUEST', response.data)
@@ -63,7 +59,8 @@ const actions = {
axios
.delete(`/api/file-request/${router.currentRoute.params.token}`)
.then((response) => {
commit('LOADING_STATE', { loading: false, data: [] })
commit('START_LOADING_VIEW')
commit('STOP_LOADING_VIEW')
commit('SET_UPLOAD_REQUEST_AS_FILLED')
})
.catch(() => this.$isSomethingWrong())

View File

@@ -80,7 +80,7 @@ const actions = {
let itemsToFavourites = items.map((item) => {
if (item.data.type === 'folder') {
if (context.getters.user.data.relationships.favourites.data.find((folder) => folder.id === item.data.id))
if (context.getters.user.data.relationships.favourites.find((folder) => folder.id === item.data.id))
return
return item.data.id;
@@ -89,7 +89,7 @@ const actions = {
// Check is favorites already don't include some of pushed folders
let favouritesWidget = items.map((item) => {
if (!context.getters.user.data.relationships.favourites.data.find((folder) => folder.data.id === item.id)) {
if (!context.getters.user.data.relationships.favourites.find((folder) => folder.data.id === item.id)) {
return item
}
})
@@ -149,7 +149,7 @@ const mutations = {
},
ADD_TO_FAVOURITES(state, folder) {
folder.forEach((item) => {
state.user.data.relationships.favourites.data.push(item)
state.user.data.relationships.favourites.push(item)
})
},
UPDATE_FIRST_NAME(state, name) {
@@ -166,12 +166,12 @@ const mutations = {
}
},
REMOVE_ITEM_FROM_FAVOURITES(state, item) {
state.user.data.relationships.favourites.data = state.user.data.relationships.favourites.data.filter(
state.user.data.relationships.favourites.data = state.user.data.relationships.favourites.filter(
(folder) => folder.data.id !== item.data.id
)
},
UPDATE_NAME_IN_FAVOURITES(state, data) {
state.user.data.relationships.favourites.data.find((folder) => {
state.user.data.relationships.favourites.find((folder) => {
if (folder.id === data.id) {
folder.name = data.name
}

View File

@@ -266,7 +266,7 @@ export default {
}
},
created() {
this.$store.dispatch('getFolder', {page:null, id:this.$route.params.id})
this.$store.dispatch('getFolder', {page: 1, id:this.$route.params.id})
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('context-menu:current-folder', (folder) => (this.item = folder))

View File

@@ -169,7 +169,7 @@ export default {
}
},
created() {
this.$store.dispatch('getMySharedItems')
this.$store.dispatch('getMySharedItems', 1)
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))

View File

@@ -234,7 +234,7 @@ export default {
},
},
created() {
this.$store.dispatch('getSharedFolder', {page:null, id:this.$route.params.id})
this.$store.dispatch('getSharedFolder', {page: 1, id: this.$route.params.id})
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))

View File

@@ -151,7 +151,7 @@ export default {
}
},
created() {
this.$store.dispatch('getRecentUploads')
this.$store.dispatch('getRecentUploads', 1)
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))

View File

@@ -242,7 +242,7 @@ export default {
},
},
mounted() {
this.$store.dispatch('getSharedWithMeFolder',{page:null, id:this.$route.params.id})
this.$store.dispatch('getSharedWithMeFolder',{page: 1, id:this.$route.params.id})
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))
@@ -257,7 +257,7 @@ export default {
if (this.$route.params.id) {
this.$router.push({ name: 'SharedWithMe' })
} else {
this.$store.dispatch('getSharedWithMeFolder',{page:null, id:undefined})
this.$store.dispatch('getSharedWithMeFolder',{page: 1, id:undefined})
}
events.$emit('toaster', {

View File

@@ -293,7 +293,7 @@ export default {
}
},
mounted() {
this.$store.dispatch('getTeamFolder', {page:null, id:this.$route.params.id})
this.$store.dispatch('getTeamFolder', {page: 1, id:this.$route.params.id})
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))

View File

@@ -149,7 +149,7 @@ export default {
}
},
created() {
this.$store.dispatch('getTrash', {page:null, id:this.$route.params.id})
this.$store.dispatch('getTrash', {page: 1, id: this.$route.params.id})
events.$on('context-menu:show', (event, item) => (this.item = item))
events.$on('mobile-context-menu:show', (item) => (this.item = item))

View File

@@ -5,7 +5,6 @@ use Domain\Pages\Controllers\AdminPagesController;
use Domain\Settings\Controllers\FlushCacheController;
use Domain\Localization\Controllers\LanguageController;
use Domain\Admin\Controllers\Users\DeleteUserController;
use Domain\Settings\Controllers\TestWebsocketConnectionController;
use Domain\Settings\Controllers\UpgradeLicenseController;
use Domain\Settings\Controllers\GetServerStatusController;
use Domain\Settings\Controllers\GetSettingsValueController;
@@ -17,6 +16,7 @@ use Domain\Settings\Controllers\StoreEmailCredentialsController;
use Domain\Transactions\Controllers\GetAllTransactionsController;
use Domain\Admin\Controllers\Dashboard\GetDashboardDataController;
use Domain\Settings\Controllers\StoreStorageCredentialsController;
use Domain\Settings\Controllers\TestWebsocketConnectionController;
use Domain\Transactions\Controllers\GetUserTransactionsController;
use Domain\Localization\Controllers\UpdateLanguageStringController;
use Domain\Admin\Controllers\Users\ShowUserStorageCapacityController;

View File

@@ -11,8 +11,10 @@ use Domain\Folders\Controllers\FavouriteController;
use Domain\Sharing\Controllers\ShareItemController;
use Domain\Settings\Controllers\GetConfigController;
use Domain\SetupWizard\Controllers\PingAPIController;
use Domain\Browsing\Controllers\BrowseTrashController;
use Domain\Folders\Controllers\CreateFolderController;
use Domain\Browsing\Controllers\BrowseFolderController;
use Domain\Browsing\Controllers\BrowseSharedController;
use Domain\Sharing\Controllers\ShareViaEmailController;
use Domain\Files\Controllers\UploadFileChunksController;
use Domain\Folders\Controllers\NavigationTreeController;
@@ -24,8 +26,6 @@ use Domain\Items\Controllers\RenameFileOrFolderController;
use Domain\Settings\Controllers\GetSettingsValueController;
use Domain\Trash\Controllers\RestoreTrashContentController;
use Domain\Browsing\Controllers\BrowseLatestFilesController;
use Domain\Browsing\Controllers\BrowseSharedItemsController;
use Domain\Browsing\Controllers\BrowseTrashContentController;
use Domain\Homepage\Controllers\SendContactMessageController;
use Domain\RemoteUpload\Controllers\RemoteUploadFileController;
use Domain\Sharing\Controllers\GetShareLinkViaQrCodeController;
@@ -69,8 +69,8 @@ Route::group(['middleware' => ['auth:sanctum']], function () {
Route::get('/folders/{id}', BrowseFolderController::class);
Route::get('/navigation', NavigationTreeController::class);
Route::get('/latest', BrowseLatestFilesController::class);
Route::get('/trash/{id}', BrowseTrashContentController::class);
Route::get('/share', BrowseSharedItemsController::class);
Route::get('/trash/{id}', BrowseTrashController::class);
Route::get('/share', BrowseSharedController::class);
});
// Trash

View File

@@ -3,8 +3,8 @@ namespace App\Socialite\Controllers;
use App\Users\Models\User;
use App\Users\DTO\CreateUserData;
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Laravel\Socialite\Facades\Socialite;
use App\Users\Actions\CreateNewUserAction;

View File

@@ -2,7 +2,6 @@
namespace App\Users\Controllers\Authentication;
use Illuminate\Support\Str;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;

View File

@@ -4,7 +4,7 @@ namespace Domain\Browsing\Controllers;
use Str;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\JsonResponse;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderResource;
use Domain\Folders\Resources\FolderCollection;
@@ -13,33 +13,49 @@ class BrowseFolderController
{
public function __invoke(
string $id,
): array {
$root_id = Str::isUuid($id) ? $id : null;
): JsonResponse {
$rootId = Str::isUuid($id)
? $id
: null;
$folderQuery = [
'parent_id' => $root_id,
'team_folder' => false,
'user_id' => Auth::id(),
'deleted_at' => null,
$page = request()->has('page')
? request()->input('page')
: 'all';
// Prepare folder & file db query
$query = [
'folder' => [
'where' => [
'parent_id' => $rootId,
'team_folder' => false,
'user_id' => auth()->id(),
'deleted_at' => null,
],
],
'file' => [
'where' => [
'parent_id' => $rootId,
'user_id' => auth()->id(),
'deleted_at' => null,
],
],
'with' => [
'parent:id,name',
'shared:token,id,item_id,permission,is_protected,expire_in',
],
];
$fileQuery = [
'parent_id' => $root_id,
'user_id' => Auth::id(),
'deleted_at' => null,
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
list($foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalItemsCount) = getRecordsCount($folderQuery, $fileQuery, request()->input('page'));
$folders = Folder::with(['parent:id,name', 'shared:token,id,item_id,permission,is_protected,expire_in'])
->where($folderQuery)
$folders = Folder::with($query['with'])
->where($query['folder']['where'])
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::with(['parent:id,name', 'shared:token,id,item_id,permission,is_protected,expire_in'])
->where($fileQuery)
$files = File::with($query['with'])
->where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
@@ -50,15 +66,15 @@ class BrowseFolderController
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
list($paginate, $links) = generatePaginationCounts($totalItemsCount);
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
return [
return response()->json([
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => $root_id ? new FolderResource(Folder::findOrFail($root_id)) : null,
'root' => $rootId ? new FolderResource(Folder::findOrFail($rootId)) : null,
],
];
]);
}
}

View File

@@ -1,29 +1,58 @@
<?php
namespace Domain\Browsing\Controllers;
use App\Users\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use DB;
use Domain\Files\Models\File;
use Illuminate\Http\JsonResponse;
use Domain\Files\Resources\FilesCollection;
class BrowseLatestFilesController
{
public function __invoke(Request $request): array
public function __invoke(): JsonResponse
{
$user = User::with([
'latestUploads' => fn ($query) => $query->sortable(['created_at' => 'desc']),
])
->where('id', Auth::id())
->first();
$entriesPerPage = config('vuefilemanager.paginate.perPage');
list($data, $paginate, $links) = groupPaginate($request, null, $user->latestUploads);
$page = request()->has('page')
? request()->input('page')
: 'all';
return [
'data' => $data,
$totalFiles = DB::table('files')
->where('user_id', auth()->id())
->whereNull('deleted_at')
->count();
$getWith = [
'parent:id,name',
'shared:token,id,item_id,permission,is_protected,expire_in',
];
// Get paginator data
[$paginate, $links] = formatPaginatorMetadata($totalFiles);
// Get all files
if ($page === 'all') {
$files = File::with($getWith)
->where('user_id', auth()->id())
->sortable(['created_at' => 'desc'])
->get();
}
// Get certain page
if ($page !== 'all') {
$files = File::with($getWith)
->where('user_id', auth()->id())
->sortable(['created_at' => 'desc'])
->skip($entriesPerPage * ($page - 1))
->take($entriesPerPage)
->get();
}
return response()->json([
'data' => new FilesCollection($files),
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => null,
],
];
]);
}
}

View File

@@ -0,0 +1,93 @@
<?php
namespace Domain\Browsing\Controllers;
use Illuminate\Http\Request;
use Domain\Files\Models\File;
use Domain\Sharing\Models\Share;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderCollection;
class BrowseSharedController
{
public function __invoke(Request $request): JsonResponse
{
$userId = auth()->id();
$page = request()->has('page')
? request()->input('page')
: 'all';
// Get shared folders and files
$parentIds = Share::where('user_id', $userId)
->where('type', 'folder')
->pluck('item_id')
->toArray();
$fileIds = Share::where('user_id', $userId)
->where('type', '!=', 'folder')
->pluck('item_id')
->toArray();
$query = [
'folder' => [
'where' => [
'user_id' => $userId,
],
'whereIn' => [
'id' => $parentIds,
],
],
'file' => [
'where' => [
'user_id' => $userId,
],
'whereIn' => [
'id' => $fileIds,
],
],
'with' => [
'parent',
'shared:token,id,item_id,permission,is_protected,expire_in',
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
$folders = Folder::with($query['with'])
->where($query['folder']['where'])
->whereIn('id', $parentIds, )
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::with($query['with'])
->where($query['file']['where'])
->whereIn('id', $fileIds)
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
// Collect entries
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
// Get paginator metadata
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
// Collect folders and files to single array
return response()->json([
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => null,
],
]);
}
}

View File

@@ -1,50 +0,0 @@
<?php
namespace Domain\Browsing\Controllers;
use Illuminate\Http\Request;
use Domain\Files\Models\File;
use Domain\Sharing\Models\Share;
use Domain\Folders\Models\Folder;
use Illuminate\Support\Facades\Auth;
class BrowseSharedItemsController
{
public function __invoke(Request $request): array
{
$user_id = Auth::id();
// Get shared folders and files
$parent_ids = Share::where('user_id', $user_id)
->where('type', 'folder')
->pluck('item_id');
$file_ids = Share::where('user_id', $user_id)
->where('type', '!=', 'folder')
->pluck('item_id');
// Get folders and files
$folders = Folder::with(['parent', 'shared:token,id,item_id,permission,is_protected,expire_in'])
->where('user_id', $user_id)
->whereIn('id', $parent_ids)
->sortable()
->get();
$files = File::with(['parent', 'shared:token,id,item_id,permission,is_protected,expire_in'])
->where('user_id', $user_id)
->whereIn('id', $file_ids)
->sortable()
->get();
list($data, $paginate, $links) = groupPaginate($request, $folders, $files);
// Collect folders and files to single array
return [
'data' => $data,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => null,
],
];
}
}

View File

@@ -1,76 +0,0 @@
<?php
namespace Domain\Browsing\Controllers;
use Str;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Support\Facades\Auth;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderCollection;
class BrowseTrashContentController
{
public function __invoke(string $id): array
{
$userId = Auth::id();
$rootId = Str::isUuid($id) ? $id : null;
$requestedFolder = $rootId
? Folder::withTrashed()
->findOrFail($rootId)
: null;
if ($rootId) {
// Get folders and files
$folders = Folder::onlyTrashed()
->with('parent')
->where('parent_id', $rootId)
->sortable()
->get();
$files = File::onlyTrashed()
->with('parent')
->where('parent_id', $rootId)
->sortable()
->get();
// Collect folders and files to single array
return [
'folders' => new FolderCollection($folders),
'files' => new FilesCollection($files),
'root' => $requestedFolder,
];
}
// Get folders and files
$folders_trashed = Folder::onlyTrashed()
->with(['trashedFolders', 'parent'])
->where('user_id', $userId)
->get(['parent_id', 'id', 'name']);
$folders = Folder::onlyTrashed()
->with(['parent'])
->where('user_id', $userId)
->whereIn('id', filter_folders_ids($folders_trashed))
->sortable()
->get();
// Get files trashed
$files_trashed = File::onlyTrashed()
->with(['parent'])
->where('user_id', $userId)
->where(function ($query) use ($folders_trashed) {
$query->whereNull('parent_id');
$query->orWhereNotIn('parent_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'id'))));
})
->sortable()
->get();
// Collect folders and files to single array
return [
'folders' => new FolderCollection($folders),
'files' => new FilesCollection($files_trashed),
'root' => $requestedFolder,
];
}
}

View File

@@ -0,0 +1,140 @@
<?php
namespace Domain\Browsing\Controllers;
use Str;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderCollection;
class BrowseTrashController
{
public function __invoke(
string $id
): JsonResponse {
$userId = auth()->id();
$rootId = Str::isUuid($id)
? $id
: null;
$requestedFolder = $rootId
? Folder::withTrashed()
->findOrFail($rootId)
: null;
$page = request()->has('page')
? request()->input('page')
: 'all';
// Load trashed folder content
if ($rootId) {
// Prepare folder & file db query
$query = [
'folder' => [
'where' => [
'parent_id' => $rootId,
],
],
'file' => [
'where' => [
'parent_id' => $rootId,
],
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
// Get folders and files
$folders = Folder::onlyTrashed()
->with('parent')
->where($query['folder']['where'])
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::onlyTrashed()
->with('parent')
->where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
}
// Load trash root
if (! $rootId) {
// Get folders and files
$folders_trashed = Folder::onlyTrashed()
->with(['trashedFolders', 'parent'])
->where('user_id', $userId)
->get(['parent_id', 'id', 'name']);
// Prepare folder & file db query
$query = [
'folder' => [
'where' => [
'user_id' => $userId,
],
'whereIn' => [
'id' => filter_folders_ids($folders_trashed),
],
],
'file' => [
'where' => function ($query) use ($folders_trashed, $userId) {
$query
->where('user_id', $userId)
->whereNull('parent_id')
->orWhereNotIn('parent_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'id'))));
},
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page, true);
$folders = Folder::onlyTrashed()
->with(['parent'])
->where($query['folder']['where'])
->whereIn('id', filter_folders_ids($folders_trashed))
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::onlyTrashed()
->with(['parent'])
->where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
// Collect folders and files to single array
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
}
// Collect folders and files to single array
return response()->json([
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => $requestedFolder,
],
]);
}
}

View File

@@ -35,24 +35,57 @@ class VisitorBrowseFolderController
// Get requested folder
$requestedFolder = Folder::findOrFail($id);
// Get files and folders
$folders = Folder::where('user_id', $shared->user_id)
->where('parent_id', $id)
$page = request()->has('page')
? request()->input('page')
: 'all';
// Prepare folder & file db query
$query = [
'folder' => [
'where' => [
'parent_id' => $id,
'user_id' => $shared->user_id,
],
],
'file' => [
'where' => [
'parent_id' => $id,
'user_id' => $shared->user_id,
],
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
$folders = Folder::where($query['folder']['where'])
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::where('user_id', $shared->user_id)
->where('parent_id', $id)
$files = File::where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
// Set thumbnail links for public files
$files->map(fn ($file) => $file->setSharedPublicUrl($shared->token));
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
return response()->json([
'folders' => new FolderCollection($folders),
'files' => new FilesCollection($files),
'root' => new FolderResource($requestedFolder),
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => new FolderResource($requestedFolder),
],
]);
}
}

View File

@@ -4,9 +4,9 @@ namespace Domain\Files\Controllers;
use Gate;
use Domain\Files\Models\File;
use Domain\Sharing\Models\Share;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\JsonResponse;
use Domain\Files\Resources\FileResource;
use Illuminate\Auth\Access\AuthorizationException;
/**
* Get shared file record

View File

@@ -4,8 +4,6 @@ namespace Domain\Invoices\Controllers;
use Domain\Settings\Models\Setting;
use Illuminate\Contracts\View\View;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\Foundation\Application;
use App\Users\Actions\FormatUsageEstimatesAction;
use VueFileManager\Subscription\Domain\Transactions\Models\Transaction;

View File

@@ -2,11 +2,11 @@
namespace Domain\RemoteUpload\Controllers;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use Domain\UploadRequest\Models\UploadRequest;
use Domain\RemoteUpload\Requests\RemoteUploadRequest;
use Domain\RemoteUpload\Actions\GetContentFromExternalSource;
use Domain\UploadRequest\Actions\CreateUploadRequestRootFolderAction;
use Illuminate\Http\JsonResponse;
class UploadFilesRemotelyForUploadRequestController
{

View File

@@ -1,5 +1,4 @@
<?php
namespace Domain\Settings\Controllers;
use Illuminate\Http\JsonResponse;

View File

@@ -1,9 +1,8 @@
<?php
namespace Domain\Settings\Controllers;
use Domain\Settings\Events\TestWebsocketConnectionEvent;
use Illuminate\Http\JsonResponse;
use Domain\Settings\Events\TestWebsocketConnectionEvent;
class TestWebsocketConnectionController
{
@@ -14,7 +13,7 @@ class TestWebsocketConnectionController
);
return response()->json([
'type' => 'success',
'type' => 'success',
'message' => 'The websocket test event was successfully dispatched.',
]);
}

View File

@@ -103,7 +103,7 @@ class StoreAppSettingsController extends Controller
}
return response()->json([
'type' => 'success',
'type' => 'success',
'message' => 'The app settings was set successfully',
]);
}

View File

@@ -4,7 +4,6 @@ namespace Domain\SetupWizard\Controllers;
use DB;
use Artisan;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Response;
use App\Http\Controllers\Controller;
use Doctrine\DBAL\Driver\PDOException;
use Symfony\Component\HttpKernel\Exception\HttpException;

View File

@@ -195,7 +195,7 @@ class StoreEnvironmentSettingsController extends Controller
}
return response()->json([
'type' => 'success',
'type' => 'success',
'message' => 'The environment was set successfully',
]);
}

View File

@@ -6,55 +6,125 @@ use Gate;
use Illuminate\Http\Request;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderResource;
use Domain\Folders\Resources\FolderCollection;
class BrowseSharedWithMeController
{
public function __invoke(Request $request, $id): array
{
$id = Str::isUuid($id) ? $id : null;
public function __invoke(
Request $request,
string $id,
): JsonResponse {
// Get root ID
$id = Str::isUuid($id)
? $id
: null;
// Get page number
$page = request()->has('page')
? request()->input('page')
: 'all';
if ($id) {
$teamFolder = Folder::findOrFail($id)->getLatestParent();
if (! Gate::any(['can-edit', 'can-view'], [$teamFolder, null])) {
abort(403, 'Access Denied');
}
$folders = Folder::with(['parent:id,name'])
->where('parent_id', $id)
->sortable()
->get();
$files = File::with(['parent:id,name'])
->where('parent_id', $id)
->sortable()
->get();
[$teamFolder, $folders, $files, $totalEntries] = $this->getSingleSharedWithMeFolderContent($id, $page);
} else {
[$folders, $files, $totalEntries] = $this->getRootFolders($page);
}
if (! $id) {
$sharedFolderIds = DB::table('team_folder_members')
->where('user_id', Auth::id())
->whereIn('permission', ['can-edit', 'can-view'])
->pluck('parent_id');
// Get paginator data
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
$folders = Folder::whereIn('id', $sharedFolderIds)
->sortable()
->get();
// Collect entries
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
return response()->json([
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'teamFolder' => $id
? new FolderResource($teamFolder)
: null,
'root' => $id
? new FolderResource(Folder::findOrFail($id))
: null,
],
]);
}
private function getRootFolders(mixed $page): array
{
$entriesPerPage = config('vuefilemanager.paginate.perPage');
$sharedFolderIds = DB::table('team_folder_members')
->where('user_id', auth()->id())
->whereIn('permission', ['can-edit', 'can-view'])
->pluck('parent_id');
$folders = Folder::whereIn('id', $sharedFolderIds)
->sortable()
->skip($entriesPerPage * ($page - 1))
->take($entriesPerPage)
->get();
$totalEntries = DB::table('folders')
->whereIn('id', $sharedFolderIds)
->count();
$files = null;
return [$folders, $files, $totalEntries];
}
private function getSingleSharedWithMeFolderContent(string|null $id, mixed $page): array
{
$teamFolder = Folder::findOrFail($id)
->getLatestParent();
if (! Gate::any(['can-edit', 'can-view'], [$teamFolder, null])) {
abort(
response()->json(accessDeniedError(), 403)
);
}
list($data, $paginate, $links) = groupPaginate($request, $folders, $files ?? null);
return [
'data' => $data,
'teamFolder' => $id ? new FolderResource($teamFolder) : null,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => $id ? new FolderResource(Folder::findOrFail($id)) : null,
$query = [
'folder' => [
'where' => [
'parent_id' => $id,
],
],
'file' => [
'where' => [
'parent_id' => $id,
],
],
'with' => [
'parent:id,name',
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
$folders = Folder::with($query['with'])
->where($query['folder']['where'])
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::with($query['with'])
->where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
return [$teamFolder, $folders, $files, $totalEntries];
}
}

View File

@@ -2,12 +2,12 @@
namespace Domain\Teams\Controllers;
use Domain\Folders\Models\Folder;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Gate;
use Domain\Teams\Models\TeamFolderMember;
use Domain\Folders\Resources\FolderResource;
use Illuminate\Auth\Access\AuthorizationException;
use Domain\Teams\Requests\ConvertIntoTeamFolderRequest;
use Domain\Teams\Actions\InviteMembersIntoTeamFolderAction;
use Domain\Teams\Actions\SetTeamFolderPropertyForAllChildrenAction;

View File

@@ -2,17 +2,17 @@
namespace Domain\Teams\Controllers;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Domain\Teams\Models\TeamFolderMember;
use Domain\Teams\DTO\CreateTeamFolderData;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderResource;
use Domain\Teams\Actions\UpdateMembersAction;
use Domain\Folders\Resources\FolderCollection;
use Domain\Teams\Actions\UpdateInvitationsAction;
use Domain\Teams\Requests\CreateTeamFolderRequest;
use Domain\Teams\Requests\UpdateTeamFolderMembersRequest;
@@ -27,41 +27,97 @@ class TeamFoldersController extends Controller
) {
}
public function show(Request $request, $id): array
public function show($id): JsonResponse
{
$id = Str::isUuid($id) ? $id : null;
// Get root ID
$id = Str::isUuid($id)
? $id
: null;
// Get page number
$page = request()->has('page')
? request()->input('page')
: 'all';
$entriesPerPage = config('vuefilemanager.paginate.perPage');
// TODO: check privileges
if ($id) {
$folders = Folder::where('parent_id', $id)
->where('team_folder', true)
$query = [
'folder' => [
'where' => [
'parent_id' => $id,
'team_folder' => true,
],
],
'file' => [
'where' => [
'parent_id' => $id,
],
],
'with' => [
'parent:id,name',
'shared:token,id,item_id,permission,is_protected,expire_in',
],
];
[$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries] = getRecordsCount($query, $page);
$folders = Folder::with($query['with'])
->where($query['folder']['where'])
->sortable()
->skip($foldersSkip)
->take($foldersTake)
->get();
$files = File::where('parent_id', $id)
$files = File::with($query['with'])
->where($query['file']['where'])
->sortable()
->skip($filesSkip)
->take($filesTake)
->get();
}
if (! $id) {
$folders = Folder::where('parent_id', null)
->where('team_folder', true)
->where('user_id', Auth::id())
->where('user_id', auth()->id())
->sortable()
->skip($entriesPerPage * ($page - 1))
->take($entriesPerPage)
->get();
$totalEntries = DB::table('folders')
->where('parent_id', null)
->where('team_folder', true)
->where('user_id', auth()->id())
->count();
$files = null;
}
list($data, $paginate, $links) = groupPaginate($request, $folders, $files ?? null);
[$paginate, $links] = formatPaginatorMetadata($totalEntries);
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
// Collect folders and files to single array
return [
'data' => $data,
'teamFolder' => $id ? new FolderResource(Folder::findOrFail($id)->getLatestParent()) : null,
return response()->json([
'data' => $entries,
'links' => $links,
'meta' => [
'paginate' => $paginate,
'root' => $id ? new FolderResource(Folder::findOrFail($id)) : null,
'teamFolder' => $id
? new FolderResource(Folder::findOrFail($id)->getLatestParent())
: null,
'root' => $id
? new FolderResource(Folder::findOrFail($id))
: null,
],
];
]);
}
public function store(

View File

@@ -2,7 +2,6 @@
namespace Domain\Transactions\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Domain\Transactions\Resources\TransactionCollection;

View File

@@ -4,6 +4,7 @@ namespace Domain\UploadRequest\Controllers;
use Illuminate\Support\Str;
use Domain\Files\Models\File;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Domain\Files\Resources\FilesCollection;
use Domain\Folders\Resources\FolderResource;
@@ -12,9 +13,13 @@ use Domain\UploadRequest\Models\UploadRequest;
class BrowseUploadRequestController extends Controller
{
public function __invoke(UploadRequest $uploadRequest, $id): array
{
$rootId = Str::isUuid($id) ? $id : $uploadRequest->id;
public function __invoke(
UploadRequest $uploadRequest,
string $id,
): JsonResponse {
$rootId = Str::isUuid($id)
? $id
: $uploadRequest->id;
$folders = Folder::with(['parent:id,name'])
->where('parent_id', $rootId)
@@ -30,11 +35,16 @@ class BrowseUploadRequestController extends Controller
->get()
->each(fn ($file) => $file->setUploadRequestPublicUrl($uploadRequest->id));
// Collect folders and files to single array
return [
'folders' => new FolderCollection($folders),
'files' => new FilesCollection($files),
'root' => new FolderResource(Folder::find($rootId)),
];
$entries = collect([
$folders ? json_decode((new FolderCollection($folders))->toJson(), true) : null,
$files ? json_decode((new FilesCollection($files))->toJson(), true) : null,
])->collapse();
return response()->json([
'data' => $entries,
'meta' => [
'root' => new FolderResource(Folder::find($rootId)),
],
]);
}
}

View File

@@ -1,9 +1,9 @@
<?php
namespace Domain\UploadRequest\Controllers;
use App\Users\Models\User;
use Gate;
use Notification;
use App\Users\Models\User;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;

View File

@@ -1,8 +1,8 @@
<?php
namespace Domain\UploadRequest\Controllers;
use Illuminate\Http\JsonResponse;
use Domain\Folders\Models\Folder;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Domain\UploadRequest\Models\UploadRequest;

View File

@@ -21,7 +21,7 @@ class MoveItemInUploadRequestController extends Controller
}
$item->update([
'parent_id' => $request->input('to_id') ?? $uploadRequest->id
'parent_id' => $request->input('to_id') ?? $uploadRequest->id,
]);
}

View File

@@ -1,13 +1,13 @@
<?php
namespace Domain\UploadRequest\Controllers;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Domain\Files\Resources\FileResource;
use Domain\Folders\Resources\FolderResource;
use Domain\Items\Requests\RenameItemRequest;
use Domain\UploadRequest\Models\UploadRequest;
use Domain\Folders\Actions\UpdateFolderPropertyAction;
use Illuminate\Http\JsonResponse;
use Support\Demo\Actions\FakeRenameFileOrFolderAction;
class RenameFileOrFolderController extends Controller

View File

@@ -67,7 +67,7 @@ class UploadRequestNotification extends Notification implements ShouldQueue
'type' => 'url',
'params' => [
'target' => 'blank',
'url' => url("/request/{$this->uploadRequest->id}/upload"),
'url' => url("/request/{$this->uploadRequest->id}/upload"),
'button' => __t('upload_files'),
],
],

View File

@@ -132,7 +132,7 @@ if (! function_exists('get_settings')) {
/**
* Get single or multiple values from settings table
*/
function get_settings(array | string $setting): Collection | string | null
function get_settings(array|string $setting): Collection|string|null
{
if (is_array($setting)) {
return Setting::whereIn('name', $setting)
@@ -851,103 +851,103 @@ if (! function_exists('remove_accents')) {
if (seems_utf8($string)) {
$chars = [
// Decompositions for Latin-1 Supplement
chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',
chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',
chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',
chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',
chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',
chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',
chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',
chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',
chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',
chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',
chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',
chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',
chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',
chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',
chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',
chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',
chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',
chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',
chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',
chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',
chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',
chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',
chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',
chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',
chr(195) . chr(191) => 'y',
chr(195) . chr(128) => 'A', chr(195) . chr(129) => 'A',
chr(195) . chr(130) => 'A', chr(195) . chr(131) => 'A',
chr(195) . chr(132) => 'A', chr(195) . chr(133) => 'A',
chr(195) . chr(135) => 'C', chr(195) . chr(136) => 'E',
chr(195) . chr(137) => 'E', chr(195) . chr(138) => 'E',
chr(195) . chr(139) => 'E', chr(195) . chr(140) => 'I',
chr(195) . chr(141) => 'I', chr(195) . chr(142) => 'I',
chr(195) . chr(143) => 'I', chr(195) . chr(145) => 'N',
chr(195) . chr(146) => 'O', chr(195) . chr(147) => 'O',
chr(195) . chr(148) => 'O', chr(195) . chr(149) => 'O',
chr(195) . chr(150) => 'O', chr(195) . chr(153) => 'U',
chr(195) . chr(154) => 'U', chr(195) . chr(155) => 'U',
chr(195) . chr(156) => 'U', chr(195) . chr(157) => 'Y',
chr(195) . chr(159) => 's', chr(195) . chr(160) => 'a',
chr(195) . chr(161) => 'a', chr(195) . chr(162) => 'a',
chr(195) . chr(163) => 'a', chr(195) . chr(164) => 'a',
chr(195) . chr(165) => 'a', chr(195) . chr(167) => 'c',
chr(195) . chr(168) => 'e', chr(195) . chr(169) => 'e',
chr(195) . chr(170) => 'e', chr(195) . chr(171) => 'e',
chr(195) . chr(172) => 'i', chr(195) . chr(173) => 'i',
chr(195) . chr(174) => 'i', chr(195) . chr(175) => 'i',
chr(195) . chr(177) => 'n', chr(195) . chr(178) => 'o',
chr(195) . chr(179) => 'o', chr(195) . chr(180) => 'o',
chr(195) . chr(181) => 'o', chr(195) . chr(182) => 'o',
chr(195) . chr(182) => 'o', chr(195) . chr(185) => 'u',
chr(195) . chr(186) => 'u', chr(195) . chr(187) => 'u',
chr(195) . chr(188) => 'u', chr(195) . chr(189) => 'y',
chr(195) . chr(191) => 'y',
// Decompositions for Latin Extended-A
chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',
chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',
chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',
chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',
chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',
chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',
chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',
chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',
chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',
chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',
chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',
chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',
chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',
chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',
chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',
chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',
chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',
chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',
chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',
chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',
chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',
chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',
chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',
chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',
chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',
chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',
chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',
chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',
chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',
chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',
chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',
chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',
chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',
chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',
chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',
chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',
chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',
chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',
chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',
chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',
chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',
chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',
chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',
chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',
chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',
chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',
chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',
chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',
chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',
chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',
chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',
chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',
chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',
chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',
chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',
chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',
chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',
chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',
chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',
chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',
chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',
chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',
chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',
chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',
chr(196) . chr(128) => 'A', chr(196) . chr(129) => 'a',
chr(196) . chr(130) => 'A', chr(196) . chr(131) => 'a',
chr(196) . chr(132) => 'A', chr(196) . chr(133) => 'a',
chr(196) . chr(134) => 'C', chr(196) . chr(135) => 'c',
chr(196) . chr(136) => 'C', chr(196) . chr(137) => 'c',
chr(196) . chr(138) => 'C', chr(196) . chr(139) => 'c',
chr(196) . chr(140) => 'C', chr(196) . chr(141) => 'c',
chr(196) . chr(142) => 'D', chr(196) . chr(143) => 'd',
chr(196) . chr(144) => 'D', chr(196) . chr(145) => 'd',
chr(196) . chr(146) => 'E', chr(196) . chr(147) => 'e',
chr(196) . chr(148) => 'E', chr(196) . chr(149) => 'e',
chr(196) . chr(150) => 'E', chr(196) . chr(151) => 'e',
chr(196) . chr(152) => 'E', chr(196) . chr(153) => 'e',
chr(196) . chr(154) => 'E', chr(196) . chr(155) => 'e',
chr(196) . chr(156) => 'G', chr(196) . chr(157) => 'g',
chr(196) . chr(158) => 'G', chr(196) . chr(159) => 'g',
chr(196) . chr(160) => 'G', chr(196) . chr(161) => 'g',
chr(196) . chr(162) => 'G', chr(196) . chr(163) => 'g',
chr(196) . chr(164) => 'H', chr(196) . chr(165) => 'h',
chr(196) . chr(166) => 'H', chr(196) . chr(167) => 'h',
chr(196) . chr(168) => 'I', chr(196) . chr(169) => 'i',
chr(196) . chr(170) => 'I', chr(196) . chr(171) => 'i',
chr(196) . chr(172) => 'I', chr(196) . chr(173) => 'i',
chr(196) . chr(174) => 'I', chr(196) . chr(175) => 'i',
chr(196) . chr(176) => 'I', chr(196) . chr(177) => 'i',
chr(196) . chr(178) => 'IJ', chr(196) . chr(179) => 'ij',
chr(196) . chr(180) => 'J', chr(196) . chr(181) => 'j',
chr(196) . chr(182) => 'K', chr(196) . chr(183) => 'k',
chr(196) . chr(184) => 'k', chr(196) . chr(185) => 'L',
chr(196) . chr(186) => 'l', chr(196) . chr(187) => 'L',
chr(196) . chr(188) => 'l', chr(196) . chr(189) => 'L',
chr(196) . chr(190) => 'l', chr(196) . chr(191) => 'L',
chr(197) . chr(128) => 'l', chr(197) . chr(129) => 'L',
chr(197) . chr(130) => 'l', chr(197) . chr(131) => 'N',
chr(197) . chr(132) => 'n', chr(197) . chr(133) => 'N',
chr(197) . chr(134) => 'n', chr(197) . chr(135) => 'N',
chr(197) . chr(136) => 'n', chr(197) . chr(137) => 'N',
chr(197) . chr(138) => 'n', chr(197) . chr(139) => 'N',
chr(197) . chr(140) => 'O', chr(197) . chr(141) => 'o',
chr(197) . chr(142) => 'O', chr(197) . chr(143) => 'o',
chr(197) . chr(144) => 'O', chr(197) . chr(145) => 'o',
chr(197) . chr(146) => 'OE', chr(197) . chr(147) => 'oe',
chr(197) . chr(148) => 'R', chr(197) . chr(149) => 'r',
chr(197) . chr(150) => 'R', chr(197) . chr(151) => 'r',
chr(197) . chr(152) => 'R', chr(197) . chr(153) => 'r',
chr(197) . chr(154) => 'S', chr(197) . chr(155) => 's',
chr(197) . chr(156) => 'S', chr(197) . chr(157) => 's',
chr(197) . chr(158) => 'S', chr(197) . chr(159) => 's',
chr(197) . chr(160) => 'S', chr(197) . chr(161) => 's',
chr(197) . chr(162) => 'T', chr(197) . chr(163) => 't',
chr(197) . chr(164) => 'T', chr(197) . chr(165) => 't',
chr(197) . chr(166) => 'T', chr(197) . chr(167) => 't',
chr(197) . chr(168) => 'U', chr(197) . chr(169) => 'u',
chr(197) . chr(170) => 'U', chr(197) . chr(171) => 'u',
chr(197) . chr(172) => 'U', chr(197) . chr(173) => 'u',
chr(197) . chr(174) => 'U', chr(197) . chr(175) => 'u',
chr(197) . chr(176) => 'U', chr(197) . chr(177) => 'u',
chr(197) . chr(178) => 'U', chr(197) . chr(179) => 'u',
chr(197) . chr(180) => 'W', chr(197) . chr(181) => 'w',
chr(197) . chr(182) => 'Y', chr(197) . chr(183) => 'y',
chr(197) . chr(184) => 'Y', chr(197) . chr(185) => 'Z',
chr(197) . chr(186) => 'z', chr(197) . chr(187) => 'Z',
chr(197) . chr(188) => 'z', chr(197) . chr(189) => 'Z',
chr(197) . chr(190) => 'z', chr(197) . chr(191) => 's',
// Euro Sign
chr(226) . chr(130) . chr(172) => 'E',
// GBP (Pound) Sign
chr(194) . chr(163) => '', ];
chr(194) . chr(163) => '', ];
$string = strtr($string, $chars);
} else {
@@ -1013,7 +1013,7 @@ if (! function_exists('set_time_by_user_timezone')) {
/**
* Set time by user timezone GMT
*/
function set_time_by_user_timezone($user, $createdAt): string | Carbon
function set_time_by_user_timezone($user, $createdAt): string|Carbon
{
$timezone = $user->settings->timezone ?? 0;
@@ -1210,34 +1210,35 @@ if (! function_exists('extractItemsFromGetAttribute')) {
});
}
if (! function_exists('generatePaginationCounts')) {
if (! function_exists('formatPaginatorMetadata')) {
/**
* Group paginate of Foldes and Files
* Format paginate data
*/
function generatePaginationCounts(
int $totalItemsCount
) : array {
$perPage = config('vuefilemanager.paginate.perPage');
$currentPage = request()->input('page') === 'all' ? 1 : (int) request()->input('page');
function formatPaginatorMetadata(
int $totalEntries
): array {
$uri = request()->fullUrl();
$lastPage = ceil($totalItemsCount / $perPage);
$perPage = config('vuefilemanager.paginate.perPage');
$lastPage = ceil($totalEntries / $perPage);
$currentPage = request()->input('page') === 'all'
? 1
: (int) request()->input('page');
return [
[
'currentPage' => $currentPage,
'from' => 1,
'lastPage' => $lastPage,
'path' => $uri,
'perPage' => $perPage,
'to' => $perPage,
'total' => $totalItemsCount,
'currentPage' => $currentPage,
'from' => 1,
'lastPage' => $lastPage,
'path' => $uri,
'perPage' => $perPage,
'to' => $perPage,
'total' => $totalEntries,
],
[
'first' => $uri . '&page=1',
'last' => $uri . '&page=' . $lastPage,
'next' => $currentPage == $lastPage ? null : $uri . '&page=' . $currentPage + 1,
'prev' => $currentPage == 1 ? null : $uri . '&page=' . $currentPage - 1,
'first' => $uri . '&page=1',
'last' => $uri . '&page=' . $lastPage,
'next' => $currentPage == $lastPage ? null : $uri . '&page=' . $currentPage + 1,
'prev' => $currentPage == 1 ? null : $uri . '&page=' . $currentPage - 1,
],
];
}
@@ -1248,12 +1249,12 @@ if (! function_exists('extractItemsFromGetAttribute')) {
* Get count of items from the Database
*/
function getRecordsCount(
array $folderQuery,
array $fileQuery,
string $page
) : array {
array $query,
string $page = 'all',
bool $findTrashed = false,
): array {
$perPage = config('vuefilemanager.paginate.perPage');
$currentPage = $page === 'all' ? 1 : (int) $page;
$currentPage = $page === 'all' ? 'all' : intval($page);
$foldersSkip = 0;
$foldersTake = 0;
@@ -1261,15 +1262,50 @@ if (! function_exists('extractItemsFromGetAttribute')) {
$filesTake = 0;
$foldersCount = DB::table('folders')
->where($folderQuery)
->when(
$findTrashed,
fn ($q) => $q->whereNotNull('deleted_at')
)
->when(
array_key_exists('where', $query['folder']),
fn ($q) => $q->where($query['folder']['where'])
)
->when(
array_key_exists('whereIn', $query['folder']),
function ($q) use ($query) {
foreach ($query['folder']['whereIn'] as $key => $value) {
$q->whereIn($key, $value);
}
return $q;
}
)
->count();
$filesCount = DB::table('files')
->where($fileQuery)
->when(
$findTrashed,
fn ($q) => $q->whereNotNull('deleted_at')
)
->when(
array_key_exists('where', $query['file']),
fn ($q) => $q->where($query['file']['where'])
)
->when(
array_key_exists('whereIn', $query['file']),
function ($q) use ($query) {
foreach ($query['file']['whereIn'] as $key => $value) {
$q->whereIn($key, $value);
}
return $q;
}
)
->count();
$totalItemsCount = $foldersCount + $filesCount;
$totalEntries = $foldersCount + $filesCount;
// Get certain page
if ($page !== 'all') {
// Folders pages
if ($foldersCount >= $currentPage * $perPage) {
@@ -1290,12 +1326,15 @@ if (! function_exists('extractItemsFromGetAttribute')) {
$filesTake = $perPage;
$filesSkip = ((ceil($foldersCount / $perPage) * $perPage) - $foldersCount) + ($currentPage - (ceil($foldersCount / $perPage)) - 1) * $perPage;
}
} else {
}
// Get all records
if ($page === 'all') {
$foldersTake = $foldersCount;
$filesTake = $filesCount;
}
return [$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalItemsCount];
return [$foldersTake, $foldersSkip, $filesTake, $filesSkip, $totalEntries];
}
}
}

View File

@@ -1,6 +1,9 @@
<?php
namespace Tests\App\Restrictions;
use Illuminate\Http\UploadedFile;
use Storage;
use Str;
use Tests\TestCase;
use App\Users\Models\User;
use Domain\Files\Models\File;
@@ -121,10 +124,15 @@ class DefaultRestrictionsTest extends TestCase
->hasSettings()
->create();
$file = UploadedFile::fake()
->create(Str::random() . '-fake-file.pdf', 1200, 'application/pdf');
Storage::putFileAs("files/$user->id", $file, $file->name);
$file = File::factory()
->create([
'user_id' => $user->id,
'basename' => 'fake-file.pdf',
'basename' => $file->name,
'name' => 'fake-file.pdf',
]);

View File

@@ -1,6 +1,9 @@
<?php
namespace Tests\App\Restrictions;
use Illuminate\Http\UploadedFile;
use Storage;
use Str;
use Tests\TestCase;
use App\Users\Models\User;
use Domain\Files\Models\File;
@@ -167,10 +170,15 @@ class FixedBillingRestrictionsTest extends TestCase
->hasSettings()
->create();
$file = UploadedFile::fake()
->create(Str::random() . '-fake-file.pdf', 1200, 'application/pdf');
Storage::putFileAs("files/$user->id", $file, $file->name);
$file = File::factory()
->create([
'user_id' => $user->id,
'basename' => 'fake-file.pdf',
'basename' => $file->name,
'name' => 'fake-file.pdf',
]);

View File

@@ -1,6 +1,9 @@
<?php
namespace Tests\App\Restrictions;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Str;
use Storage;
use Tests\TestCase;
use App\Users\Models\User;
use Domain\Files\Models\File;
@@ -145,10 +148,15 @@ class MeteredBillingRestrictionsTest extends TestCase
->hasSettings()
->create();
$file = UploadedFile::fake()
->create(Str::random() . '-fake-file.pdf', 1200, 'application/pdf');
Storage::putFileAs("files/$user->id", $file, $file->name);
$file = File::factory()
->create([
'user_id' => $user->id,
'basename' => 'fake-file.pdf',
'basename' => $file->name,
'name' => 'fake-file.pdf',
]);
@@ -197,10 +205,15 @@ class MeteredBillingRestrictionsTest extends TestCase
->hasSettings()
->create();
$file = UploadedFile::fake()
->create(Str::random() . '-fake-file.pdf', 1200, 'application/pdf');
Storage::putFileAs("files/$user->id", $file, $file->name);
$file = File::factory()
->create([
'user_id' => $user->id,
'basename' => 'fake-file.pdf',
'basename' => $file->name,
'name' => 'fake-file.pdf',
]);

View File

@@ -19,7 +19,7 @@ class SocialiteTest extends TestCase
{
$response = $this->get('api/socialite/google/redirect');
$this->assertStringContainsString('accounts.google.com/o/oauth2/auth', $response['url']);
$this->assertStringContainsString('accounts.google.com/o/oauth2/auth', $response->json()['data']['url']);
}
/**

View File

@@ -203,9 +203,7 @@ class UserAccountTest extends TestCase
],
],
],
'favourites' => [
'data' => [],
],
'favourites' => [],
'readNotifications' => [
'data' => [],
],

View File

@@ -50,7 +50,7 @@ class SetupWizardTest extends TestCase
'name' => 'database/test.sqlite',
'username' => 'null',
'password' => 'null',
])->assertStatus(204);
])->assertStatus(200);
}
/**
@@ -76,7 +76,7 @@ class SetupWizardTest extends TestCase
'logo_horizontal' => UploadedFile::fake()->image('fake-logo-horizontal.jpg'),
'logo_horizontal_dark' => UploadedFile::fake()->image('fake-logo-horizontal-dark.jpg'),
'favicon' => UploadedFile::fake()->image('fake-favicon.jpg'),
])->assertStatus(204);
])->assertStatus(200);
$this
->assertDatabaseHas('settings', [

View File

@@ -182,7 +182,7 @@ class TeamsTest extends TestCase
$this
->actingAs($user)
->getJson('/api/teams/folders/undefined')
->getJson('/api/teams/folders/all?page=1')
->assertOk()
->assertJsonFragment([
'id' => $folder->id,
@@ -255,7 +255,7 @@ class TeamsTest extends TestCase
$this
->actingAs($member)
->getJson('/api/teams/shared-with-me/undefined')
->getJson('/api/teams/shared-with-me/all?page=1')
->assertOk()
->assertJsonFragment([
'id' => $folders[0]->id,

View File

@@ -53,17 +53,18 @@ class HelperTest extends TestCase
'parent_id' => null,
]);
$folderQuery = [
'parent_id' => null,
'team_folder' => false,
'user_id' => $user->id,
'deleted_at' => null,
];
$fileQuery = [
'parent_id' => null,
'user_id' => $user->id,
'deleted_at' => null,
$query = [
'folder' => [
'parent_id' => null,
'team_folder' => false,
'user_id' => $user->id,
'deleted_at' => null,
],
'file' => [
'parent_id' => null,
'user_id' => $user->id,
'deleted_at' => null,
],
];
Config::set('vuefilemanager.paginate.perPage', 5);
@@ -71,15 +72,15 @@ class HelperTest extends TestCase
// getRecordsCunt returned array [foldersTake, foldersSkip, filesTake, filesSkip, totalItemsCount]
// Get folders page
$this->assertEquals([5, 0, 0, 0, 25], getRecordsCount($folderQuery, $fileQuery, '1'));
$this->assertEquals([5, 0, 0, 0, 25], getRecordsCount($query, 1));
// Get mixed page
$this->assertEquals([2, 10, 3, 0, 25], getRecordsCount($folderQuery, $fileQuery, '3'));
$this->assertEquals([2, 10, 3, 0, 25], getRecordsCount($query, 3));
// Get files page
$this->assertEquals([0, 0, 5, 8, 25], getRecordsCount($folderQuery, $fileQuery, '5'));
$this->assertEquals([0, 0, 5, 8, 25], getRecordsCount($query, 5));
// Get all pages
$this->assertEquals([12, 0, 13, 0, 25], getRecordsCount($folderQuery, $fileQuery, 'all'));
$this->assertEquals([12, 0, 13, 0, 25], getRecordsCount($query));
}
}