From 3aed735ceae4d6b5de153a4f92bece08987a8cf3 Mon Sep 17 00:00:00 2001 From: Matt Gerega Date: Tue, 26 Mar 2024 21:26:41 -0400 Subject: [PATCH] Updated vendor API to correct issues - Implement new UI --- client/public/locales/en/common.json | 4 ++++ client/src/pages/vendors/create.tsx | 18 +++++++++++++++++- client/src/pages/vendors/edit.tsx | 18 +++++++++++++++++- client/src/pages/vendors/list.tsx | 13 +++++++++++-- client/src/pages/vendors/model.tsx | 1 + client/src/pages/vendors/show.tsx | 2 ++ spoolman/api/v1/models.py | 2 ++ spoolman/api/v1/vendor.py | 11 ++++++----- spoolman/database/vendor.py | 2 ++ 9 files changed, 62 insertions(+), 9 deletions(-) diff --git a/client/public/locales/en/common.json b/client/public/locales/en/common.json index 53160f8..16d7800 100644 --- a/client/public/locales/en/common.json +++ b/client/public/locales/en/common.json @@ -227,9 +227,13 @@ "fields": { "id": "ID", "name": "Name", + "empty_spool_weight": "Empty Spool Weight", "registered": "Registered", "comment": "Comment" }, + "fields_help": { + "empty_spool_weight": "The weight of an empty spool from this vendor." + }, "titles": { "create": "Create Vendor", "clone": "Clone Vendor", diff --git a/client/src/pages/vendors/create.tsx b/client/src/pages/vendors/create.tsx index 9649ccd..69ac0ae 100644 --- a/client/src/pages/vendors/create.tsx +++ b/client/src/pages/vendors/create.tsx @@ -1,7 +1,7 @@ import React from "react"; import { HttpError, IResourceComponentsProps, useTranslate } from "@refinedev/core"; import { Create, useForm } from "@refinedev/antd"; -import { Button, Form, Input, Typography } from "antd"; +import { Button, Form, Input, Typography, InputNumber } from "antd"; import TextArea from "antd/es/input/TextArea"; import { IVendor, IVendorParsedExtras } from "./model"; import { EntityType, useGetFields } from "../../utils/queryFields"; @@ -85,6 +85,22 @@ export const VendorCreate: React.FC