This commit is contained in:
2019-01-08 23:46:53 +00:00
parent ed09326317
commit 4d2b2c0a53
9 changed files with 195 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ Error messages / Numbers
- Make sure Every error has a number and that is documented in the manual
- Locale keys for error numbers?? i.e. E1000, "blah blah error 1000"
Cleanup and sticking to the following code convention:
C# code convention:
All names are PascalCaseOnly with the following two exceptions:
- function paramenter names are ALWAYS camelCased
- CONST values are ALL_CAPS with underlines between for spaces

View File

@@ -16,7 +16,7 @@ UI FEATURE - The ability to customize forms:
- If a dispatcher needs a custom field set on a workorder, a bizadminfull user must login and set that up for them
- When customize is selected a generic form pops up with a list of fields provided by the backend and their current settings and controls
- This form can then be re-used everywhere as it's a stock object and this way we don't need to have a customize form for every existing CRUD form
- Choosing to expose one or more of up to 15 custom fields on form in custom field section that shows when at least one is enabled
- Choosing to expose one or more of up to 16 custom fields on form in custom field section that shows when at least one is enabled
- Set the localized text for the current locale for every existing field and any custom ones enabled
- Set whether a field is visible or not to user
- Some stock fields will never be able to be hidden, they will be "core" fields required for AyaNova operations and will have their hidden checkbox grayed out
@@ -27,7 +27,8 @@ UI FEATURE - The ability to customize forms:
- Client caches the customization data when it first opens the form and then checks if it's changed when it next opens the form
- The route that fetches the FormCustom data needs to accept a query item that is a date or concurrency token so that
if nothing has changed the server returns the unchanged code or instead returns all the data if it is changed to save bandwidth
- RAVEN custom fields start with 1 not zero like in v7
- Import v7 custom0 to RAVEN custom1
## TODO
@@ -42,7 +43,7 @@ UI FEATURE - The ability to customize forms:
- Need a FormAvailableFields static collection class that contains the fields available to each form
- This should be independent from any other class tied to a particular route or controller or db table as it could be some or none of all of those things
- Method: GetFields(FormKey): FormKey, FieldKey (localekey), Core (bool, true means can't be hidden), IsCustom (bool, means it's one of the custom fields that can be set to type etc)
- Method: GetFields(FormKey): FieldKey (localekey), Core (bool, true means can't be hidden), IsCustom (bool, means it's one of the custom fields that can be set to type etc)
- Method: GetForms() returns a list of form names
- Method: IsValidForm(string formKey) bool exists or not

View File

@@ -89,3 +89,8 @@ NOTES FOR DOCS
- PartCategory
- DispatchZone
- ScheduleableUserGroup
- CUSTOM FIELDS
- RAVEN custom fields start with 1 not zero like in v7
- Import v7 custom0 to RAVEN custom1

View File

@@ -14,6 +14,10 @@ Do the stuff in the Client todo first then back to the server as required.
SERVER
- PickListFetcher: WTF? It has a reference to widgetbiz in it, isn't this a generic class??
- Resource localization edit all Custom field locale keys for all langauges and change to be 1 to 16 (remove 0 and add 6 more)
- So, for example ClientCustom0 becomes ClientCustom1 and make sure the display values are identical as right now there are "My Custom0" and "Custom Field 8" in the same bunch
- Copy from WidgetCustom1 to 16 if necessary or for reference
- CUSTOM FIELDS?!
- CUSTOM FIELDS (case 3426)

View File

@@ -0,0 +1,116 @@
using System.Collections.Generic;
namespace AyaNova.Biz
{
public static class FormAvailableFields
{
private const string WIDGET = "widget";
public static List<string> AvailableFormKeys
{
get
{
List<string> l = new List<string>{
WIDGET//,USER_CRUD, WIDGET etc
};
return l;
}
}
public static bool IsValidFormKey(string key)
{
return AvailableFormKeys.Contains(key);
}
public static List<FormField> FormFields(string key)
{
List<FormField> l = new List<FormField>();
switch (key)
{
case WIDGET:
/*"Widget":"Widget",
"WidgetList":"Widgets",
"WidgetName":"Name",
"WidgetSerial":"Serial #",
"WidgetDollarAmount":"Price",
"WidgetCount":"Count",
"WidgetRoles":"Roles",
"WidgetStartDate":"Start",
"WidgetEndDate":"End",
"WidgetNotes":"Notes",
"WidgetCustom1": "Custom1",
"WidgetCustom2": "Custom2",
"WidgetCustom3": "Custom3",
"WidgetCustom4": "Custom4",
"WidgetCustom5": "Custom5",
"WidgetCustom6": "Custom6",
"WidgetCustom7": "Custom7",
"WidgetCustom8": "Custom8",
"WidgetCustom9": "Custom9",
"WidgetCustom10": "Custom10",
"WidgetCustom11": "Custom11",
"WidgetCustom12": "Custom12",
"WidgetCustom13": "Custom13",
"WidgetCustom14": "Custom14",
"WidgetCustom15": "Custom15",
"WidgetCustom16": "Custom16", */
l.Add(new FormField("WidgetName", false, false));//is not shared localized text key and not hideable as it is in the validation rules for widget
l.Add(new FormField("WidgetSerial"));//not in validation rules...you get the idea
l.Add(new FormField("WidgetDollarAmount"));
l.Add(new FormField("WidgetCount"));
l.Add(new FormField("WidgetRoles"));
l.Add(new FormField("WidgetStartDate", false, false));
l.Add(new FormField("WidgetEndDate", false, false));
l.Add(new FormField("WidgetNotes"));
l.Add(new FormField("CommonActive", true));
l.Add(new FormField("Tags", true));
l.Add(new FormField("WidgetCustom1", false, true, true));
l.Add(new FormField("WidgetCustom2", false, true, true));
l.Add(new FormField("WidgetCustom3", false, true, true));
l.Add(new FormField("WidgetCustom4", false, true, true));
l.Add(new FormField("WidgetCustom5", false, true, true));
l.Add(new FormField("WidgetCustom6", false, true, true));
l.Add(new FormField("WidgetCustom7", false, true, true));
l.Add(new FormField("WidgetCustom8", false, true, true));
l.Add(new FormField("WidgetCustom9", false, true, true));
l.Add(new FormField("WidgetCustom10", false, true, true));
l.Add(new FormField("WidgetCustom11", false, true, true));
l.Add(new FormField("WidgetCustom12", false, true, true));
l.Add(new FormField("WidgetCustom13", false, true, true));
l.Add(new FormField("WidgetCustom14", false, true, true));
l.Add(new FormField("WidgetCustom15", false, true, true));
l.Add(new FormField("WidgetCustom16", false, true, true));
break;
default:
throw new System.ArgumentOutOfRangeException($"FormAvailableFields: {key} is not a valid form key");
}
return l;
}
}//eoc FormAvailableFields
public class FormField
{
public string Key { get; set; }
public bool Hideable { get; set; }
public bool SharedLTKey { get; set; }
public bool Custom { get; set; }
public FormField(string key, bool sharedLTKey = false, bool hideable = true, bool custom = false)
{
Key = key;
Hideable = hideable;
Custom = custom;
SharedLTKey = sharedLTKey;
}
}
}//ens

View File

@@ -1440,6 +1440,22 @@
"WidgetStartDate":"Startdatum",
"WidgetEndDate":"Enddatum",
"WidgetNotes":"Notizen",
"WidgetCustom1": "Angepasstes Feld 1",
"WidgetCustom2": "Angepasstes Feld 2",
"WidgetCustom3": "Angepasstes Feld 3",
"WidgetCustom4": "Angepasstes Feld 4",
"WidgetCustom5": "Angepasstes Feld 5",
"WidgetCustom6": "Angepasstes Feld 6",
"WidgetCustom7": "Angepasstes Feld 7",
"WidgetCustom8": "Angepasstes Feld 8",
"WidgetCustom9": "Angepasstes Feld 9",
"WidgetCustom10": "Angepasstes Feld 10",
"WidgetCustom11": "Angepasstes Feld 11",
"WidgetCustom12": "Angepasstes Feld 12",
"WidgetCustom13": "Angepasstes Feld 13",
"WidgetCustom14": "Angepasstes Feld 14",
"WidgetCustom15": "Angepasstes Feld 15",
"WidgetCustom16": "Angepasstes Feld 16",
"RowsPerPage":"Zeilen pro Seite",
"Tags":"Kategorien",
"ID":"ID",

View File

@@ -1438,7 +1438,23 @@
"WidgetRoles":"Roles",
"WidgetStartDate":"Start",
"WidgetEndDate":"End",
"WidgetNotes":"Notes",
"WidgetNotes":"Notes",
"WidgetCustom1": "Custom1",
"WidgetCustom2": "Custom2",
"WidgetCustom3": "Custom3",
"WidgetCustom4": "Custom4",
"WidgetCustom5": "Custom5",
"WidgetCustom6": "Custom6",
"WidgetCustom7": "Custom7",
"WidgetCustom8": "Custom8",
"WidgetCustom9": "Custom9",
"WidgetCustom10": "Custom10",
"WidgetCustom11": "Custom11",
"WidgetCustom12": "Custom12",
"WidgetCustom13": "Custom13",
"WidgetCustom14": "Custom14",
"WidgetCustom15": "Custom15",
"WidgetCustom16": "Custom16",
"RowsPerPage":"Rows per page",
"Tags":"Tags",
"ID":"ID",

View File

@@ -1440,6 +1440,22 @@
"WidgetStartDate":"Fecha de comienzo",
"WidgetEndDate":"Fecha de fin",
"WidgetNotes":"Notas",
"WidgetCustom1": "Campo personalizado 1",
"WidgetCustom2": "Campo personalizado 2",
"WidgetCustom3": "Campo personalizado 3",
"WidgetCustom4": "Campo personalizado 4",
"WidgetCustom5": "Campo personalizado 5",
"WidgetCustom6": "Campo personalizado 6",
"WidgetCustom7": "Campo personalizado 7",
"WidgetCustom8": "Campo personalizado 8",
"WidgetCustom9": "Campo personalizado 9",
"WidgetCustom10": "Campo personalizado 10",
"WidgetCustom11": "Campo personalizado 11",
"WidgetCustom12": "Campo personalizado 12",
"WidgetCustom13": "Campo personalizado 13",
"WidgetCustom14": "Campo personalizado 14",
"WidgetCustom15": "Campo personalizado 15",
"WidgetCustom16": "Campo personalizado 16",
"RowsPerPage":"Filas por página",
"Tags":"Etiquetas",
"ID":"ID",

View File

@@ -1439,6 +1439,22 @@
"WidgetStartDate":"Date de début",
"WidgetEndDate":"Date de fin",
"WidgetNotes":"Notes",
"WidgetCustom1": "Champ personnalisé 1",
"WidgetCustom2": "Champ personnalisé 2",
"WidgetCustom3": "Champ personnalisé 3",
"WidgetCustom4": "Champ personnalisé 4",
"WidgetCustom5": "Champ personnalisé 5",
"WidgetCustom6": "Champ personnalisé 6",
"WidgetCustom7": "Champ personnalisé 7",
"WidgetCustom8": "Champ personnalisé 8",
"WidgetCustom9": "Champ personnalisé 9",
"WidgetCustom10": "Champ personnalisé 10",
"WidgetCustom11": "Champ personnalisé 11",
"WidgetCustom12": "Champ personnalisé 12",
"WidgetCustom13": "Champ personnalisé 13",
"WidgetCustom14": "Champ personnalisé 14",
"WidgetCustom15": "Champ personnalisé 15",
"WidgetCustom16": "Champ personnalisé 16",
"RowsPerPage":"Lignes par page",
"Tags":"Balises",
"ID":"ID",