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: make all the non-standard form layouts look the same

Brad Barbin5ef441c4b4eb
diff --git a/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx b/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx
index 9ed6ba80a7..95c9be662f 100644
--- a/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx
+++ b/apps/carbon/app/modules/account/ui/Password/PasswordForm.tsx
@@ -1,4 +1,11 @@
-import { VStack } from "@carbon/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useRef, useState } from "react";
import { Password, Submit } from "~/components/Form";
@@ -21,30 +28,37 @@ const PasswordForm = () => {
};
return (
- <div className="w-full">
+ <Card>
<ValidatedForm
method="post"
action={path.to.accountPassword}
validator={accountPasswordValidator}
>
- <VStack spacing={4} className="my-4 max-w-[440px]">
- <Password name="currentPassword" label="Current Password" />
- <Password
- ref={passwordRef}
- onChange={onPasswordChange}
- name="password"
- label="New Password"
- />
- <Password
- ref={confirmPasswordRef}
- onChange={onPasswordChange}
- name="confirmPassword"
- label="Confirm Password"
- />
+ <CardHeader>
+ <CardTitle>Update Password</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <VStack spacing={4} className="my-4 max-w-[440px]">
+ <Password name="currentPassword" label="Current Password" />
+ <Password
+ ref={passwordRef}
+ onChange={onPasswordChange}
+ name="password"
+ label="New Password"
+ />
+ <Password
+ ref={confirmPasswordRef}
+ onChange={onPasswordChange}
+ name="confirmPassword"
+ label="Confirm Password"
+ />
+ </VStack>
+ </CardContent>
+ <CardFooter>
<Submit isDisabled={!passwordsMatch}>Update Password</Submit>
- </VStack>
+ </CardFooter>
</ValidatedForm>
- </div>
+ </Card>
);
};
diff --git a/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx b/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx
index be21e21bb6..114f3b7028 100644
--- a/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx
+++ b/apps/carbon/app/modules/account/ui/Profile/ProfileForm.tsx
@@ -1,14 +1,7 @@
-import {
- Card,
- CardContent,
- CardFooter,
- CardHeader,
- CardTitle,
- VStack,
-} from "@carbon/react";
+import { VStack } from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useParams } from "@remix-run/react";
-import { Hidden, Input, Submit, TextArea } from "~/components/Form";
+import { Hidden, Input, TextArea } from "~/components/Form";
import { accountProfileValidator } from "~/modules/account";
import type { User } from "~/modules/users";
import { path } from "~/utils/path";
@@ -29,29 +22,19 @@ const ProfileForm = ({ user }: ProfileFormProps) => {
defaultValues={user}
className="w-full"
>
- <Card>
- <CardHeader>
- <CardTitle>Basic Information</CardTitle>
- </CardHeader>
- <CardContent>
- <VStack spacing={4} className="my-4">
- <div className="grid grid-cols-2 gap-4 w-full">
- <Input name="firstName" label="First Name" />
- <Input name="lastName" label="Last Name" />
- </div>
- <TextArea
- name="about"
- label="About"
- characterLimit={160}
- className="my-2"
- />
- <Hidden name="intent" value="about" />
- </VStack>
- </CardContent>
- <CardFooter>
- <Submit>Save</Submit>
- </CardFooter>
- </Card>
+ <VStack spacing={4}>
+ <div className="grid grid-cols-2 gap-4 w-full">
+ <Input name="firstName" label="First Name" />
+ <Input name="lastName" label="Last Name" />
+ </div>
+ <TextArea
+ name="about"
+ label="About"
+ characterLimit={160}
+ className="my-2"
+ />
+ <Hidden name="intent" value="about" />
+ </VStack>
</ValidatedForm>
);
};
diff --git a/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx b/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx
index 17f61f7499..bd65fae5ef 100644
--- a/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/AccountDefaults/AccountDefaultsForm.tsx
@@ -2,6 +2,8 @@ import {
Button,
Card,
CardContent,
+ CardDescription,
+ CardFooter,
CardHeader,
CardTitle,
HStack,
@@ -9,7 +11,6 @@ import {
TabsContent,
TabsList,
TabsTrigger,
- VStack,
} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import { useNavigate } from "@remix-run/react";
@@ -48,7 +49,7 @@ const AccountDefaultsForm = ({
}));
return (
- <VStack spacing={0} className="h-full">
+ <Card>
<ValidatedForm
validator={defaultAcountValidator}
method="post"
@@ -58,250 +59,242 @@ const AccountDefaultsForm = ({
width: "100%",
}}
>
- <Tabs defaultValue="income">
- <TabsList>
- <TabsTrigger value="income">Income Statement</TabsTrigger>
- <TabsTrigger value="balance">Balance Sheet</TabsTrigger>
- </TabsList>
+ <CardHeader>
+ <CardTitle>Account Defaults</CardTitle>
+ <CardDescription>
+ These accounts are used in the absence of a more specific account
+ from a posting group
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <Tabs defaultValue="income">
+ <TabsList>
+ <TabsTrigger value="income">Income Statement</TabsTrigger>
+ <TabsTrigger value="balance">Balance Sheet</TabsTrigger>
+ </TabsList>
- <TabsContent value="income" className="py-6">
- <VStack spacing={8}>
- <Card>
- <CardHeader>
- <CardTitle>Income Statement</CardTitle>
- </CardHeader>
- <CardContent>
- <div className="grid gap-y-4 gap-x-8 grid-cols-1 md:grid-cols-2">
- <Select
- name="salesAccount"
- label="Sales"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="salesDiscountAccount"
- label="Sales Discounts"
- options={incomeStatementAccountOptions}
- />
+ <TabsContent value="income" className="py-6">
+ <div className="grid gap-y-4 gap-x-8 grid-cols-1 md:grid-cols-2">
+ <Select
+ name="salesAccount"
+ label="Sales"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="salesDiscountAccount"
+ label="Sales Discounts"
+ options={incomeStatementAccountOptions}
+ />
- <Select
- name="costOfGoodsSoldAccount"
- label="Cost of Goods Sold"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="purchaseAccount"
- label="Purchases"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="directCostAppliedAccount"
- label="Direct Cost Applied"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="overheadCostAppliedAccount"
- label="Overhead Cost Applied"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="purchaseVarianceAccount"
- label="Purchase Variance"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="inventoryAdjustmentVarianceAccount"
- label="Inventory Adjustment"
- options={incomeStatementAccountOptions}
- />
+ <Select
+ name="costOfGoodsSoldAccount"
+ label="Cost of Goods Sold"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="purchaseAccount"
+ label="Purchases"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="directCostAppliedAccount"
+ label="Direct Cost Applied"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="overheadCostAppliedAccount"
+ label="Overhead Cost Applied"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="purchaseVarianceAccount"
+ label="Purchase Variance"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="inventoryAdjustmentVarianceAccount"
+ label="Inventory Adjustment"
+ options={incomeStatementAccountOptions}
+ />
- <Select
- name="materialVarianceAccount"
- label="Material Variance"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="capacityVarianceAccount"
- label="Capacity Variance"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="overheadAccount"
- label="Overhead"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="maintenanceAccount"
- label="Maintenance Expense"
- options={incomeStatementAccountOptions}
- />
+ <Select
+ name="materialVarianceAccount"
+ label="Material Variance"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="capacityVarianceAccount"
+ label="Capacity Variance"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="overheadAccount"
+ label="Overhead"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="maintenanceAccount"
+ label="Maintenance Expense"
+ options={incomeStatementAccountOptions}
+ />
- <Select
- name="assetDepreciationExpenseAccount"
- label="Depreciation Expense"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="assetGainsAndLossesAccount"
- label="Gains and Losses"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="serviceChargeAccount"
- label="Service Charges"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="interestAccount"
- label="Interest"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="supplierPaymentDiscountAccount"
- label="Supplier Payment Discounts"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="customerPaymentDiscountAccount"
- label="Customer Payment Discounts"
- options={incomeStatementAccountOptions}
- />
- <Select
- name="roundingAccount"
- label="Rounding Account"
- options={incomeStatementAccountOptions}
- />
- </div>
- </CardContent>
- </Card>
- </VStack>
- </TabsContent>
- <TabsContent value="balance" className="py-6">
- <VStack spacing={8}>
- <Card>
- <CardHeader>
- <CardTitle>Balance Sheet</CardTitle>
- </CardHeader>
- <CardContent>
- <div className="grid gap-y-4 gap-x-8 grid-cols-1 md:grid-cols-2">
- <Select
- name="inventoryAccount"
- label="Inventory"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="inventoryInterimAccrualAccount"
- label="Inventory Interim Accrual"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="workInProgressAccount"
- label="Work in Progress (WIP)"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="receivablesAccount"
- label="Receivables"
- options={balanceSheetAccountOptions}
- />
+ <Select
+ name="assetDepreciationExpenseAccount"
+ label="Depreciation Expense"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="assetGainsAndLossesAccount"
+ label="Gains and Losses"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="serviceChargeAccount"
+ label="Service Charges"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="interestAccount"
+ label="Interest"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="supplierPaymentDiscountAccount"
+ label="Supplier Payment Discounts"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="customerPaymentDiscountAccount"
+ label="Customer Payment Discounts"
+ options={incomeStatementAccountOptions}
+ />
+ <Select
+ name="roundingAccount"
+ label="Rounding Account"
+ options={incomeStatementAccountOptions}
+ />
+ </div>
+ </TabsContent>
+ <TabsContent value="balance" className="py-6">
+ <div className="grid gap-y-4 gap-x-8 grid-cols-1 md:grid-cols-2">
+ <Select
+ name="inventoryAccount"
+ label="Inventory"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="inventoryInterimAccrualAccount"
+ label="Inventory Interim Accrual"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="workInProgressAccount"
+ label="Work in Progress (WIP)"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="receivablesAccount"
+ label="Receivables"
+ options={balanceSheetAccountOptions}
+ />
- <Select
- name="inventoryInvoicedNotReceivedAccount"
- label="Inventory Invoiced Not Received"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="bankCashAccount"
- label="Bank - Cash"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="bankLocalCurrencyAccount"
- label="Bank - Local Currency"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="bankForeignCurrencyAccount"
- label="Bank - Foreign Currency"
- options={balanceSheetAccountOptions}
- />
+ <Select
+ name="inventoryInvoicedNotReceivedAccount"
+ label="Inventory Invoiced Not Received"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="bankCashAccount"
+ label="Bank - Cash"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="bankLocalCurrencyAccount"
+ label="Bank - Local Currency"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="bankForeignCurrencyAccount"
+ label="Bank - Foreign Currency"
+ options={balanceSheetAccountOptions}
+ />
- <Select
- name="assetAquisitionCostAccount"
- label="Asset Aquisition Cost"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="assetAquisitionCostOnDisposalAccount"
- label="Asset Cost on Disposal"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="accumulatedDepreciationAccount"
- label="Accumulated Depreciation"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="accumulatedDepreciationOnDisposalAccount"
- label="Accumulated Depreciation on Disposal"
- options={balanceSheetAccountOptions}
- />
+ <Select
+ name="assetAquisitionCostAccount"
+ label="Asset Aquisition Cost"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="assetAquisitionCostOnDisposalAccount"
+ label="Asset Cost on Disposal"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="accumulatedDepreciationAccount"
+ label="Accumulated Depreciation"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="accumulatedDepreciationOnDisposalAccount"
+ label="Accumulated Depreciation on Disposal"
+ options={balanceSheetAccountOptions}
+ />
- <Select
- name="prepaymentAccount"
- label="Prepayments"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="payablesAccount"
- label="Payables"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="inventoryReceivedNotInvoicedAccount"
- label="Inventory Received Not Invoiced"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="inventoryShippedNotInvoicedAccount"
- label="Inventory Shipped Not Invoiced"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="salesTaxPayableAccount"
- label="Sales Tax Payable"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="purchaseTaxPayableAccount"
- label="Purchase Tax Payable"
- options={balanceSheetAccountOptions}
- />
- <Select
- name="reverseChargeSalesTaxPayableAccount"
- label="Reverse Charge Sales Tax"
- options={balanceSheetAccountOptions}
- />
+ <Select
+ name="prepaymentAccount"
+ label="Prepayments"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="payablesAccount"
+ label="Payables"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="inventoryReceivedNotInvoicedAccount"
+ label="Inventory Received Not Invoiced"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="inventoryShippedNotInvoicedAccount"
+ label="Inventory Shipped Not Invoiced"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="salesTaxPayableAccount"
+ label="Sales Tax Payable"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="purchaseTaxPayableAccount"
+ label="Purchase Tax Payable"
+ options={balanceSheetAccountOptions}
+ />
+ <Select
+ name="reverseChargeSalesTaxPayableAccount"
+ label="Reverse Charge Sales Tax"
+ options={balanceSheetAccountOptions}
+ />
- <Select
- name="retainedEarningsAccount"
- label="Retained Earnings"
- options={balanceSheetAccountOptions}
- />
- </div>
- </CardContent>
- </Card>
- </VStack>
- </TabsContent>
- </Tabs>
-
- <HStack>
- <Submit isDisabled={isDisabled}>Save</Submit>
- <Button size="md" variant="solid" onClick={onClose}>
- Cancel
- </Button>
- </HStack>
+ <Select
+ name="retainedEarningsAccount"
+ label="Retained Earnings"
+ options={balanceSheetAccountOptions}
+ />
+ </div>
+ </TabsContent>
+ </Tabs>
+ </CardContent>
+ <CardFooter>
+ <HStack>
+ <Submit isDisabled={isDisabled}>Save</Submit>
+ <Button size="md" variant="solid" onClick={onClose}>
+ Cancel
+ </Button>
+ </HStack>
+ </CardFooter>
</ValidatedForm>
- </VStack>
+ </Card>
);
};
diff --git a/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx b/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx
index 183040ba75..8a1bc651f3 100644
--- a/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx
+++ b/apps/carbon/app/modules/accounting/ui/FiscalYear/FiscalYearSettingsForm.tsx
@@ -1,4 +1,11 @@
-import { VStack } from "@carbon/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import type { z } from "zod";
import { Select, Submit } from "~/components/Form";
@@ -16,26 +23,33 @@ const FiscalYearSettingsForm = ({
}: FiscalYearSettingsFormProps) => {
const permissions = usePermissions();
return (
- <div className="w-full">
+ <Card>
<ValidatedForm
method="post"
action={path.to.fiscalYears}
defaultValues={initialValues}
validator={fiscalYearSettingsValidator}
>
- <VStack spacing={4} className="my-4 w-full max-w-[440px]">
- <Select
- name="startMonth"
- label="Start of Fiscal Year"
- options={months.map((month) => ({ label: month, value: month }))}
- helperText="This is the month your fiscal year starts."
- />
- <Select
- name="taxStartMonth"
- label="Start of Tax Year"
- options={months.map((month) => ({ label: month, value: month }))}
- helperText="This is the month your tax year starts."
- />
+ <CardHeader>
+ <CardTitle>Fiscal Year Settings</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <VStack spacing={4} className="my-4 w-full max-w-[440px]">
+ <Select
+ name="startMonth"
+ label="Start of Fiscal Year"
+ options={months.map((month) => ({ label: month, value: month }))}
+ helperText="This is the month your fiscal year starts."
+ />
+ <Select
+ name="taxStartMonth"
+ label="Start of Tax Year"
+ options={months.map((month) => ({ label: month, value: month }))}
+ helperText="This is the month your tax year starts."
+ />
+ </VStack>
+ </CardContent>
+ <CardFooter>
<Submit
isDisabled={
!permissions.can("update", "accounting") ||
@@ -44,9 +58,9 @@ const FiscalYearSettingsForm = ({
>
Save
</Submit>
- </VStack>
+ </CardFooter>
</ValidatedForm>
- </div>
+ </Card>
);
};
diff --git a/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx b/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx
index b559d10222..8259c8f0c8 100644
--- a/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx
+++ b/apps/carbon/app/modules/settings/ui/Company/CompanyForm.tsx
@@ -1,12 +1,4 @@
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
- VStack,
-} from "@carbon/react";
+import { VStack } from "@carbon/react";
import { ValidatedForm } from "@carbon/remix-validated-form";
import type { z } from "zod";
import { Hidden, Input, Submit } from "~/components/Form";
@@ -19,43 +11,34 @@ type CompanyFormProps = {
const CompanyForm = ({ company }: CompanyFormProps) => {
return (
- <Card>
+ <>
<ValidatedForm
method="post"
action={path.to.company}
validator={companyValidator}
defaultValues={company}
>
- <CardHeader>
- <CardTitle>Company</CardTitle>
- <CardDescription>
- This information will be displayed on document headers.
- </CardDescription>
- </CardHeader>
- <CardContent>
- <VStack spacing={4} className="my-4">
- <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full">
- <Input name="name" label="Company Name" />
- <Input name="taxId" label="Tax ID" />
- <Input name="addressLine1" label="Address Line 1" />
- <Input name="addressLine2" label="Address Line 2" />
- <Input name="city" label="City" />
- <Input name="state" label="State" />
- <Input name="postalCode" label="Postal Code" />
- <Input name="countryCode" label="Country" />
- <Input name="phone" label="Phone Number" />
- <Input name="fax" label="Fax Number" />
- <Input name="email" label="Email" />
- <Input name="website" label="Website" />
- </div>
- <Hidden name="intent" value="about" />
- </VStack>
- </CardContent>
- <CardFooter>
+ <Hidden name="intent" value="about" />
+
+ <VStack spacing={4} className="p-4">
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full">
+ <Input name="name" label="Company Name" />
+ <Input name="taxId" label="Tax ID" />
+ <Input name="addressLine1" label="Address Line 1" />
+ <Input name="addressLine2" label="Address Line 2" />
+ <Input name="city" label="City" />
+ <Input name="state" label="State" />
+ <Input name="postalCode" label="Postal Code" />
+ <Input name="countryCode" label="Country" />
+ <Input name="phone" label="Phone Number" />
+ <Input name="fax" label="Fax Number" />
+ <Input name="email" label="Email" />
+ <Input name="website" label="Website" />
+ </div>
<Submit>Save</Submit>
- </CardFooter>
+ </VStack>
</ValidatedForm>
- </Card>
+ </>
);
};
diff --git a/apps/carbon/app/modules/settings/ui/useSettingsSubmodules.tsx b/apps/carbon/app/modules/settings/ui/useSettingsSubmodules.tsx
index dd6d121858..efd75e2fbc 100644
--- a/apps/carbon/app/modules/settings/ui/useSettingsSubmodules.tsx
+++ b/apps/carbon/app/modules/settings/ui/useSettingsSubmodules.tsx
@@ -12,7 +12,7 @@ const settingsRoutes: AuthenticatedRouteGroup[] = [
name: "Company",
routes: [
{
- name: "Business",
+ name: "Company",
to: path.to.company,
role: "employee",
icon: <TbBuildingFactory2 />,
diff --git a/apps/carbon/app/routes/x+/account+/_layout.tsx b/apps/carbon/app/routes/x+/account+/_layout.tsx
index d5fdeb1ec0..a77c49dc81 100644
--- a/apps/carbon/app/routes/x+/account+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/account+/_layout.tsx
@@ -22,7 +22,7 @@ export default function AccountRoute() {
return (
<div className="grid w-full h-full grid-cols-[auto_1fr]">
<ContentSidebar links={links} />
- <VStack spacing={0} className="h-full p-8 bg-background">
+ <VStack spacing={0} className="h-full p-4">
<Outlet />
</VStack>
</div>
diff --git a/apps/carbon/app/routes/x+/account+/password.tsx b/apps/carbon/app/routes/x+/account+/password.tsx
index fe12966b2b..2ef7291d90 100644
--- a/apps/carbon/app/routes/x+/account+/password.tsx
+++ b/apps/carbon/app/routes/x+/account+/password.tsx
@@ -1,7 +1,6 @@
import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
-import { PageTitle } from "~/components/Layout";
import { getSupabaseServiceRole } from "~/lib/supabase";
import { PasswordForm, accountPasswordValidator } from "~/modules/account";
import { requirePermissions } from "~/services/auth";
@@ -65,13 +64,5 @@ export async function action({ request }: ActionFunctionArgs) {
}
export default function AccountPassword() {
- return (
- <>
- <PageTitle
- title="Change Password"
- subtitle="Make sure it's at least 12 characters"
- />
- <PasswordForm />
- </>
- );
+ return <PasswordForm />;
}
diff --git a/apps/carbon/app/routes/x+/account+/personal.tsx b/apps/carbon/app/routes/x+/account+/personal.tsx
index 8d5725c258..c54c7726a6 100644
--- a/apps/carbon/app/routes/x+/account+/personal.tsx
+++ b/apps/carbon/app/routes/x+/account+/personal.tsx
@@ -8,7 +8,6 @@ import {
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { PageTitle } from "~/components/Layout";
import type { PrivateAttributes } from "~/modules/account";
import { UserAttributesForm, getPrivateAttributes } from "~/modules/account";
import { requirePermissions } from "~/services/auth";
@@ -45,31 +44,25 @@ export async function loader({ request }: LoaderFunctionArgs) {
export default function AccountPersonal() {
const { attributes } = useLoaderData<typeof loader>();
return (
- <>
- <PageTitle
- title="Personal Data"
- subtitle="This information is private and can only be seen by you and authorized employees."
- />
- <VStack spacing={8}>
- {attributes.length ? (
- attributes.map((category: PrivateAttributes) => (
- <Card key={category.id}>
- <CardHeader>
- <CardTitle>{category.name}</CardTitle>
- </CardHeader>
- <CardContent>
- <UserAttributesForm attributeCategory={category} />
- </CardContent>
- </Card>
- ))
- ) : (
- <Card>
- <CardContent className="text-muted-foreground w-full py-8 text-center">
- No private attributes
+ <VStack spacing={4}>
+ {attributes.length ? (
+ attributes.map((category: PrivateAttributes) => (
+ <Card key={category.id}>
+ <CardHeader>
+ <CardTitle>{category.name}</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <UserAttributesForm attributeCategory={category} />
</CardContent>
</Card>
- )}
- </VStack>
- </>
+ ))
+ ) : (
+ <Card>
+ <CardContent className="text-muted-foreground w-full py-8 text-center">
+ No private attributes
+ </CardContent>
+ </Card>
+ )}
+ </VStack>
);
}
diff --git a/apps/carbon/app/routes/x+/account+/profile.tsx b/apps/carbon/app/routes/x+/account+/profile.tsx
index 759c44efc5..d8a4817d4e 100644
--- a/apps/carbon/app/routes/x+/account+/profile.tsx
+++ b/apps/carbon/app/routes/x+/account+/profile.tsx
@@ -1,6 +1,7 @@
import {
Card,
CardContent,
+ CardDescription,
CardHeader,
CardTitle,
VStack,
@@ -9,7 +10,6 @@ import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { PageTitle } from "~/components/Layout";
import {
ProfileForm,
ProfilePhotoForm,
@@ -130,38 +130,43 @@ export default function AccountProfile() {
const { user, attributes } = useLoaderData<typeof loader>();
return (
- <>
- <PageTitle
- title="Profile"
- subtitle="This information will be visible to all users, so be careful what you
- share."
- />
- <div className="grid grid-cols-1 md:grid-cols-[1fr_auto] gap-8 w-full">
- <VStack spacing={8}>
- <ProfileForm user={user} />
- {attributes.length ? (
- <>
- {attributes.map((category) => (
- <Card key={category.id}>
- <CardHeader>
- <CardTitle>{category.name}</CardTitle>
- </CardHeader>
- <CardContent>
- <UserAttributesForm attributeCategory={category} />
- </CardContent>
- </Card>
- ))}
- </>
- ) : (
- <Card>
- <CardContent className="text-muted-foreground w-full text-center py-8">
- No public attributes
+ <VStack spacing={4}>
+ <Card>
+ <CardHeader>
+ <CardTitle>Profile</CardTitle>
+ <CardDescription>
+ This information will be visible to all users, so be careful what
+ you share.
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <div className="grid grid-cols-1 md:grid-cols-[1fr_auto] gap-4 w-full">
+ <ProfileForm user={user} />
+ <ProfilePhotoForm user={user} />
+ </div>
+ </CardContent>
+ </Card>
+
+ {attributes.length ? (
+ <>
+ {attributes.map((category) => (
+ <Card key={category.id}>
+ <CardHeader>
+ <CardTitle>{category.name}</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <UserAttributesForm attributeCategory={category} />
</CardContent>
</Card>
- )}
- </VStack>
- <ProfilePhotoForm user={user} />
- </div>
- </>
+ ))}
+ </>
+ ) : (
+ <Card>
+ <CardContent className="text-muted-foreground w-full text-center py-8">
+ No public attributes
+ </CardContent>
+ </Card>
+ )}
+ </VStack>
);
}
diff --git a/apps/carbon/app/routes/x+/accounting+/defaults.tsx b/apps/carbon/app/routes/x+/accounting+/defaults.tsx
index df78234d0d..26bc542f74 100644
--- a/apps/carbon/app/routes/x+/accounting+/defaults.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/defaults.tsx
@@ -3,7 +3,6 @@ import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { PageTitle } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type { AccountListItem } from "~/modules/accounting";
import {
@@ -88,12 +87,7 @@ export default function AccountDefaultsRoute() {
}>(path.to.accounting);
return (
- <VStack className="bg-background h-full p-4 overflow-y-auto">
- <PageTitle
- title="Account Defaults"
- subtitle="These accounts will be used to prepopulate posting grous when a new customer type, supplier type, part group, or location is created."
- />
-
+ <VStack className="h-full p-4 overflow-y-auto">
<AccountDefaultsForm
balanceSheetAccounts={routeData?.balanceSheetAccounts ?? []}
incomeStatementAccounts={routeData?.incomeStatementAccounts ?? []}
diff --git a/apps/carbon/app/routes/x+/accounting+/years.tsx b/apps/carbon/app/routes/x+/accounting+/years.tsx
index 8b42846a4a..eb8b23082e 100644
--- a/apps/carbon/app/routes/x+/accounting+/years.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/years.tsx
@@ -3,7 +3,6 @@ import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
-import { PageTitle } from "~/components/Layout";
import {
FiscalYearSettingsForm,
fiscalYearSettingsValidator,
@@ -84,11 +83,7 @@ export default function FiscalYearSettingsRoute() {
};
return (
- <VStack spacing={0} className="h-full bg-background p-8">
- <PageTitle
- title="Fiscal Year Settings"
- subtitle="Define the month when your fiscal year starts"
- />
+ <VStack spacing={0} className="h-full p-4">
<FiscalYearSettingsForm initialValues={initialValues} />
</VStack>
);
diff --git a/apps/carbon/app/routes/x+/settings+/company.tsx b/apps/carbon/app/routes/x+/settings+/company.tsx
index b08a28e87b..af986db8b6 100644
--- a/apps/carbon/app/routes/x+/settings+/company.tsx
+++ b/apps/carbon/app/routes/x+/settings+/company.tsx
@@ -1,4 +1,11 @@
-import { VStack } from "@carbon/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
import { validationError, validator } from "@carbon/remix-validated-form";
import type { ActionFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
@@ -107,10 +114,20 @@ export default function Company() {
return (
<VStack spacing={0} className="p-4 h-full">
- <div className="grid grid-cols-1 md:grid-cols-[1fr_auto] gap-4 w-full">
- <CompanyForm company={initialValues} />
- <CompanyLogoForm company={company} />
- </div>
+ <Card>
+ <CardHeader>
+ <CardTitle>Company</CardTitle>
+ <CardDescription>
+ This information will be used on document headers
+ </CardDescription>
+ </CardHeader>
+ <CardContent>
+ <div className="grid grid-cols-1 md:grid-cols-[1fr_auto] gap-4 w-full">
+ <CompanyForm company={initialValues} />
+ <CompanyLogoForm company={company} />
+ </div>
+ </CardContent>
+ </Card>
</VStack>
);
}