Skip to content

Commit

Permalink
fix: Key form name field, add max length validation and fix css issue (
Browse files Browse the repository at this point in the history
…#898)

* fix: Key form name field, add max length validation and fix css issue

* fix: headers in detail pages

---------

Co-authored-by: Oleksandr Raspopov <[email protected]>
  • Loading branch information
Alexander-frenki and Oleksandr Raspopov authored Jan 27, 2025
1 parent b8cc99f commit 447ba8e
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 11 deletions.
20 changes: 18 additions & 2 deletions ui/src/components/display-methods/DisplayMethodDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ export function DisplayMethodDetails() {
layout="vertical"
onFinish={handleEdit}
>
<Form.Item label="Name" name="name" rules={[{ message: VALUE_REQUIRED, required: true }]}>
<Form.Item
label="Name"
name="name"
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>

Expand All @@ -229,7 +236,16 @@ export function DisplayMethodDetails() {

const cardTitle = isAsyncTaskDataAvailable(displayMethod) && (
<Flex align="center" gap={8} justify="space-between">
<Typography.Text style={{ fontWeight: 600 }}>{displayMethod.data.name}</Typography.Text>
<Typography.Text
style={{
fontWeight: 600,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{displayMethod.data.name}
</Typography.Text>
<Flex gap={8}>
<Button
icon={<EditIcon />}
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/display-methods/DisplayMethodForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function DisplayMethodForm({
<Form.Item
label="Name"
name="name"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down
14 changes: 12 additions & 2 deletions ui/src/components/identities/Identity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ export function Identity() {
className="centered"
title={
<Flex align="center" gap={8} justify="space-between">
<Typography.Text style={{ fontWeight: 600 }}>
<Typography.Text
style={{
fontWeight: 600,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{identity.data.displayName}
</Typography.Text>
<Flex gap={8}>
Expand Down Expand Up @@ -174,7 +181,10 @@ export function Identity() {
>
<Form.Item
name="displayName"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/identities/IdentityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ export function IdentityForm({
<Form.Item
label="Identity name"
name="displayName"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/keys/CreateKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export function CreateKey() {
<Form.Item
label="Key name"
name="name"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down
16 changes: 14 additions & 2 deletions ui/src/components/keys/Key.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,16 @@ export function Key() {
className="centered"
title={
<Flex align="center" gap={8} justify="space-between">
<Typography.Text style={{ fontWeight: 600 }}>{key.data.name}</Typography.Text>
<Typography.Text
style={{
fontWeight: 600,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{key.data.name}
</Typography.Text>
<Flex gap={8}>
<Button
icon={<EditIcon />}
Expand Down Expand Up @@ -207,7 +216,10 @@ export function Key() {
<Form.Item
label="Name"
name="name"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down
9 changes: 8 additions & 1 deletion ui/src/components/payments/PaymentOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,14 @@ export function PaymentOption() {
className="centered"
title={
<Flex align="center" gap={8} justify="space-between">
<Typography.Text style={{ fontWeight: 600 }}>
<Typography.Text
style={{
fontWeight: 600,
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
}}
>
{paymentOption.data.name}
</Typography.Text>
<Flex gap={8}>
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/payments/PaymentOptionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ export function PaymentOptionForm({
<Form.Item
label="Name"
name="name"
rules={[{ message: VALUE_REQUIRED, required: true }]}
rules={[
{ message: VALUE_REQUIRED, required: true },
{ max: 60, message: "Name cannot be longer than 60 characters" },
]}
>
<Input placeholder="Enter name" />
</Form.Item>
Expand Down

0 comments on commit 447ba8e

Please sign in to comment.