diff --git a/src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx
index be3a54d02..9fa6ea504 100644
--- a/src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/members/page.tsx
@@ -2,6 +2,7 @@
import { AxiosResponse } from "axios";
import { EllipsisIcon } from "lucide-react";
+import Link from "next/link";
import { useState } from "react";
import CustomButton from "~/components/common/common-button/common-button";
@@ -184,7 +185,11 @@ const Members = () => {
On the Free plan all members in a workspace are administrators.
Upgrade to a paid plan to add the ability to assign or remove
- administrator roles. Go to Plans
+ administrator roles.{" "}
+
+ {" "}
+ Go to Plans
+
diff --git a/src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/create-role/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/create-role/page.tsx
index 0333ece7a..35330829d 100644
--- a/src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/create-role/page.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/organization/roles-and-permissions/create-role/page.tsx
@@ -137,8 +137,9 @@ function CreateNewRolePage() {
handleSubmit,
formState: { errors },
setValue,
+ trigger,
} = useForm
({
- mode: "onBlur",
+ mode: "onChange",
resolver: zodResolver(roleSchema),
});
@@ -207,6 +208,10 @@ function CreateNewRolePage() {
}
};
+ const handleInputChange = (field: keyof UseFormInputs) => {
+ trigger(field);
+ };
+
return (
@@ -237,17 +242,28 @@ function CreateNewRolePage() {
handleInputChange("name"),
+ })}
+ className={`!w-full rounded-md border ${
+ errors.name ? "border-red-500" : "border-border"
+ } bg-transparent px-3 py-2 shadow-sm outline-none focus:border-primary focus:ring-ring md:w-56`}
/>
+ {errors.name && (
+
{errors.name.message}
+ )}
+
Permissions
setPermissions(JSON.parse(value))}
+ onValueChange={(value) => {
+ setPermissions(JSON.parse(value));
+ trigger("permissions");
+ }}
>
{errors.permissions && (
-
Please select valid permissions.
+
+ {errors.permissions.message}
+
)}
@@ -279,9 +297,18 @@ function CreateNewRolePage() {
diff --git a/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
index 337a5f0e1..8a9ae3e68 100644
--- a/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
+++ b/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
@@ -277,7 +277,7 @@ export default function SettingsPage() {
onValueChange={(value) => setPronoun(value)}
>
-
+
{pronouns.map((pronoun) => (
diff --git a/src/components/common/modals/invite-member/index.tsx b/src/components/common/modals/invite-member/index.tsx
index ce0f294af..ee93cd2b4 100644
--- a/src/components/common/modals/invite-member/index.tsx
+++ b/src/components/common/modals/invite-member/index.tsx
@@ -154,14 +154,14 @@ const InviteMemberModal: React.FC = ({ show, onClose }) => {
- Add to Organization (Optional)
+ Invite as
-
+
diff --git a/src/components/layouts/footer/index.tsx b/src/components/layouts/footer/index.tsx
index 0cd004c3f..e2ed93606 100644
--- a/src/components/layouts/footer/index.tsx
+++ b/src/components/layouts/footer/index.tsx
@@ -152,8 +152,8 @@ const Footer = () => {
];
const footerBottom = [
- { route: "privacyPolicy", link: "/" },
- { route: "termsOfUse", link: "/" },
+ { route: "privacyPolicy", link: "/privacy-policy" },
+ { route: "termsOfUse", link: "/terms-and-conditions" },
];
//
diff --git a/src/schemas/index.ts b/src/schemas/index.ts
index 734a3fe96..03bf949cc 100644
--- a/src/schemas/index.ts
+++ b/src/schemas/index.ts
@@ -121,14 +121,25 @@ export const permissionsSchema = z.object({
"Can create users": z.boolean(),
"Can blacklist/whitelist users": z.boolean(),
});
+
export const roleSchema = z.object({
- name: z.string().min(2, {
- message: "name is required",
- }),
+ name: z
+ .string()
+ .min(2, { message: "Name is required" })
+ .max(50, { message: "Name must be 50 characters or less" })
+ .regex(/^[\d !(),.?A-Za-z-]+$/, {
+ message:
+ "Name can only include letters, numbers, spaces, and common punctuation marks",
+ }),
+ description: z
+ .string()
+ .min(10, { message: "Role description must be at least 10 characters" })
+ .max(200, { message: "Role description must be 200 characters or less" })
+ .regex(/^[\d !(),.?A-Za-z-]+$/, {
+ message:
+ "Description can only include letters, numbers, spaces, and common punctuation marks",
+ }),
permissions: z
.array(z.string().uuid())
.nonempty("At least one permission must be selected"),
- description: z.string().min(2, {
- message: "Role description must be at least 2 characters.",
- }),
});