updated Automation Modal and translations

This commit is contained in:
smilerz 2023-08-31 13:51:46 -05:00
parent 4120adc546
commit 8bae21025b
No known key found for this signature in database
GPG Key ID: 39444C7606D47126
2 changed files with 52 additions and 46 deletions

View File

@ -529,5 +529,8 @@
"Create Recipe": "Create Recipe",
"Import Recipe": "Import Recipe",
"Never_Unit": "Never Unit",
"Transpose_Words": "Transpose Words"
"Transpose_Words": "Transpose Words",
"Title_Replace":"Title Replace",
"Food_Replace":"Food Replace",
"Unit_Replace":"Unit Replace"
}

View File

@ -23,7 +23,7 @@ export class Models {
false: undefined,
},
},
tree: {default: undefined},
tree: { default: undefined },
},
},
delete: {
@ -50,7 +50,7 @@ export class Models {
type: "lookup",
field: "target",
list: "self",
sticky_options: [{id: 0, name: "tree_root"}],
sticky_options: [{ id: 0, name: "tree_root" }],
},
},
},
@ -71,7 +71,7 @@ export class Models {
food_onhand: true,
shopping: true,
},
tags: [{field: "supermarket_category", label: "name", color: "info"}],
tags: [{ field: "supermarket_category", label: "name", color: "info" }],
// REQUIRED: unordered array of fields that can be set during create
create: {
// if not defined partialUpdate will use the same parameters, prepending 'id'
@ -177,7 +177,7 @@ export class Models {
field: "substitute_siblings",
label: "substitute_siblings", // form.label always translated in utils.getForm()
help_text: "substitute_siblings_help", // form.help_text always translated
condition: {field: "parent", value: true, condition: "field_exists"},
condition: { field: "parent", value: true, condition: "field_exists" },
},
substitute_children: {
form_field: true,
@ -186,7 +186,7 @@ export class Models {
field: "substitute_children",
label: "substitute_children",
help_text: "substitute_children_help",
condition: {field: "numchild", value: 0, condition: "gt"},
condition: { field: "numchild", value: 0, condition: "gt" },
},
inherit_fields: {
form_field: true,
@ -196,7 +196,7 @@ export class Models {
field: "inherit_fields",
list: "FOOD_INHERIT_FIELDS",
label: "InheritFields",
condition: {field: "food_children_exist", value: true, condition: "preference_equals"},
condition: { field: "food_children_exist", value: true, condition: "preference_equals" },
help_text: "InheritFields_help",
},
child_inherit_fields: {
@ -207,7 +207,7 @@ export class Models {
field: "child_inherit_fields",
list: "FOOD_INHERIT_FIELDS",
label: "ChildInheritFields", // form.label always translated in utils.getForm()
condition: {field: "numchild", value: 0, condition: "gt"},
condition: { field: "numchild", value: 0, condition: "gt" },
help_text: "ChildInheritFields_help", // form.help_text always translated
},
reset_inherit: {
@ -217,7 +217,7 @@ export class Models {
field: "reset_inherit",
label: "reset_children",
help_text: "reset_children_help",
condition: {field: "numchild", value: 0, condition: "gt"},
condition: { field: "numchild", value: 0, condition: "gt" },
},
form_function: "FoodCreateDefault",
},
@ -304,24 +304,24 @@ export class Models {
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"},
{ 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",
@ -457,7 +457,7 @@ export class Models {
static SUPERMARKET = {
name: "Supermarket",
apiName: "Supermarket",
ordered_tags: [{field: "category_to_supermarket", label: "category::name", color: "info"}],
ordered_tags: [{ field: "category_to_supermarket", label: "category::name", color: "info" }],
create: {
params: [["name", "description", "category_to_supermarket"]],
form: {
@ -540,13 +540,16 @@ export class Models {
form_field: true,
type: "choice",
options: [
{value: "FOOD_ALIAS", text: "Food_Alias"},
{value: "UNIT_ALIAS", text: "Unit_Alias"},
{value: "KEYWORD_ALIAS", text: "Keyword_Alias"},
{value: "DESCRIPTION_REPLACE", text: "Description_Replace"},
{value: "INSTRUCTION_REPLACE", text: "Instruction_Replace"},
{value: "NEVER_UNIT", text: "Never_Unit"},
{value: "TRANSPOSE_WORDS", text: "Transpose_Words"},
{ value: "FOOD_ALIAS", text: "Food_Alias" },
{ value: "UNIT_ALIAS", text: "Unit_Alias" },
{ value: "KEYWORD_ALIAS", text: "Keyword_Alias" },
{ value: "DESCRIPTION_REPLACE", text: "Description_Replace" },
{ value: "INSTRUCTION_REPLACE", text: "Instruction_Replace" },
{ value: "TITLE_REPLACE", text: "Title_Replace" },
{ value: "FOOD_REPLACE", text: "Food_Replace" },
{ value: "UNIT_REPLACE", text: "Unit_Replace" },
{ value: "NEVER_UNIT", text: "Never_Unit" },
{ value: "TRANSPOSE_WORDS", text: "Transpose_Words" },
],
field: "type",
label: "Type",
@ -1009,7 +1012,7 @@ export class Actions {
},
],
},
ok_label: {function: "translate", phrase: "Save"},
ok_label: { function: "translate", phrase: "Save" },
},
}
static UPDATE = {
@ -1044,7 +1047,7 @@ export class Actions {
},
],
},
ok_label: {function: "translate", phrase: "Delete"},
ok_label: { function: "translate", phrase: "Delete" },
instruction: {
form_field: true,
type: "instruction",
@ -1071,17 +1074,17 @@ export class Actions {
suffix: "s",
params: ["query", "page", "pageSize", "options"],
config: {
query: {default: undefined},
page: {default: 1},
pageSize: {default: 25},
query: { default: undefined },
page: { default: 1 },
pageSize: { default: 25 },
},
}
static MERGE = {
function: "merge",
params: ["source", "target"],
config: {
source: {type: "string"},
target: {type: "string"},
source: { type: "string" },
target: { type: "string" },
},
form: {
title: {
@ -1096,7 +1099,7 @@ export class Actions {
},
],
},
ok_label: {function: "translate", phrase: "Merge"},
ok_label: { function: "translate", phrase: "Merge" },
instruction: {
form_field: true,
type: "instruction",
@ -1130,8 +1133,8 @@ export class Actions {
function: "move",
params: ["source", "target"],
config: {
source: {type: "string"},
target: {type: "string"},
source: { type: "string" },
target: { type: "string" },
},
form: {
title: {
@ -1146,7 +1149,7 @@ export class Actions {
},
],
},
ok_label: {function: "translate", phrase: "Move"},
ok_label: { function: "translate", phrase: "Move" },
instruction: {
form_field: true,
type: "instruction",