Skip to content

Commit

Permalink
Merge pull request #1122 from The-Commit-Company/1116-issue-when-the-…
Browse files Browse the repository at this point in the history
…user-removes-the-full-name-from-their-profile

fix: name is required in User form
  • Loading branch information
nikkothari22 authored Oct 18, 2024
2 parents afe1f6c + ff6cb6c commit 4a484be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PageContainer from "@/components/layout/Settings/PageContainer"
import SettingsPageHeader from "@/components/layout/Settings/SettingsPageHeader"
import SettingsContentContainer from "@/components/layout/Settings/SettingsContentContainer"
import { __ } from "@/utils/translations"
import { Stack } from "@/components/layout/Stack"

type UserProfile = {
full_name?: string,
Expand Down Expand Up @@ -88,24 +89,30 @@ const UserProfile = () => {
<Flex gap='4' direction='column' className={'py-4 px-6 dark:bg-slate-2'}>

<Flex justify={'between'} align={'center'}>
<Label htmlFor='full_name'>{__("Full Name")}</Label>
<TextField.Root
autoFocus
maxLength={140}
className={'w-48 sm:w-96'}
id='full_name'
placeholder='full name'
{...register('full_name', {
maxLength: {
value: 140,
message: __("Name cannot be more than {0} characters.", [140])
}
})}
aria-invalid={errors.full_name ? 'true' : 'false'}
/>
{errors?.full_name && <ErrorText>{errors.full_name?.message}</ErrorText>}
<Label htmlFor='full_name' isRequired>{__("Full Name")}</Label>
<Stack gap='1'>
<TextField.Root
autoFocus
maxLength={140}
className={'w-48 sm:w-96'}
id='full_name'
placeholder='Full Name'
{...register('full_name', {
maxLength: {
value: 140,
message: __("Name cannot be more than {0} characters.", [140])
},
required: __("Name is required")
})}
aria-invalid={errors.full_name ? 'true' : 'false'}
/>
{errors?.full_name && <ErrorText>{errors.full_name?.message}</ErrorText>}
</Stack>

</Flex>



<Separator className={'w-full bg-slate-4'} />

<Flex justify={'between'} align={'center'}>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/Raven/RavenUser.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { RavenPinnedChannels } from './RavenPinnedChannels'

export interface RavenUser{
name: string
creation: string
name: string
modified: string
owner: string
modified_by: string
Expand Down
4 changes: 2 additions & 2 deletions raven/raven/doctype/raven_user/raven_user.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled",
"read_only": 1
"read_only_depends_on": "eval: doc.type == \"User\";"
},
{
"fieldname": "html_xuuw",
Expand Down Expand Up @@ -120,7 +120,7 @@
],
"image_field": "user_image",
"links": [],
"modified": "2024-07-26 20:46:52.128509",
"modified": "2024-10-18 16:51:11.597658",
"modified_by": "Administrator",
"module": "Raven",
"name": "Raven User",
Expand Down

0 comments on commit 4a484be

Please sign in to comment.