mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
Update to set QFieldSection label from name; try to avoid backend-module-not-defined errors
This commit is contained in:
@ -130,6 +130,10 @@ public class QInstanceEnricher
|
||||
{
|
||||
generateTableFieldSections(table);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.getSections().forEach(this::enrich);
|
||||
}
|
||||
|
||||
if(CollectionUtils.nullSafeHasContents(table.getRecordLabelFields()) && !StringUtils.hasContent(table.getRecordLabelFormat()))
|
||||
{
|
||||
@ -215,6 +219,19 @@ public class QInstanceEnricher
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
private void enrich(QFieldSection section)
|
||||
{
|
||||
if(!StringUtils.hasContent(section.getLabel()))
|
||||
{
|
||||
section.setLabel(nameToLabel(section.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
@ -63,6 +63,19 @@ public class QFieldSection
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
public QFieldSection(String name, QIcon icon, Tier tier, List<String> fieldNames)
|
||||
{
|
||||
this.name = name;
|
||||
this.icon = icon;
|
||||
this.tier = tier;
|
||||
this.fieldNames = fieldNames;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Getter for name
|
||||
**
|
||||
|
@ -65,7 +65,7 @@ public class QBackendModuleDispatcher
|
||||
return;
|
||||
}
|
||||
|
||||
backendTypeToModuleClassNameMap = new HashMap<>();
|
||||
Map<String, String> newMap = new HashMap<>();
|
||||
|
||||
String[] moduleClassNames = new String[]
|
||||
{
|
||||
@ -84,13 +84,15 @@ public class QBackendModuleDispatcher
|
||||
{
|
||||
Class<?> moduleClass = Class.forName(moduleClassName);
|
||||
QBackendModuleInterface module = (QBackendModuleInterface) moduleClass.getConstructor().newInstance();
|
||||
backendTypeToModuleClassNameMap.put(module.getBackendType(), moduleClassName);
|
||||
newMap.put(module.getBackendType(), moduleClassName);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
LOG.debug("Backend module [{}] could not be loaded: {}", moduleClassName, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
backendTypeToModuleClassNameMap = newMap;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user