From 6e8ec1beca67e31f0607ff91529cd237424cf489 Mon Sep 17 00:00:00 2001 From: ItsANameToo Date: Thu, 30 Sep 2021 12:15:28 +0200 Subject: [PATCH 1/4] chore: remove honeypot dep and update docs --- composer.json | 1 - composer.lock | 92 +++++++++------------------------------------------ usage/ui.md | 22 ++---------- 3 files changed, 17 insertions(+), 98 deletions(-) diff --git a/composer.json b/composer.json index bd50b85e6..141a0943a 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,6 @@ "laravel/fortify": "^1.8", "league/commonmark": "^2.0", "livewire/livewire": "^2.6", - "lukeraymonddowning/honey": "^0.3.4", "mockery/mockery": "^1.4", "nunomaduro/collision": "^5.5", "nunomaduro/larastan": "^0.7", diff --git a/composer.lock b/composer.lock index 13f80b7ea..6a16ea65e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e956455283a69f1063fc1457330534f0", + "content-hash": "f52197f6ce7175d75fe8c3e9c78c16f8", "packages": [ { "name": "amphp/amp", @@ -3564,6 +3564,19 @@ "reference": "4c7579b93543e4346287f4a46b93aab46209722f", "shasum": "" }, + "archive": { + "exclude": [ + "/.editorconfig", + "/.github", + "/.gitattributes", + "/.gitignore", + "/.scrutinizer.yml", + "/tests", + "/php*.dist", + "/psalm.xml", + "/scripts" + ] + }, "require": { "dflydev/dot-access-data": "^3.0", "ext-mbstring": "*", @@ -3601,19 +3614,6 @@ "League\\Configuration\\Tests\\Unit\\": "tests/unit" } }, - "archive": { - "exclude": [ - "/.editorconfig", - "/.github", - "/.gitattributes", - "/.gitignore", - "/.scrutinizer.yml", - "/tests", - "/php*.dist", - "/psalm.xml", - "/scripts" - ] - }, "scripts": { "fix": [ "vendor/bin/phpcbf" @@ -3959,68 +3959,6 @@ ], "time": "2021-09-25T22:50:47+00:00" }, - { - "name": "lukeraymonddowning/honey", - "version": "0.3.4", - "source": { - "type": "git", - "url": "https://github.com/lukeraymonddowning/honey.git", - "reference": "3b46c5ad77fd32b38c18b556421c810184ac641b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lukeraymonddowning/honey/zipball/3b46c5ad77fd32b38c18b556421c810184ac641b", - "reference": "3b46c5ad77fd32b38c18b556421c810184ac641b", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.3|^7.2", - "illuminate/support": "^7.0|^8.0", - "php": "^7.4|^8.0" - }, - "require-dev": { - "livewire/livewire": "^2.3", - "orchestra/testbench": "^6.4" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Lukeraymonddowning\\Honey\\Providers\\HoneyServiceProvider" - ], - "aliases": { - "Honey": "Lukeraymonddowning\\Honey\\Facades\\Honey" - } - } - }, - "autoload": { - "psr-4": { - "Lukeraymonddowning\\Honey\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "luke", - "email": "lukeraymonddowning@gmail.com" - } - ], - "description": "Reduce spam on your Laravel site.", - "support": { - "issues": "https://github.com/lukeraymonddowning/honey/issues", - "source": "https://github.com/lukeraymonddowning/honey/tree/0.3.4" - }, - "funding": [ - { - "url": "https://github.com/lukeraymonddowning", - "type": "github" - } - ], - "time": "2021-07-07T08:08:09+00:00" - }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -14078,5 +14016,5 @@ "php": "^8.0" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.0.0" } diff --git a/usage/ui.md b/usage/ui.md index 2bd601bd7..639c268ff 100644 --- a/usage/ui.md +++ b/usage/ui.md @@ -108,6 +108,8 @@ window.Modal = Modal; ### WYSIWYG Markdown editor +> Important: you will need to have `php-tidy` installed for the Markdown parsing. Ensure this is installed on any servers before implementing the markdown editor + 1. Install the npm dependencies ```bash @@ -260,26 +262,6 @@ Note: You can change the the URL by using the `endpoint` prop. 6. The component accepts a `usersInContext` prop that expects an array of usernames. These usernames will be sent in the search query request as `context` and can be used to show those users first in the response. Useful to show the user in the conversation first. -### Honeypot - -1. Install dependency - -```bash -composer require lukeraymonddowning/honey -``` - -2. Setup honeypot - -```bash -php artisan honey:install -``` - -3. Database Migration - -```bash -php artisan migrate -``` - #### Livewire modals To use the Livewire modals, use the `ARKEcosystem\UserInterface\Http\Livewire\Concerns\HasModal` trait in your component class. The trait adds the `closeModal` and `openModal` methods that toggle the `modalShown` property that is the one you should use to whether show or hide the modal. From 98937603264105dad44b9680a3f85f56c04475b4 Mon Sep 17 00:00:00 2001 From: ItsANameToo Date: Thu, 30 Sep 2021 12:33:01 +0200 Subject: [PATCH 2/4] wip --- resources/views/honey-pot.blade.php | 29 ------------------- .../UserInterfaceServiceProvider.php | 4 --- src/UserInterface/Components/HoneyPot.php | 15 ---------- 3 files changed, 48 deletions(-) delete mode 100644 resources/views/honey-pot.blade.php delete mode 100644 src/UserInterface/Components/HoneyPot.php diff --git a/resources/views/honey-pot.blade.php b/resources/views/honey-pot.blade.php deleted file mode 100644 index adb9491d0..000000000 --- a/resources/views/honey-pot.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -@if (in_array(\Lukeraymonddowning\Honey\Checks\JavascriptInputFilledCheck::class, config('honey.checks'))) - @once - - @endonce -@endif - -
- - - - {{ $slot }} -
- -@isset($attributes['recaptcha']) - -@endisset \ No newline at end of file diff --git a/src/Providers/UserInterfaceServiceProvider.php b/src/Providers/UserInterfaceServiceProvider.php index 5d7ab45d3..0ea96181f 100644 --- a/src/Providers/UserInterfaceServiceProvider.php +++ b/src/Providers/UserInterfaceServiceProvider.php @@ -7,7 +7,6 @@ use ARKEcosystem\Foundation\UserInterface\Components\Currency; use ARKEcosystem\Foundation\UserInterface\Components\DataBag; use ARKEcosystem\Foundation\UserInterface\Components\FlashMessage; -use ARKEcosystem\Foundation\UserInterface\Components\HoneyPot; use ARKEcosystem\Foundation\UserInterface\Components\Number; use ARKEcosystem\Foundation\UserInterface\Components\Percentage; use ARKEcosystem\Foundation\UserInterface\Components\ShortCurrency; @@ -297,9 +296,6 @@ private function registerBladeComponents(): void // Font Loader $blade->component('ark::font-loader', 'ark-font-loader'); - // Honey Pot - $blade->component('honey-pot', HoneyPot::class); - // Formatting $blade->component('currency', Currency::class); $blade->component('number', Number::class); diff --git a/src/UserInterface/Components/HoneyPot.php b/src/UserInterface/Components/HoneyPot.php deleted file mode 100644 index 4871361ec..000000000 --- a/src/UserInterface/Components/HoneyPot.php +++ /dev/null @@ -1,15 +0,0 @@ - Date: Thu, 30 Sep 2021 10:33:24 +0000 Subject: [PATCH 3/4] style: resolve style guide violations --- .../views/auth/forgot-password.blade.php | 6 +- resources/views/auth/login.blade.php | 6 +- resources/views/auth/register-form.blade.php | 2 +- resources/views/auth/register.blade.php | 2 +- .../views/auth/reset-password-form.blade.php | 4 +- resources/views/auth/reset-password.blade.php | 2 +- .../views/auth/two-factor-challenge.blade.php | 8 +-- .../views/auth/two-factor/form.blade.php | 6 +- .../auth/two-factor/recovery-form.blade.php | 6 +- .../components/auth-verify-email.blade.php | 6 +- .../components/component-heading.blade.php | 6 +- .../views/components/form-wrapper.blade.php | 4 +- .../components/manage-notifications.blade.php | 56 +++++++++---------- .../modals/2fa-recovery-codes.blade.php | 12 ++-- .../modals/password-confirmation.blade.php | 6 +- .../views/components/password-rules.blade.php | 6 +- .../views/navbar-notifications.blade.php | 14 ++--- .../footer-subscription-form.blade.php | 2 +- resources/views/notification-icon.blade.php | 24 ++++---- .../views/profile/delete-user-form.blade.php | 8 +-- .../views/profile/export-user-data.blade.php | 2 +- .../profile/feedback-thank-you.blade.php | 4 +- ...gout-other-browser-sessions-form.blade.php | 4 +- .../two-factor-authentication-form.blade.php | 28 +++++----- .../profile/update-password-form.blade.php | 6 +- 25 files changed, 115 insertions(+), 115 deletions(-) diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index feb7aacca..6d4d08792 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -16,7 +16,7 @@ @section('content') -
+
@@ -37,12 +37,12 @@ class="w-full"
-
+
-
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 9ff8b115c..67df2fe46 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -79,12 +79,12 @@ class="flex flex-col-reverse items-center space-y-4 sm:space-y-0 sm:flex-row {{ @if($hasForgotPassword)
@lang('ui::auth.sign-in.forgot_password') + class="font-semibold link">@lang('ui::auth.sign-in.forgot_password')
@endif
- @@ -92,7 +92,7 @@ class="link font-semibold">@lang('ui::auth.sign-in.forgot_password') @if(Route::has('register')) -
+
@endif diff --git a/resources/views/auth/register-form.blade.php b/resources/views/auth/register-form.blade.php index 26f579fe1..d0715891a 100644 --- a/resources/views/auth/register-form.blade.php +++ b/resources/views/auth/register-form.blade.php @@ -97,7 +97,7 @@ class="w-full"
-
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index fb8cc06c6..812c3b0ab 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -16,7 +16,7 @@ @section('content') -
+
diff --git a/resources/views/auth/reset-password-form.blade.php b/resources/views/auth/reset-password-form.blade.php index f05ce7ad1..cb92a6620 100644 --- a/resources/views/auth/reset-password-form.blade.php +++ b/resources/views/auth/reset-password-form.blade.php @@ -53,12 +53,12 @@ class="w-full"
-
+
-
diff --git a/resources/views/auth/reset-password.blade.php b/resources/views/auth/reset-password.blade.php index 8a90e5be3..d51ffaadc 100644 --- a/resources/views/auth/reset-password.blade.php +++ b/resources/views/auth/reset-password.blade.php @@ -16,7 +16,7 @@ @section('content') -
+
@endsection diff --git a/resources/views/auth/two-factor-challenge.blade.php b/resources/views/auth/two-factor-challenge.blade.php index 27597c633..5db559792 100644 --- a/resources/views/auth/two-factor-challenge.blade.php +++ b/resources/views/auth/two-factor-challenge.blade.php @@ -14,10 +14,10 @@ @endsection @section('content') -
-
-

@lang('ui::auth.two-factor.page_header')

-

@lang('ui::auth.two-factor.page_description')

+
+
+

@lang('ui::auth.two-factor.page_header')

+

@lang('ui::auth.two-factor.page_description')

diff --git a/resources/views/auth/two-factor/form.blade.php b/resources/views/auth/two-factor/form.blade.php index bd2b0feb0..b04cabce6 100644 --- a/resources/views/auth/two-factor/form.blade.php +++ b/resources/views/auth/two-factor/form.blade.php @@ -21,12 +21,12 @@ class="w-full hide-number-input-arrows"
-
- -
diff --git a/resources/views/auth/two-factor/recovery-form.blade.php b/resources/views/auth/two-factor/recovery-form.blade.php index ebc80721c..6e9763845 100644 --- a/resources/views/auth/two-factor/recovery-form.blade.php +++ b/resources/views/auth/two-factor/recovery-form.blade.php @@ -17,13 +17,13 @@ class="w-full"
-
- -
diff --git a/resources/views/components/auth-verify-email.blade.php b/resources/views/components/auth-verify-email.blade.php index 06d08decd..24d1f3d6c 100644 --- a/resources/views/components/auth-verify-email.blade.php +++ b/resources/views/components/auth-verify-email.blade.php @@ -1,12 +1,12 @@ -
-
+
+

@lang('ui::auth.verify.page_header')

@lang('ui::auth.verify.link_description')

- +

diff --git a/resources/views/components/component-heading.blade.php b/resources/views/components/component-heading.blade.php index 5e693770a..bb2f8aac3 100644 --- a/resources/views/components/component-heading.blade.php +++ b/resources/views/components/component-heading.blade.php @@ -1,6 +1,6 @@ -

-
+
+

{{ $title }}

-

{{ $description }}

+

{{ $description }}

diff --git a/resources/views/components/form-wrapper.blade.php b/resources/views/components/form-wrapper.blade.php index cdbd7e580..59da87f26 100644 --- a/resources/views/components/form-wrapper.blade.php +++ b/resources/views/components/form-wrapper.blade.php @@ -1,7 +1,7 @@ @props(['action', 'method' => 'POST']) -
- +
+ @csrf {{ $slot }} diff --git a/resources/views/components/manage-notifications.blade.php b/resources/views/components/manage-notifications.blade.php index 4f323c994..6fe403ece 100644 --- a/resources/views/components/manage-notifications.blade.php +++ b/resources/views/components/manage-notifications.blade.php @@ -2,24 +2,24 @@

@lang('ui::pages.notifications.page_title')

-
-
+
+
-
- + @slot('button') -
+
{{ ucfirst($this->activeFilter) }} @@ -31,7 +31,7 @@ @endslot
@foreach ($this->getAvailableFilters() as $filter) - @endforeach @@ -40,11 +40,11 @@
- +
@else @endif -
+
{{ $notification->created_at_local->diffForHumans() }} @@ -139,14 +139,14 @@ class="block w-5 h-5 text-white border-2 rounded border-theme-secondary-300"
-
+
+

{{ $notification->name() }} @if ($notification->is_starred)

-