profile
This commit is contained in:
parent
dfafb9e88d
commit
648f28090c
@ -3,7 +3,6 @@
|
||||
namespace App\Actions\Fortify;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
|
||||
@ -18,8 +17,11 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
||||
public function update(User $user, array $input): void
|
||||
{
|
||||
Validator::make($input, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
|
||||
'display_name' => ['required', 'string', 'max:255'],
|
||||
'first_name' => ['required', 'string', 'max:255'],
|
||||
'last_name' => ['max:255'],
|
||||
'email' => ['email', 'max:255', Rule::unique('users')->ignore($user->id)],
|
||||
'phone' => ['phone', 'max:20', Rule::unique('users')->ignore($user->id)],
|
||||
'photo' => ['nullable', 'mimes:jpg,jpeg,png', 'max:1024'],
|
||||
])->validateWithBag('updateProfileInformation');
|
||||
|
||||
@ -27,30 +29,10 @@ public function update(User $user, array $input): void
|
||||
$user->updateProfilePhoto($input['photo']);
|
||||
}
|
||||
|
||||
if ($input['email'] !== $user->email &&
|
||||
$user instanceof MustVerifyEmail) {
|
||||
$this->updateVerifiedUser($user, $input);
|
||||
} else {
|
||||
$user->forceFill([
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
])->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given verified user's profile information.
|
||||
*
|
||||
* @param array<string, string> $input
|
||||
*/
|
||||
protected function updateVerifiedUser(User $user, array $input): void
|
||||
{
|
||||
$user->forceFill([
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
'email_verified_at' => null,
|
||||
])->save();
|
||||
|
||||
$user->sendEmailVerificationNotification();
|
||||
$user->forceFill(
|
||||
collect($input)
|
||||
->only(['display_name', 'first_name', 'last_name', 'email', 'phone'])
|
||||
->toArray()
|
||||
)->save();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\DAL\Studies\WorklistFactory;
|
||||
use App\Models\Study;
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Illuminate\Support\Str;
|
||||
@ -24,7 +25,7 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
return (new EloquentDataTable($query))
|
||||
->addColumn('action', 'worklist.action')
|
||||
->orderColumn('patient_name', 'patient_name $1')
|
||||
->rawColumns(['priority_icon'])
|
||||
->rawColumns(['priority_icon', 'report_status_led'])
|
||||
->setRowId('id');
|
||||
}
|
||||
|
||||
@ -33,7 +34,8 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
||||
*/
|
||||
public function query(Study $model): QueryBuilder
|
||||
{
|
||||
return $model->newQuery();
|
||||
return WorklistFactory::getLister()->query();
|
||||
// return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,7 +62,6 @@ public function html(): HtmlBuilder
|
||||
'reload',
|
||||
],
|
||||
])
|
||||
->orderBy(1)
|
||||
->selectStyleSingle()
|
||||
->pageLength(25) // Set default page length to 10
|
||||
->lengthMenu([15, 25, 50, 100, 250]) // Custom page length options
|
||||
@ -80,16 +81,30 @@ public function html(): HtmlBuilder
|
||||
public function getColumns(): array
|
||||
{
|
||||
return [
|
||||
Column::make('priority_icon'),
|
||||
Column::checkbox(''),
|
||||
Column::make('priority_icon')
|
||||
->searchable(false)
|
||||
->orderable(false)
|
||||
->addClass('text-center')
|
||||
->title('Priority'),
|
||||
Column::make('report_status_led')
|
||||
->searchable(false)
|
||||
->orderable(false)
|
||||
->addClass('text-center')
|
||||
->title('Status'),
|
||||
Column::make('modality'),
|
||||
|
||||
Column::make('patient_id'),
|
||||
Column::make('patient_name'),
|
||||
Column::make('sex_age'),
|
||||
Column::make('sex_age')
|
||||
->searchable(false)
|
||||
->orderable(false)
|
||||
->addClass('text-center')
|
||||
->title('Age'),
|
||||
|
||||
Column::make('study_date'),
|
||||
Column::make('received_at'),
|
||||
Column::make('reported_at'),
|
||||
Column::make('study_date')->searchable(false)->title('Study'),
|
||||
Column::make('received_at')->searchable(false)->title('Received'),
|
||||
Column::make('reported_at')->searchable(false)->title('Reported'),
|
||||
|
||||
Column::make('study_description'),
|
||||
Column::make('reporting_physician_id'),
|
||||
@ -97,7 +112,8 @@ public function getColumns(): array
|
||||
Column::make('num_instances')
|
||||
->searchable(false)
|
||||
->orderable(false)
|
||||
->addClass('text-center'),
|
||||
->addClass('text-center')
|
||||
->title('Images'),
|
||||
|
||||
// Column::make('xxx'),
|
||||
Column::computed('action')
|
||||
|
@ -108,6 +108,20 @@ public function numInstances(): string
|
||||
return "{$this->image_count} / {$this->series_count}";
|
||||
}
|
||||
|
||||
public function getReportStatusLedAttribute(): string
|
||||
{
|
||||
$color = match ($this->report_status) {
|
||||
ReportStatus::Pending => 'bg-dark',
|
||||
ReportStatus::Opened => 'bg-warning',
|
||||
ReportStatus::Draft => 'bg-warning',
|
||||
ReportStatus::Finalized => 'bg-success',
|
||||
ReportStatus::Authorized => 'bg-success',
|
||||
default => 'bg-light',
|
||||
};
|
||||
|
||||
return sprintf('<span class="badge badge-center rounded-pill %s"><i class="fa-light fa-battery-bolt"></i></span>', $color);
|
||||
}
|
||||
|
||||
public function getArchiveLink(): ?string
|
||||
{
|
||||
if (auth()->user()->may(Permission::StudyDownload)) {
|
||||
@ -180,6 +194,7 @@ public function allowed(): array
|
||||
public function toArray(): array
|
||||
{
|
||||
return array_merge(parent::toArray(), [
|
||||
'report_status_led' => $this->getReportStatusLedAttribute(),
|
||||
'priority_icon' => $this->getPriorityIcon(),
|
||||
'sex_age' => $this->sexAge(),
|
||||
'num_instances' => $this->numInstances(),
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
'features' => [
|
||||
// Features::termsAndPrivacyPolicy(),
|
||||
// Features::profilePhotos(),
|
||||
Features::profilePhotos(),
|
||||
// Features::api(),
|
||||
// Features::teams(['invitations' => true]),
|
||||
// Features::accountDeletion(),
|
||||
|
@ -46,10 +46,24 @@
|
||||
|
||||
<!-- Name -->
|
||||
<div class="mb-5">
|
||||
<x-label class="form-label" for="name" value="{{ __('Name') }}" />
|
||||
<x-input id="name" type="text" class="{{ $errors->has('name') ? 'is-invalid' : '' }}"
|
||||
wire:model="state.name" autocomplete="name" />
|
||||
<x-input-error for="name" />
|
||||
<x-label class="form-label" for="first_name" value="{{ __('First Name') }}" />
|
||||
<x-input id="first_name" type="text" class="{{ $errors->has('first_name') ? 'is-invalid' : '' }}"
|
||||
wire:model="state.first_name" autocomplete="first_name" />
|
||||
<x-input-error for="first_name" />
|
||||
</div>
|
||||
<!-- Name -->
|
||||
<div class="mb-5">
|
||||
<x-label class="form-label" for="last_name" value="{{ __('Last Name') }}" />
|
||||
<x-input id="last_name" type="text" class="{{ $errors->has('last_name') ? 'is-invalid' : '' }}"
|
||||
wire:model="state.last_name" autocomplete="last_name" />
|
||||
<x-input-error for="last_name" />
|
||||
</div>
|
||||
<!-- Name -->
|
||||
<div class="mb-5">
|
||||
<x-label class="form-label" for="display_name" value="{{ __('Display Name') }}" />
|
||||
<x-input id="display_name" type="text" class="{{ $errors->has('display_name') ? 'is-invalid' : '' }}"
|
||||
wire:model="state.display_name" autocomplete="display_name" />
|
||||
<x-input-error for="display_name" />
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
@ -59,6 +73,16 @@
|
||||
wire:model="state.email" />
|
||||
<x-input-error for="email" />
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="mb-5">
|
||||
<x-label class="form-label" for="phone" value="{{ __('Phone') }}" />
|
||||
<x-input id="phone" type="phone" class="{{ $errors->has('phone') ? 'is-invalid' : '' }}"
|
||||
wire:model="state.phone" />
|
||||
<x-input-error for="phone" />
|
||||
</div>
|
||||
|
||||
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="actions">
|
||||
|
Loading…
Reference in New Issue
Block a user