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: remove color and stub out custom fields for each form

Brad Barbin1b86b6a7175c
diff --git a/apps/carbon/app/components/Form/CustomerType.tsx b/apps/carbon/app/components/Form/CustomerType.tsx
index 8c6bb3910d..6edc03e9d2 100644
--- a/apps/carbon/app/components/Form/CustomerType.tsx
+++ b/apps/carbon/app/components/Form/CustomerType.tsx
@@ -67,7 +67,6 @@ const CustomerType = (props: CustomerTypeSelectProps) => {
}}
initialValues={{
name: created,
- color: "#000000",
}}
/>
)}
diff --git a/apps/carbon/app/components/Form/Department.tsx b/apps/carbon/app/components/Form/Department.tsx
index e8a56c8541..d74df54c48 100644
--- a/apps/carbon/app/components/Form/Department.tsx
+++ b/apps/carbon/app/components/Form/Department.tsx
@@ -54,7 +54,6 @@ const Department = (props: DepartmentSelectProps) => {
}}
initialValues={{
name: created,
- color: "#000000",
}}
/>
)}
diff --git a/apps/carbon/app/components/Form/EquipmentType.tsx b/apps/carbon/app/components/Form/EquipmentType.tsx
index fe621145c9..8cacb88ff2 100644
--- a/apps/carbon/app/components/Form/EquipmentType.tsx
+++ b/apps/carbon/app/components/Form/EquipmentType.tsx
@@ -55,7 +55,6 @@ const EquipmentType = (props: EquipmentTypeSelectProps) => {
initialValues={{
name: created,
description: "",
- color: "#000000",
setupHours: 0,
}}
/>
diff --git a/apps/carbon/app/components/Form/SupplierType.tsx b/apps/carbon/app/components/Form/SupplierType.tsx
index d8114df2e8..d35a7b6ffb 100644
--- a/apps/carbon/app/components/Form/SupplierType.tsx
+++ b/apps/carbon/app/components/Form/SupplierType.tsx
@@ -69,7 +69,6 @@ const SupplierType = (props: SupplierTypeSelectProps) => {
}}
initialValues={{
name: created,
- color: "#000000",
}}
/>
)}
diff --git a/apps/carbon/app/components/Form/WorkCellType.tsx b/apps/carbon/app/components/Form/WorkCellType.tsx
index 952f544a28..ad181319fe 100644
--- a/apps/carbon/app/components/Form/WorkCellType.tsx
+++ b/apps/carbon/app/components/Form/WorkCellType.tsx
@@ -55,7 +55,6 @@ const WorkCellType = (props: WorkCellTypeSelectProps) => {
initialValues={{
name: created,
description: "",
- color: "#000000",
quotingRate: 0,
laborRate: 0,
overheadRate: 0,
diff --git a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx
index 8f4f37dcd5..c7f76b4692 100644
--- a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountCategoryForm.tsx
@@ -80,6 +80,7 @@ const AccountCategoryForm = ({
label: accountClass,
}))}
/>
+ {/* <CustomFormFields table="accountCategory" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx
index 008120fbed..17e71d02ec 100644
--- a/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/AccountCategories/AccountSubcategoryForm.tsx
@@ -80,6 +80,7 @@ const AccountSubcategoryForm = ({
<InputBase value={category} isReadOnly />
</FormControl>
<Input name="name" label="Name" />
+ {/* <CustomFormFields table="accountSubcategory" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx
index ace4cd17d7..4e0ab216d5 100644
--- a/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/ChartOfAccounts/ChartOfAccountForm.tsx
@@ -8,7 +8,6 @@ import {
DrawerHeader,
DrawerTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useNavigate } from "@remix-run/react";
@@ -101,68 +100,61 @@ const ChartOfAccountForm = ({ initialValues }: ChartOfAccountFormProps) => {
<DrawerBody>
<Hidden name="id" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack spacing={4}>
- <Input name="number" label="Account Number" />
- <Input name="name" label="Name" />
- <Select
- name="type"
- label="Type"
- options={accountTypes.map((accountType) => ({
- label: accountType,
- value: accountType,
- }))}
- />
- </VStack>
- <VStack spacing={4}>
- <AccountCategory
- name="accountCategoryId"
- onChange={onAccountCategoryChange}
- />
- <AccountSubcategory
- name="accountSubcategoryId"
- accountCategoryId={accountCategoryId}
- />
- <ComboboxControlled
- name="incomeBalance"
- label="Income/Balance"
- options={incomeBalanceTypes.map((incomeBalance) => ({
- label: incomeBalance,
- value: incomeBalance,
- }))}
- value={incomeBalance}
- onChange={(newValue) => {
- if (newValue)
- setIncomeBalance(newValue.value as AccountIncomeBalance);
- }}
- />
- </VStack>
- <VStack spacing={4}>
- <ComboboxControlled
- name="class"
- label="Class"
- options={accountClassTypes.map((accountClass) => ({
- label: accountClass,
- value: accountClass,
- }))}
- value={accountClass}
- onChange={(newValue) => {
- if (newValue)
- setAccountClass(newValue.value as AccountClass);
- }}
- />
- <Select
- name="consolidatedRate"
- label="Consolidated Rate"
- options={consolidatedRateTypes.map(
- (consolidatedRateType) => ({
- label: consolidatedRateType,
- value: consolidatedRateType,
- })
- )}
- />
- <Boolean name="directPosting" label="Direct Posting" />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Input name="number" label="Account Number" />
+ <Input name="name" label="Name" />
+ <Select
+ name="type"
+ label="Type"
+ options={accountTypes.map((accountType) => ({
+ label: accountType,
+ value: accountType,
+ }))}
+ />
+
+ <AccountCategory
+ name="accountCategoryId"
+ onChange={onAccountCategoryChange}
+ />
+ <AccountSubcategory
+ name="accountSubcategoryId"
+ accountCategoryId={accountCategoryId}
+ />
+ <ComboboxControlled
+ name="incomeBalance"
+ label="Income/Balance"
+ options={incomeBalanceTypes.map((incomeBalance) => ({
+ label: incomeBalance,
+ value: incomeBalance,
+ }))}
+ value={incomeBalance}
+ onChange={(newValue) => {
+ if (newValue)
+ setIncomeBalance(newValue.value as AccountIncomeBalance);
+ }}
+ />
+ <ComboboxControlled
+ name="class"
+ label="Class"
+ options={accountClassTypes.map((accountClass) => ({
+ label: accountClass,
+ value: accountClass,
+ }))}
+ value={accountClass}
+ onChange={(newValue) => {
+ if (newValue) setAccountClass(newValue.value as AccountClass);
+ }}
+ />
+ <Select
+ name="consolidatedRate"
+ label="Consolidated Rate"
+ options={consolidatedRateTypes.map((consolidatedRateType) => ({
+ label: consolidatedRateType,
+ value: consolidatedRateType,
+ }))}
+ />
+ <Boolean name="directPosting" label="Direct Posting" />
+ {/* <CustomFormFields table="account" />*/}
</div>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx b/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx
index 231d0ce660..505c45d337 100644
--- a/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/Currencies/CurrencyForm.tsx
@@ -95,6 +95,7 @@ const CurrencyForm = ({ initialValues }: CurrencyFormProps) => {
helperText={exchnageRateHelperText}
/>
<Boolean name="isBaseCurrency" label="Base Currency" />
+ {/* <CustomFormFields table="currency" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx b/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx
index 965cde0309..ad712cc00c 100644
--- a/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/PaymentTerms/PaymentTermForm.tsx
@@ -99,6 +99,7 @@ const PaymentTermForm = ({ initialValues }: PaymentTermFormProps) => {
maxValue={100}
helperText="The percentage of the cash discount. Use 0 for no discount."
/>
+ {/* <CustomFormFields table="paymentTerm" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx
index 10ff5fe3a0..6c2232717a 100644
--- a/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx
+++ b/apps/carbon/app/modules/inventory/ui/Receipts/ReceiptForm/ReceiptForm.tsx
@@ -174,6 +174,7 @@ const ReceiptForm = ({
label="External Reference"
/>
</div>
+ {/* <CustomFormFields table="receipt" />*/}
</VStack>
</ValidatedForm>
</div>
diff --git a/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx b/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx
index 30b868842a..fce9c35a10 100644
--- a/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx
+++ b/apps/carbon/app/modules/inventory/ui/ShippingMethods/ShippingMethodForm.tsx
@@ -82,6 +82,7 @@ const ShippingMethodForm = ({ initialValues }: ShippingMethodFormProps) => {
label="Tracking URL"
prefix="https://"
/>
+ {/* <CustomFormFields table="shippingMethod" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx
index ad4c4b5223..7eb641a46a 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm.tsx
@@ -85,42 +85,15 @@ const PurchaseInvoiceForm = ({
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Supplier
- name="supplierId"
- label="Supplier"
- isReadOnly={isEditing}
- />
- {isEditing && (
- <>
- <Supplier
- name="invoiceSupplierId"
- label="Invoice Supplier"
- onChange={(newValue) =>
- setSupplier(newValue?.value as string | undefined)
- }
- />
- <SupplierLocation
- name="invoiceSupplierLocationId"
- label="Invoice Location"
- supplier={supplier}
- />
- <SupplierContact
- name="invoiceSupplierContactId"
- label="Invoice Supplier Contact"
- supplier={supplier}
- />
- </>
- )}
- </VStack>
- <VStack>
- <Input
- name="supplierReference"
- label="Supplier Invoice Number"
- />
- <DatePicker name="dateIssued" label="Date Issued" />
- <DatePicker name="dateDue" label="Due Date" />
- {isEditing && (
+ <Supplier
+ name="supplierId"
+ label="Supplier"
+ isReadOnly={isEditing}
+ />
+ <Input name="supplierReference" label="Supplier Invoice Number" />
+
+ {isEditing && (
+ <>
<Select
name="status"
label="Status"
@@ -128,20 +101,39 @@ const PurchaseInvoiceForm = ({
options={statusOptions}
isReadOnly={permissions.can("delete", "invoicing")}
/>
- )}
- </VStack>
- <VStack>
- {isEditing && (
- <>
- <Select
- name="paymentTermId"
- label="Payment Terms"
- options={paymentTermOptions}
- />
- <Currency name="currencyCode" label="Currency" />
- </>
- )}
- </VStack>
+ <Supplier
+ name="invoiceSupplierId"
+ label="Invoice Supplier"
+ onChange={(newValue) =>
+ setSupplier(newValue?.value as string | undefined)
+ }
+ />
+ <SupplierLocation
+ name="invoiceSupplierLocationId"
+ label="Invoice Location"
+ supplier={supplier}
+ />
+ <SupplierContact
+ name="invoiceSupplierContactId"
+ label="Invoice Supplier Contact"
+ supplier={supplier}
+ />
+ </>
+ )}
+
+ <DatePicker name="dateDue" label="Due Date" />
+ <DatePicker name="dateIssued" label="Date Issued" />
+ {isEditing && (
+ <>
+ <Select
+ name="paymentTermId"
+ label="Payment Terms"
+ options={paymentTermOptions}
+ />
+ <Currency name="currencyCode" label="Currency" />
+ </>
+ )}
+ {/* <CustomFormFields table="purchaseInvoice" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
index e509f764a1..81a2d336a5 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLineForm.tsx
@@ -352,6 +352,7 @@ const PurchaseInvoiceLineForm = ({
)}
</>
)}
+ {/* <CustomFormFields table="purchaseInvoiceLine" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx
index 79a8c7717b..c1eaa272db 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm.tsx
@@ -4,7 +4,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import type { z } from "zod";
@@ -40,51 +39,49 @@ const PartCostingForm = ({ initialValues }: PartCostingFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="partId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Select
- name="costingMethod"
- label="Part Costing Method"
- options={partCostingMethodOptions}
- />
- <Number
- name="standardCost"
- label="Standard Cost"
- formatOptions={{
- style: "currency",
- currency,
- }}
- />
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Select
+ name="costingMethod"
+ label="Part Costing Method"
+ options={partCostingMethodOptions}
+ />
+ <Number
+ name="standardCost"
+ label="Standard Cost"
+ formatOptions={{
+ style: "currency",
+ currency,
+ }}
+ />
- <Number
- name="unitCost"
- label="Unit Cost"
- formatOptions={{
- style: "currency",
- currency,
- }}
- />
- </VStack>
- <VStack>
- <Number
- name="salesHistory"
- label="Sales History"
- formatOptions={{
- style: "currency",
- currency,
- }}
- isReadOnly
- />
- <Number
- name="salesHistoryQty"
- label="Sales History Qty"
- formatOptions={{
- maximumSignificantDigits: 3,
- }}
- isReadOnly
- />
- <Boolean name="costIsAdjusted" label="Cost Is Adjusted" />
- </VStack>
+ <Number
+ name="unitCost"
+ label="Unit Cost"
+ formatOptions={{
+ style: "currency",
+ currency,
+ }}
+ />
+
+ <Number
+ name="salesHistory"
+ label="Sales History"
+ formatOptions={{
+ style: "currency",
+ currency,
+ }}
+ isReadOnly
+ />
+ <Number
+ name="salesHistoryQty"
+ label="Sales History Qty"
+ formatOptions={{
+ maximumSignificantDigits: 3,
+ }}
+ isReadOnly
+ />
+ <Boolean name="costIsAdjusted" label="Cost Is Adjusted" />
+ {/* <CustomFormFields table="partCost" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx
index d98d3b0f0c..1a341a394c 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartForm.tsx
@@ -7,7 +7,6 @@ import {
ModalCardHeader,
ModalCardProvider,
ModalCardTitle,
- VStack,
cn,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
@@ -130,48 +129,45 @@ const PartForm = ({ initialValues, type = "card", onClose }: PartFormProps) => {
<Hidden name="type" value={type} />
<div
className={cn(
- "grid w-full gap-x-8 gap-y-2",
+ "grid w-full gap-x-8 gap-y-4",
isEditing ? "grid-cols-1 md:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- {isEditing ? (
- <Input name="id" label="Part ID" isReadOnly />
- ) : (
- <InputControlled
- name="id"
- label="Part ID"
- helperText="Use ... to get the next part ID"
- value={partId}
- onChange={onPartIdChange}
- isDisabled={loading}
- />
- )}
-
- <Input name="name" label="Name" />
- <TextArea name="description" label="Description" />
- </VStack>
- <VStack>
- <Select
- name="replenishmentSystem"
- label="Replenishment System"
- options={partReplenishmentSystemOptions}
- />
- <Select
- name="partType"
- label="Part Type"
- options={partTypeOptions}
+ {isEditing ? (
+ <Input name="id" label="Part ID" isReadOnly />
+ ) : (
+ <InputControlled
+ name="id"
+ label="Part ID"
+ helperText="Use ... to get the next part ID"
+ value={partId}
+ onChange={onPartIdChange}
+ isDisabled={loading}
/>
- <UnitOfMeasure
- name="unitOfMeasureCode"
- label="Unit of Measure"
- />
- </VStack>
- <VStack>
- <PartGroup name="partGroupId" label="Part Group" />
- <Boolean name="blocked" label="Blocked" />
- {isEditing && <Boolean name="active" label="Active" />}
- </VStack>
+ )}
+
+ <Input name="name" label="Name" />
+ <PartGroup name="partGroupId" label="Part Group" />
+
+ <TextArea name="description" label="Description" />
+ <Select
+ name="replenishmentSystem"
+ label="Replenishment System"
+ options={partReplenishmentSystemOptions}
+ />
+ <Select
+ name="partType"
+ label="Part Type"
+ options={partTypeOptions}
+ />
+ <UnitOfMeasure
+ name="unitOfMeasureCode"
+ label="Unit of Measure"
+ />
+
+ <Boolean name="blocked" label="Blocked" />
+ {isEditing && <Boolean name="active" label="Active" />}
+ {/* <CustomFormFields table="customerStatus" />*/}
</div>
</ModalCardBody>
<ModalCardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx
index b1bb1289a1..be6a4c49cb 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm.tsx
@@ -6,7 +6,6 @@ import {
CardHeader,
CardTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useRevalidator } from "@remix-run/react";
@@ -74,54 +73,47 @@ const PartInventoryForm = ({
<CardContent>
<Hidden name="partId" />
<Hidden name="locationId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <CreatableCombobox
- name="defaultShelfId"
- label="Default Shelf"
- options={shelfOptions}
- onCreateOption={async (option) => {
- const response = await supabase?.from("shelf").insert({
- id: option,
- locationId: initialValues.locationId,
- createdBy: user.id,
- });
- if (response && response.error === null)
- revalidator.revalidate();
- }}
- className="w-full"
- />
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <CreatableCombobox
+ name="defaultShelfId"
+ label="Default Shelf"
+ options={shelfOptions}
+ onCreateOption={async (option) => {
+ const response = await supabase?.from("shelf").insert({
+ id: option,
+ locationId: initialValues.locationId,
+ createdBy: user.id,
+ });
+ if (response && response.error === null)
+ revalidator.revalidate();
+ }}
+ className="w-full"
+ />
+
+ <Number name="quantityOnHand" label="Quantity On Hand" isReadOnly />
+
+ <Number
+ name="quantityAvailable"
+ label="Quantity Available"
+ isReadOnly
+ />
+ <Number
+ name="quantityOnPurchaseOrder"
+ label="Quantity On Purchase Order"
+ isReadOnly
+ />
- <Number
- name="quantityOnHand"
- label="Quantity On Hand"
- isReadOnly
- />
- </VStack>
- <VStack>
- <Number
- name="quantityAvailable"
- label="Quantity Available"
- isReadOnly
- />
- <Number
- name="quantityOnPurchaseOrder"
- label="Quantity On Purchase Order"
- isReadOnly
- />
- </VStack>
- <VStack>
- <Number
- name="quantityOnProdOrder"
- label="Quantity On Prod Order"
- isReadOnly
- />
- <Number
- name="quantityOnSalesOrder"
- label="Quantity On Sales Order"
- isReadOnly
- />
- </VStack>
+ <Number
+ name="quantityOnProdOrder"
+ label="Quantity On Prod Order"
+ isReadOnly
+ />
+ <Number
+ name="quantityOnSalesOrder"
+ label="Quantity On Sales Order"
+ isReadOnly
+ />
+ {/* <CustomFormFields table="partInventory" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx
index ac4ae27bd6..8f51aed590 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm.tsx
@@ -4,7 +4,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import type { z } from "zod";
@@ -42,38 +41,35 @@ const PartManufacturingForm = ({
</CardHeader>
<CardContent>
<Hidden name="partId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Select
- name="manufacturingPolicy"
- label="Manufacturing Policy"
- options={partManufacturingPolicyOptions}
- />
- {/* <Select
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Select
+ name="manufacturingPolicy"
+ label="Manufacturing Policy"
+ options={partManufacturingPolicyOptions}
+ />
+ {/* <Select
name="routingId"
label="Routing ID"
options={[{ label: "", value: "" }]}
/> */}
- </VStack>
- <VStack>
- <Number name="manufacturingLeadTime" label="Lead Time (Days)" />
- <Number
- name="scrapPercentage"
- label="Scrap Percentage"
- formatOptions={{ style: "percent" }}
- />
- <Number name="lotSize" label="Lot Size" />
- </VStack>
- <VStack>
- <Boolean
- name="manufacturingBlocked"
- label="Manufacturing Blocked"
- />
- <Boolean
- name="requiresConfiguration"
- label="Requires Configuration"
- />
- </VStack>
+
+ <Number name="manufacturingLeadTime" label="Lead Time (Days)" />
+ <Number
+ name="scrapPercentage"
+ label="Scrap Percentage"
+ formatOptions={{ style: "percent" }}
+ />
+ <Number name="lotSize" label="Lot Size" />
+
+ <Boolean
+ name="manufacturingBlocked"
+ label="Manufacturing Blocked"
+ />
+ <Boolean
+ name="requiresConfiguration"
+ label="Requires Configuration"
+ />
+ {/* <CustomFormFields table="partReplenishment" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx
index a50109b3b1..41fded070f 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm.tsx
@@ -6,7 +6,6 @@ import {
CardHeader,
CardTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import type { z } from "zod";
@@ -67,70 +66,59 @@ const PartPlanningForm = ({
<CardContent>
<Hidden name="partId" />
<Hidden name="locationId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <SelectForm
- name="reorderingPolicy"
- label="Reordering Policy"
- options={partReorderingPolicies.map((policy) => ({
- label: policy,
- value: policy,
- }))}
- />
- <Boolean name="critical" label="Critical" />
- <Number
- name="safetyStockQuantity"
- label="Safety Stock Quantity"
- />
- <Number
- name="safetyStockLeadTime"
- label="Safety Stock Lead Time (Days)"
- />
- <Number
- name="minimumOrderQuantity"
- label="Minimum Order Quantity"
- minValue={0}
- />
- <Number
- name="maximumOrderQuantity"
- label="Maximum Order Quantity"
- minValue={0}
- />
- <Number
- name="orderMultiple"
- label="Order Multiple"
- minValue={0}
- />
- </VStack>
- <VStack>
- <Number
- name="demandAccumulationPeriod"
- label="Demand Accumulation Period (Days)"
- minValue={0}
- />
- <Number
- name="demandReschedulingPeriod"
- label="Rescheduling Period (Days)"
- minValue={0}
- />
- <Boolean
- name="demandAccumulationIncludesInventory"
- label="Demand Includes Inventory"
- />
- </VStack>
- <VStack>
- <Number name="reorderPoint" label="Reorder Point" />
- <Number
- name="reorderQuantity"
- label="Reorder Quantity"
- minValue={0}
- />
- <Number
- name="reorderMaximumInventory"
- label="Reorder Maximum Inventory"
- minValue={0}
- />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <SelectForm
+ name="reorderingPolicy"
+ label="Reordering Policy"
+ options={partReorderingPolicies.map((policy) => ({
+ label: policy,
+ value: policy,
+ }))}
+ />
+ <Number name="safetyStockQuantity" label="Safety Stock Quantity" />
+ <Number
+ name="safetyStockLeadTime"
+ label="Safety Stock Lead Time (Days)"
+ />
+ <Number
+ name="minimumOrderQuantity"
+ label="Minimum Order Quantity"
+ minValue={0}
+ />
+ <Number
+ name="maximumOrderQuantity"
+ label="Maximum Order Quantity"
+ minValue={0}
+ />
+ <Number name="orderMultiple" label="Order Multiple" minValue={0} />
+
+ <Number
+ name="demandAccumulationPeriod"
+ label="Demand Accumulation Period (Days)"
+ minValue={0}
+ />
+ <Number
+ name="demandReschedulingPeriod"
+ label="Rescheduling Period (Days)"
+ minValue={0}
+ />
+ <Number name="reorderPoint" label="Reorder Point" />
+ <Number
+ name="reorderQuantity"
+ label="Reorder Quantity"
+ minValue={0}
+ />
+ <Number
+ name="reorderMaximumInventory"
+ label="Reorder Maximum Inventory"
+ minValue={0}
+ />
+ <Boolean
+ name="demandAccumulationIncludesInventory"
+ label="Demand Includes Inventory"
+ />
+ <Boolean name="critical" label="Critical" />
+ {/* <CustomFormFields table="partPlanning" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx
index 9fedb07902..7e95209a0b 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm.tsx
@@ -38,7 +38,7 @@ const PartPurchasingForm = ({ initialValues }: PartPurchasingFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="partId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
<VStack>
<Supplier name="preferredSupplierId" label="Preferred Supplier" />
<Number name="purchasingLeadTime" label="Lead Time (Days)" />
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx
index 2bdf223b5d..b0d2e40947 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm.tsx
@@ -4,7 +4,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -40,39 +39,36 @@ const PartSalePriceForm = ({ initialValues }: PartSalePriceFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="partId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Number
- name="unitSalePrice"
- label="Unit Sale Price"
- minValue={0}
- formatOptions={{
- style: "currency",
- currency,
- }}
- />
- <Currency
- name="currencyCode"
- label="Currency"
- onChange={(newValue) => {
- if (newValue) setCurrency(newValue?.value);
- }}
- />
- </VStack>
- <VStack>
- <UnitOfMeasure
- name="salesUnitOfMeasureCode"
- label="Sales Unit of Measure"
- />
- </VStack>
- <VStack>
- <Boolean name="salesBlocked" label="Sales Blocked" />
- <Boolean name="priceIncludesTax" label="Price Includes Tax" />
- <Boolean
- name="allowInvoiceDiscount"
- label="Allow Invoice Discount"
- />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Number
+ name="unitSalePrice"
+ label="Unit Sale Price"
+ minValue={0}
+ formatOptions={{
+ style: "currency",
+ currency,
+ }}
+ />
+ <Currency
+ name="currencyCode"
+ label="Currency"
+ onChange={(newValue) => {
+ if (newValue) setCurrency(newValue?.value);
+ }}
+ />
+
+ <UnitOfMeasure
+ name="salesUnitOfMeasureCode"
+ label="Sales Unit of Measure"
+ />
+
+ <Boolean name="salesBlocked" label="Sales Blocked" />
+ <Boolean name="priceIncludesTax" label="Price Includes Tax" />
+ <Boolean
+ name="allowInvoiceDiscount"
+ label="Allow Invoice Discount"
+ />
+ {/* <CustomFormFields table="partUnitSalePrice" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx
index 9fbea81221..fed3234b9a 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartSupplierForm.tsx
@@ -87,6 +87,7 @@ const PartSupplierForm = ({ initialValues }: PartSupplierFormProps) => {
label="Conversion Factor"
minValue={0}
/>
+ {/* <CustomFormFields table="partSupplier" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx b/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx
index 51b8219b86..73f9fd4926 100644
--- a/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/PartGroups/PartGroupForm.tsx
@@ -76,6 +76,7 @@ const PartGroupForm = ({
<VStack spacing={4}>
<Input name="name" label="Name" />
<TextArea name="description" label="Description" />
+ {/* <CustomFormFields table="partGroup" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx
index bd26ba2eb2..c8b1906b39 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceForm.tsx
@@ -5,7 +5,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
cn,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
@@ -119,38 +118,35 @@ const ServiceForm = ({ initialValues }: ServiceFormProps) => {
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- {isEditing ? (
- <Input name="id" label="Service ID" isReadOnly />
- ) : (
- <InputControlled
- name="id"
- label="Service ID"
- helperText="Use ... to get the next service ID"
- value={serviceId}
- onChange={onServiceIdChange}
- isDisabled={loading}
- />
- )}
- <Input name="name" label="Name" />
- <TextArea name="description" label="Description" />
- </VStack>
- <VStack>
- <Select
- name="serviceType"
- label="Service Type"
- options={serviceTypeOptions}
+ {isEditing ? (
+ <Input name="id" label="Service ID" isReadOnly />
+ ) : (
+ <InputControlled
+ name="id"
+ label="Service ID"
+ helperText="Use ... to get the next service ID"
+ value={serviceId}
+ onChange={onServiceIdChange}
+ isDisabled={loading}
/>
- <Combobox
- name="partGroupId"
- label="Part Group"
- options={partGroupOptions}
- />
- </VStack>
- <VStack>
- <Boolean name="blocked" label="Blocked" />
- {isEditing && <Boolean name="active" label="Active" />}
- </VStack>
+ )}
+ <Input name="name" label="Name" />
+ <Combobox
+ name="partGroupId"
+ label="Part Group"
+ options={partGroupOptions}
+ />
+ <TextArea name="description" label="Description" />
+
+ <Select
+ name="serviceType"
+ label="Service Type"
+ options={serviceTypeOptions}
+ />
+
+ <Boolean name="blocked" label="Blocked" />
+ {isEditing && <Boolean name="active" label="Active" />}
+ {/* <CustomFormFields table="service" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx
index adb88cd900..3cc4c2851c 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceSupplierForm.tsx
@@ -66,6 +66,7 @@ const ServiceSupplierForm = ({ initialValues }: ServiceSupplierFormProps) => {
<VStack spacing={4}>
<Supplier name="supplierId" label="Supplier" />
<Input name="supplierServiceId" label="Supplier Service ID" />
+ {/* <CustomFormFields table="serviceSupplier" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx b/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
index 993bcb4976..ca0cfd8173 100644
--- a/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/UnitOfMeasure/UnitOfMeasureForm.tsx
@@ -76,6 +76,7 @@ const UnitOfMeasureForm = ({
label="Code"
helperText="Unique, uppercase, without spaces"
/>
+ {/* <CustomFormFields table="unitOfMeasure" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/purchasing.models.ts b/apps/carbon/app/modules/purchasing/purchasing.models.ts
index 6f727b4a77..4adcfca910 100644
--- a/apps/carbon/app/modules/purchasing/purchasing.models.ts
+++ b/apps/carbon/app/modules/purchasing/purchasing.models.ts
@@ -246,7 +246,6 @@ export const supplierShippingValidator = z.object({
export const supplierTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
- color: z.string(),
});
export const supplierStatusValidator = z.object({
diff --git a/apps/carbon/app/modules/purchasing/purchasing.service.ts b/apps/carbon/app/modules/purchasing/purchasing.service.ts
index 21c4c91f39..aeec18e82b 100644
--- a/apps/carbon/app/modules/purchasing/purchasing.service.ts
+++ b/apps/carbon/app/modules/purchasing/purchasing.service.ts
@@ -422,7 +422,7 @@ export async function getSupplierType(
) {
return client
.from("supplierType")
- .select("id, name, color, protected")
+ .select("id, name, protected")
.eq("id", supplierTypeId)
.single();
}
@@ -431,9 +431,7 @@ export async function getSupplierTypes(
client: SupabaseClient<Database>,
args?: GenericQueryFilters & { name: string | null }
) {
- let query = client
- .from("supplierType")
- .select("id, name, color, protected", { count: "exact" });
+ let query = client.from("supplierType").select("*", { count: "exact" });
if (args?.name) {
query = query.ilike("name", `%${args.name}%`);
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx
index f2fe8baa3a..1ba8fff1c5 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm.tsx
@@ -4,7 +4,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -67,54 +66,51 @@ const PurchaseOrderDeliveryForm = ({
</CardHeader>
<CardContent>
<Hidden name="id" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Location
- name="locationId"
- label="Delivery Location"
- isReadOnly={isSupplier}
- isClearable
- />
- <Select
- name="shippingMethodId"
- label="Shipping Method"
- options={shippingMethodOptions}
- />
- <Select
- name="shippingTermId"
- label="Shipping Terms"
- isReadOnly={isSupplier}
- options={shippingTermOptions}
- />
- </VStack>
- <VStack>
- <DatePicker name="receiptRequestedDate" label="Requested Date" />
- <DatePicker name="receiptPromisedDate" label="Promised Date" />
- <DatePicker name="deliveryDate" label="Delivery Date" />
- </VStack>
- <VStack>
- <Input name="trackingNumber" label="Tracking Number" />
- {/* <TextArea name="notes" label="Shipping Notes" /> */}
- <Boolean
- name="dropShipment"
- label="Drop Shipment"
- onChange={setDropShip}
- />
- {dropShip && (
- <>
- <Customer
- name="customerId"
- label="Customer"
- onChange={(value) => setCustomer(value?.value as string)}
- />
- <CustomerLocation
- name="customerLocationId"
- label="Location"
- customer={customer}
- />
- </>
- )}
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Location
+ name="locationId"
+ label="Delivery Location"
+ isReadOnly={isSupplier}
+ isClearable
+ />
+ <Select
+ name="shippingMethodId"
+ label="Shipping Method"
+ options={shippingMethodOptions}
+ />
+ <Select
+ name="shippingTermId"
+ label="Shipping Terms"
+ isReadOnly={isSupplier}
+ options={shippingTermOptions}
+ />
+
+ <DatePicker name="receiptRequestedDate" label="Requested Date" />
+ <DatePicker name="receiptPromisedDate" label="Promised Date" />
+ <DatePicker name="deliveryDate" label="Delivery Date" />
+
+ <Input name="trackingNumber" label="Tracking Number" />
+ {/* <TextArea name="notes" label="Shipping Notes" /> */}
+ <Boolean
+ name="dropShipment"
+ label="Drop Shipment"
+ onChange={setDropShip}
+ />
+ {dropShip && (
+ <>
+ <Customer
+ name="customerId"
+ label="Customer"
+ onChange={(value) => setCustomer(value?.value as string)}
+ />
+ <CustomerLocation
+ name="customerLocationId"
+ label="Location"
+ customer={customer}
+ />
+ </>
+ )}
+ {/* <CustomFormFields table="purchaseOrderDelivery" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx
index 99606b482d..df28137099 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm.tsx
@@ -80,61 +80,51 @@ const PurchaseOrderForm = ({ initialValues }: PurchaseOrderFormProps) => {
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Supplier
- autoFocus={!isEditing}
- name="supplierId"
- label="Supplier"
- onChange={(newValue) =>
- setSupplier(newValue?.value as string | undefined)
- }
- />
-
- <SupplierLocation
- name="supplierLocationId"
- label="Supplier Location"
- supplier={supplier}
- />
- <SupplierContact
- name="supplierContactId"
- label="Supplier Contact"
- supplier={supplier}
- />
- </VStack>
- <VStack>
- <Input name="supplierReference" label="Supplier Order Number" />
- <DatePicker
- name="orderDate"
- label="Order Date"
- isDisabled={isSupplier}
- />
+ <Supplier
+ autoFocus={!isEditing}
+ name="supplierId"
+ label="Supplier"
+ onChange={(newValue) =>
+ setSupplier(newValue?.value as string | undefined)
+ }
+ />
+ <Input name="supplierReference" label="Supplier Order Number" />
+ {isEditing && permissions.can("delete", "purchasing") && (
<Select
- name="type"
- label="Type"
- options={typeOptions}
- isReadOnly={true} // {isSupplier}
+ name="status"
+ label="Status"
+ value={initialValues.status}
+ options={statusOptions}
+ isReadOnly={isSupplier}
/>
- </VStack>
- <VStack>
- {isEditing && (
- <>
- {permissions.can("delete", "purchasing") && (
- <Select
- name="status"
- label="Status"
- value={initialValues.status}
- options={statusOptions}
- isReadOnly={isSupplier}
- />
- )}
- <TextArea
- name="notes"
- label="Notes"
- readOnly={isSupplier}
- />
- </>
- )}
- </VStack>
+ )}
+ <SupplierLocation
+ name="supplierLocationId"
+ label="Supplier Location"
+ supplier={supplier}
+ />
+ <SupplierContact
+ name="supplierContactId"
+ label="Supplier Contact"
+ supplier={supplier}
+ />
+
+ <DatePicker
+ name="orderDate"
+ label="Order Date"
+ isDisabled={isSupplier}
+ />
+ <Select
+ name="type"
+ label="Type"
+ options={typeOptions}
+ isReadOnly={true} // {isSupplier}
+ />
+
+ {isEditing && (
+ <TextArea name="notes" label="Notes" readOnly={isSupplier} />
+ )}
+ {/* <CustomFormFields table="purchaseOrder" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
index a1e44414aa..24fc79f062 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLineForm.tsx
@@ -327,6 +327,7 @@ const PurchaseOrderLineForm = ({
)}
</>
)}
+ {/* <CustomFormFields table="purchaseOrderLine" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx
index bd1710a123..a21385594d 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm.tsx
@@ -4,7 +4,6 @@ import {
CardFooter,
CardHeader,
CardTitle,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -55,35 +54,32 @@ const PurchaseOrderPaymentForm = ({
</CardHeader>
<CardContent>
<Hidden name="id" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Supplier
- name="invoiceSupplierId"
- label="Invoice Supplier"
- onChange={(value) => setSupplier(value?.value as string)}
- />
- <SupplierLocation
- name="invoiceSupplierLocationId"
- label="Invoice Location"
- supplier={supplier}
- />
- <SupplierContact
- name="invoiceSupplierContactId"
- label="Invoice Contact"
- supplier={supplier}
- />
- </VStack>
- <VStack>
- <Select
- name="paymentTermId"
- label="Payment Terms"
- options={paymentTermOptions}
- />
- <Currency name="currencyCode" label="Currency" />
- </VStack>
- <VStack>
- <Boolean name="paymentComplete" label="Payment Complete" />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Supplier
+ name="invoiceSupplierId"
+ label="Invoice Supplier"
+ onChange={(value) => setSupplier(value?.value as string)}
+ />
+ <SupplierLocation
+ name="invoiceSupplierLocationId"
+ label="Invoice Location"
+ supplier={supplier}
+ />
+ <SupplierContact
+ name="invoiceSupplierContactId"
+ label="Invoice Contact"
+ supplier={supplier}
+ />
+
+ <Select
+ name="paymentTermId"
+ label="Payment Terms"
+ options={paymentTermOptions}
+ />
+ <Currency name="currencyCode" label="Currency" />
+
+ <Boolean name="paymentComplete" label="Payment Complete" />
+ {/* <CustomFormFields table="purchaseOrderPayment" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx b/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx
index b6201ed808..26e4d52bf8 100644
--- a/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/RequestForQuote/RequestForQuoteForm.tsx
@@ -69,33 +69,27 @@ const RequestForQuoteForm = ({ initialValues }: RequestForQuoteFormProps) => {
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Input autoFocus={!isEditing} name="name" label="Name" />
- <DatePicker name="receiptDate" label="Receipt Date" />
- <DatePicker name="expirationDate" label="Expiration Date" />
- </VStack>
- <VStack>
- <Location name="locationId" label="Location" />
- {isEditing && (
- <>
- <Select
- name="status"
- label="Status"
- value={initialValues.status}
- options={statusOptions}
- isReadOnly={
- isSupplier || !permissions.can("delete", "purchasing")
- }
- />
+ <Input autoFocus={!isEditing} name="name" label="Name" />
+ <DatePicker name="receiptDate" label="Receipt Date" />
+ <DatePicker name="expirationDate" label="Expiration Date" />
- <TextArea
- name="notes"
- label="Notes"
- readOnly={isSupplier}
- />
- </>
- )}
- </VStack>
+ <Location name="locationId" label="Location" />
+ {isEditing && (
+ <>
+ <Select
+ name="status"
+ label="Status"
+ value={initialValues.status}
+ options={statusOptions}
+ isReadOnly={
+ isSupplier || !permissions.can("delete", "purchasing")
+ }
+ />
+
+ <TextArea name="notes" label="Notes" readOnly={isSupplier} />
+ </>
+ )}
+ {/* <CustomFormFields table="requestForQuote" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx
index 648b753fc6..3ad128920e 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContactForm.tsx
@@ -96,6 +96,7 @@ const SupplierContactForm = ({
{/* Country dropdown */}
<DatePicker name="birthday" label="Birthday" />
<TextArea name="notes" label="Notes" />
+ {/* <CustomFormFields table="supplierContact" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx
index 45298c39d3..44d3326c74 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm.tsx
@@ -8,7 +8,6 @@ import {
ModalCardHeader,
ModalCardProvider,
ModalCardTitle,
- VStack,
cn,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
@@ -77,32 +76,23 @@ const SupplierForm = ({
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Input autoFocus={!isEditing} name="name" label="Name" />
- <Input name="taxId" label="Tax ID" />
- </VStack>
- <VStack>
- <SupplierType
- name="supplierTypeId"
- label="Supplier Type"
- placeholder="Select Supplier Type"
- />
- <SupplierStatus
- name="supplierStatusId"
- label="Supplier Status"
- placeholder="Select Supplier Status"
- />
- </VStack>
- {isEditing && (
- <>
- <VStack>
- <Employee
- name="accountManagerId"
- label="Account Manager"
- />
- </VStack>
- </>
- )}
+ <Input autoFocus={!isEditing} name="name" label="Name" />
+ <Input name="taxId" label="Tax ID" />
+
+ <SupplierType
+ name="supplierTypeId"
+ label="Supplier Type"
+ placeholder="Select Supplier Type"
+ />
+ <SupplierStatus
+ name="supplierStatusId"
+ label="Supplier Status"
+ placeholder="Select Supplier Status"
+ />
+
+ <Employee name="accountManagerId" label="Account Manager" />
+
+ {/* <CustomFormFields table="supplier" />*/}
</div>
</ModalCardBody>
<ModalCardFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx
index 32893df82b..3d35581627 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocationForm.tsx
@@ -80,6 +80,7 @@ const SupplierLocationForm = ({
<Input name="state" label="State" />
<Input name="postalCode" label="Zip Code" />
{/* Country dropdown */}
+ {/* <CustomFormFields table="supplierLocation" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx
index 6865d9413e..e6d0a7c036 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm.tsx
@@ -5,7 +5,6 @@ import {
CardHeader,
CardTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -58,32 +57,30 @@ const SupplierPaymentForm = ({ initialValues }: SupplierPaymentFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="supplierId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Supplier
- name="invoiceSupplierId"
- label="Invoice Supplier"
- onChange={(value) => setSupplier(value?.value as string)}
- />
- <SupplierLocation
- name="invoiceSupplierLocationId"
- label="Invoice Location"
- supplier={supplier}
- />
- <SupplierContact
- name="invoiceSupplierContactId"
- label="Invoice Contact"
- supplier={supplier}
- />
- </VStack>
- <VStack>
- <Select
- name="paymentTermId"
- label="Payment Term"
- options={paymentTermOptions}
- />
- <Currency name="currencyCode" label="Currency" />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Supplier
+ name="invoiceSupplierId"
+ label="Invoice Supplier"
+ onChange={(value) => setSupplier(value?.value as string)}
+ />
+ <SupplierLocation
+ name="invoiceSupplierLocationId"
+ label="Invoice Location"
+ supplier={supplier}
+ />
+ <SupplierContact
+ name="invoiceSupplierContactId"
+ label="Invoice Contact"
+ supplier={supplier}
+ />
+
+ <Select
+ name="paymentTermId"
+ label="Payment Term"
+ options={paymentTermOptions}
+ />
+ <Currency name="currencyCode" label="Currency" />
+ {/* <CustomFormFields table="supplierPayment" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx
index db897a5b86..c2ccaab803 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm.tsx
@@ -5,7 +5,6 @@ import {
CardHeader,
CardTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -64,36 +63,34 @@ const SupplierShippingForm = ({ initialValues }: SupplierShippingFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="supplierId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Supplier
- name="shippingSupplierId"
- label="Shipping Supplier"
- onChange={(value) => setSupplier(value?.value as string)}
- />
- <SupplierLocation
- name="shippingSupplierLocationId"
- label="Shipping Location"
- supplier={supplier}
- />
- <SupplierContact
- name="shippingSupplierContactId"
- label="Shipping Contact"
- supplier={supplier}
- />
- </VStack>
- <VStack>
- <Select
- name="shippingMethodId"
- label="Shipping Method"
- options={shippingMethodOptions}
- />
- <Select
- name="shippingTermId"
- label="Shipping Term"
- options={shippingTermOptions}
- />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Supplier
+ name="shippingSupplierId"
+ label="Shipping Supplier"
+ onChange={(value) => setSupplier(value?.value as string)}
+ />
+ <SupplierLocation
+ name="shippingSupplierLocationId"
+ label="Shipping Location"
+ supplier={supplier}
+ />
+ <SupplierContact
+ name="shippingSupplierContactId"
+ label="Shipping Contact"
+ supplier={supplier}
+ />
+
+ <Select
+ name="shippingMethodId"
+ label="Shipping Method"
+ options={shippingMethodOptions}
+ />
+ <Select
+ name="shippingTermId"
+ label="Shipping Term"
+ options={shippingTermOptions}
+ />
+ {/* <CustomFormFields table="supplierShipping" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusForm.tsx b/apps/carbon/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusForm.tsx
index f2f2b6994c..ffc12b2eda 100644
--- a/apps/carbon/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/SupplierStatuses/SupplierStatusForm.tsx
@@ -75,6 +75,7 @@ const SupplierStatusForm = ({
<Hidden name="type" value={type} />
<VStack spacing={4}>
<Input name="name" label="Supplier Status" />
+ {/* <CustomFormFields table="supplierStatus" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx
index 4ea8e59cfa..d6521a4981 100644
--- a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypeForm.tsx
@@ -13,7 +13,7 @@ import {
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useFetcher } from "@remix-run/react";
import type { z } from "zod";
-import { Color, Hidden, Input, Submit } from "~/components/Form";
+import { Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import { supplierTypeValidator } from "~/modules/purchasing";
import { path } from "~/utils/path";
@@ -75,7 +75,7 @@ const SupplierTypeForm = ({
<Hidden name="type" value={type} />
<VStack spacing={4}>
<Input name="name" label="Supplier Type" />
- <Color name="color" label="Color" />
+ {/* <CustomFormFields table="supplierType" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx
index ae28aa95c3..2049b7ca05 100644
--- a/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/SupplierTypes/SupplierTypesTable.tsx
@@ -30,17 +30,6 @@ const SupplierTypesTable = memo(({ data, count }: SupplierTypesTableProps) => {
</Hyperlink>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
];
}, [navigate]);
diff --git a/apps/carbon/app/modules/resources/resources.models.ts b/apps/carbon/app/modules/resources/resources.models.ts
index b0c4a8504e..302b0fd400 100644
--- a/apps/carbon/app/modules/resources/resources.models.ts
+++ b/apps/carbon/app/modules/resources/resources.models.ts
@@ -91,7 +91,6 @@ export const contractorValidator = z.object({
export const departmentValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
- color: z.string(),
parentDepartmentId: zfd.text(z.string().optional()),
});
@@ -125,7 +124,6 @@ export const equipmentTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
description: z.string(),
- color: z.string(),
requiredAbility: zfd.text(z.string().optional()),
setupHours: zfd.numeric(
z.number().min(0, { message: "Setup hours is required" })
@@ -199,7 +197,6 @@ export const workCellTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
description: z.string(),
- color: z.string(),
requiredAbility: zfd.text(z.string().optional()),
quotingRate: zfd.numeric(z.number().min(0)),
laborRate: zfd.numeric(z.number().min(0)),
diff --git a/apps/carbon/app/modules/resources/resources.service.ts b/apps/carbon/app/modules/resources/resources.service.ts
index 37d89c4682..78fbc7d0c3 100644
--- a/apps/carbon/app/modules/resources/resources.service.ts
+++ b/apps/carbon/app/modules/resources/resources.service.ts
@@ -311,22 +311,16 @@ export async function getDepartment(
client: SupabaseClient<Database>,
departmentId: string
) {
- return client
- .from("department")
- .select(`id, name, color, parentDepartmentId`)
- .eq("id", departmentId)
- .single();
+ return client.from("department").select("*").eq("id", departmentId).single();
}
export async function getDepartments(
client: SupabaseClient<Database>,
args?: GenericQueryFilters & { name: string | null }
) {
- let query = client
- .from("department")
- .select(`id, name, color, department(id, name)`, {
- count: "exact",
- });
+ let query = client.from("department").select(`*, department(id, name)`, {
+ count: "exact",
+ });
if (args?.name) {
query = query.ilike("name", `%${args.name}%`);
@@ -428,12 +422,9 @@ export async function getEquipmentTypes(
) {
let query = client
.from("equipmentType")
- .select(
- "id, name, color, description, requiredAbility, equipment(id, name)",
- {
- count: "exact",
- }
- )
+ .select("*, equipment(id, name)", {
+ count: "exact",
+ })
.eq("active", true)
.eq("equipment.active", true);
@@ -780,12 +771,9 @@ export async function getWorkCellTypes(
) {
let query = client
.from("workCellType")
- .select(
- "id, name, color, description, requiredAbility, workCell(id, name)",
- {
- count: "exact",
- }
- )
+ .select("*, workCell(id, name)", {
+ count: "exact",
+ })
.eq("active", true)
.eq("workCell.active", true);
diff --git a/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx b/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx
index c1ae279cb8..516cb175ed 100644
--- a/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Abilities/AbilityForm.tsx
@@ -100,6 +100,7 @@ const AbilityForm = ({ initialValues }: AbilityFormProps) => {
label="Employees"
helperText="Employees who already have this ability"
/>
+ {/* <CustomFormFields table="ability" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx b/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx
index 8112b906f2..73662b8175 100644
--- a/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Abilities/EmployeeAbilityForm.tsx
@@ -125,6 +125,7 @@ const EmployeeAbilityForm = ({
<Hidden name="trainingDays" value={trainingDays} />
</>
)}
+ {/* <CustomFormFields table="employeeAbility" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx b/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx
index 283de2a5b3..94e5f9b866 100644
--- a/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Contractors/ContractorForm.tsx
@@ -92,6 +92,7 @@ const ContractorForm = ({ initialValues }: ContractorFormProps) => {
minValue={0}
maxValue={10000}
/>
+ {/* <CustomFormFields table="contractor" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx b/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx
index cb1d1a697a..27d07227aa 100644
--- a/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Departments/DepartmentForm.tsx
@@ -13,7 +13,7 @@ import {
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useFetcher } from "@remix-run/react";
import type { z } from "zod";
-import { Color, Department, Hidden, Input, Submit } from "~/components/Form";
+import { Department, Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import { departmentValidator } from "~/modules/resources";
import { path } from "~/utils/path";
@@ -75,11 +75,11 @@ const DepartmentForm = ({
<Hidden name="type" value={type} />
<VStack spacing={4}>
<Input name="name" label="Department Name" />
- <Color name="color" label="Color" />
<Department
name="parentDepartmentId"
label="Parent Department"
/>
+ {/* <CustomFormFields table="department" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Departments/DepartmentsTable.tsx b/apps/carbon/app/modules/resources/ui/Departments/DepartmentsTable.tsx
index df1b0e9f0f..4ece1c9044 100644
--- a/apps/carbon/app/modules/resources/ui/Departments/DepartmentsTable.tsx
+++ b/apps/carbon/app/modules/resources/ui/Departments/DepartmentsTable.tsx
@@ -38,17 +38,6 @@ const DepartmentsTable = memo(({ data, count }: DepartmentsTableProps) => {
</Hyperlink>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
{
header: "Sub-Departments",
cell: ({ row }) => row.original.parentDepartment,
diff --git a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx
index c43eba2606..fb6f27219f 100644
--- a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentForm.tsx
@@ -140,6 +140,7 @@ const EquipmentForm = ({
minValue={0}
maxValue={100} // this seems like a reasonable max?
/>
+ {/* <CustomFormFields table="equipment" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx
index 094a494426..00c6535fef 100644
--- a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypeForm.tsx
@@ -15,7 +15,6 @@ import { useFetcher } from "@remix-run/react";
import type { z } from "zod";
import {
Ability,
- Color,
Hidden,
Input,
Number,
@@ -84,13 +83,13 @@ const EquipmentTypeForm = ({
<VStack spacing={4}>
<Input name="name" label="Name" />
<TextArea name="description" label="Description" />
- <Color name="color" label="Color" />
<Ability
name="requiredAbility"
label="Required Ability"
isClearable
/>
<Number name="setupHours" label="Setup Hours" />
+ {/* <CustomFormFields table="equipmentType" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypesTable.tsx b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypesTable.tsx
index 27bf0484f2..448fd28dc0 100644
--- a/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypesTable.tsx
+++ b/apps/carbon/app/modules/resources/ui/Equipment/EquipmentTypesTable.tsx
@@ -91,17 +91,6 @@ const EquipmentTypesTable = memo(
</Button>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
];
}, [navigate, params]);
diff --git a/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx b/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx
index 40cabe6ede..a29f296088 100644
--- a/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Holidays/HolidayForm.tsx
@@ -56,6 +56,7 @@ const HolidayForm = ({ initialValues }: HolidayFormProps) => {
<VStack spacing={4}>
<Input name="name" label="Holiday Name" />
<DatePicker name="date" label="Date" />
+ {/* <CustomFormFields table="holiday" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx b/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx
index f18b07ea57..9fc7bb932a 100644
--- a/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Locations/LocationForm.tsx
@@ -84,6 +84,7 @@ const LocationForm = ({
<Timezone name="timezone" label="Timezone" />
{/* <Number name="latitude" label="Latitude" minValue={-90} maxValue={90} />
<Number name="longitude" label="Longitude" minVale={-180} maxValue={180} /> */}
+ {/* <CustomFormFields table="location" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx b/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx
index 53c9e6fe2e..6aabc89b40 100644
--- a/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Partners/PartnerForm.tsx
@@ -116,6 +116,7 @@ const PartnerForm = ({ initialValues }: PartnerFormProps) => {
minValue={0}
maxValue={10000}
/>
+ {/* <CustomFormFields table="partner" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx
index 5a5e2e581b..e011543048 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonJob.tsx
@@ -58,6 +58,7 @@ const PersonJob = ({ job }: PersonJobProps) => {
/>
<Employee name="managerId" label="Manager" />
<Hidden name="intent" value="job" />
+ {/* <CustomFormFields table="employeeJob" />*/}
</VStack>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx b/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx
index 858fbb1d42..72efe9a0c2 100644
--- a/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/Shifts/ShiftForm.tsx
@@ -80,6 +80,7 @@ const ShiftForm = ({ initialValues }: ShiftFormProps) => {
<Boolean name="sunday" description="Sunday" />
</VStack>
</FormControl>
+ {/* <CustomFormFields table="shift" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx
index 27d04fbb28..f6a1162a0b 100644
--- a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellForm.tsx
@@ -87,6 +87,7 @@ const WorkCellForm = ({
<Location name="locationId" label="Location" />
<Department name="departmentId" label="Department" />
<DatePicker name="activeDate" label="Active Date" />
+ {/* <CustomFormFields table="workCell" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx
index 58ea0ec783..35e32a3e00 100644
--- a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx
+++ b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypeForm.tsx
@@ -15,7 +15,6 @@ import { useFetcher } from "@remix-run/react";
import type { z } from "zod";
import {
Ability,
- Color,
Hidden,
Input,
Number,
@@ -85,7 +84,6 @@ const WorkCellTypeForm = ({
<VStack spacing={4}>
<Input name="name" label="Name" />
<TextArea name="description" label="Description" />
- <Color name="color" label="Color" />
<Ability
name="requiredAbility"
label="Required Ability"
@@ -98,6 +96,7 @@ const WorkCellTypeForm = ({
name="defaultStandardFactor"
label="Default Standard Factor"
/>
+ {/* <CustomFormFields table="workCellType" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypesTable.tsx b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypesTable.tsx
index d54e86cfb2..54bbec56b0 100644
--- a/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypesTable.tsx
+++ b/apps/carbon/app/modules/resources/ui/WorkCells/WorkCellTypesTable.tsx
@@ -88,17 +88,6 @@ const WorkCellTypesTable = memo(({ data, count }: WorkCellTypesTableProps) => {
</Button>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
];
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [params]);
diff --git a/apps/carbon/app/modules/sales/sales.models.ts b/apps/carbon/app/modules/sales/sales.models.ts
index bc91a915e6..1fef959666 100644
--- a/apps/carbon/app/modules/sales/sales.models.ts
+++ b/apps/carbon/app/modules/sales/sales.models.ts
@@ -49,7 +49,6 @@ export const customerStatusValidator = z.object({
export const customerTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
- color: z.string(),
});
export const quoteLineStatusType = [
diff --git a/apps/carbon/app/modules/sales/sales.service.ts b/apps/carbon/app/modules/sales/sales.service.ts
index dfcee064b1..4e885781d7 100644
--- a/apps/carbon/app/modules/sales/sales.service.ts
+++ b/apps/carbon/app/modules/sales/sales.service.ts
@@ -255,7 +255,7 @@ export async function getCustomerType(
) {
return client
.from("customerType")
- .select("id, name, color, protected")
+ .select("*")
.eq("id", customerTypeId)
.single();
}
@@ -264,9 +264,7 @@ export async function getCustomerTypes(
client: SupabaseClient<Database>,
args?: GenericQueryFilters & { name: string | null }
) {
- let query = client
- .from("customerType")
- .select("id, name, color, protected", { count: "exact" });
+ let query = client.from("customerType").select("*", { count: "exact" });
if (args?.name) {
query = query.ilike("name", `%${args.name}%`);
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx
index 8d30840b39..f3ab04426d 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerContactForm.tsx
@@ -96,6 +96,7 @@ const CustomerContactForm = ({
{/* Country dropdown */}
<DatePicker name="birthday" label="Birthday" />
<TextArea name="notes" label="Notes" />
+ {/* <CustomFormFields table="customerContact" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
index 11a6acaf72..7c647a9b12 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm.tsx
@@ -8,7 +8,6 @@ import {
ModalCardHeader,
ModalCardProvider,
ModalCardTitle,
- VStack,
cn,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
@@ -73,36 +72,26 @@ const CustomerForm = ({
<Hidden name="type" value={type} />
<div
className={cn(
- "grid w-full gap-x-8 gap-y-2",
+ "grid w-full gap-x-8 gap-y-4",
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Input name="name" label="Name" />
- <Input name="taxId" label="Tax ID" />
- </VStack>
- <VStack>
- <CustomerType
- name="customerTypeId"
- label="Customer Type"
- placeholder="Select Customer Type"
- />
- <CustomerStatus
- name="customerStatusId"
- label="Customer Status"
- placeholder="Select Customer Status"
- />
- </VStack>
- {isEditing && (
- <>
- <VStack>
- <Employee
- name="accountManagerId"
- label="Account Manager"
- />
- </VStack>
- </>
- )}
+ <Input name="name" label="Name" />
+ <Input name="taxId" label="Tax ID" />
+
+ <CustomerType
+ name="customerTypeId"
+ label="Customer Type"
+ placeholder="Select Customer Type"
+ />
+ <CustomerStatus
+ name="customerStatusId"
+ label="Customer Status"
+ placeholder="Select Customer Status"
+ />
+
+ <Employee name="accountManagerId" label="Account Manager" />
+ {/* <CustomFormFields table="customer" />*/}
</div>
</ModalCardBody>
<ModalCardFooter>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx
index b35388c3dd..3d92db7d66 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocationForm.tsx
@@ -80,6 +80,7 @@ const CustomerLocationForm = ({
<Input name="state" label="State" />
<Input name="postalCode" label="Zip Code" />
{/* Country dropdown */}
+ {/* <CustomFormFields table="customerLocation" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx
index 71b4ea2378..80996a38e5 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm.tsx
@@ -5,7 +5,6 @@ import {
CardHeader,
CardTitle,
HStack,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useState } from "react";
@@ -58,32 +57,30 @@ const CustomerPaymentForm = ({ initialValues }: CustomerPaymentFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="customerId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
- <VStack>
- <Customer
- name="invoiceCustomerId"
- label="Invoice Customer"
- onChange={(value) => setCustomer(value?.value as string)}
- />
- <CustomerLocation
- name="invoiceCustomerLocationId"
- label="Invoice Location"
- customer={customer}
- />
- <CustomerContact
- name="invoiceCustomerContactId"
- label="Invoice Contact"
- customer={customer}
- />
- </VStack>
- <VStack>
- <Select
- name="paymentTermId"
- label="Payment Term"
- options={paymentTermOptions}
- />
- <Currency name="currencyCode" label="Currency" />
- </VStack>
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
+ <Customer
+ name="invoiceCustomerId"
+ label="Invoice Customer"
+ onChange={(value) => setCustomer(value?.value as string)}
+ />
+ <CustomerLocation
+ name="invoiceCustomerLocationId"
+ label="Invoice Location"
+ customer={customer}
+ />
+ <CustomerContact
+ name="invoiceCustomerContactId"
+ label="Invoice Contact"
+ customer={customer}
+ />
+
+ <Select
+ name="paymentTermId"
+ label="Payment Term"
+ options={paymentTermOptions}
+ />
+ <Currency name="currencyCode" label="Currency" />
+ {/* <CustomFormFields table="customerPayment" />*/}
</div>
</CardContent>
<CardFooter>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx
index 905a3f6210..135ae5ee69 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm.tsx
@@ -64,7 +64,7 @@ const CustomerShippingForm = ({ initialValues }: CustomerShippingFormProps) => {
</CardHeader>
<CardContent>
<Hidden name="customerId" />
- <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-2 w-full">
+ <div className="grid grid-cols-1 lg:grid-cols-3 gap-x-8 gap-y-4 w-full">
<VStack>
<Customer
name="shippingCustomerId"
diff --git a/apps/carbon/app/modules/sales/ui/CustomerStatuses/CustomerStatusForm.tsx b/apps/carbon/app/modules/sales/ui/CustomerStatuses/CustomerStatusForm.tsx
index 268781c89b..9c0e9526a6 100644
--- a/apps/carbon/app/modules/sales/ui/CustomerStatuses/CustomerStatusForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/CustomerStatuses/CustomerStatusForm.tsx
@@ -75,6 +75,7 @@ const CustomerStatusForm = ({
<Hidden name="type" value={type} />
<VStack spacing={4}>
<Input name="name" label="Customer Status" />
+ {/* <CustomFormFields table="customerStatus" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx
index 2aba80cd66..9bf46a4dcc 100644
--- a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypeForm.tsx
@@ -13,7 +13,7 @@ import {
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useFetcher } from "@remix-run/react";
import type { z } from "zod";
-import { Color, Hidden, Input, Submit } from "~/components/Form";
+import { Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import { customerTypeValidator } from "~/modules/sales";
import { path } from "~/utils/path";
@@ -75,7 +75,7 @@ const CustomerTypeForm = ({
<Hidden name="type" value={type} />
<VStack spacing={4}>
<Input name="name" label="Customer Type" />
- <Color name="color" label="Color" />
+ {/* <CustomFormFields table="customerType" />*/}
</VStack>
</ModalDrawerBody>
<ModalDrawerFooter>
diff --git a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx
index 1754e3ec5b..db4018cee6 100644
--- a/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx
+++ b/apps/carbon/app/modules/sales/ui/CustomerTypes/CustomerTypesTable.tsx
@@ -30,17 +30,6 @@ const CustomerTypesTable = memo(({ data, count }: CustomerTypesTableProps) => {
</Hyperlink>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
];
}, [navigate]);
diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx
index a7db57fe02..0bd65490c7 100644
--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationAssemblyForm.tsx
@@ -146,34 +146,31 @@ const QuotationAssemblyForm = ({
/>
<Hidden name="unitOfMeasureCode" value={partData?.uom} />
<VStack>
- <div className="grid w-full gap-x-8 gap-y-2 grid-cols-1 lg:grid-cols-3">
- <VStack>
- <Part
- name="partId"
- label="Manufactured Part"
- partReplenishmentSystem="Make"
- onChange={(value) => {
- onPartChange(value?.value as string);
- }}
- />
- </VStack>
- <VStack>
- <InputControlled
- name="description"
- label="Description"
- value={partData.description}
- onChange={(newValue) =>
- setPartData((d) => ({ ...d, description: newValue }))
- }
- />
- </VStack>
- <VStack>
- <Number
- name="quantityPerParent"
- label="Quantity per Parent"
- minValue={0}
- />
- </VStack>
+ <div className="grid w-full gap-x-8 gap-y-4 grid-cols-1 lg:grid-cols-3">
+ <Part
+ name="partId"
+ label="Manufactured Part"
+ partReplenishmentSystem="Make"
+ onChange={(value) => {
+ onPartChange(value?.value as string);
+ }}
+ />
+
+ <InputControlled
+ name="description"
+ label="Description"
+ value={partData.description}
+ onChange={(newValue) =>
+ setPartData((d) => ({ ...d, description: newValue }))
+ }
+ />
+
+ <Number
+ name="quantityPerParent"
+ label="Quantity per Parent"
+ minValue={0}
+ />
+ {/* <CustomFormFields table="quoteAssembly" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx
index a5b38e36cf..1a2457a039 100644
--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationForm.tsx
@@ -62,41 +62,38 @@ const QuotationForm = ({ initialValues }: QuotationFormProps) => {
<VStack>
<div
className={cn(
- "grid w-full gap-x-8 gap-y-2",
+ "grid w-full gap-x-8 gap-y-4",
isEditing ? "grid-cols-1 lg:grid-cols-3" : "grid-cols-1"
)}
>
- <VStack>
- <Customer
- autoFocus={!isEditing}
- name="customerId"
- label="Customer"
- onChange={(value) => setCustomer(value?.value as string)}
- />
- <Input name="name" label="Name" />
- <Employee name="ownerId" label="Quoter" />
- </VStack>
- <VStack>
- <Location name="locationId" label="Location" />
- <CustomerLocation
- name="customerLocationId"
- label="Customer Location"
- customer={customer}
- />
- <CustomerContact
- name="customerContactId"
- label="Customer Contact"
- customer={customer}
- />
- </VStack>
- <VStack>
- {isEditing && (
- <>
- <DatePicker name="expirationDate" label="Expiration Date" />
- <TextArea name="notes" label="Notes" />
- </>
- )}
- </VStack>
+ <Customer
+ autoFocus={!isEditing}
+ name="customerId"
+ label="Customer"
+ onChange={(value) => setCustomer(value?.value as string)}
+ />
+ <Input name="name" label="Name" />
+ <Employee name="ownerId" label="Quoter" />
+
+ <Location name="locationId" label="Location" />
+ <CustomerLocation
+ name="customerLocationId"
+ label="Customer Location"
+ customer={customer}
+ />
+ <CustomerContact
+ name="customerContactId"
+ label="Customer Contact"
+ customer={customer}
+ />
+
+ {isEditing && (
+ <>
+ <DatePicker name="expirationDate" label="Expiration Date" />
+ <TextArea name="notes" label="Notes" />
+ </>
+ )}
+ {/* <CustomFormFields table="quote" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx
index e1948bcf71..fb53f7c75e 100644
--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationLineForm.tsx
@@ -154,72 +154,69 @@ const QuotationLineForm = ({ initialValues }: QuotationLineFormProps) => {
<Hidden name="quoteId" />
<Hidden name="unitOfMeasureCode" value={partData?.uom} />
<VStack>
- <div className="grid w-full gap-x-8 gap-y-2 grid-cols-1 lg:grid-cols-3">
- <VStack>
- <Part
- name="partId"
- label="Part"
- onChange={(value) => {
- onPartChange(value?.value as string);
- }}
- />
-
- <InputControlled
- name="description"
- label="Description"
- value={partData.description}
- onChange={(newValue) =>
- setPartData((d) => ({ ...d, description: newValue }))
- }
- />
- </VStack>
- <VStack>
- <Input name="customerPartId" label="Customer Part ID" />
- <Input
- name="customerPartRevision"
- label="Customer Part Revision"
- />
- </VStack>
- <VStack>
- <SelectControlled
- name="replenishmentSystem"
- label="Replenishment System"
- options={
- partData.replenishmentSystem === "Buy"
- ? [{ label: "Buy", value: "Buy" }]
- : partData.replenishmentSystem === "Make"
- ? [{ label: "Make", value: "Make" }]
- : [
- {
- label: "Buy",
- value: "Buy",
- },
- {
- label: "Make",
- value: "Make",
- },
- ]
- }
- value={partData.replenishmentSystem}
- onChange={(newValue) => {
- if (newValue)
- setPartData((d) => ({
- ...d,
- replenishmentSystem: newValue?.value,
- }));
- }}
- />
-
- <Select
- name="status"
- label="Status"
- options={quoteLineStatusType.map((s) => ({
- label: s,
- value: s,
- }))}
- className={cn(!isEditing && "sr-only")}
- />
- </VStack>
+ <div className="grid w-full gap-x-8 gap-y-4 grid-cols-1 lg:grid-cols-3">
+ <Part
+ name="partId"
+ label="Part"
+ onChange={(value) => {
+ onPartChange(value?.value as string);
+ }}
+ />
+
+ <InputControlled
+ name="description"
+ label="Description"
+ value={partData.description}
+ onChange={(newValue) =>
+ setPartData((d) => ({ ...d, description: newValue }))
+ }
+ />
+
+ <SelectControlled
+ name="replenishmentSystem"
+ label="Replenishment System"
+ options={
+ partData.replenishmentSystem === "Buy"
+ ? [{ label: "Buy", value: "Buy" }]
+ : partData.replenishmentSystem === "Make"
+ ? [{ label: "Make", value: "Make" }]
+ : [
+ {
+ label: "Buy",
+ value: "Buy",
+ },
+ {
+ label: "Make",
+ value: "Make",
+ },
+ ]
+ }
+ value={partData.replenishmentSystem}
+ onChange={(newValue) => {
+ if (newValue)
+ setPartData((d) => ({
+ ...d,
+ replenishmentSystem: newValue?.value,
+ }));
+ }}
+ />
+
+ <Input name="customerPartId" label="Customer Part ID" />
+ <Input
+ name="customerPartRevision"
+ label="Customer Part Revision"
+ />
+
+ <Select
+ name="status"
+ label="Line Status"
+ options={quoteLineStatusType.map((s) => ({
+ label: s,
+ value: s,
+ }))}
+ className={cn(!isEditing && "sr-only")}
+ />
+ {/* <CustomFormFields table="quoteLine" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx
index d831bc25a4..c47d2544dd 100644
--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationMaterialForm.tsx
@@ -157,6 +157,7 @@ const QuotationMaterialForm = ({
}))
}
/>
+ {/* <CustomFormFields table="quoteMaterial" />*/}
</VStack>
</DrawerBody>
<DrawerFooter>
diff --git a/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx b/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx
index 24c18e21c8..7b7ec1e868 100644
--- a/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Quotation/QuotationOperationForm.tsx
@@ -168,77 +168,72 @@ const QuotationOperationForm = ({
<Hidden name="quoteAssemblyId" value={quoteAssemblyId ?? undefined} />
<VStack>
- <div className="grid w-full gap-x-8 gap-y-2 grid-cols-1 lg:grid-cols-3">
- <VStack>
- <WorkCellType
- name="workCellTypeId"
- label="Work Cell"
- onChange={(value) => {
- onWorkCellChange(value?.value as string);
- }}
- />
- <InputControlled
- name="description"
- label="Description"
- value={workCellData.description}
- onChange={(newValue) => {
- setWorkCellData((d) => ({ ...d, description: newValue }));
- }}
- />
- <EquipmentType
- name="equipmentTypeId"
- label="Equipment"
- onChange={(value) =>
- onEquipmentChange(value?.value as string)
- }
- />
- </VStack>
- <VStack>
- <NumberControlled
- name="setupHours"
- label="Setup Time (hours)"
- minValue={0}
- value={equipmentData.setupHours}
- onChange={(newValue) => {
- setEquipmentData((d) => ({ ...d, setupHours: newValue }));
- }}
- />
- <Number
- name="productionStandard"
- label="Production Standard"
- minValue={0}
- />
- <StandardFactor name="standardFactor" label="Standard Factor" />
- </VStack>
- <VStack>
- <NumberControlled
- name="quotingRate"
- label="Quoting Rate"
- minValue={0}
- value={workCellData.quotingRate}
- onChange={(newValue) => {
- setWorkCellData((d) => ({ ...d, quotingRate: newValue }));
- }}
- />
- <NumberControlled
- name="laborRate"
- label="Labor Rate"
- minValue={0}
- value={workCellData.laborRate}
- onChange={(newValue) => {
- setWorkCellData((d) => ({ ...d, laborRate: newValue }));
- }}
- />
- <NumberControlled
- name="overheadRate"
- label="Overhead Rate"
- minValue={0}
- value={workCellData.overheadRate}
- onChange={(newValue) => {
- setWorkCellData((d) => ({ ...d, overheadRate: newValue }));
- }}
- />
- </VStack>
+ <div className="grid w-full gap-x-8 gap-y-4 grid-cols-1 lg:grid-cols-3">
+ <WorkCellType
+ name="workCellTypeId"
+ label="Work Cell"
+ onChange={(value) => {
+ onWorkCellChange(value?.value as string);
+ }}
+ />
+ <InputControlled
+ name="description"
+ label="Description"
+ value={workCellData.description}
+ onChange={(newValue) => {
+ setWorkCellData((d) => ({ ...d, description: newValue }));
+ }}
+ />
+ <EquipmentType
+ name="equipmentTypeId"
+ label="Equipment"
+ onChange={(value) => onEquipmentChange(value?.value as string)}
+ />
+
+ <NumberControlled
+ name="setupHours"
+ label="Setup Time (hours)"
+ minValue={0}
+ value={equipmentData.setupHours}
+ onChange={(newValue) => {
+ setEquipmentData((d) => ({ ...d, setupHours: newValue }));
+ }}
+ />
+ <Number
+ name="productionStandard"
+ label="Production Standard"
+ minValue={0}
+ />
+ <StandardFactor name="standardFactor" label="Standard Factor" />
+
+ <NumberControlled
+ name="quotingRate"
+ label="Quoting Rate"
+ minValue={0}
+ value={workCellData.quotingRate}
+ onChange={(newValue) => {
+ setWorkCellData((d) => ({ ...d, quotingRate: newValue }));
+ }}
+ />
+ <NumberControlled
+ name="laborRate"
+ label="Labor Rate"
+ minValue={0}
+ value={workCellData.laborRate}
+ onChange={(newValue) => {
+ setWorkCellData((d) => ({ ...d, laborRate: newValue }));
+ }}
+ />
+ <NumberControlled
+ name="overheadRate"
+ label="Overhead Rate"
+ minValue={0}
+ value={workCellData.overheadRate}
+ onChange={(newValue) => {
+ setWorkCellData((d) => ({ ...d, overheadRate: newValue }));
+ }}
+ />
+ {/* <CustomFormFields table="quoteOperation" />*/}
</div>
</VStack>
</CardContent>
diff --git a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx
index 293dd41d25..61d8675b16 100644
--- a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx
+++ b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypeForm.tsx
@@ -13,7 +13,7 @@ import { ValidatedForm } from "@carbon/remix-validated-form";
import { useNavigate } from "@remix-run/react";
import { useState } from "react";
import type { z } from "zod";
-import { Color, Hidden, Input, Submit } from "~/components/Form";
+import { Hidden, Input, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
import type { Permission } from "~/modules/users";
import { employeeTypeValidator } from "~/modules/users";
@@ -81,7 +81,6 @@ const EmployeeTypeForm = ({ initialValues }: EmployeeTypeFormProps) => {
<Hidden name="id" />
<VStack spacing={4}>
<Input name="name" label="Employee Type" />
- <Color name="color" label="Color" />
<Hidden
name="data"
value={JSON.stringify(Object.values(permissions))}
diff --git a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
index e5b78a6467..c59bb385b2 100644
--- a/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
+++ b/apps/carbon/app/modules/users/ui/EmployeeTypes/EmployeeTypesTable.tsx
@@ -33,17 +33,6 @@ const EmployeeTypesTable = memo(({ data, count }: EmployeeTypesTableProps) => {
</Hyperlink>
),
},
- {
- accessorKey: "color",
- header: "Color",
- cell: (item) => (
- <div
- aria-label="Color"
- className="w-6 h-6 rounded-md bg-zinc-500"
- style={{ background: item.getValue<string>() ?? "#000000" }}
- />
- ),
- },
];
}, [navigate]);
diff --git a/apps/carbon/app/modules/users/users.models.ts b/apps/carbon/app/modules/users/users.models.ts
index c675e5fcfd..416e495167 100644
--- a/apps/carbon/app/modules/users/users.models.ts
+++ b/apps/carbon/app/modules/users/users.models.ts
@@ -42,7 +42,6 @@ export const deactivateUsersValidator = z.object({
export const employeeTypeValidator = z.object({
id: zfd.text(z.string().optional()),
name: z.string().min(1, { message: "Name is required" }),
- color: z.string(),
data: z
.string()
.startsWith("[", { message: "Invalid JSON" })
diff --git a/apps/carbon/app/modules/users/users.service.ts b/apps/carbon/app/modules/users/users.service.ts
index d34967f1a3..55badd518b 100644
--- a/apps/carbon/app/modules/users/users.service.ts
+++ b/apps/carbon/app/modules/users/users.service.ts
@@ -100,7 +100,7 @@ export async function getEmployeeType(
) {
return client
.from("employeeType")
- .select("id, name, color, protected")
+ .select("*")
.eq("id", employeeTypeId)
.single();
}
@@ -109,9 +109,7 @@ export async function getEmployeeTypes(
client: SupabaseClient<Database>,
args?: GenericQueryFilters & { name: string | null }
) {
- let query = client
- .from("employeeType")
- .select("id, name, color, protected", { count: "exact" });
+ let query = client.from("employeeType").select("*", { count: "exact" });
if (args?.name) {
query = query.ilike("name", `%${args.name}%`);
diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-statuses.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-statuses.new.tsx
index 5c7cd48b64..e56761357f 100644
--- a/apps/carbon/app/routes/x+/purchasing+/supplier-statuses.new.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-statuses.new.tsx
@@ -71,7 +71,6 @@ export default function NewSupplierStatusesRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
- color: "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx
index 83dd095b91..f051be0358 100644
--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.$supplierTypeId.tsx
@@ -92,7 +92,6 @@ export default function EditSupplierTypesRoute() {
const initialValues = {
id: supplierType.id ?? undefined,
name: supplierType.name ?? "",
- color: supplierType.color ?? "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
index 46a644e336..dcc896b780 100644
--- a/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/supplier-types.new.tsx
@@ -66,7 +66,6 @@ export default function NewSupplierTypesRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
- color: "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
index 910aaa2fd8..fef371fc6b 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.$departmentId.tsx
@@ -82,7 +82,6 @@ export default function DepartmentRoute() {
const initialValues = {
id: department.id,
name: department.name,
- color: department.color ?? "#000000",
parentDepartmentId: department.parentDepartmentId ?? undefined,
};
diff --git a/apps/carbon/app/routes/x+/resources+/departments.new.tsx b/apps/carbon/app/routes/x+/resources+/departments.new.tsx
index 1289bfb2d3..6f8081972b 100644
--- a/apps/carbon/app/routes/x+/resources+/departments.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/departments.new.tsx
@@ -65,7 +65,6 @@ export default function NewDepartmentRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
- color: "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
index 1c9d033696..6a25aee834 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.$typeId.tsx
@@ -84,7 +84,6 @@ export default function EditAttributeCategoryRoute() {
id: equipmentType?.id,
name: equipmentType?.name ?? "",
description: equipmentType?.description ?? "",
- color: equipmentType?.color ?? "#000000",
requiredAbility: equipmentType?.requiredAbility ?? undefined,
setupHours: equipmentType?.setupHours ?? 0,
};
diff --git a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx b/apps/carbon/app/routes/x+/resources+/equipment.new.tsx
index 1d32f2a0d4..dddaa2c344 100644
--- a/apps/carbon/app/routes/x+/resources+/equipment.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/equipment.new.tsx
@@ -58,7 +58,6 @@ export default function NewEquipmentTypeRoute() {
const initialValues = {
name: "",
description: "",
- color: "#000000",
setupHours: 0,
};
diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
index f384e8c3c4..e9e4edd742 100644
--- a/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
+++ b/apps/carbon/app/routes/x+/resources+/work-cells.$typeId.tsx
@@ -84,7 +84,6 @@ export default function EditAttributeCategoryRoute() {
id: workCellType?.id,
name: workCellType?.name ?? "",
description: workCellType?.description ?? "",
- color: workCellType?.color ?? "#000000",
requiredAbility: workCellType?.requiredAbility ?? undefined,
quotingRate: workCellType?.quotingRate ?? 0,
laborRate: workCellType?.laborRate ?? 0,
diff --git a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx
index 37c87abd4d..25e625816d 100644
--- a/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx
+++ b/apps/carbon/app/routes/x+/resources+/work-cells.new.tsx
@@ -58,7 +58,6 @@ export default function NewWorkCellTypeRoute() {
const initialValues = {
name: "",
description: "",
- color: "#000000",
quotingRate: 0,
laborRate: 0,
overheadRate: 0,
diff --git a/apps/carbon/app/routes/x+/sales+/customer-statuses.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-statuses.new.tsx
index 42095802ec..4ada3ac32d 100644
--- a/apps/carbon/app/routes/x+/sales+/customer-statuses.new.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customer-statuses.new.tsx
@@ -71,7 +71,6 @@ export default function NewCustomerStatusesRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
- color: "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
index 08d9f2c51f..a0cfc0cd97 100644
--- a/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customer-types.$customerTypeId.tsx
@@ -83,7 +83,6 @@ export default function EditCustomerTypesRoute() {
const initialValues = {
id: customerType?.id ?? undefined,
name: customerType?.name ?? "",
- color: customerType?.color ?? "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
index 93e98043c7..c1f59bb2b3 100644
--- a/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
+++ b/apps/carbon/app/routes/x+/sales+/customer-types.new.tsx
@@ -66,7 +66,6 @@ export default function NewCustomerTypesRoute() {
const navigate = useNavigate();
const initialValues = {
name: "",
- color: "#000000",
};
return (
diff --git a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx
index 1c2c3a148b..e92517fd3f 100644
--- a/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx
+++ b/apps/carbon/app/routes/x+/users+/employee-types.$employeeTypeId.tsx
@@ -61,7 +61,7 @@ export async function action({ request }: ActionFunctionArgs) {
return validationError(validation.error);
}
- const { id, name, color, data } = validation.data;
+ const { id, name, data } = validation.data;
if (!id) throw notFound("id not found");
const permissions = JSON.parse(data);
@@ -80,7 +80,6 @@ export async function action({ request }: ActionFunctionArgs) {
const updateEmployeeType = await upsertEmployeeType(client, {
id,
name,
- color: color ?? undefined,
});
if (updateEmployeeType.error) {
@@ -125,7 +124,6 @@ export default function EditEmployeeTypesRoute() {
const initialValues = {
id: employeeType?.id ?? "",
name: employeeType?.name ?? "",
- color: employeeType?.color ?? "#000000",
permissions: employeeTypePermissions,
};
diff --git a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
index 37bff9d296..44524b9f1d 100644
--- a/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
+++ b/apps/carbon/app/routes/x+/users+/employee-types.new.tsx
@@ -49,7 +49,7 @@ export async function action({ request }: ActionFunctionArgs) {
return validationError(validation.error);
}
- const { name, color, data } = validation.data;
+ const { name, data } = validation.data;
const permissions = JSON.parse(data);
const jsonValidation =
@@ -66,7 +66,6 @@ export async function action({ request }: ActionFunctionArgs) {
const createEmployeeType = await insertEmployeeType(client, {
name,
- color: color ?? undefined,
});
if (createEmployeeType.error) {
return json(
@@ -118,7 +117,6 @@ export default function NewEmployeeTypesRoute() {
const initialValues = {
name: "",
- color: "#000000",
data: "",
permissions,
};
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index aa7cc20a82..319dc2d5e1 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -2408,7 +2408,6 @@ export type Database = {
}
customerType: {
Row: {
- color: string | null
createdAt: string
createdBy: string
customFields: Json | null
@@ -2419,7 +2418,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string | null
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -2430,7 +2428,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string | null
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -2614,7 +2611,6 @@ export type Database = {
}
department: {
Row: {
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -2625,7 +2621,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -2636,7 +2631,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -3194,7 +3188,6 @@ export type Database = {
}
employeeType: {
Row: {
- color: string
createdAt: string
id: string
name: string
@@ -3202,7 +3195,6 @@ export type Database = {
updatedAt: string | null
}
Insert: {
- color?: string
createdAt?: string
id?: string
name: string
@@ -3210,7 +3202,6 @@ export type Database = {
updatedAt?: string | null
}
Update: {
- color?: string
createdAt?: string
id?: string
name?: string
@@ -3402,7 +3393,6 @@ export type Database = {
equipmentType: {
Row: {
active: boolean
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -3416,7 +3406,6 @@ export type Database = {
}
Insert: {
active?: boolean
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -3430,7 +3419,6 @@ export type Database = {
}
Update: {
active?: boolean
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -10943,7 +10931,6 @@ export type Database = {
}
supplierType: {
Row: {
- color: string | null
createdAt: string
createdBy: string
customFields: Json | null
@@ -10954,7 +10941,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string | null
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -10965,7 +10951,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string | null
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -11704,7 +11689,6 @@ export type Database = {
workCellType: {
Row: {
active: boolean
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -11721,7 +11705,6 @@ export type Database = {
}
Insert: {
active?: boolean
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -11738,7 +11721,6 @@ export type Database = {
}
Update: {
active?: boolean
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index aa7cc20a82..319dc2d5e1 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -2408,7 +2408,6 @@ export type Database = {
}
customerType: {
Row: {
- color: string | null
createdAt: string
createdBy: string
customFields: Json | null
@@ -2419,7 +2418,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string | null
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -2430,7 +2428,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string | null
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -2614,7 +2611,6 @@ export type Database = {
}
department: {
Row: {
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -2625,7 +2621,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -2636,7 +2631,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -3194,7 +3188,6 @@ export type Database = {
}
employeeType: {
Row: {
- color: string
createdAt: string
id: string
name: string
@@ -3202,7 +3195,6 @@ export type Database = {
updatedAt: string | null
}
Insert: {
- color?: string
createdAt?: string
id?: string
name: string
@@ -3210,7 +3202,6 @@ export type Database = {
updatedAt?: string | null
}
Update: {
- color?: string
createdAt?: string
id?: string
name?: string
@@ -3402,7 +3393,6 @@ export type Database = {
equipmentType: {
Row: {
active: boolean
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -3416,7 +3406,6 @@ export type Database = {
}
Insert: {
active?: boolean
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -3430,7 +3419,6 @@ export type Database = {
}
Update: {
active?: boolean
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -10943,7 +10931,6 @@ export type Database = {
}
supplierType: {
Row: {
- color: string | null
createdAt: string
createdBy: string
customFields: Json | null
@@ -10954,7 +10941,6 @@ export type Database = {
updatedBy: string | null
}
Insert: {
- color?: string | null
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -10965,7 +10951,6 @@ export type Database = {
updatedBy?: string | null
}
Update: {
- color?: string | null
createdAt?: string
createdBy?: string
customFields?: Json | null
@@ -11704,7 +11689,6 @@ export type Database = {
workCellType: {
Row: {
active: boolean
- color: string
createdAt: string
createdBy: string
customFields: Json | null
@@ -11721,7 +11705,6 @@ export type Database = {
}
Insert: {
active?: boolean
- color?: string
createdAt?: string
createdBy: string
customFields?: Json | null
@@ -11738,7 +11721,6 @@ export type Database = {
}
Update: {
active?: boolean
- color?: string
createdAt?: string
createdBy?: string
customFields?: Json | null
diff --git a/packages/database/supabase/migrations/20230123004339_employee-types.sql b/packages/database/supabase/migrations/20230123004339_employee-types.sql
index 7dad650ef9..b0269da423 100644
--- a/packages/database/supabase/migrations/20230123004339_employee-types.sql
+++ b/packages/database/supabase/migrations/20230123004339_employee-types.sql
@@ -4,13 +4,11 @@ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE "employeeType" (
"id" TEXT NOT NULL DEFAULT uuid_generate_v4(),
"name" TEXT NOT NULL,
- "color" TEXT NOT NULL DEFAULT '#000000',
"protected" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"updatedAt" TIMESTAMP WITH TIME ZONE,
- CONSTRAINT "employeeType_pkey" PRIMARY KEY ("id"),
- CONSTRAINT "employeeType_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$')
+ CONSTRAINT "employeeType_pkey" PRIMARY KEY ("id")
);
ALTER TABLE "employeeType" ENABLE ROW LEVEL SECURITY;
diff --git a/packages/database/supabase/migrations/20230123004612_suppliers-and-customers.sql b/packages/database/supabase/migrations/20230123004612_suppliers-and-customers.sql
index a8d7ca8523..25e0cdf01f 100644
--- a/packages/database/supabase/migrations/20230123004612_suppliers-and-customers.sql
+++ b/packages/database/supabase/migrations/20230123004612_suppliers-and-customers.sql
@@ -61,7 +61,6 @@ CREATE TABLE "supplierStatus" (
CREATE TABLE "supplierType" (
"id" TEXT NOT NULL DEFAULT uuid_generate_v4(),
"name" TEXT NOT NULL,
- "color" TEXT DEFAULT '#000000',
"protected" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"createdBy" TEXT NOT NULL,
@@ -70,7 +69,6 @@ CREATE TABLE "supplierType" (
CONSTRAINT "supplierType_pkey" PRIMARY KEY ("id"),
CONSTRAINT "supplierType_name_unique" UNIQUE ("name"),
- CONSTRAINT "supplierType_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$'),
CONSTRAINT "supplierType_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT "supplierType_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id") ON UPDATE CASCADE ON DELETE SET NULL
);
@@ -153,7 +151,6 @@ CREATE TABLE "customerStatus" (
CREATE TABLE "customerType" (
"id" TEXT NOT NULL DEFAULT uuid_generate_v4(),
"name" TEXT NOT NULL,
- "color" TEXT DEFAULT '#000000',
"protected" BOOLEAN NOT NULL DEFAULT false,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
"createdBy" TEXT NOT NULL,
@@ -162,7 +159,6 @@ CREATE TABLE "customerType" (
CONSTRAINT "customerType_pkey" PRIMARY KEY ("id"),
CONSTRAINT "customerType_name_unique" UNIQUE ("name"),
- CONSTRAINT "customerType_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$'),
CONSTRAINT "customerType_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON UPDATE CASCADE ON DELETE RESTRICT,
CONSTRAINT "customerType_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id") ON UPDATE CASCADE ON DELETE SET NULL
);
diff --git a/packages/database/supabase/migrations/20230302030217_equipment.sql b/packages/database/supabase/migrations/20230302030217_equipment.sql
index 5f692c3938..5116e36e54 100644
--- a/packages/database/supabase/migrations/20230302030217_equipment.sql
+++ b/packages/database/supabase/migrations/20230302030217_equipment.sql
@@ -16,7 +16,6 @@ CREATE TYPE factor AS ENUM (
CREATE TABLE "department" (
"id" TEXT NOT NULL DEFAULT xid(),
"name" TEXT NOT NULL UNIQUE,
- "color" TEXT NOT NULL DEFAULT '#000000',
"parentDepartmentId" TEXT,
"createdBy" TEXT NOT NULL,
"createdAt" TIMESTAMP NOT NULL DEFAULT now(),
@@ -24,7 +23,6 @@ CREATE TABLE "department" (
"updatedAt" TIMESTAMP,
CONSTRAINT "department_pkey" PRIMARY KEY ("id"),
- CONSTRAINT "department_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$'),
CONSTRAINT "department_parentDepartmentId_fkey" FOREIGN KEY ("parentDepartmentId") REFERENCES "department"("id") ON DELETE CASCADE ON UPDATE CASCADE
);
@@ -61,7 +59,6 @@ CREATE POLICY "Employees with resources_delete can delete departments" ON "depar
CREATE TABLE "workCellType" (
"id" TEXT NOT NULL DEFAULT xid(),
"name" TEXT NOT NULL UNIQUE,
- "color" TEXT NOT NULL DEFAULT '#000000',
"description" TEXT,
"requiredAbility" TEXT,
"quotingRate" NUMERIC NOT NULL DEFAULT 0,
@@ -75,7 +72,6 @@ CREATE TABLE "workCellType" (
"updatedAt" TIMESTAMP,
CONSTRAINT "workCellType_pkey" PRIMARY KEY ("id"),
- CONSTRAINT "workCellType_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$'),
CONSTRAINT "workCellType_requiredAbility_fkey" FOREIGN KEY ("requiredAbility") REFERENCES "ability"("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "workCellType_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "workCellType_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE
@@ -256,7 +252,6 @@ CREATE POLICY "Employees with resources_delete can delete crew abilities" ON "cr
CREATE TABLE "equipmentType" (
"id" TEXT NOT NULL DEFAULT xid(),
"name" TEXT NOT NULL UNIQUE,
- "color" TEXT NOT NULL DEFAULT '#000000',
"description" TEXT,
"requiredAbility" TEXT,
"setupHours" NUMERIC NOT NULL DEFAULT 0,
@@ -267,7 +262,6 @@ CREATE TABLE "equipmentType" (
"updatedAt" TIMESTAMP,
CONSTRAINT "equipmentType_pkey" PRIMARY KEY ("id"),
- CONSTRAINT "equipmentType_colorCheck" CHECK ("color" is null or "color" ~* '^#[a-f0-9]{6}$'),
CONSTRAINT "equipmentType_requiredAbility_fkey" FOREIGN KEY ("requiredAbility") REFERENCES "ability"("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "equipmentType_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT "equipmentType_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE
diff --git a/packages/database/supabase/migrations/20240313021647_custom-fields-on-tables.sql b/packages/database/supabase/migrations/20240313021647_custom-fields-on-tables.sql
index 5b4f446fba..2f8a57b7d3 100644
--- a/packages/database/supabase/migrations/20240313021647_custom-fields-on-tables.sql
+++ b/packages/database/supabase/migrations/20240313021647_custom-fields-on-tables.sql
@@ -10,10 +10,8 @@ ALTER TABLE "customerLocation" ADD COLUMN "customFields" JSONB;
ALTER TABLE "customerStatus" ADD COLUMN "customFields" JSONB;
ALTER TABLE "customerType" ADD COLUMN "customFields" JSONB;
ALTER TABLE "department" ADD COLUMN "customFields" JSONB;
-ALTER TABLE "employee" ADD COLUMN "customFields" JSONB;
ALTER TABLE "employeeAbility" ADD COLUMN "customFields" JSONB;
ALTER TABLE "employeeJob" ADD COLUMN "customFields" JSONB;
-ALTER TABLE "employeeShift" ADD COLUMN "customFields" JSONB;
ALTER TABLE "equipment" ADD COLUMN "customFields" JSONB;
ALTER TABLE "equipmentType" ADD COLUMN "customFields" JSONB;
ALTER TABLE "holiday" ADD COLUMN "customFields" JSONB;