From 3bf04aca0089c2f6709e0086d438f189ab905748 Mon Sep 17 00:00:00 2001 From: Nicolas Perrenoud Date: Sun, 19 Nov 2023 22:25:22 +0100 Subject: [PATCH] Remove laravelcollective/html and obsolete blade components --- app/Providers/FormServiceProvider.php | 38 ------ composer.json | 1 - composer.lock | 75 +---------- config/app.php | 1 - .../views/accounting/webling/index.blade.php | 32 ----- .../accounting/webling/prepare.blade.php | 121 ------------------ .../form/bs-delete-button.blade.php | 13 -- .../form/bs-submit-button.blade.php | 11 -- .../views/components/form/bsInput.blade.php | 36 ------ .../components/form/bsRadioList.blade.php | 20 --- .../views/components/form/bsSelect.blade.php | 3 - .../views/components/form/bsText.blade.php | 16 --- .../views/components/icon-status.blade.php | 9 -- 13 files changed, 1 insertion(+), 375 deletions(-) delete mode 100644 app/Providers/FormServiceProvider.php delete mode 100644 resources/views/accounting/webling/index.blade.php delete mode 100644 resources/views/accounting/webling/prepare.blade.php delete mode 100644 resources/views/components/form/bs-delete-button.blade.php delete mode 100644 resources/views/components/form/bs-submit-button.blade.php delete mode 100644 resources/views/components/form/bsInput.blade.php delete mode 100644 resources/views/components/form/bsRadioList.blade.php delete mode 100644 resources/views/components/form/bsSelect.blade.php delete mode 100644 resources/views/components/form/bsText.blade.php delete mode 100644 resources/views/components/icon-status.blade.php diff --git a/app/Providers/FormServiceProvider.php b/app/Providers/FormServiceProvider.php deleted file mode 100644 index 2c4122373..000000000 --- a/app/Providers/FormServiceProvider.php +++ /dev/null @@ -1,38 +0,0 @@ -runningInConsole()) { - return; - } - - Form::component('bsText', 'components.form.bsText', ['name', 'value' => null, 'attributes' => [], 'label' => null, 'help' => null]); - Form::component('bsRadioList', 'components.form.bsRadioList', ['name', 'entries', 'value' => null, 'label' => null, 'help' => null]); - Form::component('bsSelect', 'components.form.bsSelect', ['name', 'entries', 'value' => null, 'attributes' => [], 'label' => null, 'help' => null]); - } - - /** - * Register the application services. - * - * @return void - */ - public function register() - { - // - } -} diff --git a/composer.json b/composer.json index d3dc103ce..4c3c005fe 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,6 @@ "laravel/sanctum": "^3.0", "laravel/socialite": "^5.0", "laravel/ui": "^4.0", - "laravelcollective/html": "^6.0", "lasserafn/php-initial-avatar-generator": "^4.2", "maatwebsite/excel": "^3.1", "maennchen/zipstream-php": "^3.0", diff --git a/composer.lock b/composer.lock index 8e8ab208e..b049d1292 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": "6f6b411e1d2fdc37dc289c2c4d941c4c", + "content-hash": "fdd6f5cdbe7b2c476ad4a1a852039193", "packages": [ { "name": "akaunting/laravel-language", @@ -3122,79 +3122,6 @@ }, "time": "2023-05-09T19:47:28+00:00" }, - { - "name": "laravelcollective/html", - "version": "v6.4.1", - "source": { - "type": "git", - "url": "https://github.com/LaravelCollective/html.git", - "reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/LaravelCollective/html/zipball/64ddfdcaeeb8d332bd98bef442bef81e39c3910b", - "reference": "64ddfdcaeeb8d332bd98bef442bef81e39c3910b", - "shasum": "" - }, - "require": { - "illuminate/http": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/session": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/view": "^6.0|^7.0|^8.0|^9.0|^10.0", - "php": ">=7.2.5" - }, - "require-dev": { - "illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0", - "mockery/mockery": "~1.0", - "phpunit/phpunit": "~8.5|^9.5.10" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - }, - "laravel": { - "providers": [ - "Collective\\Html\\HtmlServiceProvider" - ], - "aliases": { - "Form": "Collective\\Html\\FormFacade", - "Html": "Collective\\Html\\HtmlFacade" - } - } - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Collective\\Html\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Adam Engebretson", - "email": "adam@laravelcollective.com" - }, - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "HTML and Form Builders for the Laravel Framework", - "homepage": "https://laravelcollective.com", - "support": { - "issues": "https://github.com/LaravelCollective/html/issues", - "source": "https://github.com/LaravelCollective/html" - }, - "abandoned": "spatie/laravel-html", - "time": "2023-04-25T02:46:11+00:00" - }, { "name": "lasserafn/php-initial-avatar-generator", "version": "4.3", diff --git a/config/app.php b/config/app.php index 6b4a4b097..4422e9c31 100644 --- a/config/app.php +++ b/config/app.php @@ -195,7 +195,6 @@ App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, App\Providers\ComposerServiceProvider::class, - App\Providers\FormServiceProvider::class, App\Providers\NavigationServiceProvider::class, App\Providers\Accounting\WeblingServiceProvider::class, diff --git a/resources/views/accounting/webling/index.blade.php b/resources/views/accounting/webling/index.blade.php deleted file mode 100644 index 4fdaa4008..000000000 --- a/resources/views/accounting/webling/index.blade.php +++ /dev/null @@ -1,32 +0,0 @@ -@extends('layouts.app') - -@section('title', __('Book to Webling')) - -@section('content') - @unless($periods->isEmpty()) -

{{ __('Please choose a month with unbooked transactions in an open booking period:') }}

- @foreach($periods as $period_id => $period) -

{{ $period->title }}

- @unless($period->months->isEmpty()) -
- @foreach($period->months as $month) - -
-
{{ $month->date->formatLocalized('%B %Y') }}
-
{{ $month->transactions }} {{ __('Transactions') }}
-
-
- @endforeach -
- @else - - {{ __('No months with unbooked transactions found.') }} - - @endunless - @endforeach - @else - - {{ __('No matching open booking periods found.') }} - - @endunless -@endsection diff --git a/resources/views/accounting/webling/prepare.blade.php b/resources/views/accounting/webling/prepare.blade.php deleted file mode 100644 index 7dbc6a084..000000000 --- a/resources/views/accounting/webling/prepare.blade.php +++ /dev/null @@ -1,121 +0,0 @@ -@extends('layouts.app') - -@section('title', __('Book to Webling')) - -@section('content') -

{{ __('The following transactions from :from to :to can be booked in the period :period:', [ 'from' => $from->toDateString(), 'to' => $to->toDateString(), 'period' => $period->title ]) }}

- @unless($transactions->isEmpty()) - {!! Form::open(['route' => ['accounting.webling.store', $wallet ]]) !!} - {{ Form::hidden('period', $period->id) }} - {{ Form::hidden('from', $from->toDateString()) }} - {{ Form::hidden('to', $to->toDateString()) }} -
- - - - - - - - - - - - - - - - @foreach ($transactions as $transaction) - @php - $posting_text = $transaction->category->name . ' - ' . (isset($transaction->project) ? $transaction->project->name .' - ' : '') . $transaction->description; - @endphp - - - - - - - - - - - - @endforeach - -
{{ __('Date') }}{{ __('Credit') }}{{ __('Debit') }}{{ __('Posting text') }}{{ __('Debit side') }}{{ __(' Credit side') }}{{ __('Receipt No.') }}{{ __('Controlled') }}{{ __('Action') }}
- {{ $transaction->date }} - - @if($transaction->type == 'income') {{ number_format($transaction->amount, 2) }}@endif - - @if($transaction->type == 'spending') {{ number_format($transaction->amount, 2) }}@endif - - {{ Form::bsText('posting_text['.$transaction->id.']', $posting_text, [ 'placeholder' => __('Posting text') ], '') }} - - - @if($transaction->type == 'income') - {{ Form::bsSelect('debit_side['.$transaction->id.']', $assetsSelect, null, [ 'placeholder' => __('Money to') ], '') }} - @elseif($transaction->type == 'spending') - {{ Form::bsSelect('debit_side['.$transaction->id.']', $expenseSelect, null, [ 'placeholder' => __('Paid for') ], '') }} - @endif - - @if($transaction->type == 'income') - {{ Form::bsSelect('credit_side['.$transaction->id.']', $incomeSelect, null, [ 'placeholder' => __('Received for') ], '') }} - @elseif($transaction->type == 'spending') - {{ Form::bsSelect('credit_side['.$transaction->id.']', $assetsSelect, null, [ 'placeholder' => __('Paid from') ], '') }} - @endif - {{ $transaction->receipt_no }} - - - {{ Form::bsRadioList('action['.$transaction->id.']', $actions, $defaultAction, '') }} -
-
-

- -

- {!! Form::close() !!} - @else - - {{ __('No transactions found.') }} - - @endunless -@endsection - -@push('footer') - -@endpush diff --git a/resources/views/components/form/bs-delete-button.blade.php b/resources/views/components/form/bs-delete-button.blade.php deleted file mode 100644 index 44fdad5bd..000000000 --- a/resources/views/components/form/bs-delete-button.blade.php +++ /dev/null @@ -1,13 +0,0 @@ -@props([ - 'label' => 'Delete', - 'icon' => 'trash', - 'confirmation' => 'Do you really want to delete this item?' -]) - diff --git a/resources/views/components/form/bs-submit-button.blade.php b/resources/views/components/form/bs-submit-button.blade.php deleted file mode 100644 index e72040656..000000000 --- a/resources/views/components/form/bs-submit-button.blade.php +++ /dev/null @@ -1,11 +0,0 @@ -@props([ - 'label', - 'icon' => 'check' -]) - diff --git a/resources/views/components/form/bsInput.blade.php b/resources/views/components/form/bsInput.blade.php deleted file mode 100644 index 631eb5c20..000000000 --- a/resources/views/components/form/bsInput.blade.php +++ /dev/null @@ -1,36 +0,0 @@ -
- @if ($label === null || ! empty($label)) - {{ Form::label($name, $label) }} - @if(isset($attributes) && in_array('required', $attributes, true))*@endif - @endif - @if (isset($attributes['prepend']) || isset($attributes['append'])) -
- @if (isset($attributes['prepend'])) -
- {{ $attributes['prepend'] }} -
- @endif - @endif - {{ $slot }} - @if (isset($attributes['prepend']) || isset($attributes['append'])) - @if (isset($attributes['append'])) -
- {!! $attributes['append'] !!} -
- @endif -
- @endif - @if ($errors->has($name)) - {{ $errors->first($name) }} - @endif - @if (isset($help)) - - {{ $help }} - - @endif - @if (isset($attributes['error']) && ! empty($attributes['error'])) - - {{ $attributes['error'] }} - - @endif -
diff --git a/resources/views/components/form/bsRadioList.blade.php b/resources/views/components/form/bsRadioList.blade.php deleted file mode 100644 index 749a09c4f..000000000 --- a/resources/views/components/form/bsRadioList.blade.php +++ /dev/null @@ -1,20 +0,0 @@ -@if ($label !== null || ! empty($label)) -

- {{ $label }} - @if(isset($attributes) && in_array('required', $attributes, true))*@endif -

-@endif -@foreach($entries as $k => $v) -
- {{ Form::radio($name, $k, $k == $value, [ 'class' => 'custom-control-input', 'id' => form_id_string($name, $k) ]) }} - -
-@endforeach -@if ($errors->has($name)) -
{{ $errors->first($name) }}
-@endif -@if (isset($help)) - - {{ $help }} - -@endif diff --git a/resources/views/components/form/bsSelect.blade.php b/resources/views/components/form/bsSelect.blade.php deleted file mode 100644 index a80bcef45..000000000 --- a/resources/views/components/form/bsSelect.blade.php +++ /dev/null @@ -1,3 +0,0 @@ -@component('components.form.bsInput', [ 'name' => form_id_string($name), 'label' => $label, 'help' => $help, 'attributes' => $attributes ]) - {{ Form::select($name, $entries, $value, array_merge([ 'id' => form_id_string($name), 'class' => 'custom-select'.($errors->has($name) ? ' is-invalid' : '') ], $attributes)) }} -@endcomponent diff --git a/resources/views/components/form/bsText.blade.php b/resources/views/components/form/bsText.blade.php deleted file mode 100644 index 07456b349..000000000 --- a/resources/views/components/form/bsText.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@component('components.form.bsInput', [ 'name' => form_id_string($name), 'label' => $label, 'help' => $help, 'attributes' => $attributes ]) - @php - if (isset($attributes['list']) && is_array($attributes['list'])) { - $list_items = $attributes['list']; - $attributes['list'] = form_id_string($name) . '-list'; - } - @endphp - {{ Form::text($name, $value, array_merge([ 'id' => form_id_string($name), 'class' => 'form-control'.($errors->has($name) ? ' is-invalid' : '') ], $attributes)) }} - @isset($list_items) - - @foreach($list_items as $item) - - @endisset -@endcomponent diff --git a/resources/views/components/icon-status.blade.php b/resources/views/components/icon-status.blade.php deleted file mode 100644 index 567a9d04f..000000000 --- a/resources/views/components/icon-status.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -@props([ - 'check', - 'colors' => false, -]) -@if($check) - merge(['class' => $colors ? 'text-success' : null]) }}/> -@else - merge(['class' => $colors ? 'text-danger' : null]) }}/> -@endif