diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index 9738772..33a6e73 100644 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -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 $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(); } } diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 11a480c..e05c3c1 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -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') diff --git a/app/Models/Study.php b/app/Models/Study.php index fd1c57c..c6a090a 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -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('', $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(), diff --git a/config/jetstream.php b/config/jetstream.php index d5d293d..0bb776d 100644 --- a/config/jetstream.php +++ b/config/jetstream.php @@ -59,7 +59,7 @@ 'features' => [ // Features::termsAndPrivacyPolicy(), - // Features::profilePhotos(), + Features::profilePhotos(), // Features::api(), // Features::teams(['invitations' => true]), // Features::accountDeletion(), diff --git a/resources/views/profile/update-profile-information-form.blade.php b/resources/views/profile/update-profile-information-form.blade.php index 22f5c8b..8268874 100644 --- a/resources/views/profile/update-profile-information-form.blade.php +++ b/resources/views/profile/update-profile-information-form.blade.php @@ -46,10 +46,24 @@
- - - + + + +
+ +
+ + + +
+ +
+ + +
@@ -59,6 +73,16 @@ wire:model="state.email" /> + + +
+ + + +
+ +