mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-1068 - add dynamicForm widget type
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -27,10 +27,12 @@ package com.kingsrook.qqq.backend.core.model.dashboard.widgets;
|
||||
*******************************************************************************/
|
||||
public enum WidgetType
|
||||
{
|
||||
///////////////////////////////////
|
||||
// (generally) dashboard widgets //
|
||||
///////////////////////////////////
|
||||
ALERT("alert"),
|
||||
BAR_CHART("barChart"),
|
||||
CHART("chart"),
|
||||
CHILD_RECORD_LIST("childRecordList"),
|
||||
DIVIDER("divider"),
|
||||
FIELD_VALUE_LIST("fieldValueList"),
|
||||
GENERIC("generic"),
|
||||
@ -40,20 +42,34 @@ public enum WidgetType
|
||||
SMALL_LINE_CHART("smallLineChart"),
|
||||
LOCATION("location"),
|
||||
MULTI_STATISTICS("multiStatistics"),
|
||||
PARENT_WIDGET("parentWidget"),
|
||||
PIE_CHART("pieChart"),
|
||||
PROCESS("process"),
|
||||
QUICK_SIGHT_CHART("quickSightChart"),
|
||||
STATISTICS("statistics"),
|
||||
STACKED_BAR_CHART("stackedBarChart"),
|
||||
STEPPER("stepper"),
|
||||
TABLE("table"),
|
||||
USA_MAP("usaMap"),
|
||||
|
||||
///////////////////////////////
|
||||
// widget to house a process //
|
||||
///////////////////////////////
|
||||
PROCESS("process"),
|
||||
|
||||
///////////////////////
|
||||
// container widgets //
|
||||
///////////////////////
|
||||
PARENT_WIDGET("parentWidget"),
|
||||
COMPOSITE("composite"),
|
||||
|
||||
//////////////////////////////
|
||||
// record view/edit widgets //
|
||||
//////////////////////////////
|
||||
CHILD_RECORD_LIST("childRecordList"),
|
||||
DYNAMIC_FORM("dynamicForm"),
|
||||
DATA_BAG_VIEWER("dataBagViewer"),
|
||||
SCRIPT_VIEWER("scriptViewer"),
|
||||
PIVOT_TABLE_SETUP("pivotTableSetup"),
|
||||
REPORT_SETUP("reportSetup"),
|
||||
PIVOT_TABLE_SETUP("pivotTableSetup");
|
||||
SCRIPT_VIEWER("scriptViewer");
|
||||
|
||||
|
||||
private final String type;
|
||||
|
Reference in New Issue
Block a user