Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Requests/Profile/UpdateProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function rules(): array
],
'file' => ['sometimes', 'nullable', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120'],
'clear_image' => ['sometimes', 'boolean'],
'about' => ['sometimes', 'nullable', 'string', 'max:1000', new CleanText],
'about' => ['sometimes', 'nullable', 'string', 'max:255', new CleanText],
'institution' => ['sometimes', 'nullable', 'string', 'max:255', new CleanText],
'activity_privacy' => ['sometimes', 'string', Rule::in(['public', 'appreciators_only', 'private'])],
'allow_pokes' => ['sometimes', 'boolean'],
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/User/StoreUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function rules(): array
'permissions' => ['nullable', 'array'],
'permissions.*' => ['string', 'exists:permissions,name'],
'file' => ['nullable', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120'],
'about' => ['nullable', 'string', 'max:1000', new CleanText],
'about' => ['nullable', 'string', 'max:255', new CleanText],
'title' => ['nullable', 'string', 'max:255', new CleanText],
'institution' => ['nullable', 'string', 'max:255', new CleanText],
'facebook' => ['nullable', 'string', 'max:255'],
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/User/UpdateUserRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function rules(): array
],
'email' => ['sometimes', 'email', 'unique:users,email,'.$user->id],
'file' => ['sometimes', 'nullable', 'image', 'mimes:jpg,jpeg,png,webp', 'max:5120'],
'about' => ['sometimes', 'nullable', 'string', 'max:1000', new CleanText],
'about' => ['sometimes', 'nullable', 'string', 'max:255', new CleanText],
'title' => ['sometimes', 'nullable', 'string', 'max:255', new CleanText],
'institution' => ['sometimes', 'nullable', 'string', 'max:255', new CleanText],
'facebook' => ['sometimes', 'nullable', 'string', 'max:255'],
Expand Down
20 changes: 14 additions & 6 deletions resources/js/pages/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,16 +382,24 @@ const submitForm = () => {
</div>

<div class="sm:col-span-2">
<label
for="about"
class="mb-1.5 block text-xs font-semibold text-slate-700 dark:text-gray-300"
>
About / Bio
</label>
<div class="mb-1.5 flex items-center justify-between">
<label
for="about"
class="block text-xs font-semibold text-slate-700 dark:text-gray-300"
>
About / Bio
</label>
<span
class="text-xs text-slate-400 dark:text-gray-500"
>
{{ form.about?.length || 0 }}/255
</span>
</div>
<textarea
v-model="form.about"
id="about"
rows="3"
maxlength="255"
placeholder="Tell us a little bit about yourself..."
:disabled="form.processing"
class="w-full rounded-lg border border-slate-300 bg-white px-3.5 py-2.5 text-sm text-slate-900 transition outline-none placeholder:text-slate-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 disabled:bg-slate-50 dark:border-gray-600 dark:bg-gray-950 dark:text-gray-100 dark:placeholder:text-gray-500"
Expand Down
16 changes: 11 additions & 5 deletions resources/js/pages/admin/users/CreateOrEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,21 @@ const submitForm = () => {
</div>

<div>
<label
for="about"
class="mb-1.5 block text-sm font-semibold text-slate-700 dark:text-gray-300"
>About</label
>
<div class="mb-1.5 flex items-center justify-between">
<label
for="about"
class="block text-sm font-semibold text-slate-700 dark:text-gray-300"
>About</label
>
<span class="text-xs text-slate-400 dark:text-gray-500">
{{ form.about?.length || 0 }}/255
</span>
</div>
<textarea
v-model="form.about"
id="about"
rows="4"
maxlength="255"
placeholder="Short bio..."
:disabled="form.processing"
class="w-full rounded-lg border bg-white px-4 py-2.5 text-slate-900 transition outline-none placeholder:text-slate-400 disabled:bg-slate-50 disabled:text-slate-500 dark:bg-gray-900 dark:text-gray-100 dark:placeholder:text-gray-500 dark:disabled:bg-gray-800 dark:disabled:text-gray-400"
Expand Down
6 changes: 6 additions & 0 deletions tests/Feature/UserProfileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@
'institution' => 'Offensive College',
]);
$response->assertSessionHasErrors(['institution']);

$response = $this->actingAs($user)->put('/profile', [
'name' => 'John Doe',
'about' => str_repeat('a', 256),
]);
$response->assertSessionHasErrors(['about']);
});

test('user image_url accessor generates storage url for image_path', function () {
Expand Down
Loading