@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
@@ -141,23 +141,53 @@ describe('<Table />', function () {
141
141
  test('kitchen sink', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
142
142
  var ActionCell, addColumns;
143
143
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
144
- while (1) {
145
- switch (_context.prev = _context.next) {
144
+ while (1) switch (_context.prev = _context.next) {
145
+ case 0:
146
+ ActionCell = function ActionCell(props) {
147
+ return /*#__PURE__*/_react["default"].createElement("td", null, props.value);
148
+ };
149
+ addColumns = [{
150
+ value: '_action',
151
+ label: 'Actions',
152
+ components: {
153
+ BodyCell: ActionCell
154
+ }
155
+ }];
156
+ _context.next = 4;
157
+ return mountTable({
158
+ columns: columns,
159
+ addColumns: addColumns,
160
+ dataSource: function dataSource(_tableOptions) {
161
+ return {
162
+ fn: dataSourceFn,
163
+ params: function params(_paramData) {
164
+ return [];
165
+ },
166
+ transform: function transform(result) {
167
+ return {
168
+ data: result.mockData
169
+ };
170
+ }
171
+ };
172
+ }
173
+ });
174
+ case 4:
175
+ wrapper = _context.sent;
176
+ expect(wrapper).toMatchSnapshot();
177
+ case 6:
178
+ case "end":
179
+ return _context.stop();
180
+ }
181
+ }, _callee);
182
+ })));
183
+ describe('filters', function () {
184
+ test('legacy filters', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
185
+ var filterLayout;
186
+ return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
187
+ while (1) switch (_context2.prev = _context2.next) {
146
188
  case 0:
147
- ActionCell = function ActionCell(props) {
148
- return /*#__PURE__*/_react["default"].createElement("td", null, props.value);
149
- };
150
- addColumns = [{
151
- value: '_action',
152
- label: 'Actions',
153
- components: {
154
- BodyCell: ActionCell
155
- }
156
- }];
157
- _context.next = 4;
189
+ _context2.next = 2;
158
190
  return mountTable({
159
- columns: columns,
160
- addColumns: addColumns,
161
191
  dataSource: function dataSource(_tableOptions) {
162
192
  return {
163
193
  fn: dataSourceFn,
@@ -172,95 +202,59 @@ describe('<Table />', function () {
172
202
  };
173
203
  }
174
204
  });
175
- case 4:
176
- wrapper = _context.sent;
177
- expect(wrapper).toMatchSnapshot();
205
+ case 2:
206
+ wrapper = _context2.sent;
207
+ filterLayout = wrapper.find('FilterLayout');
208
+ expect(filterLayout).toBeDefined();
209
+ expect(filterLayout).toMatchSnapshot();
178
210
  case 6:
179
211
  case "end":
180
- return _context.stop();
181
- }
182
- }
183
- }, _callee);
184
- })));
185
- describe('filters', function () {
186
- test('legacy filters', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
187
- var filterLayout;
188
- return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
189
- while (1) {
190
- switch (_context2.prev = _context2.next) {
191
- case 0:
192
- _context2.next = 2;
193
- return mountTable({
194
- dataSource: function dataSource(_tableOptions) {
195
- return {
196
- fn: dataSourceFn,
197
- params: function params(_paramData) {
198
- return [];
199
- },
200
- transform: function transform(result) {
201
- return {
202
- data: result.mockData
203
- };
204
- }
205
- };
206
- }
207
- });
208
- case 2:
209
- wrapper = _context2.sent;
210
- filterLayout = wrapper.find('FilterLayout');
211
- expect(filterLayout).toBeDefined();
212
- expect(filterLayout).toMatchSnapshot();
213
- case 6:
214
- case "end":
215
- return _context2.stop();
216
- }
212
+ return _context2.stop();
217
213
  }
218
214
  }, _callee2);
219
215
  })));
220
216
  test('filter form', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
221
217
  var filterForm;
222
218
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
223
- while (1) {
224
- switch (_context3.prev = _context3.next) {
225
- case 0:
226
- _context3.next = 2;
227
- return mountTable({
228
- filters: function filters() {
229
- return function () {
230
- return [{
231
- name: 'name',
232
- label: 'Name',
233
- type: 'text'
234
- }, {
235
- name: 'status',
236
- label: 'Status',
237
- type: 'text'
238
- }];
239
- };
240
- },
241
- dataSource: function dataSource(_tableOptions) {
242
- return {
243
- fn: dataSourceFn,
244
- params: function params(_paramData) {
245
- return [];
246
- },
247
- transform: function transform(result) {
248
- return {
249
- data: result.mockData
250
- };
251
- }
252
- };
253
- }
254
- });
255
- case 2:
256
- wrapper = _context3.sent;
257
- filterForm = wrapper.find('FilterForm');
258
- expect(filterForm).toBeDefined();
259
- expect(filterForm).toMatchSnapshot();
260
- case 6:
261
- case "end":
262
- return _context3.stop();
263
- }
219
+ while (1) switch (_context3.prev = _context3.next) {
220
+ case 0:
221
+ _context3.next = 2;
222
+ return mountTable({
223
+ filters: function filters() {
224
+ return function () {
225
+ return [{
226
+ name: 'name',
227
+ label: 'Name',
228
+ type: 'text'
229
+ }, {
230
+ name: 'status',
231
+ label: 'Status',
232
+ type: 'text'
233
+ }];
234
+ };
235
+ },
236
+ dataSource: function dataSource(_tableOptions) {
237
+ return {
238
+ fn: dataSourceFn,
239
+ params: function params(_paramData) {
240
+ return [];
241
+ },
242
+ transform: function transform(result) {
243
+ return {
244
+ data: result.mockData
245
+ };
246
+ }
247
+ };
248
+ }
249
+ });
250
+ case 2:
251
+ wrapper = _context3.sent;
252
+ filterForm = wrapper.find('FilterForm');
253
+ expect(filterForm).toBeDefined();
254
+ expect(filterForm).toMatchSnapshot();
255
+ case 6:
256
+ case "end":
257
+ return _context3.stop();
264
258
  }
265
259
  }, _callee3);
266
260
  })));
@@ -268,33 +262,31 @@ describe('<Table />', function () {
268
262
  describe('dataSource', function () {
269
263
  test('dataSource resolves', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
270
264
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
271
- while (1) {
272
- switch (_context4.prev = _context4.next) {
273
- case 0:
274
- _context4.next = 2;
275
- return mountTable({
276
- dataSource: function dataSource(_tableOptions) {
277
- return {
278
- fn: dataSourceFn,
279
- params: function params(_paramData) {
280
- return [];
281
- },
282
- transform: function transform(result) {
283
- return {
284
- data: result.mockData
285
- };
286
- }
287
- };
288
- }
289
- });
290
- case 2:
291
- wrapper = _context4.sent;
292
- expect(wrapper).toMatchSnapshot();
293
- expect(dataSourceFn.mock.calls).toMatchSnapshot();
294
- case 5:
295
- case "end":
296
- return _context4.stop();
297
- }
265
+ while (1) switch (_context4.prev = _context4.next) {
266
+ case 0:
267
+ _context4.next = 2;
268
+ return mountTable({
269
+ dataSource: function dataSource(_tableOptions) {
270
+ return {
271
+ fn: dataSourceFn,
272
+ params: function params(_paramData) {
273
+ return [];
274
+ },
275
+ transform: function transform(result) {
276
+ return {
277
+ data: result.mockData
278
+ };
279
+ }
280
+ };
281
+ }
282
+ });
283
+ case 2:
284
+ wrapper = _context4.sent;
285
+ expect(wrapper).toMatchSnapshot();
286
+ expect(dataSourceFn.mock.calls).toMatchSnapshot();
287
+ case 5:
288
+ case "end":
289
+ return _context4.stop();
298
290
  }
299
291
  }, _callee4);
300
292
  })));
@@ -626,6 +618,45 @@ describe('<Table />', function () {
626
618
  expect(column).not.toBeUndefined();
627
619
  });
628
620
  });
621
+ describe('#sortColumns', function () {
622
+ test('sort columns returns expected sort order', function () {
623
+ var columns = (0, _immutable.List)([(0, _immutable.Map)({
624
+ value: 'a',
625
+ title: 'A'
626
+ }), (0, _immutable.Map)({
627
+ value: 'b',
628
+ title: 'B'
629
+ }), (0, _immutable.Map)({
630
+ value: 'c',
631
+ title: 'C'
632
+ })]);
633
+ var columnSet = (0, _immutable.List)(['b', 'a']);
634
+ expect((0, _Table.sortColumns)(columns, columnSet).toJS().map(function (c) {
635
+ return c.value;
636
+ }).join('')).toBe('bca');
637
+ });
638
+ });
639
+ describe('#getToggleableColumns', function () {
640
+ test('toggleable columns list is correct', function () {
641
+ var columns = (0, _immutable.List)([(0, _immutable.Map)({
642
+ value: 'a',
643
+ title: 'A',
644
+ toggleable: true
645
+ }), (0, _immutable.Map)({
646
+ value: 'b',
647
+ title: 'B'
648
+ }), (0, _immutable.Map)({
649
+ value: 'c',
650
+ title: 'C'
651
+ }), (0, _immutable.Map)({
652
+ value: 'd'
653
+ })]);
654
+ var columnSet = (0, _immutable.List)(['a', 'b', 'd']);
655
+ expect((0, _Table.getToggleableColumns)(columns, columnSet, 'table-key').toJS().map(function (c) {
656
+ return c.value;
657
+ }).join('')).toBe('ab');
658
+ });
659
+ });
629
660
  xdescribe('#extractColumnComponents', function () {
630
661
  var columns, addColumns, alterColumns;
631
662
  beforeEach(function () {
@@ -14,5 +14,4 @@ var BodyCell = function BodyCell(_ref) {
14
14
  scope: 'row'
15
15
  } : {}, value);
16
16
  };
17
- var _default = BodyCell;
18
- exports["default"] = _default;
17
+ var _default = exports["default"] = BodyCell;
@@ -10,5 +10,4 @@ var BodyRow = function BodyRow(_ref) {
10
10
  var cells = _ref.cells;
11
11
  return /*#__PURE__*/_react["default"].createElement("tr", null, cells);
12
12
  };
13
- var _default = BodyRow;
14
- exports["default"] = _default;
13
+ var _default = exports["default"] = BodyRow;
@@ -28,5 +28,4 @@ var BooleanFilter = function BooleanFilter(_ref) {
28
28
  value: "false"
29
29
  }, "No")));
30
30
  };
31
- var _default = BooleanFilter;
32
- exports["default"] = _default;
31
+ var _default = exports["default"] = BooleanFilter;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var ColumnControl = function ColumnControl(_ref) {
10
+ var columns = _ref.columns;
11
+ return /*#__PURE__*/_react["default"].createElement("div", null, columns.map(function (column) {
12
+ return /*#__PURE__*/_react["default"].createElement("div", {
13
+ className: "field"
14
+ }, /*#__PURE__*/_react["default"].createElement("input", {
15
+ type: "checkbox",
16
+ id: "column-".concat(column.get('value')),
17
+ checked: column.get('checked'),
18
+ disabled: !column.get('enabled'),
19
+ onChange: column.get('toggle')
20
+ }), /*#__PURE__*/_react["default"].createElement("label", {
21
+ htmlFor: "column-".concat(column.get('value'))
22
+ }, column.get('label')));
23
+ }));
24
+ };
25
+ var _default = exports["default"] = ColumnControl;
@@ -14,5 +14,4 @@ var EmptyBodyRow = function EmptyBodyRow(_ref) {
14
14
  colSpan: colSpan
15
15
  }, /*#__PURE__*/_react["default"].createElement("em", null, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "No data found."))));
16
16
  };
17
- var _default = EmptyBodyRow;
18
- exports["default"] = _default;
17
+ var _default = exports["default"] = EmptyBodyRow;
@@ -25,5 +25,4 @@ var FilterLayout = function FilterLayout(_ref) {
25
25
  type: "submit"
26
26
  }, "Search"));
27
27
  };
28
- var _default = FilterLayout;
29
- exports["default"] = _default;
28
+ var _default = exports["default"] = FilterLayout;
@@ -11,5 +11,4 @@ var Footer = function Footer(_ref) {
11
11
  var footerRow = _ref.footerRow;
12
12
  return /*#__PURE__*/_react["default"].createElement("tfoot", null, footerRow);
13
13
  };
14
- var _default = Footer;
15
- exports["default"] = _default;
14
+ var _default = exports["default"] = Footer;
@@ -9,5 +9,4 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var FooterCell = function FooterCell() {
10
10
  return /*#__PURE__*/_react["default"].createElement("td", null);
11
11
  };
12
- var _default = FooterCell;
13
- exports["default"] = _default;
12
+ var _default = exports["default"] = FooterCell;
@@ -10,5 +10,4 @@ var FooterRow = function FooterRow(_ref) {
10
10
  var cells = _ref.cells;
11
11
  return /*#__PURE__*/_react["default"].createElement("tr", null, cells);
12
12
  };
13
- var _default = FooterRow;
14
- exports["default"] = _default;
13
+ var _default = exports["default"] = FooterRow;
@@ -10,5 +10,4 @@ var Header = function Header(_ref) {
10
10
  var headerRow = _ref.headerRow;
11
11
  return /*#__PURE__*/_react["default"].createElement("thead", null, headerRow);
12
12
  };
13
- var _default = Header;
14
- exports["default"] = _default;
13
+ var _default = exports["default"] = Header;
@@ -19,5 +19,4 @@ var HeaderCell = function HeaderCell(_ref) {
19
19
  onClick: onSortColumn
20
20
  }, sorting === 'desc' ? /*#__PURE__*/_react["default"].createElement("span", null, "\u2193") : sorting === 'asc' ? /*#__PURE__*/_react["default"].createElement("span", null, "\u2191") : /*#__PURE__*/_react["default"].createElement("span", null, "\u2013"))));
21
21
  };
22
- var _default = HeaderCell;
23
- exports["default"] = _default;
22
+ var _default = exports["default"] = HeaderCell;
@@ -10,5 +10,4 @@ var HeaderRow = function HeaderRow(_ref) {
10
10
  var columnHeaders = _ref.columnHeaders;
11
11
  return /*#__PURE__*/_react["default"].createElement("tr", null, columnHeaders);
12
12
  };
13
- var _default = HeaderRow;
14
- exports["default"] = _default;
13
+ var _default = exports["default"] = HeaderRow;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports["default"] = exports.PaginationControl = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _I18n = require("../../core/i18n/I18n");
10
- var PaginationControl = function PaginationControl(_ref) {
10
+ var PaginationControl = exports.PaginationControl = function PaginationControl(_ref) {
11
11
  var nextPage = _ref.nextPage,
12
12
  prevPage = _ref.prevPage,
13
13
  loading = _ref.loading;
@@ -19,6 +19,4 @@ var PaginationControl = function PaginationControl(_ref) {
19
19
  disabled: loading || !nextPage
20
20
  }, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "Next")));
21
21
  };
22
- exports.PaginationControl = PaginationControl;
23
- var _default = PaginationControl;
24
- exports["default"] = _default;
22
+ var _default = exports["default"] = PaginationControl;
@@ -10,5 +10,4 @@ var TableBody = function TableBody(_ref) {
10
10
  var tableRows = _ref.tableRows;
11
11
  return /*#__PURE__*/_react["default"].createElement("tbody", null, tableRows);
12
12
  };
13
- var _default = TableBody;
14
- exports["default"] = _default;
13
+ var _default = exports["default"] = TableBody;
@@ -12,5 +12,4 @@ var TableLayout = function TableLayout(_ref) {
12
12
  footer = _ref.footer;
13
13
  return /*#__PURE__*/_react["default"].createElement("table", null, header, body, footer);
14
14
  };
15
- var _default = TableLayout;
16
- exports["default"] = _default;
15
+ var _default = exports["default"] = TableLayout;
@@ -25,5 +25,4 @@ var TextFilter = function TextFilter(_ref) {
25
25
  }
26
26
  }));
27
27
  };
28
- var _default = TextFilter;
29
- exports["default"] = _default;
28
+ var _default = exports["default"] = TextFilter;
@@ -21,7 +21,8 @@ var _FilterLayout = _interopRequireDefault(require("./FilterLayout"));
21
21
  var _BooleanFilter = _interopRequireDefault(require("./BooleanFilter"));
22
22
  var _TextFilter = _interopRequireDefault(require("./TextFilter"));
23
23
  var _PaginationControl = _interopRequireDefault(require("./PaginationControl"));
24
- var DefaultTableConfig = (0, _immutable.Map)({
24
+ var _ColumnControl = _interopRequireDefault(require("./ColumnControl"));
25
+ var DefaultTableConfig = exports.DefaultTableConfig = (0, _immutable.Map)({
25
26
  TableLayout: _TableLayout["default"],
26
27
  Header: _Header["default"],
27
28
  HeaderRow: _HeaderRow["default"],
@@ -36,6 +37,6 @@ var DefaultTableConfig = (0, _immutable.Map)({
36
37
  FilterLayout: _FilterLayout["default"],
37
38
  TextFilter: _TextFilter["default"],
38
39
  BooleanFilter: _BooleanFilter["default"],
39
- PaginationControl: _PaginationControl["default"]
40
- });
41
- exports.DefaultTableConfig = DefaultTableConfig;
40
+ PaginationControl: _PaginationControl["default"],
41
+ ColumnControl: _ColumnControl["default"]
42
+ });
@@ -21,7 +21,7 @@ var _helpers = require("./helpers");
21
21
  var _SvgText = require("./SvgText");
22
22
  var _filter = _interopRequireDefault(require("../../../../assets/task/icons/filter.svg"));
23
23
  var _lodashEs = require("lodash-es");
24
- var Connector = /*#__PURE__*/function (_Component) {
24
+ var Connector = exports.Connector = /*#__PURE__*/function (_Component) {
25
25
  (0, _inherits2["default"])(Connector, _Component);
26
26
  var _super = (0, _createSuper2["default"])(Connector);
27
27
  function Connector(props) {
@@ -31,11 +31,24 @@ var Connector = /*#__PURE__*/function (_Component) {
31
31
  _this.setTreeBuilder = function (treeBuilder) {
32
32
  _this.treeBuilder = treeBuilder;
33
33
  };
34
+ /*****************************************************************************
35
+ * Click handlers *
36
+ ****************************************************************************/
34
37
  _this.onSelect = function (event) {
35
38
  if (typeof _this.props.onSelect === 'function') {
36
39
  _this.props.onSelect(_this.props.connector, event.shiftKey);
37
40
  }
38
41
  };
42
+ /*****************************************************************************
43
+ * Drag-and-drop support *
44
+ * Leverages the `watchDrag` helper exposed by the `TreeBuilder` instance. *
45
+ * On move we update this instance's `head` or `tail` properties and set *
46
+ * `dragging` to either "head" or "tail" so that the `draw` method knows if *
47
+ * we are drawing to a dragging point or to the center of a node. *
48
+ * On drop we check to see if the point we are dropping at is within a node *
49
+ * (we check that its a valid node as well) and dispatch a redux action to *
50
+ * persist the change or we reset the `head` or `tail` properties and `draw` *
51
+ ****************************************************************************/
39
52
  _this.dragHead = function (event) {
40
53
  _this.treeBuilder.watchDrag({
41
54
  relative: false,
@@ -90,18 +103,29 @@ var Connector = /*#__PURE__*/function (_Component) {
90
103
  _this.setTail(_this.props.tailNode.position, false);
91
104
  }
92
105
  };
106
+ // Dragging will be true when dragging by the head and false when called via
107
+ // dragging node.
93
108
  _this.setHead = function (point) {
94
109
  var dragging = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
95
110
  _this.dragging = dragging ? 'head' : null;
96
111
  _this.head = point;
97
112
  _this.draw();
98
113
  };
114
+ // Dragging will be true when dragging by the tail and false when called via
115
+ // dragging node.
99
116
  _this.setTail = function (point) {
100
117
  var dragging = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
101
118
  _this.dragging = dragging ? 'tail' : null;
102
119
  _this.tail = point;
103
120
  _this.draw();
104
121
  };
122
+ /*****************************************************************************
123
+ * Rendering *
124
+ * To make the drag-and-drop perform as fast as possible we manually *
125
+ * manipulate some DOM elements in the `draw` method below. Anything that *
126
+ * changes the instance's `head` or `tail` properties should also call *
127
+ * `draw` *
128
+ ****************************************************************************/
105
129
  _this.draw = function () {
106
130
  _this.connector.current.parentElement.style.display = '';
107
131
  var _getRectIntersections = (0, _helpers.getRectIntersections)((0, _assertThisInitialized2["default"])(_this)),
@@ -183,14 +207,6 @@ var Connector = /*#__PURE__*/function (_Component) {
183
207
  this.draw();
184
208
  }
185
209
  }
186
-
187
- /*****************************************************************************
188
- * Rendering *
189
- * To make the drag-and-drop perform as fast as possible we manually *
190
- * manipulate some DOM elements in the `draw` method below. Anything that *
191
- * changes the instance's `head` or `tail` properties should also call *
192
- * `draw` *
193
- ****************************************************************************/
194
210
  }, {
195
211
  key: "render",
196
212
  value: function render() {
@@ -288,5 +304,4 @@ var Connector = /*#__PURE__*/function (_Component) {
288
304
  }
289
305
  }]);
290
306
  return Connector;
291
- }(_react.Component);
292
- exports.Connector = Connector;
307
+ }(_react.Component);
@@ -81,11 +81,10 @@ var handleSubmit = function handleSubmit(_ref4) {
81
81
  return connector.merge(values);
82
82
  };
83
83
  };
84
- var ConnectorForm = (0, _Form.generateForm)({
84
+ var ConnectorForm = exports.ConnectorForm = (0, _Form.generateForm)({
85
85
  formOptions: ['connector', 'tasks', 'tree'],
86
86
  dataSources: dataSources,
87
87
  fields: fields,
88
88
  handleSubmit: handleSubmit
89
89
  });
90
- exports.ConnectorForm = ConnectorForm;
91
90
  ConnectorForm.displayName = 'ConnectorForm';