Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: miscellaenous ui updates

Brad Barbin0af603ea6c37
diff --git a/apps/erp/app/components/EmployeeAvatar.tsx b/apps/erp/app/components/EmployeeAvatar.tsx
index 006d10fd8d..80f40d61f7 100644
--- a/apps/erp/app/components/EmployeeAvatar.tsx
+++ b/apps/erp/app/components/EmployeeAvatar.tsx
@@ -22,7 +22,7 @@ const EmployeeAvatar = ({
if (employeeId === "system") {
return (
<HStack className="truncate no-underline hover:no-underline">
- <Avatar size={size ?? "xs"} path={undefined} name={"System"} />
+ <Avatar size={size ?? "xs"} path={undefined} />
{withName && <span>System</span>}
</HStack>
);
@@ -31,7 +31,7 @@ const EmployeeAvatar = ({
const person = people.find((p) => p.id === employeeId);
if (!person) {
- return <Avatar size={size ?? "xs"} path={undefined} name="System" />;
+ return <Avatar size={size ?? "xs"} path={undefined} />;
}
return (
diff --git a/apps/erp/app/modules/sales/sales.service.ts b/apps/erp/app/modules/sales/sales.service.ts
index e4a198fd9b..e80ee05ee8 100644
--- a/apps/erp/app/modules/sales/sales.service.ts
+++ b/apps/erp/app/modules/sales/sales.service.ts
@@ -310,7 +310,7 @@ export async function getCustomer(
client: SupabaseClient<Database>,
customerId: string
) {
- return client.from("customer").select("*").eq("id", customerId).single();
+ return client.from("customers").select("*").eq("id", customerId).single();
}
export async function getCustomerContact(
diff --git a/apps/mes/app/components/EmployeeAvatar.tsx b/apps/mes/app/components/EmployeeAvatar.tsx
index 006d10fd8d..80f40d61f7 100644
--- a/apps/mes/app/components/EmployeeAvatar.tsx
+++ b/apps/mes/app/components/EmployeeAvatar.tsx
@@ -22,7 +22,7 @@ const EmployeeAvatar = ({
if (employeeId === "system") {
return (
<HStack className="truncate no-underline hover:no-underline">
- <Avatar size={size ?? "xs"} path={undefined} name={"System"} />
+ <Avatar size={size ?? "xs"} path={undefined} />
{withName && <span>System</span>}
</HStack>
);
@@ -31,7 +31,7 @@ const EmployeeAvatar = ({
const person = people.find((p) => p.id === employeeId);
if (!person) {
- return <Avatar size={size ?? "xs"} path={undefined} name="System" />;
+ return <Avatar size={size ?? "xs"} path={undefined} />;
}
return (
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 42c9273873..fc8b971099 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -40752,6 +40752,63 @@ export default {
tags: ["salesRfqs"],
},
},
+ "/rpc/get_companies_with_employee_permission": {
+ get: {
+ parameters: [
+ {
+ format: "text",
+ in: "query",
+ name: "permission",
+ required: true,
+ type: "string",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_permission"],
+ },
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ properties: {
+ permission: {
+ format: "text",
+ type: "string",
+ },
+ },
+ required: ["permission"],
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_permission"],
+ },
+ },
"/rpc/get_companies_with_permission": {
get: {
parameters: [
@@ -41343,6 +41400,47 @@ export default {
tags: ["(rpc) get_active_job_operations_by_location"],
},
},
+ "/rpc/get_companies_with_employee_role": {
+ get: {
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_role"],
+ },
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_employee_role"],
+ },
+ },
"/rpc/jsonb_to_text_array": {
get: {
parameters: [
@@ -42890,6 +42988,47 @@ export default {
tags: ["(rpc) get_company_id_from_api_key"],
},
},
+ "/rpc/get_companies_with_any_role": {
+ get: {
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_any_role"],
+ },
+ post: {
+ parameters: [
+ {
+ in: "body",
+ name: "args",
+ required: true,
+ schema: {
+ type: "object",
+ },
+ },
+ {
+ $ref: "#/parameters/preferParams",
+ },
+ ],
+ produces: [
+ "application/json",
+ "application/vnd.pgrst.object+json;nulls=stripped",
+ "application/vnd.pgrst.object+json",
+ ],
+ responses: {
+ "200": {
+ description: "OK",
+ },
+ },
+ tags: ["(rpc) get_companies_with_any_role"],
+ },
+ },
"/rpc/is_claims_admin": {
get: {
produces: [
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 0b16fd56cb..c8b39fb14d 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -33407,12 +33407,46 @@ export type Database = {
}
Returns: Json
}
+ get_companies_with_any_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
+ get_companies_with_customer_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_customer_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
+ get_companies_with_employee_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_employee_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
get_companies_with_permission: {
Args: {
permission: string
}
Returns: string[]
}
+ get_companies_with_supplier_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_supplier_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
get_company_id_from_api_key: {
Args: Record<PropertyKey, never>
Returns: string
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 0b16fd56cb..c8b39fb14d 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -33407,12 +33407,46 @@ export type Database = {
}
Returns: Json
}
+ get_companies_with_any_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
+ get_companies_with_customer_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_customer_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
+ get_companies_with_employee_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_employee_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
get_companies_with_permission: {
Args: {
permission: string
}
Returns: string[]
}
+ get_companies_with_supplier_permission: {
+ Args: {
+ permission: string
+ }
+ Returns: string[]
+ }
+ get_companies_with_supplier_role: {
+ Args: Record<PropertyKey, never>
+ Returns: string[]
+ }
get_company_id_from_api_key: {
Args: Record<PropertyKey, never>
Returns: string
diff --git a/packages/react/src/Button.tsx b/packages/react/src/Button.tsx
index 636ce34282..e9282436cc 100644
--- a/packages/react/src/Button.tsx
+++ b/packages/react/src/Button.tsx
@@ -19,7 +19,7 @@ export const buttonVariants = cva(
primary:
"bg-gradient-to-br from-primary/90 to-primary text-primary-foreground hover:bg-primary/90 saturate-[105%] shadow-[inset_0px_0.5px_0px_rgb(255_255_255_/_0.32)]",
active:
- "bg-active text-active-foreground hover:bg-active/90 hover:text-active-foreground shadow-button-base",
+ "bg-active text-active-foreground hover:bg-active/90 hover:text-active-foreground shadow-button-base hover:before:opacity-100 dark:hover:before:opacity-50",
secondary:
"bg-white dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 shadow-button-base hover:before:opacity-100 dark:hover:before:opacity-50",
solid: