disable actions

This commit is contained in:
Benjamin Takats
2022-11-30 17:32:43 +01:00
parent 4d28829686
commit b262ca0693
7 changed files with 29 additions and 21 deletions

View File

@@ -18,16 +18,20 @@ class CreateNewUser implements CreatesNewUsers
* Create a newly registered user. * Create a newly registered user.
* *
* @param array $input * @param array $input
*
* @return \App\Models\User * @return \App\Models\User
*/ */
public function create(array $input) public function create(array $input)
{ {
abort('404', 'WIP');
Validator::make($input, [ Validator::make($input, [
'name' => ['required', 'string', 'max:255'], 'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => $this->passwordRules(), 'password' => $this->passwordRules(),
'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '', 'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['accepted', 'required'] : '',
])->validate(); ])
->validate();
return DB::transaction(function () use ($input) { return DB::transaction(function () use ($input) {
return tap(User::create([ return tap(User::create([
@@ -44,11 +48,13 @@ class CreateNewUser implements CreatesNewUsers
* Create a personal team for the user. * Create a personal team for the user.
* *
* @param \App\Models\User $user * @param \App\Models\User $user
*
* @return void * @return void
*/ */
protected function createTeam(User $user) protected function createTeam(User $user)
{ {
$user->ownedTeams()->save(Team::forceCreate([ $user->ownedTeams()
->save(Team::forceCreate([
'user_id' => $user->id, 'user_id' => $user->id,
'name' => explode(' ', $user->name, 2)[0]."'s Team", 'name' => explode(' ', $user->name, 2)[0]."'s Team",
'personal_team' => true, 'personal_team' => true,

View File

@@ -19,12 +19,14 @@
<x-jet-label for="email" value="{{ __('Email') }}"/> <x-jet-label for="email" value="{{ __('Email') }}"/>
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')" <x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')"
required autofocus/> required autofocus/>
admin@einundzwanzig.space
</div> </div>
<div class="mt-4"> <div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}"/> <x-jet-label for="password" value="{{ __('Password') }}"/>
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required <x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required
autocomplete="current-password"/> autocomplete="current-password"/>
1234
</div> </div>
<div class="block mt-4"> <div class="block mt-4">

View File

@@ -43,9 +43,9 @@
{{ __('Cancel') }} {{ __('Cancel') }}
</x-jet-secondary-button> </x-jet-secondary-button>
<x-jet-danger-button class="ml-3" wire:click="deleteUser" wire:loading.attr="disabled"> {{--<x-jet-danger-button class="ml-3" wire:click="deleteUser" wire:loading.attr="disabled">
{{ __('Delete Account') }} {{ __('Delete Account') }}
</x-jet-danger-button> </x-jet-danger-button>--}}
</x-slot> </x-slot>
</x-jet-dialog-modal> </x-jet-dialog-modal>
</x-slot> </x-slot>

View File

@@ -86,11 +86,11 @@
{{ __('Cancel') }} {{ __('Cancel') }}
</x-jet-secondary-button> </x-jet-secondary-button>
<x-jet-button class="ml-3" {{--<x-jet-button class="ml-3"
wire:click="logoutOtherBrowserSessions" wire:click="logoutOtherBrowserSessions"
wire:loading.attr="disabled"> wire:loading.attr="disabled">
{{ __('Log Out Other Browser Sessions') }} {{ __('Log Out Other Browser Sessions') }}
</x-jet-button> </x-jet-button>--}}
</x-slot> </x-slot>
</x-jet-dialog-modal> </x-jet-dialog-modal>
</x-slot> </x-slot>

View File

@@ -79,9 +79,9 @@
<div class="mt-5"> <div class="mt-5">
@if (! $this->enabled) @if (! $this->enabled)
<x-jet-confirms-password wire:then="enableTwoFactorAuthentication"> <x-jet-confirms-password wire:then="enableTwoFactorAuthentication">
<x-jet-button type="button" wire:loading.attr="disabled"> {{--<x-jet-button type="button" wire:loading.attr="disabled">
{{ __('Enable') }} {{ __('Enable') }}
</x-jet-button> </x-jet-button>--}}
</x-jet-confirms-password> </x-jet-confirms-password>
@else @else
@if ($showingRecoveryCodes) @if ($showingRecoveryCodes)

View File

@@ -32,8 +32,8 @@
{{ __('Saved.') }} {{ __('Saved.') }}
</x-jet-action-message> </x-jet-action-message>
<x-jet-button> {{--<x-jet-button>
{{ __('Save') }} {{ __('Save') }}
</x-jet-button> </x-jet-button>--}}
</x-slot> </x-slot>
</x-jet-form-section> </x-jet-form-section>

View File

@@ -88,8 +88,8 @@
{{ __('Saved.') }} {{ __('Saved.') }}
</x-jet-action-message> </x-jet-action-message>
<x-jet-button wire:loading.attr="disabled" wire:target="photo"> {{--<x-jet-button wire:loading.attr="disabled" wire:target="photo">
{{ __('Save') }} {{ __('Save') }}
</x-jet-button> </x-jet-button>--}}
</x-slot> </x-slot>
</x-jet-form-section> </x-jet-form-section>