feat: Add 3dfilamentprofiles.com integration (Issue #7)
Some checks failed
CI / style (push) Has been cancelled
CI / build-client (push) Has been cancelled
CI / build-amd64 (push) Has been cancelled
CI / build-tester (push) Has been cancelled
CI / test (cockroachdb) (push) Has been cancelled
CI / test (mariadb) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / test (sqlite) (push) Has been cancelled
CI / build-arm64 (push) Has been cancelled
CI / build-armv7 (push) Has been cancelled
CI / publish-images (push) Has been cancelled
CI / publish-release (push) Has been cancelled

- Backend: Added ExternalSource enum, Filament3DFP model, and transform function
- Backend: Updated _sync() to fetch from both SpoolmanDB and 3dfilamentprofiles
- Frontend: Added source tabs to FilamentImportModal (All/SpoolmanDB/3DFP)
- Frontend: Updated ExternalFilament interface with source and temp range fields
- Frontend: Updated filament import handler to use temp range fields

Also includes:
- Dev mode styling (teal theme, DEV badge and banner)
- Translation keys for source filtering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 21:03:25 -06:00
parent 6d0ecec068
commit 671d3bd3d1
11 changed files with 447 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
import { MinusOutlined, PlusOutlined } from "@ant-design/icons";
import { Create, useForm } from "@refinedev/antd";
import { HttpError, IResourceComponentsProps, useInvalidate, useTranslate } from "@refinedev/core";
import { HttpError, IResourceComponentsProps, useTranslate } from "@refinedev/core";
import { Alert, Button, DatePicker, Divider, Form, Input, InputNumber, Radio, Select, Typography } from "antd";
import TextArea from "antd/es/input/TextArea";
import dayjs from "dayjs";
@@ -33,7 +33,6 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
const t = useTranslate();
const extraFields = useGetFields(EntityType.spool);
const currency = useCurrency();
const invalidate = useInvalidate();
const [isFilamentModalOpen, setIsFilamentModalOpen] = useState(false);
const { form, formProps, formLoading, onFinish, redirect } = useForm<
@@ -82,14 +81,12 @@ export const SpoolCreate: React.FC<IResourceComponentsProps & CreateOrCloneProps
internalSelectOptions,
externalSelectOptions,
allExternalFilaments,
refetch: refetchFilaments,
} = useGetFilamentSelectOptions();
const handleFilamentCreated = async (filament: IFilament) => {
// Invalidate filament cache so the select options refresh
await invalidate({
resource: "filament",
invalidates: ["list"],
});
// Refetch filament list so the select options include the new filament
await refetchFilaments();
// Select the newly created filament
form.setFieldValue("filament_id", filament.id);
setIsFilamentModalOpen(false);