mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Merged feature/workflows-support into integration
This commit is contained in:
@ -45,6 +45,7 @@ import com.kingsrook.qqq.backend.core.model.actions.tables.get.GetInput;
|
|||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.get.GetOutput;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.get.GetOutput;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QCriteriaOperator;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QCriteriaOperator;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterCriteria;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterCriteria;
|
||||||
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QFilterOrderBy;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QQueryFilter;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryInput;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryInput;
|
||||||
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
import com.kingsrook.qqq.backend.core.model.actions.tables.query.QueryOutput;
|
||||||
@ -195,14 +196,16 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
QTableMetaData leftTable = QContext.getQInstance().getTable(join.getLeftTable());
|
QTableMetaData leftTable = QContext.getQInstance().getTable(join.getLeftTable());
|
||||||
QTableMetaData rightTable = QContext.getQInstance().getTable(join.getRightTable());
|
QTableMetaData rightTable = QContext.getQInstance().getTable(join.getRightTable());
|
||||||
|
|
||||||
|
Map<String, Serializable> widgetMetaDataDefaultValues = input.getWidgetMetaData().getDefaultValues();
|
||||||
|
|
||||||
Integer maxRows = null;
|
Integer maxRows = null;
|
||||||
if(StringUtils.hasContent(input.getQueryParams().get("maxRows")))
|
if(StringUtils.hasContent(input.getQueryParams().get("maxRows")))
|
||||||
{
|
{
|
||||||
maxRows = ValueUtils.getValueAsInteger(input.getQueryParams().get("maxRows"));
|
maxRows = ValueUtils.getValueAsInteger(input.getQueryParams().get("maxRows"));
|
||||||
}
|
}
|
||||||
else if(input.getWidgetMetaData().getDefaultValues().containsKey("maxRows"))
|
else if(widgetMetaDataDefaultValues.containsKey("maxRows"))
|
||||||
{
|
{
|
||||||
maxRows = ValueUtils.getValueAsInteger(input.getWidgetMetaData().getDefaultValues().get("maxRows"));
|
maxRows = ValueUtils.getValueAsInteger(widgetMetaDataDefaultValues.get("maxRows"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -235,7 +238,17 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
{
|
{
|
||||||
filter.addCriteria(new QFilterCriteria(joinOn.getRightField(), QCriteriaOperator.EQUALS, List.of(primaryRecord.getValue(joinOn.getLeftField()))));
|
filter.addCriteria(new QFilterCriteria(joinOn.getRightField(), QCriteriaOperator.EQUALS, List.of(primaryRecord.getValue(joinOn.getLeftField()))));
|
||||||
}
|
}
|
||||||
filter.setOrderBys(join.getOrderBys());
|
|
||||||
|
Serializable orderBy = widgetMetaDataDefaultValues.get("orderBy");
|
||||||
|
if(orderBy instanceof List orderByList && !orderByList.isEmpty() && orderByList.get(0) instanceof QFilterOrderBy)
|
||||||
|
{
|
||||||
|
filter.setOrderBys(orderByList);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filter.setOrderBys(join.getOrderBys());
|
||||||
|
}
|
||||||
|
|
||||||
filter.setLimit(maxRows);
|
filter.setLimit(maxRows);
|
||||||
|
|
||||||
QueryInput queryInput = new QueryInput();
|
QueryInput queryInput = new QueryInput();
|
||||||
@ -284,11 +297,10 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
|
|
||||||
widgetData.setDefaultValuesForNewChildRecords(defaultValuesForNewChildRecords);
|
widgetData.setDefaultValuesForNewChildRecords(defaultValuesForNewChildRecords);
|
||||||
|
|
||||||
Map<String, Serializable> widgetValues = input.getWidgetMetaData().getDefaultValues();
|
if(widgetMetaDataDefaultValues.containsKey("disabledFieldsForNewChildRecords"))
|
||||||
if(widgetValues.containsKey("disabledFieldsForNewChildRecords"))
|
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Set<String> disabledFieldsForNewChildRecords = (Set<String>) widgetValues.get("disabledFieldsForNewChildRecords");
|
Set<String> disabledFieldsForNewChildRecords = (Set<String>) widgetMetaDataDefaultValues.get("disabledFieldsForNewChildRecords");
|
||||||
widgetData.setDisabledFieldsForNewChildRecords(disabledFieldsForNewChildRecords);
|
widgetData.setDisabledFieldsForNewChildRecords(disabledFieldsForNewChildRecords);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -308,10 +320,10 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(widgetValues.containsKey("defaultValuesForNewChildRecordsFromParentFields"))
|
if(widgetMetaDataDefaultValues.containsKey("defaultValuesForNewChildRecordsFromParentFields"))
|
||||||
{
|
{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, String> defaultValuesForNewChildRecordsFromParentFields = (Map<String, String>) widgetValues.get("defaultValuesForNewChildRecordsFromParentFields");
|
Map<String, String> defaultValuesForNewChildRecordsFromParentFields = (Map<String, String>) widgetMetaDataDefaultValues.get("defaultValuesForNewChildRecordsFromParentFields");
|
||||||
widgetData.setDefaultValuesForNewChildRecordsFromParentFields(defaultValuesForNewChildRecordsFromParentFields);
|
widgetData.setDefaultValuesForNewChildRecordsFromParentFields(defaultValuesForNewChildRecordsFromParentFields);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,11 @@ import java.util.List;
|
|||||||
public class FilterAndColumnsSetupData extends QWidgetData
|
public class FilterAndColumnsSetupData extends QWidgetData
|
||||||
{
|
{
|
||||||
private String tableName;
|
private String tableName;
|
||||||
private Boolean allowVariables = false;
|
private Boolean allowVariables = false;
|
||||||
private Boolean hideColumns = false;
|
private Boolean hideColumns = false;
|
||||||
private Boolean hidePreview = false;
|
private Boolean hidePreview = false;
|
||||||
|
private Boolean hideSortBy = false;
|
||||||
|
private Boolean overrideIsEditable = false;
|
||||||
private List<String> filterDefaultFieldNames;
|
private List<String> filterDefaultFieldNames;
|
||||||
|
|
||||||
private String filterFieldName = "queryFilterJson";
|
private String filterFieldName = "queryFilterJson";
|
||||||
@ -290,4 +292,66 @@ public class FilterAndColumnsSetupData extends QWidgetData
|
|||||||
return (this);
|
return (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for overrideIsEditable
|
||||||
|
*******************************************************************************/
|
||||||
|
public Boolean getOverrideIsEditable()
|
||||||
|
{
|
||||||
|
return (this.overrideIsEditable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Setter for overrideIsEditable
|
||||||
|
*******************************************************************************/
|
||||||
|
public void setOverrideIsEditable(Boolean overrideIsEditable)
|
||||||
|
{
|
||||||
|
this.overrideIsEditable = overrideIsEditable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Fluent setter for overrideIsEditable
|
||||||
|
*******************************************************************************/
|
||||||
|
public FilterAndColumnsSetupData withOverrideIsEditable(Boolean overrideIsEditable)
|
||||||
|
{
|
||||||
|
this.overrideIsEditable = overrideIsEditable;
|
||||||
|
return (this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Getter for hideSortBy
|
||||||
|
*******************************************************************************/
|
||||||
|
public Boolean getHideSortBy()
|
||||||
|
{
|
||||||
|
return (this.hideSortBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Setter for hideSortBy
|
||||||
|
*******************************************************************************/
|
||||||
|
public void setHideSortBy(Boolean hideSortBy)
|
||||||
|
{
|
||||||
|
this.hideSortBy = hideSortBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
** Fluent setter for hideSortBy
|
||||||
|
*******************************************************************************/
|
||||||
|
public FilterAndColumnsSetupData withHideSortBy(Boolean hideSortBy)
|
||||||
|
{
|
||||||
|
this.hideSortBy = hideSortBy;
|
||||||
|
return (this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,6 @@ public class ProcessSpecUtilsV1
|
|||||||
JSONObject outputJsonObject = convertResponseToJSONObject(response);
|
JSONObject outputJsonObject = convertResponseToJSONObject(response);
|
||||||
|
|
||||||
String json = outputJsonObject.toString(3);
|
String json = outputJsonObject.toString(3);
|
||||||
System.out.println(json);
|
|
||||||
context.result(json);
|
context.result(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,8 +307,8 @@ public class ProcessSpecUtilsV1
|
|||||||
private static void archiveUploadedFile(String processName, QUploadedFile qUploadedFile)
|
private static void archiveUploadedFile(String processName, QUploadedFile qUploadedFile)
|
||||||
{
|
{
|
||||||
String fileName = QValueFormatter.formatDate(LocalDate.now())
|
String fileName = QValueFormatter.formatDate(LocalDate.now())
|
||||||
+ File.separator + processName
|
+ File.separator + processName
|
||||||
+ File.separator + qUploadedFile.getFilename();
|
+ File.separator + qUploadedFile.getFilename();
|
||||||
|
|
||||||
InsertInput insertInput = new InsertInput();
|
InsertInput insertInput = new InsertInput();
|
||||||
insertInput.setTableName(QJavalinImplementation.getJavalinMetaData().getUploadedFileArchiveTableName());
|
insertInput.setTableName(QJavalinImplementation.getJavalinMetaData().getUploadedFileArchiveTableName());
|
||||||
|
Reference in New Issue
Block a user