Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix(dashboard): enable edit org name

Carl-Gerhard Lindesvärdfebf0df4753b
diff --git a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/edit-organization.tsx b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/edit-organization.tsx
index 4febcc992..7a8febbaf 100644
--- a/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/edit-organization.tsx
+++ b/apps/dashboard/src/app/(app)/[organizationSlug]/[projectId]/settings/organization/edit-organization.tsx
@@ -42,7 +42,6 @@ export default function EditOrganization({
return (
<form
- className="opacity-50"
onSubmit={handleSubmit((values) => {
mutation.mutate(values);
})}
@@ -50,18 +49,12 @@ export default function EditOrganization({
<Widget>
<WidgetHead className="flex items-center justify-between">
<span className="title">Org. details</span>
- <Button
- size="sm"
- type="submit"
- disabled
- // disabled={!formState.isDirty}
- >
+ <Button size="sm" type="submit" disabled={!formState.isDirty}>
Save
</Button>
</WidgetHead>
<WidgetBody>
<InputWithLabel
- disabled
label="Name"
{...register('name')}
defaultValue={organization?.name}
diff --git a/packages/trpc/src/routers/organization.ts b/packages/trpc/src/routers/organization.ts
index dcf931b80..560c20b29 100644
--- a/packages/trpc/src/routers/organization.ts
+++ b/packages/trpc/src/routers/organization.ts
@@ -23,7 +23,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.id,
});
- if (!access) {
+ if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project');
}
@@ -45,7 +45,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationSlug,
});
- if (!access) {
+ if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project');
}
@@ -100,7 +100,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: member.organizationId,
});
- if (!access) {
+ if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project');
}
@@ -142,7 +142,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationId,
});
- if (!access) {
+ if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project');
}
@@ -176,7 +176,7 @@ export const organizationRouter = createTRPCRouter({
organizationId: input.organizationSlug,
});
- if (!access) {
+ if (access?.role !== 'org:admin') {
throw TRPCAccessError('You do not have access to this project');
}