Compare commits

..

63 Commits

Author SHA1 Message Date
philipp lang cc934b1b3c Fix error handling for mailgateway forms
continuous-integration/drone/push Build is failing Details
2024-11-04 23:55:57 +01:00
philipp lang 1c92e1a2e2 Add error handling via tooltip 2024-11-04 23:55:44 +01:00
philipp lang 6827358307 Fix: Add id to select field 2024-10-29 21:21:52 +01:00
philipp lang b01bc5d1f1 Add Vite facade 2024-10-29 00:21:15 +01:00
philipp lang 04bfb85293 Add Danger theme for tippy 2024-10-29 00:20:22 +01:00
philipp lang de6cb31a79 Add vite spritemap 2024-10-29 00:15:50 +01:00
philipp lang 39edad55ca Update sprite component 2024-10-29 00:15:50 +01:00
philipp lang 4a3a80c101 Add validation attributes to nami field 2024-10-29 00:15:50 +01:00
philipp lang 0b54bbaf30 Add SettingIntro component 2024-10-29 00:15:50 +01:00
philipp lang 7ed31f111f Add Nami Settings 2024-10-29 00:15:50 +01:00
philipp lang 1be3e0393a Move test files 2024-10-29 00:15:50 +01:00
philipp lang 13cc02afd0 Add page title 2024-10-29 00:15:49 +01:00
philipp lang 7b6daa47eb Add active menu entry for setting 2024-10-29 00:15:49 +01:00
philipp lang 4ecbff4cf1 Set active title for setting 2024-10-29 00:15:49 +01:00
philipp lang 0da1e1ca42 Update arch tests 2024-10-29 00:15:48 +01:00
philipp lang dc15bda5c7 Lint 2024-10-29 00:14:57 +01:00
philipp lang 836a38390f Move types 2024-10-29 00:14:57 +01:00
philipp lang 5ef5e95be8 Move modules 2024-10-29 00:14:57 +01:00
philipp lang 16db435018 Add Badge component 2024-10-29 00:14:57 +01:00
philipp lang dd9ad974ce Add data type cast for Mailgateway 2024-10-29 00:14:57 +01:00
philipp lang 3159323f5a Allow MailmanTypeRequest to cast to data 2024-10-29 00:14:57 +01:00
philipp lang 6ea9db8eef Mod setArray macro for nested values 2024-10-29 00:14:57 +01:00
philipp lang c5bb2e3428 Simplify form 2024-10-29 00:14:57 +01:00
philipp lang 19a13df20d Update update hook 2024-10-29 00:14:57 +01:00
philipp lang 36976cda90 Add test for events 2024-10-29 00:14:57 +01:00
philipp lang cac0209a71 Lint 2024-10-29 00:14:57 +01:00
philipp lang 6f8240af80 Update refresh page 2024-10-29 00:14:57 +01:00
philipp lang 8fbd4cd2d1 Add mailgateway 2024-10-29 00:14:57 +01:00
philipp lang 96f8f7e152 Fix layout 2024-10-29 00:14:57 +01:00
philipp lang 816950797f Remove old MailgatewayRequestFactory 2024-10-29 00:14:57 +01:00
philipp lang da17f4c6d2 Lint 2024-10-29 00:14:57 +01:00
philipp lang 7be0ab1c82 Add HTTP Check to MailmanTypeRequest 2024-10-29 00:14:57 +01:00
philipp lang b8eabaa501 Delete old mailgateway tests 2024-10-29 00:14:56 +01:00
philipp lang 634c2f69c7 Mark MailgatewayResource as deprecated 2024-10-29 00:14:56 +01:00
philipp lang b528d59800 Mark old mailgateway settings as deprecated 2024-10-29 00:14:56 +01:00
philipp lang 67c62c9fa7 Add BooleanDisplay component 2024-10-29 00:14:56 +01:00
philipp lang 2ff3942b8d Make right slot optional in SettingLayout 2024-10-29 00:14:56 +01:00
philipp lang 2c501e23d0 fixup! Add modal component 2024-10-29 00:14:56 +01:00
philipp lang 114d611169 Add testable macro for setArray 2024-10-29 00:14:56 +01:00
philipp lang ffa2bf1ab9 Add modal component 2024-10-29 00:14:56 +01:00
philipp lang 03ba1777fc Throw exception when variant not found 2024-10-29 00:14:56 +01:00
philipp lang f0f1d236ef Lint 2024-10-29 00:14:56 +01:00
philipp lang d42d70d5fa Merge attributes for hint 2024-10-29 00:14:56 +01:00
philipp lang 33d8c6aae8 Lint 2024-10-29 00:14:56 +01:00
philipp lang 5f0bbf7dc1 Fix Tooltip attribute of Table action 2024-10-29 00:14:56 +01:00
philipp lang 9ce81a9f0f Register MailgatewayServiceProvider 2024-10-29 00:14:56 +01:00
philipp lang 4372b2196e Add select field 2024-10-29 00:14:56 +01:00
philipp lang d58fde42c2 Disable autocomplete for password fields 2024-10-29 00:14:56 +01:00
philipp lang 74d755ad47 Fix label required 2024-10-29 00:14:56 +01:00
philipp lang 05fe99a2bb Add Table action button 2024-10-29 00:14:56 +01:00
philipp lang e323daeacb Add table component 2024-10-29 00:14:56 +01:00
philipp lang 4ea848af7d Mod Component Test 2024-10-29 00:14:56 +01:00
philipp lang 3ae0b85b05 Move Dashboard registrations 2024-10-29 00:14:56 +01:00
philipp lang c4b300403f Add Settings for Bill 2024-10-29 00:14:56 +01:00
philipp lang bff309ccfa Add Toast and tooltip 2024-10-29 00:14:56 +01:00
philipp lang ea140b428e Remove Base tests from Composer 2024-10-29 00:14:56 +01:00
philipp lang a1a50aaddb Add Component Resolver for Modules 2024-10-29 00:14:56 +01:00
philipp lang dcb25c8814 Add Dashboard 2024-10-29 00:14:56 +01:00
philipp lang 8feac575ad Add Service Provider 2024-10-29 00:14:56 +01:00
philipp lang f8ea3824ae Add livewire components 2024-10-29 00:14:56 +01:00
philipp lang 040af778ef Add config file 2024-10-29 00:14:56 +01:00
philipp lang ea53dcea4f Install Livewire Package 2024-10-29 00:14:56 +01:00
philipp lang e807aff3e6 Remove default arch tests
continuous-integration/drone/push Build is passing Details
2024-10-28 23:54:21 +01:00
8 changed files with 46 additions and 40 deletions

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@ class Select extends Component
@endif
<div class="relative flex-none flex">
<select {{$attributes}} @if($disabled) disabled @endif name="{{$name}}"
<select {{$attributes}} @if($disabled) disabled @endif name="{{$name}}" id="{{$id}}"
class="
w-full h-[var(--height)] border-gray-600 border-solid text-gray-300 bg-gray-700 leading-none rounded-lg
group-[.size-default]:border-2 group-[.size-sm]:border
@ -47,6 +47,7 @@ class Select extends Component
<option value="{{$option['id']}}">{{ $option['name'] }}</option>
@endforeach
</select>
<x-ui::errors :for="$name" />
@if($hint)
<x-form::hint class="right-6">{{$hint}}</x-form::hint>
@endif

View File

@ -32,13 +32,6 @@ class Text extends Component
@endif
<div class="relative flex-none flex">
<input
@error($name) x-init="tippy($el, {
content: () => '@error($name){{$message}}@enderror',
showOnCreate: true,
theme: 'danger',
placement: 'top-end',
delay: [0, 3000],
})" @enderror
id="{{$id}}"
type="{{$type}}"
@if ($type === 'password') autocomplete="off" @endif
@ -51,6 +44,7 @@ class Text extends Component
"
{{ $attributes }}
/>
<x-ui::errors :for="$name" />
@if($hint)
<x-form::hint>{{$hint}}</x-form::hint>
@endif

33
app/View/Ui/Errors.php Normal file
View File

@ -0,0 +1,33 @@
<?php
namespace App\View\Ui;
use Illuminate\View\Component;
class Errors extends Component
{
public function __construct(
public string $for,
) {
}
public function id(): string
{
return 'errors-' . str_replace('.', '--', $this->for);
}
public function render()
{
return <<<'HTML'
@error($for)
<div x-data="{error: ''}" x-init="window.setTimeout(() => document.querySelector('#{{$id()}}') ? document.querySelector('#{{$id()}}').remove() : null, 2000)" class="absolute bottom-[calc(100%+0.5rem)] right-0" id="{{$id}}">
<div class="tippy-box" tabindex="-1" data-theme="danger" data-placement="top">
<div class="tippy-content">{{$message}}</div>
<div class="tippy-arrow absolute right-0 mr-2"></div>
</div>
</div>
@enderror
HTML;
}
}

View File

@ -36,7 +36,7 @@ class Form extends Component
'type' => 'Typ',
'name' => 'Beschreibung',
'domain' => 'Domain',
...$this->type ? collect($this->type::fieldNames())->mapWithKeys(fn ($attribute, $key) => ["params.{$key}" => $attribute]) : [],
...$this->type ? collect($this->type::fieldNames())->mapWithKeys(fn ($attribute, $key) => ["type.{$key}" => $attribute]) : [],
];
}
@ -104,11 +104,11 @@ class Form extends Component
<x-form::select name="typeClass" wire:model.live="typeClass" label="Typ" :options="$types" required />
@foreach($this->fields() as $index => $field)
<x-form::text
wire:key="index"
wire:key="$index"
wire:model="type.{{$field['name']}}"
:label="$field['label']"
:type="$field['type']"
:name="$field['name']"
:name="'type.'.$field['name']"
:required="str_contains('required', $field['validator'])"
></x-form::text>
@endforeach

View File

@ -14,7 +14,7 @@ class SettingView extends Component
public $settingClass = NamiSettings::class;
#[Validate('required|string|min:4')]
#[Validate('required|string')]
public string $password = '';
#[Validate('required|string')]
public string $mglnr = '';

View File

@ -6,34 +6,14 @@ import 'tippy.js/dist/tippy.css';
import 'tippy.js/animations/shift-toward.css';
import '../css/tooltip.css';
import {error, success} from './toastify.js';
import tippy from 'tippy.js';
const defaultTippy = {
Alpine.plugin(
Tooltip.defaultProps({
theme: 'primary',
animation: 'shift-toward',
};
Alpine.plugin(Tooltip.defaultProps(defaultTippy));
})
);
window.addEventListener('success', (event) => success(event.detail[0]));
document.addEventListener('alpine:init', () => {
Alpine.directive('error', function (el, {value, modifiers, expression}, {Alpine, effect, cleanup, evaluateLater}) {
let getThingToLog = evaluateLater(expression);
// el._x_custom_tippy = new tippy(el, {
// ...defaultTippy,
// content: '',
// });
effect(() => {
getThingToLog((thingToLog) => {
console.log(thingToLog);
});
});
});
});
window.tippy = tippy;
Livewire.start();

View File

@ -76,7 +76,6 @@ use App\Membership\Actions\MembershipStoreAction;
use App\Membership\Actions\MembershipUpdateAction;
use App\Payment\SubscriptionController;
Route::get('/lala', fn () => auth()->login(\App\User::first()));
Route::group(['namespace' => 'App\\Http\\Controllers'], function (): void {
Auth::routes(['register' => false]);
});