Skip to content

Instantly share code, notes, and snippets.

@kadzany
Last active April 26, 2018 10:41
Show Gist options
  • Save kadzany/4f2e2000bd98d43ff054e614faa6e51d to your computer and use it in GitHub Desktop.
Save kadzany/4f2e2000bd98d43ff054e614faa6e51d to your computer and use it in GitHub Desktop.
Contoh format json untuk auto-generate form
{
"key": "userProfile",
"translationKey": "%WMS.Inbound.ASN.userProfile.formTitle%",
"roles": [
"SysAdmin",
"Managers",
"Users"
],
"fields": [
{
"order": 0,
"key": "userId",
"properties": {
"inputType": "hidden"
}
},
{
"order": 1,
"key": "firstName",
"translationKey": "%WMS.Inbound.ASN.userProfile.firstName%",
"roleActionKey": "editField",
"properties": {
"required": true,
"importance": "high",
"inputType": "textbox",
"inputSettings": {
"minLength": "2",
"maxLength": "15"
}
}
},
{
"order": 2,
"key": "dateOfBirth",
"translationKey": "%WMS.Inbound.ASN.userProfile.dateOfBirth%",
"roleActionKey": "editField",
"properties": {
"required": true,
"importance": "standart",
"inputType": "datepicker",
"inputSettings": {
"maxDate": "today"
}
}
},
{
"order": 3,
"key": "hasIdCard",
"translationKey": "%WMS.Inbound.ASN.userProfile.hasIdCard%",
"roleActionKey": "editField",
"properties": {
"required": true,
"importance": "standart",
"inputType": "checkbox",
"inputSettings": {
}
}
},
{
"order": 4,
"key": "addressDistrict",
"translationKey": "%WMS.Inbound.ASN.userProfile.addressDistrict%",
"roleActionKey": "editField",
"properties": {
"required": false,
"importance": "standart",
"inputType": "combobox",
"inputSettings": {
"dataSource": "/relative-path/to/api/getting-data/endpoint",
"defaultValue": ""
}
}
}
],
"buttons": [
{
"order": 0,
"key": "saveData",
"translationKey": "%WMS.Inbound.ASN.userProfile.saveData%",
"roleActionKey": "clickButton",
"properties": {
"inputType": "saveButton",
"inputSettings": {
"saveEndpoint": "/relative-path/to/api/save-data/endpoint"
}
}
},
{
"order": 1,
"key": "cancel",
"translationKey": "%WMS.Inbound.ASN.userProfile.cancel%",
"roleActionKey": "clickButton",
"properties": {
"inputType": "cancelButton",
"inputSettings": {
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment