added base unit to unit editor

This commit is contained in:
vabene1111
2023-07-18 13:54:35 +02:00
parent a8f1cd26cd
commit 1f10a66c74
3 changed files with 50 additions and 2 deletions

View File

@ -281,7 +281,7 @@ export class Models {
apiName: "Unit",
paginated: true,
create: {
params: [["name", "plural_name", "description", "open_data_slug",]],
params: [["name", "plural_name", "description", "base_unit","open_data_slug",]],
form: {
show_help: true,
name: {
@ -307,6 +307,34 @@ export class Models {
placeholder: "",
optional: true,
},
base_unit: {
form_field: true,
type: "choice",
options: [
{value: "g", text: "g"},
{value: "kg", text: "kg"},
{value: "ounce", text: "ounce"},
{value: "pound", text: "pound"},
{value: "ml", text: "ml"},
{value: "l", text: "l"},
{value: "fluid_ounce", text: "fluid_ounce"},
{value: "pint", text: "pint"},
{value: "quart", text: "quart"},
{value: "gallon", text: "gallon"},
{value: "tbsp", text: "tbsp"},
{value: "tsp", text: "tsp"},
{value: "imperial_fluid_ounce", text: "imperial_fluid_ounce"},
{value: "imperial_pint", text: "imperial_pint"},
{value: "imperial_quart", text: "imperial_quart"},
{value: "imperial_gallon", text: "imperial_gallon"},
{value: "imperial_tbsp", text: "imperial_tbsp"},
{value: "imperial_tsp", text: "imperial_tsp"},
],
field: "base_unit",
label: "Base Unit",
placeholder: "",
optional: true,
},
open_data_slug: {
form_field: true,
type: "text",