Skip to content

Commit 60235ad

Browse files
committed
[TOOL-4028] Dashboard: Limit team name to 32 chars (#6685)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a maximum length restriction for the `teamName` input field in the `TeamGeneralSettingsPageUI` component and applies this restriction to the `TeamInfoFormUI` component as well, enhancing user experience by preventing excessively long team names. ### Detailed summary - Added `maxLength` attribute with a value of `32` to the `teamName` input in `TeamGeneralSettingsPageUI`. - Updated the `onChange` handler in `TeamGeneralSettingsPageUI` to set the `teamName` directly from the input value. - Introduced a new constant `maxTeamNameLength` in `TeamInfoForm.tsx` set to `32`. - Added `maxLength={maxTeamNameLength}` to the input field in `TeamInfoFormUI`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 811384b commit 60235ad

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

apps/dashboard/src/app/login/onboarding/team-onboarding/TeamInfoForm.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ export function TeamInfoFormUI(props: {
155155
});
156156
}
157157

158+
const maxTeamNameLength = 32;
159+
158160
return (
159161
<div className="rounded-lg border bg-card ">
160162
<Form {...form}>
@@ -199,6 +201,7 @@ export function TeamInfoFormUI(props: {
199201
placeholder="Company Inc."
200202
autoComplete="off"
201203
{...field}
204+
maxLength={maxTeamNameLength}
202205
/>
203206
</FormControl>
204207
<FormDescription>

apps/dashboard/src/app/team/[team_slug]/(team)/~/settings/general/TeamGeneralSettingsPageUI.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ function TeamNameFormControl(props: {
8585
>
8686
<Input
8787
value={teamName}
88+
maxLength={maxTeamNameLength}
8889
onChange={(e) => {
89-
setTeamName(e.target.value.slice(0, maxTeamNameLength));
90+
setTeamName(e.target.value);
9091
}}
9192
className="md:w-[450px]"
9293
/>

0 commit comments

Comments
 (0)