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.

feat: add priority to issue properties sidebar

Brad Barbinb072bc97b464
diff --git a/apps/academy/app/routes/challenge+/$id.tsx b/apps/academy/app/routes/challenge+/$id.tsx
index 2d72c3b6d0..de23c48fbd 100644
--- a/apps/academy/app/routes/challenge+/$id.tsx
+++ b/apps/academy/app/routes/challenge+/$id.tsx
@@ -1,6 +1,5 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import { Alert, AlertDescription, AlertTitle, Button, cn } from "@carbon/react";
-import type { ActionFunctionArgs } from "@remix-run/node";
import {
Form,
Link,
@@ -8,6 +7,7 @@ import {
useParams,
useSubmit,
} from "@remix-run/react";
+import type { ActionFunctionArgs } from "@vercel/remix";
import { useEffect, useMemo, useRef, useState } from "react";
import ConfettiExplosion from "react-confetti-explosion";
import {
diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
index de6bb6e9a3..fb66f16b06 100644
--- a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
+++ b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx
@@ -31,10 +31,11 @@ import { path } from "~/utils/path";
import { copyToClipboard } from "~/utils/string";
import {
nonConformanceApprovalRequirement,
+ nonConformancePriority,
nonConformanceSource,
} from "../../quality.models";
import type { Issue } from "../../types";
-import { getSourceIcon } from "./IssueIcons";
+import { getPriorityIcon, getSourceIcon } from "./IssueIcons";
const IssueProperties = () => {
const { id } = useParams();
@@ -356,6 +357,47 @@ const IssueProperties = () => {
/>
</ValidatedForm>
+ <ValidatedForm
+ defaultValues={{
+ priority: routeData?.nonConformance?.priority ?? "",
+ }}
+ validator={z.object({
+ priority: z.string().optional(),
+ })}
+ className="w-full"
+ >
+ <Select
+ options={nonConformancePriority.map((priority) => ({
+ value: priority,
+ label: (
+ <div className="flex gap-2 items-center">
+ {getPriorityIcon(priority, false)}
+ <span>{priority}</span>
+ </div>
+ ),
+ }))}
+ isReadOnly={disableStructureUpdate}
+ label="Priority"
+ name="priority"
+ inline={(value, options) => {
+ return (
+ <div className="flex gap-2 items-center">
+ {getPriorityIcon(
+ value as "Low" | "Medium" | "High" | "Critical",
+ false
+ )}
+ <span>{value}</span>
+ </div>
+ );
+ }}
+ onChange={(value) => {
+ if (value) {
+ onUpdate("priority", value.value);
+ }
+ }}
+ />
+ </ValidatedForm>
+
<ValidatedForm
defaultValues={{
investigationTypeIds:
diff --git a/apps/erp/app/routes/x+/issue+/$id.actions.tsx b/apps/erp/app/routes/x+/issue+/$id.actions.tsx
index 0c8fe0bc02..8afef52ca1 100644
--- a/apps/erp/app/routes/x+/issue+/$id.actions.tsx
+++ b/apps/erp/app/routes/x+/issue+/$id.actions.tsx
@@ -7,8 +7,8 @@ import {
HStack,
VStack,
} from "@carbon/react";
-import { json, type LoaderFunctionArgs } from "@remix-run/node";
import { useLoaderData, useParams } from "@remix-run/react";
+import { json, type LoaderFunctionArgs } from "@vercel/remix";
import { useRouteData } from "~/hooks";
import type { Issue, IssueActionTask } from "~/modules/quality";
diff --git a/apps/erp/app/routes/x+/issue+/$id.investigations.tsx b/apps/erp/app/routes/x+/issue+/$id.investigations.tsx
index 005a12a29c..916a21bc34 100644
--- a/apps/erp/app/routes/x+/issue+/$id.investigations.tsx
+++ b/apps/erp/app/routes/x+/issue+/$id.investigations.tsx
@@ -7,8 +7,8 @@ import {
HStack,
VStack,
} from "@carbon/react";
-import { json, type LoaderFunctionArgs } from "@remix-run/node";
import { useLoaderData, useParams } from "@remix-run/react";
+import { json, type LoaderFunctionArgs } from "@vercel/remix";
import { useRouteData } from "~/hooks";
import type { Issue, IssueInvestigationTask } from "~/modules/quality";
diff --git a/apps/erp/app/routes/x+/issue+/$id.review.tsx b/apps/erp/app/routes/x+/issue+/$id.review.tsx
index 5fc562a7ae..b44697f666 100644
--- a/apps/erp/app/routes/x+/issue+/$id.review.tsx
+++ b/apps/erp/app/routes/x+/issue+/$id.review.tsx
@@ -17,9 +17,9 @@ import {
useDisclosure,
VStack,
} from "@carbon/react";
-import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
-import { json } from "@remix-run/node";
import { useFetcher, useLoaderData, useParams } from "@remix-run/react";
+import type { ActionFunctionArgs, LoaderFunctionArgs } from "@vercel/remix";
+import { json } from "@vercel/remix";
import { LuCirclePlus } from "react-icons/lu";
import { assertIsPost, error } from "@carbon/auth";
diff --git a/apps/erp/app/routes/x+/issue+/action.$id.due-date.tsx b/apps/erp/app/routes/x+/issue+/action.$id.due-date.tsx
index 18b248e726..d41cc394d4 100644
--- a/apps/erp/app/routes/x+/issue+/action.$id.due-date.tsx
+++ b/apps/erp/app/routes/x+/issue+/action.$id.due-date.tsx
@@ -1,6 +1,6 @@
import { requirePermissions } from "@carbon/auth/auth.server";
import { validator } from "@carbon/form";
-import { json, type ActionFunctionArgs } from "@remix-run/node";
+import { json, type ActionFunctionArgs } from "@vercel/remix";
import { z } from "zod";
import { zfd } from "zod-form-data";
diff --git a/apps/erp/vite.config.ts b/apps/erp/vite.config.ts
index 10d9e54d86..c6724ca001 100644
--- a/apps/erp/vite.config.ts
+++ b/apps/erp/vite.config.ts
@@ -33,6 +33,7 @@ export default defineConfig({
},
server: {
port: 3000,
+ allowedHosts: ["c533ec99d947.ngrok-free.app"],
},
plugins: [
remix({
diff --git a/package-lock.json b/package-lock.json
index 8d1ecf2e66..afe2ed4d3d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -27,6 +27,74 @@
"turbo": "^1.13.2"
}
},
+ "apps/academy": {
+ "dependencies": {
+ "@carbon/auth": "*",
+ "@carbon/database": "*",
+ "@carbon/documents": "*",
+ "@carbon/form": "*",
+ "@carbon/kv": "*",
+ "@carbon/logger": "*",
+ "@carbon/react": "*",
+ "@carbon/utils": "*",
+ "@react-aria/i18n": "^3.11.0",
+ "@remix-run/dev": "~2.11.2",
+ "@remix-run/eslint-config": "~2.11.2",
+ "@remix-run/react": "~2.11.2",
+ "@remix-run/serve": "~2.11.2",
+ "@supabase/functions-js": "2.1.5",
+ "@supabase/supabase-js": "^2.40.0",
+ "@tailwindcss/container-queries": "^0.1.1",
+ "@tailwindcss/forms": "^0.5.7",
+ "@tailwindcss/line-clamp": "^0.4.4",
+ "@tailwindcss/typography": "^0.5.10",
+ "@upstash/ratelimit": "^2.0.5",
+ "@vercel/analytics": "^1.2.2",
+ "@vercel/remix": "2.11.2",
+ "framer-motion": "^11.1.7",
+ "isbot": "3.6.13",
+ "non.geist": "~1.0.3",
+ "react": "^18.3.1",
+ "react-confetti-explosion": "^3.0.3",
+ "react-dom": "^18.3.1",
+ "react-dropzone": "^14.2.3",
+ "react-hotkeys-hook": "~4.5.0",
+ "react-icons": "^5.4.0",
+ "tailwind-merge": "^2.2.1",
+ "tailwindcss-animate": "^1.0.7",
+ "zod": "^3.24.1",
+ "zod-form-data": "*"
+ },
+ "devDependencies": {
+ "@carbon/tailwind": "*",
+ "@carbon/tsconfig": "*",
+ "@types/react": "^18.2.74",
+ "@types/react-dom": "^18.2.24",
+ "autoprefixer": "10.4.14",
+ "cross-env": "7.0.3",
+ "nodemon": "^3.0.1",
+ "npm-run-all": "^4.1.5",
+ "postcss": "^8.4.33",
+ "tailwind-scrollbar": "^2.0.1",
+ "tailwind-scrollbar-hide": "^1.1.7",
+ "tailwindcss": "3.4.6",
+ "typescript": "^5.2.2",
+ "vite": "^5.3.3",
+ "vite-tsconfig-paths": "^4.3.2",
+ "wait-on": "7.2.0"
+ }
+ },
+ "apps/academy/node_modules/@upstash/ratelimit": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@upstash/ratelimit/-/ratelimit-2.0.5.tgz",
+ "integrity": "sha512-1FRv0cs3ZlBjCNOCpCmKYmt9BYGIJf0J0R3pucOPE88R21rL7jNjXG+I+rN/BVOvYJhI9niRAS/JaSNjiSICxA==",
+ "dependencies": {
+ "@upstash/core-analytics": "^0.0.10"
+ },
+ "peerDependencies": {
+ "@upstash/redis": "^1.34.3"
+ }
+ },
"apps/erp": {
"dependencies": {
"@ai-sdk/openai": "~0.0.66",
@@ -310,74 +378,6 @@
"@upstash/redis": "^1.34.3"
}
},
- "apps/academy": {
- "dependencies": {
- "@carbon/auth": "*",
- "@carbon/database": "*",
- "@carbon/documents": "*",
- "@carbon/form": "*",
- "@carbon/kv": "*",
- "@carbon/logger": "*",
- "@carbon/react": "*",
- "@carbon/utils": "*",
- "@react-aria/i18n": "^3.11.0",
- "@remix-run/dev": "~2.11.2",
- "@remix-run/eslint-config": "~2.11.2",
- "@remix-run/react": "~2.11.2",
- "@remix-run/serve": "~2.11.2",
- "@supabase/functions-js": "2.1.5",
- "@supabase/supabase-js": "^2.40.0",
- "@tailwindcss/container-queries": "^0.1.1",
- "@tailwindcss/forms": "^0.5.7",
- "@tailwindcss/line-clamp": "^0.4.4",
- "@tailwindcss/typography": "^0.5.10",
- "@upstash/ratelimit": "^2.0.5",
- "@vercel/analytics": "^1.2.2",
- "@vercel/remix": "2.11.2",
- "framer-motion": "^11.1.7",
- "isbot": "3.6.13",
- "non.geist": "~1.0.3",
- "react": "^18.3.1",
- "react-confetti-explosion": "^3.0.3",
- "react-dom": "^18.3.1",
- "react-dropzone": "^14.2.3",
- "react-hotkeys-hook": "~4.5.0",
- "react-icons": "^5.4.0",
- "tailwind-merge": "^2.2.1",
- "tailwindcss-animate": "^1.0.7",
- "zod": "^3.24.1",
- "zod-form-data": "*"
- },
- "devDependencies": {
- "@carbon/tailwind": "*",
- "@carbon/tsconfig": "*",
- "@types/react": "^18.2.74",
- "@types/react-dom": "^18.2.24",
- "autoprefixer": "10.4.14",
- "cross-env": "7.0.3",
- "nodemon": "^3.0.1",
- "npm-run-all": "^4.1.5",
- "postcss": "^8.4.33",
- "tailwind-scrollbar": "^2.0.1",
- "tailwind-scrollbar-hide": "^1.1.7",
- "tailwindcss": "3.4.6",
- "typescript": "^5.2.2",
- "vite": "^5.3.3",
- "vite-tsconfig-paths": "^4.3.2",
- "wait-on": "7.2.0"
- }
- },
- "apps/academy/node_modules/@upstash/ratelimit": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@upstash/ratelimit/-/ratelimit-2.0.5.tgz",
- "integrity": "sha512-1FRv0cs3ZlBjCNOCpCmKYmt9BYGIJf0J0R3pucOPE88R21rL7jNjXG+I+rN/BVOvYJhI9niRAS/JaSNjiSICxA==",
- "dependencies": {
- "@upstash/core-analytics": "^0.0.10"
- },
- "peerDependencies": {
- "@upstash/redis": "^1.34.3"
- }
- },
"ci": {
"version": "0.0.1",
"dependencies": {
@@ -13430,6 +13430,10 @@
"resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz",
"integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA=="
},
+ "node_modules/academy": {
+ "resolved": "apps/academy",
+ "link": true
+ },
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -34022,10 +34026,6 @@
"node": ">= 10.0.0"
}
},
- "node_modules/academy": {
- "resolved": "apps/academy",
- "link": true
- },
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",