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.

fixed this

alidauda93d8cbaed6bd
diff --git a/apps/carbon/app/components/Form/Color.tsx b/apps/carbon/app/components/Form/Color.tsx
index e7d36d10fd..b1c8140a4d 100644
--- a/apps/carbon/app/components/Form/Color.tsx
+++ b/apps/carbon/app/components/Form/Color.tsx
@@ -35,10 +35,8 @@ const ColorPicker = ({ name, label }: ColorFieldProps) => {
<button
className="inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 h-8 w-8 border border-border"
style={{ background: value }}
- onClick={(event) => {
- event.preventDefault(); // Prevent default action
- disclosure.onToggle();
- }}
+ onClick={disclosure.onToggle}
+ type="button"
/>
<HexColorInput
color={value}
diff --git a/packages/database/supabase/migrations/20240223235518_add_search_functionality_to_equipment_and_work_cell_types.sql b/packages/database/supabase/migrations/20240223235518_add_search_functionality_to_equipment_and_work_cell_types.sql
index c33979f761..7a402ca641 100644
--- a/packages/database/supabase/migrations/20240223235518_add_search_functionality_to_equipment_and_work_cell_types.sql
+++ b/packages/database/supabase/migrations/20240223235518_add_search_functionality_to_equipment_and_work_cell_types.sql
@@ -5,7 +5,7 @@ CREATE FUNCTION public.create_work_cell_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO public.search(name, description, entity, uuid, link)
- VALUES (new.id, new.id || ' ' || new.name || ' ' || COALESCE(new.description, ''), 'Part', new.id, '/x/resources/work-cells/' || new.id);
+ VALUES (new.name, COALESCE(new.description, ''), 'Resource', new.id, '/x/resources/work-cells/' || new.id);
RETURN new;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
@@ -18,8 +18,8 @@ CREATE FUNCTION public.update_work_cell_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
IF (old.name <> new.name OR old.description <> new.description) THEN
- UPDATE public.search SET name = new.name, description = new.id || ' ' || new.name || ' ' || COALESCE(new.description, '')
- WHERE entity = 'Part' AND uuid = new.id;
+ UPDATE public.search SET name = new.name, description = COALESCE(new.description, '')
+ WHERE entity = 'Resource' AND uuid = new.id;
END IF;
RETURN new;
END;
@@ -32,7 +32,7 @@ CREATE TRIGGER update_work_cell_type_search_result
CREATE FUNCTION public.delete_work_cell_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
- DELETE FROM public.search WHERE entity = 'Part' AND uuid = old.id;
+ DELETE FROM public.search WHERE entity = 'Resource' AND uuid = old.id;
RETURN old;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
@@ -47,7 +47,7 @@ CREATE FUNCTION public.create_equipment_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
INSERT INTO public.search(name, description, entity, uuid, link)
- VALUES (new.id, new.id || ' ' || new.name || ' ' || COALESCE(new.description, ''), 'Part', new.id, '/x/resources/equipment/' || new.id);
+ VALUES (new.name,COALESCE(new.description, ''), 'Resource', new.id, '/x/resources/equipment/' || new.id);
RETURN new;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
@@ -60,8 +60,8 @@ CREATE FUNCTION public.update_equipment_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
IF (old.name <> new.name OR old.description <> new.description) THEN
- UPDATE public.search SET name = new.name, description = new.id || ' ' || new.name || ' ' || COALESCE(new.description, '')
- WHERE entity = 'Part' AND uuid = new.id;
+ UPDATE public.search SET name = new.name, description = COALESCE(new.description, '')
+ WHERE entity = 'Resource' AND uuid = new.id;
END IF;
RETURN new;
END;
@@ -74,7 +74,7 @@ CREATE TRIGGER update_equipment_type_search_result
CREATE FUNCTION public.delete_equipment_type_search_result()
RETURNS TRIGGER AS $$
BEGIN
- DELETE FROM public.search WHERE entity = 'Part' AND uuid = old.id;
+ DELETE FROM public.search WHERE entity = 'Resource' AND uuid = old.id;
RETURN old;
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;