@kineticdata/react 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/lib/apis/agent/adapters.js +2 -3
  2. package/lib/apis/agent/bridges.js +7 -13
  3. package/lib/apis/agent/handlers.js +7 -13
  4. package/lib/apis/core/activity.js +2 -3
  5. package/lib/apis/core/attributeDefinitions.js +6 -11
  6. package/lib/apis/core/attributeDefinitions.test.js +201 -213
  7. package/lib/apis/core/authentication.js +74 -84
  8. package/lib/apis/core/backgroundJobs.js +5 -9
  9. package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
  10. package/lib/apis/core/bridgeModelAttributes.js +6 -11
  11. package/lib/apis/core/bridgeModelMappings.js +5 -10
  12. package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
  13. package/lib/apis/core/bridgeModelQualifications.js +5 -10
  14. package/lib/apis/core/bridgeModels.js +7 -13
  15. package/lib/apis/core/bridgeModels.test.js +313 -333
  16. package/lib/apis/core/bridgedresources.js +7 -13
  17. package/lib/apis/core/categories.js +6 -11
  18. package/lib/apis/core/fileResources.js +5 -10
  19. package/lib/apis/core/filestores.js +5 -10
  20. package/lib/apis/core/formTypes.js +6 -11
  21. package/lib/apis/core/forms.js +6 -11
  22. package/lib/apis/core/forms.test.js +201 -213
  23. package/lib/apis/core/kapps.js +6 -11
  24. package/lib/apis/core/kapps.test.js +122 -130
  25. package/lib/apis/core/logs.js +3 -5
  26. package/lib/apis/core/memberships.js +3 -5
  27. package/lib/apis/core/meta.js +6 -11
  28. package/lib/apis/core/notices.js +2 -3
  29. package/lib/apis/core/oauthClients.js +6 -11
  30. package/lib/apis/core/platformComponents.js +10 -19
  31. package/lib/apis/core/platformItems.js +2 -3
  32. package/lib/apis/core/profile.js +3 -5
  33. package/lib/apis/core/securityPolicyDefinitions.js +6 -11
  34. package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
  35. package/lib/apis/core/space.js +3 -5
  36. package/lib/apis/core/space.test.js +106 -114
  37. package/lib/apis/core/submissions.js +17 -33
  38. package/lib/apis/core/teams.js +6 -11
  39. package/lib/apis/core/translations.js +18 -35
  40. package/lib/apis/core/translations.test.js +1343 -1437
  41. package/lib/apis/core/users.js +6 -11
  42. package/lib/apis/core/version.js +2 -3
  43. package/lib/apis/core/webApis.js +5 -10
  44. package/lib/apis/core/webhooks.js +6 -11
  45. package/lib/apis/core/webhooks.test.js +243 -257
  46. package/lib/apis/core/webhooksJobs.js +3 -5
  47. package/lib/apis/core/workflows.js +7 -13
  48. package/lib/apis/http.js +47 -30
  49. package/lib/apis/http.test.js +100 -0
  50. package/lib/apis/system/index.js +167 -81
  51. package/lib/apis/task/index.js +73 -118
  52. package/lib/components/agent/bridge/BridgeForm.js +1 -2
  53. package/lib/components/agent/bridge/BridgeTable.js +5 -3
  54. package/lib/components/agent/filestore/FilestoreForm.js +1 -2
  55. package/lib/components/agent/filestore/FilestoreTable.js +5 -3
  56. package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
  57. package/lib/components/agent/handler/AgentHandlerTable.js +6 -4
  58. package/lib/components/common/AttributeSelect.js +2 -3
  59. package/lib/components/common/BridgeSelect.js +16 -17
  60. package/lib/components/common/ComponentConfigContext.js +1 -2
  61. package/lib/components/common/ContentEditable.js +23 -3
  62. package/lib/components/common/FormSelect.js +16 -17
  63. package/lib/components/common/NodeSelect.js +2 -3
  64. package/lib/components/common/Scroller.js +2 -3
  65. package/lib/components/common/StaticSelect.js +14 -15
  66. package/lib/components/common/TableInput.js +276 -63
  67. package/lib/components/common/TeamSelect.js +16 -17
  68. package/lib/components/common/ToastContainer.js +165 -0
  69. package/lib/components/common/Typeahead.js +15 -2
  70. package/lib/components/common/UserSelect.js +16 -17
  71. package/lib/components/common/authentication/AuthInterceptor.js +2 -3
  72. package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
  73. package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
  74. package/lib/components/common/authentication/RequestInterceptor.js +2 -10
  75. package/lib/components/common/code_input/CodeInput.js +4 -9
  76. package/lib/components/common/code_input/draftHelpers.js +20 -37
  77. package/lib/components/common/code_input/languageHelpers.js +6 -12
  78. package/lib/components/common/code_input/languageHelpers.test.js +10 -8
  79. package/lib/components/common/defaults/Toast.js +25 -0
  80. package/lib/components/common/defaults/index.js +12 -0
  81. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
  82. package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +8 -5
  83. package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
  84. package/lib/components/core/bridge_model/BridgeModelTable.js +6 -4
  85. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
  86. package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
  87. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
  88. package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
  89. package/lib/components/core/category/CategoryForm.js +1 -2
  90. package/lib/components/core/category/CategoryTable.js +14 -8
  91. package/lib/components/core/core_form/CoreForm.js +11 -22
  92. package/lib/components/core/core_form/defaults/index.js +11 -19
  93. package/lib/components/core/core_form/globals.js +3 -5
  94. package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
  95. package/lib/components/core/field_definition/FieldDefinitionTable.js +13 -9
  96. package/lib/components/core/file_resource/FileResourceForm.js +1 -2
  97. package/lib/components/core/file_resource/FileResourceTable.js +1 -2
  98. package/lib/components/core/form/FormForm.js +1 -2
  99. package/lib/components/core/form/FormTable.js +23 -13
  100. package/lib/components/core/form_type/FormTypeForm.js +1 -2
  101. package/lib/components/core/form_type/FormTypeTable.js +4 -3
  102. package/lib/components/core/i18n/I18n.js +2 -4
  103. package/lib/components/core/i18n/I18nContext.js +1 -2
  104. package/lib/components/core/i18n/I18nProvider.js +2 -3
  105. package/lib/components/core/i18n/Moment.js +10 -9
  106. package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
  107. package/lib/components/core/index_definition/IndexDefinitionTable.js +13 -7
  108. package/lib/components/core/index_job/IndexJobTable.js +1 -2
  109. package/lib/components/core/kapp/KappForm.js +1 -2
  110. package/lib/components/core/kapp/KappTable.js +18 -34
  111. package/lib/components/core/log/LogTable.js +10 -6
  112. package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
  113. package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
  114. package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
  115. package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
  116. package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
  117. package/lib/components/core/profile/ProfileForm.js +1 -2
  118. package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
  119. package/lib/components/core/security_definition/SecurityDefinitionTable.js +10 -6
  120. package/lib/components/core/space/SpaceForm.js +1 -2
  121. package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
  122. package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
  123. package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
  124. package/lib/components/core/submission/FormSubmissionTable.js +39 -23
  125. package/lib/components/core/submission/KappSubmissionTable.js +39 -23
  126. package/lib/components/core/submission/SubmissionForm.js +1 -2
  127. package/lib/components/core/submission/SubmissionTable.js +2 -3
  128. package/lib/components/core/submission/helpers.js +4 -7
  129. package/lib/components/core/team/TeamForm.js +2 -3
  130. package/lib/components/core/team/TeamTable.js +12 -7
  131. package/lib/components/core/translation/ContextForm.js +1 -2
  132. package/lib/components/core/translation/ContextTable.js +1 -2
  133. package/lib/components/core/translation/EntryForm.js +1 -2
  134. package/lib/components/core/translation/EntryTable.js +1 -2
  135. package/lib/components/core/translation/LocaleForm.js +1 -2
  136. package/lib/components/core/translation/LocaleTable.js +1 -2
  137. package/lib/components/core/user/UserForm.js +1 -2
  138. package/lib/components/core/user/UserTable.js +24 -7
  139. package/lib/components/core/webapi/WebApiForm.js +138 -123
  140. package/lib/components/core/webapi/WebApiTable.js +15 -9
  141. package/lib/components/core/webhook/WebhookForm.js +1 -2
  142. package/lib/components/core/webhook/WebhookTable.js +20 -11
  143. package/lib/components/core/webhook_job/WebhookJobTable.js +40 -21
  144. package/lib/components/form/Form.helpers.js +91 -38
  145. package/lib/components/form/Form.js +312 -355
  146. package/lib/components/form/Form.models.js +7 -11
  147. package/lib/components/form/FormState.js +1 -2
  148. package/lib/components/form/KitchenSinkForm.js +23 -3
  149. package/lib/components/form/SimpleForm.helpers.js +262 -0
  150. package/lib/components/form/SimpleForm.js +462 -0
  151. package/lib/components/form/SimpleForm.models.js +62 -0
  152. package/lib/components/form/defaults/AttributesField.js +3 -4
  153. package/lib/components/form/defaults/CheckboxField.js +2 -3
  154. package/lib/components/form/defaults/CodeField.js +2 -3
  155. package/lib/components/form/defaults/FormButtons.js +2 -3
  156. package/lib/components/form/defaults/FormError.js +2 -3
  157. package/lib/components/form/defaults/FormField.js +2 -3
  158. package/lib/components/form/defaults/FormLayout.js +2 -3
  159. package/lib/components/form/defaults/FormMultiField.js +2 -3
  160. package/lib/components/form/defaults/PasswordField.js +2 -3
  161. package/lib/components/form/defaults/RadioField.js +2 -3
  162. package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
  163. package/lib/components/form/defaults/SelectField.js +2 -3
  164. package/lib/components/form/defaults/SelectMultiField.js +2 -3
  165. package/lib/components/form/defaults/TableField.js +2 -3
  166. package/lib/components/form/defaults/TeamField.js +2 -3
  167. package/lib/components/form/defaults/TeamMultiField.js +2 -3
  168. package/lib/components/form/defaults/TextField.js +2 -3
  169. package/lib/components/form/defaults/TextMultiField.js +2 -3
  170. package/lib/components/form/defaults/UserField.js +2 -3
  171. package/lib/components/form/defaults/UserMultiField.js +2 -3
  172. package/lib/components/form/defaults/index.js +2 -3
  173. package/lib/components/form/tests/Form.test.js +3865 -4257
  174. package/lib/components/form/tests/components.js +2 -3
  175. package/lib/components/index.js +60 -0
  176. package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
  177. package/lib/components/system/SystemCassandraForm.js +97 -0
  178. package/lib/components/system/SystemElasticSearchForm.js +97 -0
  179. package/lib/components/system/SystemFilestoreForm.js +12 -8
  180. package/lib/components/system/SystemForm.js +1 -2
  181. package/lib/components/system/SystemIngressForm.js +78 -31
  182. package/lib/components/system/SystemSecurityForm.js +1 -2
  183. package/lib/components/system/SystemSmtpForm.js +1 -2
  184. package/lib/components/system/SystemTaskAdapterForm.js +30 -7
  185. package/lib/components/system/SystemTrustedCertificateForm.js +39 -0
  186. package/lib/components/system/SystemTrustedCertificatesTable.js +73 -0
  187. package/lib/components/system/SystemUserForm.js +1 -2
  188. package/lib/components/system/helpers.js +236 -65
  189. package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
  190. package/lib/components/system/spaces/SystemTenantForm.js +77 -37
  191. package/lib/components/system/spaces/SystemTenantTable.js +1 -2
  192. package/lib/components/table/Table.js +132 -54
  193. package/lib/components/table/Table.redux.js +229 -235
  194. package/lib/components/table/Table.test.js +154 -123
  195. package/lib/components/table/defaults/BodyCell.js +1 -2
  196. package/lib/components/table/defaults/BodyRow.js +1 -2
  197. package/lib/components/table/defaults/BooleanFilter.js +1 -2
  198. package/lib/components/table/defaults/ColumnControl.js +25 -0
  199. package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
  200. package/lib/components/table/defaults/FilterLayout.js +1 -2
  201. package/lib/components/table/defaults/Footer.js +1 -2
  202. package/lib/components/table/defaults/FooterCell.js +1 -2
  203. package/lib/components/table/defaults/FooterRow.js +1 -2
  204. package/lib/components/table/defaults/Header.js +1 -2
  205. package/lib/components/table/defaults/HeaderCell.js +1 -2
  206. package/lib/components/table/defaults/HeaderRow.js +1 -2
  207. package/lib/components/table/defaults/PaginationControl.js +2 -4
  208. package/lib/components/table/defaults/TableBody.js +1 -2
  209. package/lib/components/table/defaults/TableLayout.js +1 -2
  210. package/lib/components/table/defaults/TextFilter.js +1 -2
  211. package/lib/components/table/defaults/index.js +5 -4
  212. package/lib/components/task/builder/Connector.js +26 -11
  213. package/lib/components/task/builder/ConnectorForm.js +1 -2
  214. package/lib/components/task/builder/Node.js +18 -9
  215. package/lib/components/task/builder/NodeForm.js +1 -2
  216. package/lib/components/task/builder/NodeParametersForm.js +1 -2
  217. package/lib/components/task/builder/SvgCanvas.js +2 -3
  218. package/lib/components/task/builder/SvgText.js +2 -3
  219. package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
  220. package/lib/components/task/builder/TreeBuilder.js +10 -4
  221. package/lib/components/task/builder/builder.redux.js +171 -182
  222. package/lib/components/task/builder/constants.js +38 -76
  223. package/lib/components/task/builder/helpers.js +23 -40
  224. package/lib/components/task/builder/models.js +19 -35
  225. package/lib/components/task/category/TaskCategoryForm.js +2 -3
  226. package/lib/components/task/category/TaskCategoryTable.js +1 -2
  227. package/lib/components/task/common/UsageTable.js +1 -2
  228. package/lib/components/task/engine/EngineSettingsForm.js +2 -3
  229. package/lib/components/task/errors/RunErrorTable.js +35 -17
  230. package/lib/components/task/errors/SystemErrorsTable.js +1 -2
  231. package/lib/components/task/handlers/HandlerForm.js +2 -3
  232. package/lib/components/task/handlers/HandlerTable.js +24 -13
  233. package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
  234. package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
  235. package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
  236. package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
  237. package/lib/components/task/runs/RunTable.js +24 -12
  238. package/lib/components/task/runs/RunTaskTable.js +1 -2
  239. package/lib/components/task/sources/SourceForm.js +1 -2
  240. package/lib/components/task/sources/SourceTable.js +16 -9
  241. package/lib/components/task/triggers/TriggerTable.js +52 -26
  242. package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
  243. package/lib/components/task/workflows/LinkedWorkflowTable.js +33 -18
  244. package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
  245. package/lib/components/task/workflows/WorkflowForm.js +2 -3
  246. package/lib/components/task/workflows/WorkflowTable.js +31 -17
  247. package/lib/helpers/SearchBuilder.js +2 -4
  248. package/lib/helpers/index.js +13 -26
  249. package/lib/index.js +7 -9
  250. package/lib/reducer.js +3 -5
  251. package/lib/saga.js +32 -48
  252. package/lib/store.js +32 -42
  253. package/package.json +26 -16
  254. package/proxyhelper.js +17 -11
  255. package/lib/components/core/CoreFormModal.js +0 -64
  256. package/lib/components/core/CoreModal.js +0 -114
@@ -88,38 +88,47 @@ var filters = function filters() {
88
88
  };
89
89
  var columns = [{
90
90
  value: 'createdAt',
91
- title: 'Created'
91
+ title: 'Created',
92
+ toggleable: true
92
93
  }, {
93
94
  value: 'createdBy',
94
- title: 'Created By'
95
+ title: 'Created By',
96
+ toggleable: true
95
97
  }, {
96
98
  value: 'event',
97
- title: 'Event'
99
+ title: 'Event',
100
+ toggleable: true
98
101
  }, {
99
102
  value: 'filter',
100
- title: 'Filter'
103
+ title: 'Filter',
104
+ toggleable: true
101
105
  }, {
102
106
  value: 'name',
103
- title: 'Name'
107
+ title: 'Name',
108
+ toggleable: false,
109
+ columnOrder: 'first'
104
110
  }, {
105
111
  value: 'type',
106
- title: 'Type'
112
+ title: 'Type',
113
+ toggleable: true
107
114
  }, {
108
115
  value: 'updatedAt',
109
- title: 'Updated'
116
+ title: 'Updated',
117
+ toggleable: true
110
118
  }, {
111
119
  value: 'updatedBy',
112
- title: 'Updated By'
120
+ title: 'Updated By',
121
+ toggleable: true
113
122
  }, {
114
123
  value: 'url',
115
- title: 'URL'
124
+ title: 'URL',
125
+ toggleable: true
116
126
  }];
117
- var WebhookTable = (0, _Table.generateTable)({
127
+ var WebhookTable = exports.WebhookTable = (0, _Table.generateTable)({
118
128
  tableOptions: ['scope', 'kappSlug'],
119
129
  columns: columns,
120
130
  filters: filters,
121
131
  filterDataSources: filterDataSources,
122
132
  dataSource: dataSource
123
133
  });
124
- exports.WebhookTable = WebhookTable;
125
134
  WebhookTable.displayName = 'WebhookTable';
@@ -71,63 +71,83 @@ var filters = function filters() {
71
71
  };
72
72
  var columns = [{
73
73
  value: 'createdAt',
74
- title: 'Created'
74
+ title: 'Created',
75
+ toggleable: true
75
76
  }, {
76
77
  value: 'createdBy',
77
- title: 'Created By'
78
+ title: 'Created By',
79
+ toggleable: true
78
80
  }, {
79
81
  value: 'event',
80
- title: 'Event'
82
+ title: 'Event',
83
+ toggleable: true
81
84
  }, {
82
85
  value: 'id',
83
- title: 'ID'
86
+ title: 'ID',
87
+ toggleable: true
84
88
  }, {
85
89
  value: 'name',
86
- title: 'Name'
90
+ title: 'Name',
91
+ toggleable: true
87
92
  }, {
88
93
  value: 'parentId',
89
- title: 'Parent ID'
94
+ title: 'Parent ID',
95
+ toggleable: true
90
96
  }, {
91
97
  value: 'requestContent',
92
- title: 'Request Content'
98
+ title: 'Request Content',
99
+ toggleable: true
93
100
  }, {
94
101
  value: 'responseContent',
95
- title: 'Response Content'
102
+ title: 'Response Content',
103
+ toggleable: true
96
104
  }, {
97
105
  value: 'retryCount',
98
- title: 'Retry Count'
106
+ title: 'Retry Count',
107
+ toggleable: true
99
108
  }, {
100
109
  value: 'scheduledAt',
101
- title: 'Scheduled At'
110
+ title: 'Scheduled At',
111
+ toggleable: false,
112
+ columnOrder: 'first'
102
113
  }, {
103
114
  value: 'scopeId',
104
- title: 'Scope ID'
115
+ title: 'Scope ID',
116
+ toggleable: true
105
117
  }, {
106
118
  value: 'scopeType',
107
- title: 'Scope Type'
119
+ title: 'Scope Type',
120
+ toggleable: true
108
121
  }, {
109
122
  value: 'status',
110
- title: 'Status'
123
+ title: 'Status',
124
+ toggleable: true
111
125
  }, {
112
126
  value: 'summary',
113
- title: 'Summary'
127
+ title: 'Summary',
128
+ toggleable: true
114
129
  }, {
115
130
  value: 'type',
116
- title: 'Type'
131
+ title: 'Type',
132
+ toggleable: true
117
133
  }, {
118
134
  value: 'updatedAt',
119
- title: 'Updated'
135
+ title: 'Updated',
136
+ toggleable: true
120
137
  }, {
121
138
  value: 'updatedBy',
122
- title: 'Updated By'
139
+ title: 'Updated By',
140
+ toggleable: true
123
141
  }, {
124
142
  value: 'url',
125
- title: 'URL'
143
+ title: 'URL',
144
+ toggleable: true
126
145
  }, {
127
146
  value: 'webhookId',
128
- title: 'Webhook ID'
147
+ title: 'Webhook ID',
148
+ toggleable: true
129
149
  }];
130
- var WebhookJobTable = (0, _Table.generateTable)({
150
+ var WebhookJobTable = exports.WebhookJobTable = (0, _Table.generateTable)({
131
151
  tableOptions: ['scope', 'kappSlug', 'status'],
132
152
  columns: columns,
133
153
  filters: filters,
@@ -135,5 +155,4 @@ var WebhookJobTable = (0, _Table.generateTable)({
135
155
  dataSource: dataSource,
136
156
  sortable: false
137
157
  });
138
- exports.WebhookJobTable = WebhookJobTable;
139
158
  WebhookJobTable.displayName = 'WebhookJobTable';
@@ -19,7 +19,7 @@ var sameName = function sameName(field1) {
19
19
  return field1.name === field2.name;
20
20
  };
21
21
  };
22
- var handleFormErrors = function handleFormErrors(key, message) {
22
+ var handleFormErrors = exports.handleFormErrors = function handleFormErrors(key, message) {
23
23
  return function (results) {
24
24
  var error = results.error;
25
25
  if (error) {
@@ -28,8 +28,7 @@ var handleFormErrors = function handleFormErrors(key, message) {
28
28
  return key ? results[key] : results;
29
29
  };
30
30
  };
31
- exports.handleFormErrors = handleFormErrors;
32
- var resolveFieldConfig = function resolveFieldConfig(formOptions, bindings, fieldsFn) {
31
+ var resolveFieldConfig = exports.resolveFieldConfig = function resolveFieldConfig(formOptions, bindings, fieldsFn) {
33
32
  var addFieldsParam = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
34
33
  var alterFieldsParam = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
35
34
  var fields = fieldsFn(formOptions)(bindings);
@@ -57,15 +56,13 @@ var resolveFieldConfig = function resolveFieldConfig(formOptions, bindings, fiel
57
56
  }));
58
57
  }
59
58
  };
60
- exports.resolveFieldConfig = resolveFieldConfig;
61
- var initializeValue = function initializeValue(type) {
59
+ var initializeValue = exports.initializeValue = function initializeValue(type) {
62
60
  var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Form.FIELD_DEFAULT_VALUES.get(type, '');
63
61
  return type === 'map' ? (0, _immutable.OrderedMap)(value).map(function (value) {
64
62
  return (0, _immutable.fromJS)(value);
65
63
  }) : (0, _immutable.fromJS)(value);
66
64
  };
67
- exports.initializeValue = initializeValue;
68
- var createField = function createField(formKey) {
65
+ var createField = exports.createField = function createField(formKey) {
69
66
  return function (_ref2) {
70
67
  var constraint = _ref2.constraint,
71
68
  constraintMessage = _ref2.constraintMessage,
@@ -146,8 +143,7 @@ var createField = function createField(formKey) {
146
143
  });
147
144
  };
148
145
  };
149
- exports.createField = createField;
150
- var createDataSource = function createDataSource(_ref3) {
146
+ var createDataSource = exports.createDataSource = function createDataSource(_ref3) {
151
147
  var _DataSource;
152
148
  var fn = _ref3.fn,
153
149
  params = _ref3.params,
@@ -157,8 +153,7 @@ var createDataSource = function createDataSource(_ref3) {
157
153
  fn: fn
158
154
  }, (0, _defineProperty2["default"])(_DataSource, paramProp, params), (0, _defineProperty2["default"])(_DataSource, "transform", transform), _DataSource));
159
155
  };
160
- exports.createDataSource = createDataSource;
161
- var createFormState = function createFormState(_ref4) {
156
+ var createFormState = exports.createFormState = function createFormState(_ref4) {
162
157
  var addDataSources = _ref4.addDataSources,
163
158
  addFields = _ref4.addFields,
164
159
  alterFields = _ref4.alterFields,
@@ -183,77 +178,136 @@ var createFormState = function createFormState(_ref4) {
183
178
  onSubmit: onSubmit && onSubmit(formOptions)
184
179
  });
185
180
  };
186
- exports.createFormState = createFormState;
187
- var buildPropertyFields = function buildPropertyFields(_ref5) {
181
+ var buildPropertyFields = exports.buildPropertyFields = function buildPropertyFields(_ref5) {
188
182
  var isNew = _ref5.isNew,
189
183
  properties = _ref5.properties,
190
184
  getName = _ref5.getName,
185
+ getLabel = _ref5.getLabel,
191
186
  getOptions = _ref5.getOptions,
192
187
  getRequired = _ref5.getRequired,
193
188
  getSensitive = _ref5.getSensitive,
189
+ getCertificate = _ref5.getCertificate,
190
+ getHelpText = _ref5.getHelpText,
194
191
  getValue = _ref5.getValue;
195
192
  return {
196
193
  propertiesFields: properties.flatMap(function (property) {
197
194
  var name = getName(property);
195
+ var label = (0, _lodashEs.isFunction)(getLabel) && getLabel(property) || name;
198
196
  var options = (0, _lodashEs.isFunction)(getOptions) && getOptions(property);
199
197
  var required = (0, _lodashEs.isFunction)(getRequired) && getRequired(property);
200
198
  var sensitive = (0, _lodashEs.isFunction)(getSensitive) && getSensitive(property);
199
+ var certificate = (0, _lodashEs.isFunction)(getCertificate) && getCertificate(property);
200
+ var helpText = (0, _lodashEs.isFunction)(getHelpText) && getHelpText(property);
201
201
  var value = getValue(property);
202
- return !sensitive || isNew ? [{
202
+ return !!certificate ? [{
203
203
  name: "property_".concat(name),
204
- label: name,
204
+ label: label,
205
+ type: 'certificate',
206
+ required: required,
207
+ "transient": true,
208
+ options: options,
209
+ helpText: helpText,
210
+ initialValue: certificate,
211
+ visible: function visible(_ref6) {
212
+ var values = _ref6.values;
213
+ return !values.get("changeProperty_".concat(name));
214
+ }
215
+ }, {
216
+ name: "property_new_".concat(name),
217
+ label: label,
218
+ type: 'file',
219
+ required: required,
220
+ "transient": true,
221
+ helpText: helpText,
222
+ visible: function visible(_ref7) {
223
+ var values = _ref7.values;
224
+ return values.get("changeProperty_".concat(name));
225
+ }
226
+ }, {
227
+ name: "changeProperty_".concat(name),
228
+ label: "Change ".concat(label),
229
+ type: 'toggle',
230
+ "transient": true,
231
+ initialValue: false,
232
+ onChange: function onChange(_ref8, _ref9) {
233
+ var values = _ref8.values;
234
+ var setValue = _ref9.setValue;
235
+ if (!_immutable.List.isList(values.get("property_new_".concat(name))) || values.get("property_new_".concat(name)).size > 0) {
236
+ setValue("property_new_".concat(name), (0, _immutable.List)());
237
+ }
238
+ }
239
+ }] : !sensitive || isNew ? [{
240
+ name: "property_".concat(name),
241
+ label: label,
205
242
  type: sensitive ? 'password' : options ? 'select' : 'text',
206
243
  required: required,
207
244
  "transient": true,
208
245
  options: options,
246
+ helpText: helpText,
209
247
  initialValue: value
210
248
  }] : [{
211
249
  name: "property_".concat(name),
212
- label: name,
213
- type: 'password',
214
- required: required ? function (_ref6) {
215
- var values = _ref6.values;
250
+ label: label,
251
+ type: 'secret',
252
+ required: required ? function (_ref10) {
253
+ var values = _ref10.values;
216
254
  return values.get("changeProperty_".concat(name));
217
255
  } : false,
218
256
  "transient": true,
257
+ helpText: helpText,
219
258
  initialValue: '',
220
- visible: function visible(_ref7) {
221
- var values = _ref7.values;
259
+ visible: function visible(_ref11) {
260
+ var values = _ref11.values;
222
261
  return values.get("changeProperty_".concat(name));
223
262
  }
224
263
  }, {
225
264
  name: "changeProperty_".concat(name),
226
- label: "Change ".concat(name),
227
- type: 'checkbox',
265
+ label: "Change ".concat(label),
266
+ type: 'toggle',
228
267
  "transient": true,
229
268
  initialValue: false,
230
- onChange: function onChange(_ref8, _ref9) {
231
- var values = _ref8.values;
232
- var setValue = _ref9.setValue;
269
+ onChange: function onChange(_ref12, _ref13) {
270
+ var values = _ref12.values;
271
+ var setValue = _ref13.setValue;
233
272
  if (values.get("property_".concat(name)) !== '') {
234
273
  setValue("property_".concat(name), '');
235
274
  }
236
275
  }
237
276
  }];
238
277
  }).toArray(),
239
- propertiesSerialize: function propertiesSerialize(_ref10) {
240
- var values = _ref10.values;
241
- return properties.filter(function (prop) {
242
- return isNew || !(0, _lodashEs.isFunction)(getSensitive) || !getSensitive(prop) || values.get("changeProperty_".concat(getName(prop)));
243
- }).map(getName).reduce(function (reduction, propName) {
244
- return reduction.set(propName, values.get("property_".concat(propName)));
278
+ propertiesSerialize: function propertiesSerialize(_ref14) {
279
+ var values = _ref14.values;
280
+ return properties.reduce(function (reduction, property) {
281
+ var name = getName(property);
282
+ var sensitive = (0, _lodashEs.isFunction)(getSensitive) && getSensitive(property);
283
+ var certificate = (0, _lodashEs.isFunction)(getCertificate) && getCertificate(property);
284
+ if (certificate) {
285
+ // If certificate field, serialize value if the corresponding
286
+ // changeProperty field has a value. Set to the new uploaded file, or
287
+ // an empty string if no file uploaded.
288
+ if (values.get("changeProperty_".concat(name))) {
289
+ return reduction.set(name, values.getIn(["property_new_".concat(name), 0]) || '');
290
+ }
291
+ } else if (sensitive) {
292
+ // If sensitive field, serialize value if the corresponding
293
+ // changeProperty field has a value. Set to the new provided value.
294
+ if (isNew || values.get("changeProperty_".concat(name))) {
295
+ return reduction.set(name, values.get("property_".concat(name)));
296
+ }
297
+ } else {
298
+ return reduction.set(name, values.get("property_".concat(name)));
299
+ }
300
+ return reduction;
245
301
  }, (0, _immutable.Map)()).toObject();
246
302
  }
247
303
  };
248
304
  };
249
- exports.buildPropertyFields = buildPropertyFields;
250
- var getComponentName = function getComponentName(field) {
305
+ var getComponentName = exports.getComponentName = function getComponentName(field) {
251
306
  return field.type ? field.type.split('-').map(function (word) {
252
307
  return "".concat(word.charAt(0).toUpperCase()).concat(word.substring(1));
253
308
  }).join('') + 'Field' : null;
254
309
  };
255
- exports.getComponentName = getComponentName;
256
- var getFieldComponentProps = function getFieldComponentProps(field, readOnly) {
310
+ var getFieldComponentProps = exports.getFieldComponentProps = function getFieldComponentProps(field, readOnly) {
257
311
  return {
258
312
  dirty: field.dirty,
259
313
  enabled: readOnly ? false : field.enabled,
@@ -277,5 +331,4 @@ var getFieldComponentProps = function getFieldComponentProps(field, readOnly) {
277
331
  value: field.value,
278
332
  visible: field.visible
279
333
  };
280
- };
281
- exports.getFieldComponentProps = getFieldComponentProps;
334
+ };