From 4f37a5ed811061c1b683319829d6a0a7fe95ee9a Mon Sep 17 00:00:00 2001 From: "Sander den Hollander :)" Date: Tue, 13 Aug 2024 21:13:55 +0200 Subject: [PATCH 1/6] Small improvements --- .ddev/commands/web/check-all | 9 + app/Livewire/Notifications/Index.php | 2 +- composer.lock | 75 +++--- package-lock.json | 213 +++++++----------- package.json | 16 +- resources/js/notifications.js | 2 + .../components/notification/item.blade.php | 28 +++ .../livewire/notifications/index.blade.php | 53 +---- resources/views/navigation-menu.blade.php | 2 +- 9 files changed, 177 insertions(+), 223 deletions(-) create mode 100755 .ddev/commands/web/check-all create mode 100644 resources/views/components/notification/item.blade.php diff --git a/.ddev/commands/web/check-all b/.ddev/commands/web/check-all new file mode 100755 index 0000000..0a57ebc --- /dev/null +++ b/.ddev/commands/web/check-all @@ -0,0 +1,9 @@ +#!/bin/bash + +## Description: Check all commands +## Usage: check-all +## Example: ddev check-all + +php vendor/bin/pest +php vendor/bin/phpstan analyse +php vendor/bin/phpcs diff --git a/app/Livewire/Notifications/Index.php b/app/Livewire/Notifications/Index.php index 61b2054..016ed56 100644 --- a/app/Livewire/Notifications/Index.php +++ b/app/Livewire/Notifications/Index.php @@ -15,7 +15,7 @@ class Index extends Component #[On('notificationReceived')] public function mount() { - $this->notifications = auth()->user()->notifications()->get(); + $this->notifications = auth()->user()->notifications()->read()->get(); $this->unread = auth()->user()->notifications()->unread()->get(); } diff --git a/composer.lock b/composer.lock index fe6e8a1..c008558 100644 --- a/composer.lock +++ b/composer.lock @@ -402,23 +402,23 @@ }, { "name": "dasprid/enum", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/DASPRiD/Enum.git", - "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016" + "reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/6faf451159fb8ba4126b925ed2d78acfce0dc016", - "reference": "6faf451159fb8ba4126b925ed2d78acfce0dc016", + "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/8dfd07c6d2cf31c8da90c53b83c026c7696dda90", + "reference": "8dfd07c6d2cf31c8da90c53b83c026c7696dda90", "shasum": "" }, "require": { "php": ">=7.1 <9.0" }, "require-dev": { - "phpunit/phpunit": "^7 | ^8 | ^9", + "phpunit/phpunit": "^7 || ^8 || ^9 || ^10 || ^11", "squizlabs/php_codesniffer": "*" }, "type": "library", @@ -446,9 +446,9 @@ ], "support": { "issues": "https://github.com/DASPRiD/Enum/issues", - "source": "https://github.com/DASPRiD/Enum/tree/1.0.5" + "source": "https://github.com/DASPRiD/Enum/tree/1.0.6" }, - "time": "2023-08-25T16:18:39+00:00" + "time": "2024-08-09T14:30:48+00:00" }, { "name": "dflydev/dot-access-data", @@ -5395,16 +5395,16 @@ }, { "name": "sentry/sentry", - "version": "4.8.1", + "version": "4.9.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04" + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/61770efd8b7888e0bdd7d234f0ba67b066e47d04", - "reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d", + "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d", "shasum": "" }, "require": { @@ -5468,7 +5468,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/4.8.1" + "source": "https://github.com/getsentry/sentry-php/tree/4.9.0" }, "funding": [ { @@ -5480,7 +5480,7 @@ "type": "custom" } ], - "time": "2024-07-16T13:45:27+00:00" + "time": "2024-08-08T14:40:50+00:00" }, { "name": "sentry/sentry-laravel", @@ -6313,16 +6313,16 @@ }, { "name": "spatie/robots-txt", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/spatie/robots-txt.git", - "reference": "02722a0256731e7996bb9d0e544238a408e78bf5" + "reference": "db55c5f4aef0bd8576b03b80dc3ede3d176b9cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/robots-txt/zipball/02722a0256731e7996bb9d0e544238a408e78bf5", - "reference": "02722a0256731e7996bb9d0e544238a408e78bf5", + "url": "https://api.github.com/repos/spatie/robots-txt/zipball/db55c5f4aef0bd8576b03b80dc3ede3d176b9cdf", + "reference": "db55c5f4aef0bd8576b03b80dc3ede3d176b9cdf", "shasum": "" }, "require": { @@ -6357,7 +6357,7 @@ ], "support": { "issues": "https://github.com/spatie/robots-txt/issues", - "source": "https://github.com/spatie/robots-txt/tree/2.2.0" + "source": "https://github.com/spatie/robots-txt/tree/2.2.1" }, "funding": [ { @@ -6369,7 +6369,7 @@ "type": "github" } ], - "time": "2024-04-22T14:28:40+00:00" + "time": "2024-08-09T09:07:48+00:00" }, { "name": "spatie/security-advisories-health-check", @@ -10758,16 +10758,16 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "5.9.0", + "version": "5.9.1", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "011fa18a4e55591fac6545a821921dd1d61c6984" + "reference": "169a9f11f1957ea36607c9b29eac1b48679f1ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/011fa18a4e55591fac6545a821921dd1d61c6984", - "reference": "011fa18a4e55591fac6545a821921dd1d61c6984", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/169a9f11f1957ea36607c9b29eac1b48679f1ecc", + "reference": "169a9f11f1957ea36607c9b29eac1b48679f1ecc", "shasum": "" }, "require": { @@ -10785,8 +10785,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.9.12", "phpstan/phpstan-phpunit": "^1.3.3", - "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^8.5 || ^9.6", "psalm/plugin-phpunit": "^0.16.1", "vimeo/psalm": "^4.11", "zumba/json-serializer": "~3.0.2" @@ -10842,7 +10841,7 @@ "type": "other" } ], - "time": "2024-01-20T20:34:02+00:00" + "time": "2024-08-13T19:01:01+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -10893,16 +10892,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.9", + "version": "1.11.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e370bcddadaede0c1716338b262346f40d296f82" + "reference": "640410b32995914bde3eed26fa89552f9c2c082f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82", - "reference": "e370bcddadaede0c1716338b262346f40d296f82", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/640410b32995914bde3eed26fa89552f9c2c082f", + "reference": "640410b32995914bde3eed26fa89552f9c2c082f", "shasum": "" }, "require": { @@ -10947,7 +10946,7 @@ "type": "github" } ], - "time": "2024-08-01T16:25:18+00:00" + "time": "2024-08-08T09:02:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -11541,16 +11540,16 @@ }, { "name": "sebastian/comparator", - "version": "5.0.1", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372" + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2db5010a484d53ebf536087a70b4a5423c102372", - "reference": "2db5010a484d53ebf536087a70b4a5423c102372", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", + "reference": "2d3e04c3b4c1e84a5e7382221ad8883c8fbc4f53", "shasum": "" }, "require": { @@ -11561,7 +11560,7 @@ "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10.3" + "phpunit/phpunit": "^10.4" }, "type": "library", "extra": { @@ -11606,7 +11605,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.2" }, "funding": [ { @@ -11614,7 +11613,7 @@ "type": "github" } ], - "time": "2023-08-14T13:18:12+00:00" + "time": "2024-08-12T06:03:08+00:00" }, { "name": "sebastian/complexity", diff --git a/package-lock.json b/package-lock.json index f1ec776..d4149ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,25 @@ { - "name": "html", + "name": "CycleQuest", "lockfileVersion": 3, "requires": true, "packages": { "": { + "name": "CycleQuest", "dependencies": { - "@sentry/browser": "^7.40.0" + "@sentry/browser": "^8.25.0" }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", - "@tailwindcss/typography": "^0.5.10", - "autoprefixer": "^10.4.16", - "axios": "^1.6.4", - "daisyui": "^4.10.1", + "@tailwindcss/typography": "^0.5.14", + "autoprefixer": "^10.4.20", + "axios": "^1.3.1", + "daisyui": "^4.12.10", "laravel-echo": "^1.16.1", "laravel-vite-plugin": "^1.0", - "postcss": "^8.4.32", + "postcss": "^8.4.41", "pusher-js": "^8.4.0-rc2", - "tailwindcss": "^3.4.0", - "vite": "^5.0" + "tailwindcss": "^3.4.9", + "vite": "^5.4" } }, "node_modules/@alloc/quick-lru": { @@ -769,130 +770,114 @@ "win32" ] }, - "node_modules/@sentry-internal/feedback": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.118.0.tgz", - "integrity": "sha512-IYOGRcqIqKJJpMwBBv+0JTu0FPpXnakJYvOx/XEa/SNyF5+l7b9gGEjUVWh1ok50kTLW/XPnpnXNAGQcoKHg+w==", + "node_modules/@sentry-internal/browser-utils": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.25.0.tgz", + "integrity": "sha512-nlWgp1lVhNQOTUplW85G3qm0fOIgAhJ/sl/31OIuScVrITYhYDF2bO+Zv/jQ8YsdUBAUXqY1tPT9wwPJklnPhw==", "license": "MIT", "dependencies": { - "@sentry/core": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/replay-canvas": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.118.0.tgz", - "integrity": "sha512-XxHlCClvrxmVKpiZetFYyiBaPQNiojoBGFFVgbbWBIAPc+fWeLJ2BMoQEBjn/0NA/8u8T6lErK5YQo/eIx9+XQ==", - "license": "MIT", - "dependencies": { - "@sentry/core": "7.118.0", - "@sentry/replay": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@sentry-internal/tracing": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.118.0.tgz", - "integrity": "sha512-dERAshKlQLrBscHSarhHyUeGsu652bDTUN1FK0m4e3X48M3I5/s+0N880Qjpe5MprNLcINlaIgdQ9jkisvxjfw==", + "node_modules/@sentry-internal/feedback": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.25.0.tgz", + "integrity": "sha512-327I5XJAFrsgjc5qUKxZ9rff3WNCfGvf1fIii70LQ2YQhQgG4XHZILmkD06ETEyXb+H1tkrNQQEJ1/d4ai+q5g==", "license": "MIT", "dependencies": { - "@sentry/core": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.118.0.tgz", - "integrity": "sha512-8onDOFV1VLEoBuqA5yaJeR3FF1JNuxr5C7p1oN3OwY724iTVqQnOLmZKZaSnHV3RkY67wKDGQkQIie14sc+42g==", + "node_modules/@sentry-internal/replay": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.25.0.tgz", + "integrity": "sha512-3f7x8EYthyj157uV9V8vBjun+1gJnHhh2+i0qxYLhMGx7N2Fq0J3Bvvo1rosSg+fYh5HzPNZDufwIRdg5C/MQw==", "license": "MIT", "dependencies": { - "@sentry-internal/feedback": "7.118.0", - "@sentry-internal/replay-canvas": "7.118.0", - "@sentry-internal/tracing": "7.118.0", - "@sentry/core": "7.118.0", - "@sentry/integrations": "7.118.0", - "@sentry/replay": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" + "@sentry-internal/browser-utils": "8.25.0", + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/core": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.118.0.tgz", - "integrity": "sha512-ol0xBdp3/K11IMAYSQE0FMxBOOH9hMsb/rjxXWe0hfM5c72CqYWL3ol7voPci0GELJ5CZG+9ImEU1V9r6gK64g==", + "node_modules/@sentry-internal/replay-canvas": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.25.0.tgz", + "integrity": "sha512-dPXlkAbkFL1DBum8rGTaHS+apJKaXEZJF9gLcBBKTruhTCizrugFLxajzIfVSiFVuwNKuJWa2fzhzbeQM0ee7w==", "license": "MIT", "dependencies": { - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" + "@sentry-internal/replay": "8.25.0", + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.118.0.tgz", - "integrity": "sha512-C2rR4NvIMjokF8jP5qzSf1o2zxDx7IeYnr8u15Kb2+HdZtX559owALR0hfgwnfeElqMhGlJBaKUWZ48lXJMzCQ==", + "node_modules/@sentry/browser": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.25.0.tgz", + "integrity": "sha512-51bdVGXjyooqVGzaSGsnExqRTt9NvZ1zGFsxbbCSXi5UoEFN6zdMUz6jKYsL2K80eeELP2VKOVlobHlEzeJQfw==", "license": "MIT", "dependencies": { - "@sentry/core": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0", - "localforage": "^1.8.1" + "@sentry-internal/browser-utils": "8.25.0", + "@sentry-internal/feedback": "8.25.0", + "@sentry-internal/replay": "8.25.0", + "@sentry-internal/replay-canvas": "8.25.0", + "@sentry/core": "8.25.0", + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/replay": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.118.0.tgz", - "integrity": "sha512-boQfCL+1L/tSZ9Huwi00+VtU+Ih1Lcg8HtxBuAsBCJR9pQgUL5jp7ECYdTeeHyCh/RJO7JqV1CEoGTgohe10mA==", + "node_modules/@sentry/core": { + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.25.0.tgz", + "integrity": "sha512-7KtglbrW1eX4DOHkf6i4rRIExEf2CgtQ99qZ8gn5FUaAmNMg0rK7bb1yZMx0RZtp5G1TSz/S0jQQgxHWebaEig==", "license": "MIT", "dependencies": { - "@sentry-internal/tracing": "7.118.0", - "@sentry/core": "7.118.0", - "@sentry/types": "7.118.0", - "@sentry/utils": "7.118.0" + "@sentry/types": "8.25.0", + "@sentry/utils": "8.25.0" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, "node_modules/@sentry/types": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.118.0.tgz", - "integrity": "sha512-2drqrD2+6kgeg+W/ycmiti3G4lJrV3hGjY9PpJ3bJeXrh6T2+LxKPzlgSEnKFaeQWkXdZ4eaUbtTXVebMjb5JA==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.25.0.tgz", + "integrity": "sha512-ojim0gDcRhGJPguYrtms4FsprX4xZz3LGNk9Z0hwTbSVEdlhQIInsQ7CYcdM3sjUs+qT7kfpxTRZGUeZNRRJcA==", "license": "MIT", "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/@sentry/utils": { - "version": "7.118.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.118.0.tgz", - "integrity": "sha512-43qItc/ydxZV1Zb3Kn2M54RwL9XXFa3IAYBO8S82Qvq5YUYmU2AmJ1jgg7DabXlVSWgMA1HntwqnOV3JLaEnTQ==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.25.0.tgz", + "integrity": "sha512-mVlkV7S62ZZ2jM38/kOwWx2xoW8fUv2cjw2IwFKoAIPyLBh3mo1WJtvfdtN/rXGjQWZJBKW53EWaWnD00rkjyA==", "license": "MIT", "dependencies": { - "@sentry/types": "7.118.0" + "@sentry/types": "8.25.0" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/@tailwindcss/forms": { @@ -1129,9 +1114,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001650", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001650.tgz", - "integrity": "sha512-fgEc7hP/LB7iicdXHUI9VsBsMZmUmlVJeQP2qqQW+3lkqVhbmjEU8zp+h5stWeilX+G7uXuIUIIlWlDw9jdt8g==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "dev": true, "funding": [ { @@ -1331,9 +1316,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz", + "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==", "dev": true, "license": "ISC" }, @@ -1592,12 +1577,6 @@ "node": ">= 0.4" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", - "license": "MIT" - }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -1733,15 +1712,6 @@ "vite": "^5.0.0" } }, - "node_modules/lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", - "license": "MIT", - "dependencies": { - "immediate": "~3.0.5" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -1759,15 +1729,6 @@ "dev": true, "license": "MIT" }, - "node_modules/localforage": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", - "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", - "license": "Apache-2.0", - "dependencies": { - "lie": "3.1.1" - } - }, "node_modules/lodash.castarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", @@ -2181,9 +2142,9 @@ } }, "node_modules/postcss-nested/node_modules/postcss-selector-parser": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz", - "integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, "license": "MIT", "dependencies": { @@ -2552,9 +2513,9 @@ } }, "node_modules/tailwindcss": { - "version": "3.4.8", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.8.tgz", - "integrity": "sha512-GkP17r9GQkxgZ9FKHJQEnjJuKBcbFhMFzKu5slmN6NjlCuFnYJMQ8N4AZ6VrUyiRXlDtPKHkesuQ/MS913Nvdg==", + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.9.tgz", + "integrity": "sha512-1SEOvRr6sSdV5IDf9iC+NU4dhwdqzF4zKKq3sAbasUWHEM6lsMhX+eNN5gkPx1BvLFEnZQEUFbXnGj8Qlp83Pg==", "dev": true, "license": "MIT", "dependencies": { @@ -2590,9 +2551,9 @@ } }, "node_modules/tailwindcss/node_modules/postcss-selector-parser": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz", - "integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==", + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 4124035..3663c77 100644 --- a/package.json +++ b/package.json @@ -7,18 +7,18 @@ }, "devDependencies": { "@tailwindcss/forms": "^0.5.7", - "@tailwindcss/typography": "^0.5.10", - "autoprefixer": "^10.4.16", - "axios": "^1.6.4", - "daisyui": "^4.10.1", + "@tailwindcss/typography": "^0.5.14", + "autoprefixer": "^10.4.20", + "axios": "^1.3.1", + "daisyui": "^4.12.10", "laravel-echo": "^1.16.1", "laravel-vite-plugin": "^1.0", - "postcss": "^8.4.32", + "postcss": "^8.4.41", "pusher-js": "^8.4.0-rc2", - "tailwindcss": "^3.4.0", - "vite": "^5.0" + "tailwindcss": "^3.4.9", + "vite": "^5.4" }, "dependencies": { - "@sentry/browser": "^7.40.0" + "@sentry/browser": "^8.25.0" } } diff --git a/resources/js/notifications.js b/resources/js/notifications.js index b54eef5..b947b56 100644 --- a/resources/js/notifications.js +++ b/resources/js/notifications.js @@ -44,6 +44,7 @@ function showNextNotification() { let notificationStep3 = setTimeout(() => { notificationText.innerText = notification.title; notificationTextDiv.style.width = 'inherit'; + notificationTextDiv.classList.add('flex'); notificationTextDiv.classList.remove('hidden'); notificationTextDiv.classList.add('top-0'); notificationTextDiv.classList.remove('top-8'); @@ -56,6 +57,7 @@ function showNextNotification() { clearTimeout(notificationStep4); let notificationStep5 = setTimeout(() => { notificationTextDiv.classList.add('hidden'); + notificationTextDiv.classList.remove('flex'); notificationTextDiv.style.width = 'auto'; notificationInnerDiv.classList.add('w-6'); notificationInnerDiv.classList.remove('w-72'); diff --git a/resources/views/components/notification/item.blade.php b/resources/views/components/notification/item.blade.php new file mode 100644 index 0000000..127e1d5 --- /dev/null +++ b/resources/views/components/notification/item.blade.php @@ -0,0 +1,28 @@ +@props(['notification']) +
  • +
    + + +
    +
    + +

    + {{ $notification->data['view']['title'] }} +

    +
    +

    {{ $notification->data['view']['message'] }} +

    +

    {{ $notification->created_at->diffForHumans() }} +

    +
    +
    + + @if($notification->read_at === null) + + @endif + +
    +
  • diff --git a/resources/views/livewire/notifications/index.blade.php b/resources/views/livewire/notifications/index.blade.php index 9b03c8a..82ffd85 100644 --- a/resources/views/livewire/notifications/index.blade.php +++ b/resources/views/livewire/notifications/index.blade.php @@ -2,35 +2,12 @@ @if ($unread->count())
    {{ __('notifications.unread') }} -
    -
    +
    +
      @foreach ($unread as $notification) -
    • -
      - - -
      -
      - -

      - {{ $notification->data['view']['title'] }} -

      -
      -

      {{ $notification->data['view']['message'] }}

      -

      {{ $notification->created_at->diffForHumans() }} -

      -
      -
      - - - -
      -
    • + @endforeach
    @@ -45,29 +22,7 @@ class="{{ $notification->data['view']['icon'] }} text-2xl dark:text-dm-text-300"
      @foreach ($notifications as $notification) -
    • -
      - - -
      -
      - -

      - {{ $notification->data['view']['title'] }} -

      -
      -

      {{ $notification->data['view']['message'] }} -

      -

      {{ $notification->created_at->diffForHumans() }} -

      -
      -
      - - -
      -
    • + @endforeach
    diff --git a/resources/views/navigation-menu.blade.php b/resources/views/navigation-menu.blade.php index 27c2021..2aa9b7b 100644 --- a/resources/views/navigation-menu.blade.php +++ b/resources/views/navigation-menu.blade.php @@ -127,7 +127,7 @@ class="w-6 h-6 p-1 absolute" @endif
    - From 582d6484a24074dbd2fd373ea56062da7dffe670 Mon Sep 17 00:00:00 2001 From: "Sander den Hollander :)" Date: Tue, 13 Aug 2024 22:53:25 +0200 Subject: [PATCH 2/6] Notification transition timing improvements --- app/Console/Commands/SendTestNotification.php | 13 +- resources/js/notifications.js | 126 ++++++++++-------- resources/views/navigation-menu.blade.php | 4 +- 3 files changed, 76 insertions(+), 67 deletions(-) diff --git a/app/Console/Commands/SendTestNotification.php b/app/Console/Commands/SendTestNotification.php index 90b808d..20532a0 100644 --- a/app/Console/Commands/SendTestNotification.php +++ b/app/Console/Commands/SendTestNotification.php @@ -16,7 +16,7 @@ class SendTestNotification extends Command implements PromptsForMissingInput * * @var string */ - protected $signature = 'app:send-test-notification {user} {status=success}'; + protected $signature = 'app:send-test-notification {user} {status=success} {amount=1}'; /** * The console command description. @@ -25,18 +25,19 @@ class SendTestNotification extends Command implements PromptsForMissingInput */ protected $description = 'Send a test notification to an user'; - private $user; - /** * Execute the console command. */ public function handle() { - $this->user = User::findOrFail($this->argument('user')); - $this->info("Sending a test notification to user {$this->argument('user')} with status {$this->argument('status')}."); + $user = User::findOrFail($this->argument('user')); + $this->info("Sending " . $this->argument('amount') . " test notification(s) to user {$this->argument('user')} with status {$this->argument('status')}."); $this->info('Sleeping for 5 seconds...'); sleep(5); - $this->user->notify(new TestNotification($this->argument('status'))); + for ($i = 0; $i < $this->argument('amount'); $i++) { + $user->notify(new TestNotification($this->argument('status'))); + sleep(1); + } } protected function promptForMissingArgumentsUsing() diff --git a/resources/js/notifications.js b/resources/js/notifications.js index b947b56..853e356 100644 --- a/resources/js/notifications.js +++ b/resources/js/notifications.js @@ -13,77 +13,85 @@ function showNotification(notification) { Livewire.dispatch('notificationReceived', notification); if (!notificationRunning) { notificationRunning = true; - showNextNotification(); + showNotifications(); } } -function showNextNotification() { - let notificationButton = document.getElementById('notificationButton'); - let notificationInnerDiv = document.getElementById('notificationInnerDiv'); - let notificationIconDiv = document.getElementById('notificationIconDiv'); - let notificationTextDiv = document.getElementById('notificationTextDiv'); - let notificationText = notificationTextDiv.querySelector('p'); - let notificationIcon = notificationTextDiv.querySelector('i'); - let href = notificationButton.href; - let notification = notificationQueue[0]; +function showNotifications() { + const notificationButton = document.getElementById('notificationButton'); + const notificationInnerDiv = document.getElementById('notificationInnerDiv'); + const notificationIconDiv = document.getElementById('notificationIconDiv'); + const notificationTextDiv = document.getElementById('notificationTextDiv'); + const notificationText = notificationTextDiv.querySelector('p'); + const notificationIcon = notificationTextDiv.querySelector('i'); + const href = notificationButton.href; + const notification = notificationQueue[0]; + notificationButton.href = notification.url; - if (notification.status == 'success') { - notificationButton.classList.add('bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'); - } else if (notification.status == 'error') { - notificationButton.classList.add('dark:bg-dm-red', 'dark:hover:bg-dm-dark_red', 'bg-red', 'hover:bg-red-300'); - } else { - notificationButton.classList.add('bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'); - } + + const statusClasses = { + 'success': ['bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'], + 'error': ['dark:bg-dm-red', 'dark:hover:bg-dm-dark_red', 'bg-red', 'hover:bg-red-300'], + 'default': ['bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'] + }; + + const classesToAdd = statusClasses[notification.status] || statusClasses['default']; + notificationButton.classList.add(...classesToAdd); notificationButton.classList.remove('bg-pr/20', 'dark:bg-dm-pr/20'); notificationIconDiv.classList.add('top-10'); - let notificationStep2 = setTimeout(() => { + + notificationIconDiv.ontransitionend = () => { + notificationIconDiv.ontransitionend = null; notificationInnerDiv.classList.add('w-72'); notificationInnerDiv.classList.remove('w-6'); - notificationIcon.classList = notification.icon + ' me-2 dark:text-white text-white'; - clearTimeout(notificationStep2); - let notificationStep3 = setTimeout(() => { + notificationIcon.classList = `${notification.icon} me-2 dark:text-white text-white`; + + notificationInnerDiv.ontransitionend = () => { + notificationInnerDiv.ontransitionend = null; notificationText.innerText = notification.title; notificationTextDiv.style.width = 'inherit'; - notificationTextDiv.classList.add('flex'); - notificationTextDiv.classList.remove('hidden'); - notificationTextDiv.classList.add('top-0'); - notificationTextDiv.classList.remove('top-8'); + notificationTextDiv.classList.add('flex', 'top-0'); + notificationTextDiv.classList.remove('hidden', 'top-8'); document.querySelector('.notificationEmpty').classList.add('!hidden'); document.querySelector('.notificationFull').classList.remove('!hidden'); - clearTimeout(notificationStep3); - let notificationStep4 = setTimeout(() => { - notificationTextDiv.classList.add('top-8'); - notificationTextDiv.classList.remove('top-0'); - clearTimeout(notificationStep4); - let notificationStep5 = setTimeout(() => { - notificationTextDiv.classList.add('hidden'); - notificationTextDiv.classList.remove('flex'); - notificationTextDiv.style.width = 'auto'; - notificationInnerDiv.classList.add('w-6'); - notificationInnerDiv.classList.remove('w-72'); - clearTimeout(notificationStep5); - let notificationStep6 = setTimeout(() => { - notificationIconDiv.classList.remove('top-10'); - notificationButton.classList.add('bg-pr/20', 'dark:bg-dm-pr/20'); - if (notification.status == 'success') { - notificationButton.classList.remove('bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'); - } else if (notification.status == 'error') { - notificationButton.classList.remove('dark:bg-dm-red', 'dark:hover:bg-dm-dark_red', 'bg-red', 'hover:bg-red-300'); - } else { - notificationButton.classList.remove('bg-pr', 'hover:bg-pr/20', 'dark:bg-dm-pr', 'dark:hover:bg-dm-pr/20'); - } - // notificationButton.classList.remove('dark:bg-dm-aquamarine', 'dark:hover:bg-dm-dark_green-700', 'bg-sea_green', 'hover:bg-mint_green-300'); - notificationButton.href = href; - notificationQueue.shift(); - if (notificationQueue.length > 0) { - showNextNotification(); - } else { + + const notificationStep4 = setInterval(() => { + if (notificationQueue.length > 0) { + notificationQueue.shift(); + notificationTextDiv.classList.add('top-8'); + notificationTextDiv.classList.remove('top-0'); + + notificationTextDiv.ontransitionend = () => { + notificationButton.href = notification.url; + notificationText.innerText = notification.title; + notificationIcon.classList = `${notification.icon} me-2 dark:text-white text-white`; + notificationTextDiv.classList.add('top-0'); + notificationTextDiv.classList.remove('top-8'); + }; + } else { + notificationTextDiv.classList.add('top-8'); + notificationTextDiv.classList.remove('top-0'); + clearInterval(notificationStep4); + + notificationTextDiv.ontransitionend = () => { + notificationTextDiv.ontransitionend = null; + notificationTextDiv.classList.add('hidden'); + notificationTextDiv.classList.remove('flex'); + notificationTextDiv.style.width = 'auto'; + notificationInnerDiv.classList.add('w-6'); + notificationInnerDiv.classList.remove('w-72'); + + notificationInnerDiv.ontransitionend = () => { + notificationInnerDiv.ontransitionend = null; + notificationIconDiv.classList.remove('top-10'); + notificationButton.classList.add('bg-pr/20', 'dark:bg-dm-pr/20'); + notificationButton.classList.remove(...classesToAdd); + notificationButton.href = href; notificationRunning = false; } - clearTimeout(notificationStep6); - }, 500); - }, 150); - }, 5000) - }, 150); - }, 500); + } + } + }, 5000); + } + } } diff --git a/resources/views/navigation-menu.blade.php b/resources/views/navigation-menu.blade.php index 2aa9b7b..d085d07 100644 --- a/resources/views/navigation-menu.blade.php +++ b/resources/views/navigation-menu.blade.php @@ -56,7 +56,7 @@ class="bg-bg dark:bg-dm-bg border-b border-gray-300 dark:border-dm-bg-600 sticky
    - -