Compare commits
6 Commits
2a1107f59b
...
6bcea543fb
Author | SHA1 | Date |
---|---|---|
|
6bcea543fb | |
|
9ca06fd064 | |
|
9a6eba5fd9 | |
|
d41f24fdea | |
|
da567e0a73 | |
|
3ba29b9f5e |
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\Form\Models\Form;
|
use App\Form\Models\Form;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
|
@ -30,6 +31,7 @@ class AppServiceProvider extends ServiceProvider
|
||||||
app()->extend('media-library-helpers', fn ($p) => $p->put('form', Form::class));
|
app()->extend('media-library-helpers', fn ($p) => $p->put('form', Form::class));
|
||||||
|
|
||||||
Blade::componentNamespace('App\\View\\Mail', 'mail-view');
|
Blade::componentNamespace('App\\View\\Mail', 'mail-view');
|
||||||
|
Model::preventLazyLoading(!app()->isProduction());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,14 +31,18 @@ class Editor extends Component
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="relative w-full h-full">
|
<div class="relative w-full h-full">
|
||||||
<div class="
|
<div
|
||||||
|
class="
|
||||||
w-full border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg
|
w-full border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg
|
||||||
group-[.size-default]:border-2 group-[.size-sm]:border
|
group-[.size-default]:border-2 group-[.size-sm]:border
|
||||||
group-[.size-default]:text-sm group-[.size-sm]:text-xs
|
group-[.size-default]:text-sm group-[.size-sm]:text-xs
|
||||||
group-[.size-default]:p-2 group-[.size-sm]:p-1
|
group-[.size-default]:p-2 group-[.size-sm]:p-1
|
||||||
" @updated="$wire.{{$attributes->wire('model')->value}} = $event.detail" x-bind="editor"x-data="{
|
"
|
||||||
value: $wire.{{$attributes->wire('model')->value}},
|
@updated="$wire.{{$attributes->wire('model')->value}} = $event.detail"
|
||||||
}" id="{{$id}}" {{$attributes}}></div>
|
x-data="editor($wire.{{$attributes->wire('model')->value}})"
|
||||||
|
id="{{$id}}"
|
||||||
|
{{$attributes}}
|
||||||
|
></div>
|
||||||
<x-ui::errors :for="$name" />
|
<x-ui::errors :for="$name" />
|
||||||
@if($hint)
|
@if($hint)
|
||||||
<x-form::hint>{{$hint}}</x-form::hint>
|
<x-form::hint>{{$hint}}</x-form::hint>
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Text extends Component
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
return <<<'HTML'
|
return <<<'HTML'
|
||||||
<label class="flex flex-col group {{$heightClass}}" for="{{$id}}" style="{{$heightVars}}">
|
<label {{ $attributes->merge(['class' => 'flex flex-col group '.$heightClass])->only('class') }} for="{{$id}}" style="{{$heightVars}}">
|
||||||
@if ($label)
|
@if ($label)
|
||||||
<x-form::label :required="$required">{{$label}}</x-form::label>
|
<x-form::label :required="$required">{{$label}}</x-form::label>
|
||||||
@endif
|
@endif
|
||||||
|
@ -42,7 +42,7 @@ class Text extends Component
|
||||||
group-[.size-default]:text-sm group-[.size-sm]:text-xs
|
group-[.size-default]:text-sm group-[.size-sm]:text-xs
|
||||||
group-[.size-default]:p-2 group-[.size-sm]:p-1
|
group-[.size-default]:p-2 group-[.size-sm]:p-1
|
||||||
"
|
"
|
||||||
{{ $attributes }}
|
{{ $attributes->except('class') }}
|
||||||
/>
|
/>
|
||||||
<x-ui::errors :for="$name" />
|
<x-ui::errors :for="$name" />
|
||||||
@if($hint)
|
@if($hint)
|
||||||
|
|
|
@ -186,6 +186,7 @@ return [
|
||||||
Modules\Auth\AuthServiceProvider::class,
|
Modules\Auth\AuthServiceProvider::class,
|
||||||
Modules\Form\FormServiceProvider::class,
|
Modules\Form\FormServiceProvider::class,
|
||||||
Modules\Fileshare\FileshareServiceProvider::class,
|
Modules\Fileshare\FileshareServiceProvider::class,
|
||||||
|
Modules\Contribution\ContributionServiceProvider::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Contribution\Components;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class FillList extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return <<<'HTML'
|
||||||
|
<x-page::layout title="Zuschüsse" menu="contribution">
|
||||||
|
</x-page::layout>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Contribution\Components;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
|
use Livewire\Livewire;
|
||||||
|
|
||||||
|
uses(TestCase::class);
|
||||||
|
uses(DatabaseTransactions::class);
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
test()->login()->loginNami();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('displays page', function () {
|
||||||
|
test()->get(route('contribution.index'))
|
||||||
|
->assertSeeLivewire(FillList::class);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('loads component', function () {
|
||||||
|
Livewire::test(FillList::class)
|
||||||
|
->assertSee('Zuschüsse');
|
||||||
|
});
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Contribution;
|
||||||
|
|
||||||
|
use Illuminate\Routing\Router;
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Modules\Contribution\Components\FillList;
|
||||||
|
|
||||||
|
class ContributionServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function register()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
app(Router::class)->middleware(['web', 'auth:web'])->group(function ($router) {
|
||||||
|
$router->get('/contribution', FillList::class)->name('contribution.index');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ it('it displays active modules', function () {
|
||||||
test()->withoutExceptionHandling()->login()->loginNami();
|
test()->withoutExceptionHandling()->login()->loginNami();
|
||||||
app(FormSettings::class)->fill(['registerUrl' => 'http://example.com/register', 'clearCacheUrl' => 'http://example.com/clear-cache'])->save();
|
app(FormSettings::class)->fill(['registerUrl' => 'http://example.com/register', 'clearCacheUrl' => 'http://example.com/clear-cache'])->save();
|
||||||
|
|
||||||
Livewire::test(SettingView::class)
|
Livewire::test(FormSettingView::class)
|
||||||
->assertSee('Einstellungen für Anmeldeformulare')
|
->assertSee('Einstellungen für Anmeldeformulare')
|
||||||
->assertSee('Formular-Link')
|
->assertSee('Formular-Link')
|
||||||
->assertSet('registerUrl', 'http://example.com/register')
|
->assertSet('registerUrl', 'http://example.com/register')
|
||||||
|
@ -31,7 +31,7 @@ it('it displays active modules', function () {
|
||||||
it('it saves settings', function () {
|
it('it saves settings', function () {
|
||||||
test()->withoutExceptionHandling()->login()->loginNami();
|
test()->withoutExceptionHandling()->login()->loginNami();
|
||||||
|
|
||||||
Livewire::test(SettingView::class)
|
Livewire::test(FormSettingView::class)
|
||||||
->set('clearCacheUrl', 'http://example.com/clear')
|
->set('clearCacheUrl', 'http://example.com/clear')
|
||||||
->set('registerUrl', 'http://example.com/register')
|
->set('registerUrl', 'http://example.com/register')
|
||||||
->call('save')
|
->call('save')
|
||||||
|
|
|
@ -18,7 +18,7 @@ Alpine.plugin(
|
||||||
window.addEventListener('success', (event) => success(event.detail[0]));
|
window.addEventListener('success', (event) => success(event.detail[0]));
|
||||||
|
|
||||||
document.addEventListener('alpine:init', () => {
|
document.addEventListener('alpine:init', () => {
|
||||||
Alpine.bind('editor', () => editor);
|
Alpine.data('editor', editor);
|
||||||
});
|
});
|
||||||
|
|
||||||
Livewire.start();
|
Livewire.start();
|
||||||
|
|
|
@ -5,11 +5,11 @@ import Paragraph from '@editorjs/paragraph';
|
||||||
import NestedList from '@editorjs/nested-list';
|
import NestedList from '@editorjs/nested-list';
|
||||||
import Alert from 'editorjs-alert';
|
import Alert from 'editorjs-alert';
|
||||||
|
|
||||||
export default {
|
export default (initialValue) => ({
|
||||||
'editor': null,
|
editor: null,
|
||||||
'value': null,
|
value: initialValue,
|
||||||
|
|
||||||
'x-init': function () {
|
init: function () {
|
||||||
var tools = {
|
var tools = {
|
||||||
paragraph: {
|
paragraph: {
|
||||||
class: Paragraph,
|
class: Paragraph,
|
||||||
|
@ -57,4 +57,4 @@ export default {
|
||||||
}, 200),
|
}, 200),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\Feature\Nami;
|
namespace Tests\Feature\Remote;
|
||||||
|
|
||||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use Illuminate\Testing\TestResponse;
|
use Illuminate\Testing\TestResponse;
|
||||||
use Tests\EndToEndTestCase;
|
|
||||||
use Tests\TestCase;
|
use Tests\TestCase;
|
||||||
use Zoomyboy\LaravelNami\Authentication\Auth;
|
use Zoomyboy\LaravelNami\Authentication\Auth;
|
||||||
use Zoomyboy\LaravelNami\Data\MemberEntry;
|
use Zoomyboy\LaravelNami\Data\MemberEntry;
|
||||||
|
|
Loading…
Reference in New Issue