Updated data in form field
This commit is contained in:
@@ -30,6 +30,8 @@ public class FormFieldDao {
|
||||
FormFieldEntity formFieldEntity = new FormFieldEntity();
|
||||
formFieldEntity.setLabel(formFieldRequest.getLabel());
|
||||
formFieldEntity.setName(formFieldRequest.getName());
|
||||
formFieldEntity.setDescription(formFieldRequest.getDescription());
|
||||
formFieldEntity.setSortOrder(formFieldRequest.getSortOrder());
|
||||
formFieldEntity.setValidators(Utils.convertMapIntoJsonString(formFieldRequest.getValidators()));
|
||||
formFieldEntity.setSettings(setSettingRequestBean(formFieldRequest.getSettings()));
|
||||
formFieldEntity = saveFormFieldEntity(formFieldEntity);
|
||||
@@ -40,6 +42,8 @@ public class FormFieldDao {
|
||||
FormFieldResponseBean formFieldResponseBean = new FormFieldResponseBean();
|
||||
formFieldResponseBean.setId(formFieldEntity.getId());
|
||||
formFieldResponseBean.setName(formFieldEntity.getName());
|
||||
formFieldResponseBean.setDescription(formFieldEntity.getDescription());
|
||||
formFieldResponseBean.setSortOrder(formFieldEntity.getSortOrder());
|
||||
formFieldResponseBean
|
||||
.setSettings(Utils.convertJsonStringToList(formFieldEntity.getSettings(), SettingResponseBean.class));
|
||||
formFieldResponseBean.setLabel(formFieldEntity.getLabel());
|
||||
@@ -69,6 +73,8 @@ public class FormFieldDao {
|
||||
FormFieldEntity formFieldEntity = validateFormField(formFieldId);
|
||||
Utils.setIfUpdated(formFieldEntity::getName, formFieldEntity::setName, formFieldRequest.getName());
|
||||
Utils.setIfUpdated(formFieldEntity::getLabel, formFieldEntity::setLabel, formFieldRequest.getLabel());
|
||||
Utils.setIfUpdated(formFieldEntity::getDescription, formFieldEntity::setDescription, formFieldRequest.getDescription());
|
||||
Utils.setIfUpdated(formFieldEntity::getSortOrder, formFieldEntity::setSortOrder, formFieldRequest.getSortOrder());
|
||||
Utils.setIfUpdated(formFieldEntity::getSettings, formFieldEntity::setSettings,
|
||||
setSettingRequestBean(formFieldRequest.getSettings()));
|
||||
Utils.setIfUpdated(formFieldEntity::getValidators, formFieldEntity::setValidators,
|
||||
|
||||
@@ -25,4 +25,10 @@ public class FormFieldEntity extends BaseEntity{
|
||||
|
||||
@Column(name = "VALIDATORS")
|
||||
private String validators;
|
||||
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
@Column(name = "SORT_ORDER")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ public class FormFieldRequest {
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
|
||||
private Integer sortOrder;
|
||||
|
||||
private String label;
|
||||
|
||||
private List<SettingRequestBean> settings;
|
||||
|
||||
@@ -14,6 +14,11 @@ public class FormFieldResponseBean {
|
||||
|
||||
private String label;
|
||||
|
||||
private String description;
|
||||
|
||||
private Integer sortOrder;
|
||||
|
||||
|
||||
private List<SettingResponseBean> settings;
|
||||
|
||||
private Map<String,Object> validators;
|
||||
|
||||
@@ -633,4 +633,22 @@
|
||||
<column name="final_form" type="INTEGER"></column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet id="13-09-2024_1" author="Harish Bagora">
|
||||
<addColumn tableName="form_field">
|
||||
<column name="description" type="TEXT">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
<column name="sort_order" type="INTEGER">
|
||||
<constraints nullable="true"/>
|
||||
</column>
|
||||
</addColumn>
|
||||
</changeSet>
|
||||
<changeSet id="13-09-2024_2" author="Harish Bagora">
|
||||
<sql>
|
||||
TRUNCATE TABLE FORM_FIELD RESTART IDENTITY;
|
||||
</sql>
|
||||
<sqlFile dbms="postgresql"
|
||||
path="classpath:db/dump/inserted_form_field_data_13_09_2024.sql" />
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
INSERT INTO FORM_FIELD ( SORT_ORDER, NAME, LABEL, DESCRIPTION, SETTINGS, VALIDATORS, CREATED_DATE, UPDATED_DATE)
|
||||
VALUES
|
||||
( 1, 'textinput', 'Testo Breve', 'Per risposte concise (nomi, titoli, brevi descrizioni)',
|
||||
'{"label": "Testo Breve", "placeholder": ""}',
|
||||
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 2, 'textarea', 'Testo Lungo', 'Campo di testo esteso per paragrafi, descrizioni, proposte',
|
||||
'{"label": "Testo Lungo", "placeholder": ""}',
|
||||
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 3, 'wysiwyg', 'Campo di Testo Formattato', 'Editor avanzato per testo con formattazione',
|
||||
'{"label": "Testo Formattato", "placeholder": ""}',
|
||||
'{"isRequired": false, "minLength": null, "maxLength": null, "pattern": null, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 4, 'numberinput', 'Campo Numerico', 'Per l''inserimento di valori numerici (quantità, importi, percentuali)',
|
||||
'{"label": "Numero", "placeholder": "0", "step": "0"}',
|
||||
'{"isRequired": false, "min": null, "max": null, "pattern": null, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
(5, 'radio', 'Scelta Singola', 'Gruppo di opzioni per selezione singola',
|
||||
'{"label": "Scelta Singola", "options": []}',
|
||||
'{"isRequired": false, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 6, 'select', 'Menu a Tendina', 'Selezione da opzioni predefinite',
|
||||
'{"label": "Menu a Tendina", "options": []}',
|
||||
'{"isRequired": false, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 7, 'checkboxes', 'Scelta Multipla', 'Gruppo di opzioni per selezione singola o multipla',
|
||||
'{"label": "Scelta Multipla", "options": []}',
|
||||
'{"isRequired": false, "min": null, "max": null, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 8, 'switch', 'Casella di Spunta', 'Per selezioni binarie, accettazioni, conferme',
|
||||
'{"label": "Casella di Spunta"}',
|
||||
'{"isRequired": false}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 9, 'datepicker', 'Data', 'Selezione di data',
|
||||
'{"label": "Data"}',
|
||||
'{"isRequired": false, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP),
|
||||
|
||||
( 10, 'fileupload', 'Caricamento File', 'Per l''upload di documenti o immagini',
|
||||
'{"label": "Caricamento File", "mime": []}',
|
||||
'{"isRequired": false, "maxSize": 100000, "custom": null}',
|
||||
CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
|
||||
Reference in New Issue
Block a user