CE-1068 - add dynamicForm widget type

This commit is contained in:
2024-04-30 10:24:19 -05:00
parent 3d729d67e6
commit 8c882b8476
2 changed files with 171 additions and 5 deletions

View File

@ -0,0 +1,150 @@
/*
* QQQ - Low-code Application Framework for Engineers.
* Copyright (C) 2021-2024. Kingsrook, LLC
* 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States
* contact@kingsrook.com
* https://github.com/Kingsrook/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.kingsrook.qqq.backend.core.model.dashboard.widgets;
import java.util.List;
import com.kingsrook.qqq.backend.core.model.metadata.fields.QFieldMetaData;
/*******************************************************************************
**
*******************************************************************************/
public class DynamicFormWidgetData extends QWidgetData
{
private List<QFieldMetaData> fieldList;
/////////////////////////////////////////////////////
// if there are no fields, what message to display //
/////////////////////////////////////////////////////
private String noFieldsMessage;
///////////////////////////////////////////////////////////////////////////////////
// what 1 field do we want to combine the dynamic fields into (as a JSON string) //
///////////////////////////////////////////////////////////////////////////////////
private String mergedDynamicFormValuesIntoFieldName;
/*******************************************************************************
**
*******************************************************************************/
@Override
public String getType()
{
return WidgetType.DYNAMIC_FORM.getType();
}
/*******************************************************************************
** Getter for fieldList
*******************************************************************************/
public List<QFieldMetaData> getFieldList()
{
return (this.fieldList);
}
/*******************************************************************************
** Setter for fieldList
*******************************************************************************/
public void setFieldList(List<QFieldMetaData> fieldList)
{
this.fieldList = fieldList;
}
/*******************************************************************************
** Fluent setter for fieldList
*******************************************************************************/
public DynamicFormWidgetData withFieldList(List<QFieldMetaData> fieldList)
{
this.fieldList = fieldList;
return (this);
}
/*******************************************************************************
** Getter for noFieldsMessage
*******************************************************************************/
public String getNoFieldsMessage()
{
return (this.noFieldsMessage);
}
/*******************************************************************************
** Setter for noFieldsMessage
*******************************************************************************/
public void setNoFieldsMessage(String noFieldsMessage)
{
this.noFieldsMessage = noFieldsMessage;
}
/*******************************************************************************
** Fluent setter for noFieldsMessage
*******************************************************************************/
public DynamicFormWidgetData withNoFieldsMessage(String noFieldsMessage)
{
this.noFieldsMessage = noFieldsMessage;
return (this);
}
/*******************************************************************************
** Getter for mergedDynamicFormValuesIntoFieldName
*******************************************************************************/
public String getMergedDynamicFormValuesIntoFieldName()
{
return (this.mergedDynamicFormValuesIntoFieldName);
}
/*******************************************************************************
** Setter for mergedDynamicFormValuesIntoFieldName
*******************************************************************************/
public void setMergedDynamicFormValuesIntoFieldName(String mergedDynamicFormValuesIntoFieldName)
{
this.mergedDynamicFormValuesIntoFieldName = mergedDynamicFormValuesIntoFieldName;
}
/*******************************************************************************
** Fluent setter for mergedDynamicFormValuesIntoFieldName
*******************************************************************************/
public DynamicFormWidgetData withMergedDynamicFormValuesIntoFieldName(String mergedDynamicFormValuesIntoFieldName)
{
this.mergedDynamicFormValuesIntoFieldName = mergedDynamicFormValuesIntoFieldName;
return (this);
}
}

View File

@ -27,10 +27,12 @@ package com.kingsrook.qqq.backend.core.model.dashboard.widgets;
*******************************************************************************/ *******************************************************************************/
public enum WidgetType public enum WidgetType
{ {
///////////////////////////////////
// (generally) dashboard widgets //
///////////////////////////////////
ALERT("alert"), ALERT("alert"),
BAR_CHART("barChart"), BAR_CHART("barChart"),
CHART("chart"), CHART("chart"),
CHILD_RECORD_LIST("childRecordList"),
DIVIDER("divider"), DIVIDER("divider"),
FIELD_VALUE_LIST("fieldValueList"), FIELD_VALUE_LIST("fieldValueList"),
GENERIC("generic"), GENERIC("generic"),
@ -40,20 +42,34 @@ public enum WidgetType
SMALL_LINE_CHART("smallLineChart"), SMALL_LINE_CHART("smallLineChart"),
LOCATION("location"), LOCATION("location"),
MULTI_STATISTICS("multiStatistics"), MULTI_STATISTICS("multiStatistics"),
PARENT_WIDGET("parentWidget"),
PIE_CHART("pieChart"), PIE_CHART("pieChart"),
PROCESS("process"),
QUICK_SIGHT_CHART("quickSightChart"), QUICK_SIGHT_CHART("quickSightChart"),
STATISTICS("statistics"), STATISTICS("statistics"),
STACKED_BAR_CHART("stackedBarChart"), STACKED_BAR_CHART("stackedBarChart"),
STEPPER("stepper"), STEPPER("stepper"),
TABLE("table"), TABLE("table"),
USA_MAP("usaMap"), USA_MAP("usaMap"),
///////////////////////////////
// widget to house a process //
///////////////////////////////
PROCESS("process"),
///////////////////////
// container widgets //
///////////////////////
PARENT_WIDGET("parentWidget"),
COMPOSITE("composite"), COMPOSITE("composite"),
//////////////////////////////
// record view/edit widgets //
//////////////////////////////
CHILD_RECORD_LIST("childRecordList"),
DYNAMIC_FORM("dynamicForm"),
DATA_BAG_VIEWER("dataBagViewer"), DATA_BAG_VIEWER("dataBagViewer"),
SCRIPT_VIEWER("scriptViewer"), PIVOT_TABLE_SETUP("pivotTableSetup"),
REPORT_SETUP("reportSetup"), REPORT_SETUP("reportSetup"),
PIVOT_TABLE_SETUP("pivotTableSetup"); SCRIPT_VIEWER("scriptViewer");
private final String type; private final String type;