mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-20 06:00:44 +00:00
SPRINT-16: added more tests
This commit is contained in:
@ -57,7 +57,7 @@ public class RenderWidgetAction
|
||||
{
|
||||
for(Map.Entry<String, Serializable> entry : widgetMetaData.getDefaultValues().entrySet())
|
||||
{
|
||||
input.getQueryParams().putIfAbsent(entry.getKey(), ValueUtils.getValueAsString(entry.getValue()));
|
||||
input.addQueryParam(entry.getKey(), ValueUtils.getValueAsString(entry.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ import com.kingsrook.qqq.backend.core.model.actions.widgets.RenderWidgetOutput;
|
||||
import com.kingsrook.qqq.backend.core.model.dashboard.widgets.ParentWidgetData;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.dashboard.ParentWidgetMetaData;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValue;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.possiblevalues.QPossibleValueSource;
|
||||
import com.kingsrook.qqq.backend.core.utils.CollectionUtils;
|
||||
|
||||
|
||||
@ -70,9 +70,9 @@ public class ParentWidgetRenderer extends AbstractWidgetRenderer
|
||||
List<String> pvsNames = new ArrayList<>();
|
||||
for(String possibleValueSourceName : CollectionUtils.nonNullList(metaData.getPossibleValueNameList()))
|
||||
{
|
||||
QTableMetaData tableMetaData = input.getInstance().getTable(input.getInstance().getPossibleValueSource(possibleValueSourceName).getTableName());
|
||||
pvsLabels.add(tableMetaData.getLabel());
|
||||
pvsNames.add(tableMetaData.getName());
|
||||
QPossibleValueSource possibleValueSource = input.getInstance().getPossibleValueSource(possibleValueSourceName);
|
||||
pvsLabels.add(possibleValueSource.getLabel() != null ? possibleValueSource.getLabel() : possibleValueSourceName);
|
||||
pvsNames.add(possibleValueSourceName);
|
||||
|
||||
SearchPossibleValueSourceInput pvsInput = new SearchPossibleValueSourceInput(input.getInstance());
|
||||
pvsInput.setSession(input.getSession());
|
||||
|
@ -22,16 +22,19 @@
|
||||
package com.kingsrook.qqq.backend.core.model.dashboard.widgets;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import com.kingsrook.qqq.backend.core.model.metadata.processes.QProcessMetaData;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Model containing datastructure expected by frontend stepper widget
|
||||
** Model containing datastructure expected by frontend process widget
|
||||
**
|
||||
*******************************************************************************/
|
||||
public class ProcessWidgetData implements QWidget
|
||||
{
|
||||
private QProcessMetaData processMetaData;
|
||||
private QProcessMetaData processMetaData;
|
||||
private Map<String, Serializable> defaultValues;
|
||||
|
||||
|
||||
|
||||
@ -78,4 +81,38 @@ public class ProcessWidgetData implements QWidget
|
||||
return (this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Getter for defaultValues
|
||||
**
|
||||
*******************************************************************************/
|
||||
public Map<String, Serializable> getDefaultValues()
|
||||
{
|
||||
return defaultValues;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for defaultValues
|
||||
**
|
||||
*******************************************************************************/
|
||||
public void setDefaultValues(Map<String, Serializable> defaultValues)
|
||||
{
|
||||
this.defaultValues = defaultValues;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Fluent setter for defaultValues
|
||||
**
|
||||
*******************************************************************************/
|
||||
public ProcessWidgetData withDefaultValues(Map<String, Serializable> defaultValues)
|
||||
{
|
||||
this.defaultValues = defaultValues;
|
||||
return (this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.code.QCodeReference;
|
||||
public class QPossibleValueSource
|
||||
{
|
||||
private String name;
|
||||
private String label;
|
||||
private QPossibleValueSourceType type;
|
||||
|
||||
private String valueFormat = PVSValueFormatAndFields.LABEL_ONLY.getFormat();
|
||||
@ -105,6 +106,40 @@ public class QPossibleValueSource
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Getter for label
|
||||
**
|
||||
*******************************************************************************/
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Setter for label
|
||||
**
|
||||
*******************************************************************************/
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Fluent setter for label
|
||||
**
|
||||
*******************************************************************************/
|
||||
public QPossibleValueSource withLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
return (this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
Reference in New Issue
Block a user