@kineticdata/react 6.0.1 → 6.0.3

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 (258) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/lib/apis/agent/adapters.js +2 -3
  3. package/lib/apis/agent/bridges.js +7 -13
  4. package/lib/apis/agent/handlers.js +7 -13
  5. package/lib/apis/core/activity.js +2 -3
  6. package/lib/apis/core/attributeDefinitions.js +6 -11
  7. package/lib/apis/core/attributeDefinitions.test.js +201 -213
  8. package/lib/apis/core/authentication.js +74 -84
  9. package/lib/apis/core/backgroundJobs.js +5 -9
  10. package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
  11. package/lib/apis/core/bridgeModelAttributes.js +6 -11
  12. package/lib/apis/core/bridgeModelMappings.js +5 -10
  13. package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
  14. package/lib/apis/core/bridgeModelQualifications.js +5 -10
  15. package/lib/apis/core/bridgeModels.js +7 -13
  16. package/lib/apis/core/bridgeModels.test.js +313 -333
  17. package/lib/apis/core/bridgedresources.js +7 -13
  18. package/lib/apis/core/categories.js +6 -11
  19. package/lib/apis/core/fileResources.js +5 -10
  20. package/lib/apis/core/filestores.js +5 -10
  21. package/lib/apis/core/formTypes.js +6 -11
  22. package/lib/apis/core/forms.js +6 -11
  23. package/lib/apis/core/forms.test.js +201 -213
  24. package/lib/apis/core/kapps.js +6 -11
  25. package/lib/apis/core/kapps.test.js +122 -130
  26. package/lib/apis/core/logs.js +3 -5
  27. package/lib/apis/core/memberships.js +3 -5
  28. package/lib/apis/core/meta.js +6 -11
  29. package/lib/apis/core/notices.js +2 -3
  30. package/lib/apis/core/oauthClients.js +6 -11
  31. package/lib/apis/core/platformComponents.js +10 -19
  32. package/lib/apis/core/platformItems.js +2 -3
  33. package/lib/apis/core/profile.js +3 -5
  34. package/lib/apis/core/securityPolicyDefinitions.js +6 -11
  35. package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
  36. package/lib/apis/core/space.js +3 -5
  37. package/lib/apis/core/space.test.js +106 -114
  38. package/lib/apis/core/submissions.js +19 -35
  39. package/lib/apis/core/teams.js +6 -11
  40. package/lib/apis/core/translations.js +18 -35
  41. package/lib/apis/core/translations.test.js +1343 -1437
  42. package/lib/apis/core/users.js +6 -11
  43. package/lib/apis/core/version.js +2 -3
  44. package/lib/apis/core/webApis.js +5 -10
  45. package/lib/apis/core/webhooks.js +6 -11
  46. package/lib/apis/core/webhooks.test.js +243 -257
  47. package/lib/apis/core/webhooksJobs.js +3 -5
  48. package/lib/apis/core/workflows.js +7 -13
  49. package/lib/apis/http.js +16 -31
  50. package/lib/apis/system/index.js +46 -91
  51. package/lib/apis/task/index.js +60 -119
  52. package/lib/components/agent/bridge/BridgeForm.js +1 -2
  53. package/lib/components/agent/bridge/BridgeTable.js +1 -2
  54. package/lib/components/agent/filestore/FilestoreForm.js +1 -2
  55. package/lib/components/agent/filestore/FilestoreTable.js +1 -2
  56. package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
  57. package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
  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 +7 -12
  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 +1 -2
  80. package/lib/components/common/defaults/index.js +2 -3
  81. package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
  82. package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
  83. package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
  84. package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
  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 +1 -2
  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 +2 -4
  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 +4 -4
  99. package/lib/components/core/form/FormTable.js +1 -2
  100. package/lib/components/core/form_type/FormTypeForm.js +1 -2
  101. package/lib/components/core/form_type/FormTypeTable.js +1 -2
  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 +1 -2
  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 +1 -2
  111. package/lib/components/core/log/LogTable.js +2 -4
  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 +1 -2
  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 +2 -4
  125. package/lib/components/core/submission/KappSubmissionTable.js +2 -4
  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 +1 -2
  130. package/lib/components/core/team/TeamTable.js +1 -2
  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 +1 -2
  139. package/lib/components/core/webapi/WebApiForm.js +97 -101
  140. package/lib/components/core/webapi/WebApiTable.js +1 -2
  141. package/lib/components/core/webhook/WebhookForm.js +1 -2
  142. package/lib/components/core/webhook/WebhookTable.js +1 -2
  143. package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
  144. package/lib/components/form/Form.helpers.js +10 -19
  145. package/lib/components/form/Form.js +312 -355
  146. package/lib/components/form/Form.models.js +6 -11
  147. package/lib/components/form/FormState.js +3 -3
  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 +4354 -4508
  174. package/lib/components/form/tests/components.js +73 -64
  175. package/lib/components/index.js +7 -0
  176. package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
  177. package/lib/components/system/SystemCassandraForm.js +1 -2
  178. package/lib/components/system/SystemElasticSearchForm.js +1 -2
  179. package/lib/components/system/SystemFilestoreForm.js +2 -3
  180. package/lib/components/system/SystemForm.js +1 -2
  181. package/lib/components/system/SystemIngressForm.js +1 -2
  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 +1 -2
  185. package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
  186. package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
  187. package/lib/components/system/SystemUserForm.js +1 -2
  188. package/lib/components/system/helpers.js +11 -21
  189. package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
  190. package/lib/components/system/spaces/SystemTenantForm.js +2 -3
  191. package/lib/components/system/spaces/SystemTenantTable.js +1 -2
  192. package/lib/components/table/Table.js +48 -51
  193. package/lib/components/table/Table.redux.js +161 -188
  194. package/lib/components/table/Table.test.js +115 -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 +1 -2
  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 +2 -3
  212. package/lib/components/table/tests/Table.redux.test.js +162 -0
  213. package/lib/components/table/tests/Table.test.js +767 -0
  214. package/lib/components/table/tests/components.js +182 -0
  215. package/lib/components/task/builder/Connector.js +26 -11
  216. package/lib/components/task/builder/ConnectorForm.js +1 -2
  217. package/lib/components/task/builder/Node.js +18 -9
  218. package/lib/components/task/builder/NodeForm.js +1 -2
  219. package/lib/components/task/builder/NodeParametersForm.js +1 -2
  220. package/lib/components/task/builder/SvgCanvas.js +2 -3
  221. package/lib/components/task/builder/SvgText.js +2 -3
  222. package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
  223. package/lib/components/task/builder/TreeBuilder.js +14 -5
  224. package/lib/components/task/builder/builder.redux.js +187 -186
  225. package/lib/components/task/builder/constants.js +38 -76
  226. package/lib/components/task/builder/helpers.js +23 -40
  227. package/lib/components/task/builder/models.js +24 -35
  228. package/lib/components/task/category/TaskCategoryForm.js +2 -3
  229. package/lib/components/task/category/TaskCategoryTable.js +1 -2
  230. package/lib/components/task/common/UsageTable.js +1 -2
  231. package/lib/components/task/engine/EngineSettingsForm.js +2 -3
  232. package/lib/components/task/errors/RunErrorTable.js +2 -3
  233. package/lib/components/task/errors/SystemErrorsTable.js +1 -2
  234. package/lib/components/task/handlers/HandlerForm.js +2 -3
  235. package/lib/components/task/handlers/HandlerTable.js +1 -2
  236. package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
  237. package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
  238. package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
  239. package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
  240. package/lib/components/task/runs/RunTable.js +2 -3
  241. package/lib/components/task/runs/RunTaskTable.js +1 -2
  242. package/lib/components/task/sources/SourceForm.js +1 -2
  243. package/lib/components/task/sources/SourceTable.js +1 -2
  244. package/lib/components/task/triggers/TriggerTable.js +2 -3
  245. package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
  246. package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
  247. package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
  248. package/lib/components/task/workflows/WorkflowForm.js +91 -41
  249. package/lib/components/task/workflows/WorkflowTable.js +1 -2
  250. package/lib/helpers/SearchBuilder.js +2 -4
  251. package/lib/helpers/index.js +13 -26
  252. package/lib/index.js +3 -6
  253. package/lib/reducer.js +3 -5
  254. package/lib/saga.js +32 -48
  255. package/lib/store.js +32 -42
  256. package/package.json +12 -15
  257. package/lib/components/core/CoreFormModal.js +0 -64
  258. package/lib/components/core/CoreModal.js +0 -114
@@ -28,14 +28,13 @@ var formTrees = function formTrees(webhookEvents) {
28
28
  return "Submission ".concat(event);
29
29
  });
30
30
  };
31
- var getPossibleTrees = function getPossibleTrees(_ref) {
31
+ var getPossibleTrees = exports.getPossibleTrees = function getPossibleTrees(_ref) {
32
32
  var kappSlug = _ref.kappSlug,
33
33
  formSlug = _ref.formSlug,
34
34
  spaceWebhookEvents = _ref.spaceWebhookEvents,
35
35
  kappWebhookEvents = _ref.kappWebhookEvents;
36
36
  return kappSlug && formSlug ? formTrees(kappWebhookEvents) : !kappSlug && formSlug ? formTrees(spaceWebhookEvents) : kappSlug ? kappTrees(kappWebhookEvents) : spaceTrees(spaceWebhookEvents);
37
37
  };
38
- exports.getPossibleTrees = getPossibleTrees;
39
38
  var dataSources = function dataSources(_ref2) {
40
39
  var workflowId = _ref2.workflowId,
41
40
  kappSlug = _ref2.kappSlug,
@@ -240,10 +239,9 @@ var fields = function fields(_ref8) {
240
239
  }];
241
240
  };
242
241
  };
243
- var LinkedWorkflowForm = (0, _Form.generateForm)({
242
+ var LinkedWorkflowForm = exports.LinkedWorkflowForm = (0, _Form.generateForm)({
244
243
  formOptions: ['kappSlug', 'formSlug', 'workflowId', 'cloneGuid', 'scope'],
245
244
  dataSources: dataSources,
246
245
  handleSubmit: handleSubmit,
247
246
  fields: fields
248
- });
249
- exports.LinkedWorkflowForm = LinkedWorkflowForm;
247
+ });
@@ -143,11 +143,10 @@ var columns = [{
143
143
  sortable: false,
144
144
  toggleable: true
145
145
  }];
146
- var LinkedWorkflowTable = (0, _Table.generateTable)({
146
+ var LinkedWorkflowTable = exports.LinkedWorkflowTable = (0, _Table.generateTable)({
147
147
  tableOptions: ['kappSlug', 'formSlug'],
148
148
  columns: columns,
149
149
  filters: filters,
150
150
  dataSource: dataSource
151
151
  });
152
- exports.LinkedWorkflowTable = LinkedWorkflowTable;
153
152
  LinkedWorkflowTable.displayName = 'LinkedWorkflowTable';
@@ -48,11 +48,10 @@ var columns = [{
48
48
  title: 'Nodes',
49
49
  sortable: true
50
50
  }];
51
- var MissingRoutineTable = (0, _Table.generateTable)({
51
+ var MissingRoutineTable = exports.MissingRoutineTable = (0, _Table.generateTable)({
52
52
  tableOptions: [],
53
53
  columns: columns,
54
54
  filters: filters,
55
55
  dataSource: dataSource
56
56
  });
57
- exports.MissingRoutineTable = MissingRoutineTable;
58
57
  MissingRoutineTable.displayName = 'MissingRoutineTable';
@@ -9,6 +9,10 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _apis = require("../../../apis");
10
10
  var _Form = require("../../form/Form");
11
11
  var _immutable = require("immutable");
12
+ var _helpers = require("../../../helpers");
13
+ var SPACE_INCLUDES = 'formAttributeDefinitions,spaceAttributeDefinitions,teamAttributeDefinitions,userAttributeDefinitions,userProfileAttributeDefinitions';
14
+ var KAPP_INCLUDES = 'formAttributeDefinitions,kappAttributeDefinitions,fields';
15
+
12
16
  // bulids a definition id based on a name (similar to slugify)
13
17
  var buildDefinitionId = function buildDefinitionId(text) {
14
18
  return text.trim()
@@ -19,12 +23,14 @@ var buildDefinitionId = function buildDefinitionId(text) {
19
23
  // Remove unwanted chars
20
24
  .replace(/[^A-Za-z0-9_]+/g, '');
21
25
  };
22
- var dataSources = function dataSources() {
26
+ var dataSources = function dataSources(_ref) {
27
+ var kappSlug = _ref.kappSlug,
28
+ workflow = _ref.workflow;
23
29
  return {
24
30
  selectedSource: {
25
31
  fn: _apis.fetchSource,
26
- params: function params(_ref) {
27
- var values = _ref.values;
32
+ params: function params(_ref2) {
33
+ var values = _ref2.values;
28
34
  return values && values.get('sourceName') && [{
29
35
  sourceName: values.get('sourceName'),
30
36
  include: 'predefinedSourceGroups,predefinedTreeNames'
@@ -52,18 +58,37 @@ var dataSources = function dataSources() {
52
58
  transform: function transform(result) {
53
59
  return result.categories;
54
60
  }
61
+ },
62
+ space: {
63
+ fn: _apis.fetchSpace,
64
+ params: [{
65
+ include: SPACE_INCLUDES
66
+ }],
67
+ transform: function transform(result) {
68
+ return result.space;
69
+ }
70
+ },
71
+ kapp: {
72
+ fn: _apis.fetchKapp,
73
+ params: kappSlug && [{
74
+ kappSlug: kappSlug,
75
+ include: KAPP_INCLUDES
76
+ }],
77
+ transform: function transform(result) {
78
+ return result.kapp;
79
+ }
55
80
  }
56
81
  };
57
82
  };
58
- var handleSubmit = function handleSubmit(_ref2) {
59
- var workflow = _ref2.workflow;
83
+ var handleSubmit = function handleSubmit(_ref3) {
84
+ var workflow = _ref3.workflow;
60
85
  return function (values) {
61
86
  if (!workflow) {
62
87
  return (0, _apis.createTree)({
63
88
  tree: values.toJS()
64
- }).then(function (_ref3) {
65
- var tree = _ref3.tree,
66
- error = _ref3.error;
89
+ }).then(function (_ref4) {
90
+ var tree = _ref4.tree,
91
+ error = _ref4.error;
67
92
  if (error) {
68
93
  throw error.statusCode === 400 && error.message || 'There was an error saving the workflow';
69
94
  } else {
@@ -75,19 +100,19 @@ var handleSubmit = function handleSubmit(_ref2) {
75
100
  }
76
101
  };
77
102
  };
78
- var fields = function fields(_ref4) {
79
- var name = _ref4.name,
80
- workflow = _ref4.workflow,
81
- workflowType = _ref4.workflowType;
82
- return function (_ref5) {
83
- var categories = _ref5.categories;
103
+ var fields = function fields(_ref5) {
104
+ var name = _ref5.name,
105
+ workflow = _ref5.workflow,
106
+ workflowType = _ref5.workflowType;
107
+ return function (_ref6) {
108
+ var categories = _ref6.categories;
84
109
  return (!name || workflow) && categories && [{
85
110
  name: 'sourceName',
86
111
  label: 'Source',
87
112
  type: 'select',
88
113
  required: true,
89
- options: function options(_ref6) {
90
- var sources = _ref6.sources;
114
+ options: function options(_ref7) {
115
+ var sources = _ref7.sources;
91
116
  return sources;
92
117
  },
93
118
  initialValue: workflow ? workflow.get('sourceName') : workflowType === 'routines' ? '-' : '',
@@ -98,8 +123,8 @@ var fields = function fields(_ref4) {
98
123
  label: 'Source Group',
99
124
  type: 'text',
100
125
  required: true,
101
- options: function options(_ref7) {
102
- var selectedSource = _ref7.selectedSource;
126
+ options: function options(_ref8) {
127
+ var selectedSource = _ref8.selectedSource;
103
128
  return selectedSource ? selectedSource.get('predefinedSourceGroups').map(function (g) {
104
129
  return (0, _immutable.Map)({
105
130
  label: g,
@@ -118,13 +143,35 @@ var fields = function fields(_ref4) {
118
143
  required: workflow && !!workflow.get('event'),
119
144
  visible: workflow && !!workflow.get('event'),
120
145
  enabled: false
146
+ }, {
147
+ name: 'filter',
148
+ label: 'Filter',
149
+ type: 'code',
150
+ language: 'js',
151
+ initialValue: workflow ? workflow.get('filter') : '',
152
+ required: false,
153
+ // use event to show filter on linked workflows
154
+ visible: workflow && !!workflow.get('event'),
155
+ options: function options(_ref9) {
156
+ var space = _ref9.space,
157
+ kapp = _ref9.kapp,
158
+ values = _ref9.values;
159
+ var type = ['File Resource', 'Kapp', 'Form', 'Submission', 'Team', 'User'].find(function (scope) {
160
+ return values.get('event').includes(scope);
161
+ });
162
+ return (0, _helpers.buildBindings)({
163
+ space: space,
164
+ kapp: kapp,
165
+ scope: type
166
+ });
167
+ }
121
168
  }, {
122
169
  name: 'name',
123
170
  label: 'Name',
124
171
  type: 'text',
125
172
  required: true,
126
- options: function options(_ref8) {
127
- var selectedSource = _ref8.selectedSource;
173
+ options: function options(_ref10) {
174
+ var selectedSource = _ref10.selectedSource;
128
175
  return selectedSource ? selectedSource.get('predefinedTreeNames').map(function (n) {
129
176
  return (0, _immutable.Map)({
130
177
  label: n,
@@ -132,9 +179,9 @@ var fields = function fields(_ref4) {
132
179
  });
133
180
  }) : (0, _immutable.List)();
134
181
  },
135
- onChange: function onChange(_ref9, _ref10) {
136
- var values = _ref9.values;
137
- var setValue = _ref10.setValue;
182
+ onChange: function onChange(_ref11, _ref12) {
183
+ var values = _ref11.values;
184
+ var setValue = _ref12.setValue;
138
185
  if (values.has('definitionId') && values.get('linked')) {
139
186
  setValue('definitionId', buildDefinitionId(values.get('name')), false);
140
187
  }
@@ -154,14 +201,14 @@ var fields = function fields(_ref4) {
154
201
  type: 'text',
155
202
  enabled: !name && !workflow,
156
203
  required: true,
157
- onChange: function onChange(_bindings, _ref11) {
158
- var setValue = _ref11.setValue;
204
+ onChange: function onChange(_bindings, _ref13) {
205
+ var setValue = _ref13.setValue;
159
206
  setValue('linked', false);
160
207
  },
161
208
  initialValue: (0, _immutable.get)(workflow, 'definitionId', '') || '',
162
209
  helpText: 'Definition ID is generated by the system and used for API requests',
163
- serialize: function serialize(_ref12) {
164
- var values = _ref12.values;
210
+ serialize: function serialize(_ref14) {
211
+ var values = _ref14.values;
165
212
  return name || workflow ? values.get('definitionId') : "routine_".concat(values.get('definitionId'));
166
213
  }
167
214
  }, {
@@ -253,17 +300,19 @@ var fields = function fields(_ref4) {
253
300
  }];
254
301
  };
255
302
  };
256
- var WorkflowForm = function WorkflowForm(_ref13) {
257
- var addFields = _ref13.addFields,
258
- alterFields = _ref13.alterFields,
259
- fieldSet = _ref13.fieldSet,
260
- formKey = _ref13.formKey,
261
- components = _ref13.components,
262
- onSave = _ref13.onSave,
263
- onError = _ref13.onError,
264
- children = _ref13.children,
265
- workflow = _ref13.workflow,
266
- workflowType = _ref13.workflowType;
303
+ var WorkflowForm = exports.WorkflowForm = function WorkflowForm(_ref15) {
304
+ var addFields = _ref15.addFields,
305
+ alterFields = _ref15.alterFields,
306
+ fieldSet = _ref15.fieldSet,
307
+ formKey = _ref15.formKey,
308
+ components = _ref15.components,
309
+ onSave = _ref15.onSave,
310
+ onError = _ref15.onError,
311
+ children = _ref15.children,
312
+ workflow = _ref15.workflow,
313
+ workflowType = _ref15.workflowType,
314
+ uncontrolled = _ref15.uncontrolled,
315
+ kappSlug = _ref15.kappSlug;
267
316
  return /*#__PURE__*/_react["default"].createElement(_Form.Form, {
268
317
  addFields: addFields,
269
318
  alterFields: alterFields,
@@ -276,9 +325,10 @@ var WorkflowForm = function WorkflowForm(_ref13) {
276
325
  dataSources: dataSources,
277
326
  fields: fields,
278
327
  formOptions: {
328
+ kappSlug: kappSlug,
279
329
  workflow: workflow,
280
330
  workflowType: workflowType
281
- }
331
+ },
332
+ uncontrolled: uncontrolled
282
333
  }, children);
283
- };
284
- exports.WorkflowForm = WorkflowForm;
334
+ };
@@ -176,12 +176,11 @@ var columns = [{
176
176
  sortable: false,
177
177
  toggleable: true
178
178
  }];
179
- var WorkflowTable = (0, _Table.generateTable)({
179
+ var WorkflowTable = exports.WorkflowTable = (0, _Table.generateTable)({
180
180
  tableOptions: ['alterData', 'workflowType', 'sourceName', 'sourceGroup'],
181
181
  columns: columns,
182
182
  filters: filters,
183
183
  filterDataSources: filterDataSources,
184
184
  dataSource: dataSource
185
185
  });
186
- exports.WorkflowTable = WorkflowTable;
187
186
  WorkflowTable.displayName = 'WorkflowTable';
@@ -11,14 +11,12 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/es
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
12
12
  var _immutable = require("immutable");
13
13
  var _lodashEs = require("lodash-es");
14
- var defineKqlQuery = function defineKqlQuery() {
14
+ var defineKqlQuery = exports.defineKqlQuery = function defineKqlQuery() {
15
15
  return new SearchBuilder('kql');
16
16
  };
17
- exports.defineKqlQuery = defineKqlQuery;
18
- var defineFilter = function defineFilter(caseInsensitive, rootOperator) {
17
+ var defineFilter = exports.defineFilter = function defineFilter(caseInsensitive, rootOperator) {
19
18
  return new SearchBuilder('filter', caseInsensitive, rootOperator);
20
19
  };
21
- exports.defineFilter = defineFilter;
22
20
  var SearchBuilder = /*#__PURE__*/function () {
23
21
  function SearchBuilder(type) {
24
22
  var caseInsensitive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -34,12 +34,11 @@ Object.keys(_SearchBuilder).forEach(function (key) {
34
34
  }
35
35
  });
36
36
  });
37
- var K = typeof window !== "undefined" ? window.K : function () {};
37
+ var K = exports.K = typeof window !== "undefined" ? window.K : function () {};
38
38
  // platform consoles and other apps may not load app head content that
39
39
  // instantiates the bundle object used by some of these helpers so we create a
40
40
  // mock version here
41
- exports.K = K;
42
- var bundle = typeof window !== "undefined" && window.bundle ? window.bundle : {
41
+ var bundle = exports.bundle = typeof window !== "undefined" && window.bundle ? window.bundle : {
43
42
  apiLocation: function apiLocation() {
44
43
  return "".concat(process.env.REACT_APP_API_HOST || '', "/app/api/v1");
45
44
  },
@@ -52,7 +51,6 @@ var bundle = typeof window !== "undefined" && window.bundle ? window.bundle : {
52
51
  };
53
52
  // when running the bundle in dev mode there will already be a bundle object but
54
53
  // we want to prefix the locations with the REACT_APP_API_HOST value
55
- exports.bundle = bundle;
56
54
  if (typeof window !== "undefined" && window.bundle && process.env.REACT_APP_API_HOST) {
57
55
  var spaceLocation = window.bundle.spaceLocation();
58
56
  var apiLocation = window.bundle.apiLocation();
@@ -63,7 +61,7 @@ if (typeof window !== "undefined" && window.bundle && process.env.REACT_APP_API_
63
61
  return process.env.REACT_APP_API_HOST + apiLocation;
64
62
  };
65
63
  }
66
- var splitTeamName = function splitTeamName(team) {
64
+ var splitTeamName = exports.splitTeamName = function splitTeamName(team) {
67
65
  var _team$get$split$rever = team.get('name').split('::').reverse(),
68
66
  _team$get$split$rever2 = (0, _toArray2["default"])(_team$get$split$rever),
69
67
  local = _team$get$split$rever2[0],
@@ -73,16 +71,14 @@ var splitTeamName = function splitTeamName(team) {
73
71
 
74
72
  // Applies fn to each value in list, splitting it into a new list each time fn
75
73
  // returns a different value.
76
- exports.splitTeamName = splitTeamName;
77
- var partitionListBy = function partitionListBy(fn, list) {
74
+ var partitionListBy = exports.partitionListBy = function partitionListBy(fn, list) {
78
75
  return list.isEmpty() ? (0, _immutable.List)() : list.rest().reduce(function (reduction, current) {
79
76
  return fn(reduction.last().last(), current) ? reduction.push((0, _immutable.List)([current])) : reduction.update(reduction.size - 1, function (list) {
80
77
  return list.push(current);
81
78
  });
82
79
  }, (0, _immutable.List)([(0, _immutable.List)([list.first()])]));
83
80
  };
84
- exports.partitionListBy = partitionListBy;
85
- var generateKey = function generateKey() {
81
+ var generateKey = exports.generateKey = function generateKey() {
86
82
  var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;
87
83
  var result = '';
88
84
  while (result.length < length) {
@@ -90,8 +86,7 @@ var generateKey = function generateKey() {
90
86
  }
91
87
  return result;
92
88
  };
93
- exports.generateKey = generateKey;
94
- var slugify = function slugify(text) {
89
+ var slugify = exports.slugify = function slugify(text) {
95
90
  return text.trim()
96
91
  // Convert uppercase to lowercase
97
92
  .toLowerCase()
@@ -100,8 +95,7 @@ var slugify = function slugify(text) {
100
95
  // Remove all non-word chars
101
96
  .replace(/[^A-Za-z0-9\u0080-\u00FF-]+/g, '');
102
97
  };
103
- exports.slugify = slugify;
104
- var buildDefinitionId = function buildDefinitionId(text) {
98
+ var buildDefinitionId = exports.buildDefinitionId = function buildDefinitionId(text) {
105
99
  return text.trim()
106
100
  // Convert uppercase to lowercase
107
101
  .toLowerCase()
@@ -110,7 +104,6 @@ var buildDefinitionId = function buildDefinitionId(text) {
110
104
  // Remove unwanted chars
111
105
  .replace(/[^A-Za-z0-9_]+/g, '');
112
106
  };
113
- exports.buildDefinitionId = buildDefinitionId;
114
107
  var FILE_STATIC_BINDINGS = [['Folder', 'folder'], ['Name', 'name'], ['Path', 'path']];
115
108
  var SUBMISSION_STATIC_BINDINGS = [['Anonymous', 'anonymous'], ['Closed At', 'closedAt'], ['Closed By', 'closedBy'], ['Core State', 'coreState'], ['Created At', 'createdAt'], ['Created By', 'createdBy'], ['Current Page', 'currentPage'], ['Id', 'id'], ['Session Token', 'sessionToken'], ['Submitted At', 'submittedAt'], ['Submitted By', 'submittedBy'], ['Type', 'type'], ['Updated At', 'updatedAt'], ['Updated By', 'updatedBy']];
116
109
  var TEAM_STATIC_BINDINGS = [['Name', 'name'], ['Slug', 'slug']];
@@ -157,7 +150,7 @@ var bindify = function bindify(fnName, staticMap) {
157
150
  });
158
151
  }));
159
152
  };
160
- var buildBindings = function buildBindings(_ref) {
153
+ var buildBindings = exports.buildBindings = function buildBindings(_ref) {
161
154
  var space = _ref.space,
162
155
  kapp = _ref.kapp,
163
156
  form = _ref.form,
@@ -190,12 +183,10 @@ var buildBindings = function buildBindings(_ref) {
190
183
  return o.get('children') && !o.get('children').isEmpty() || o.has('value');
191
184
  });
192
185
  };
193
- exports.buildBindings = buildBindings;
194
- var buildAgentPath = function buildAgentPath(options) {
186
+ var buildAgentPath = exports.buildAgentPath = function buildAgentPath(options) {
195
187
  return "".concat(bundle.spaceLocation(), "/app/components/agents/").concat(options.agentSlug ? options.agentSlug : 'system');
196
188
  };
197
- exports.buildAgentPath = buildAgentPath;
198
- var handleFormErrors = function handleFormErrors(key) {
189
+ var handleFormErrors = exports.handleFormErrors = function handleFormErrors(key) {
199
190
  return function (result) {
200
191
  var error = result.error;
201
192
  if (error) {
@@ -204,10 +195,6 @@ var handleFormErrors = function handleFormErrors(key) {
204
195
  return key ? result[key] : result;
205
196
  };
206
197
  };
207
- exports.handleFormErrors = handleFormErrors;
208
- var INDEX_STATIC_PARTS = ['closedBy', 'coreState', 'createdBy', 'handle', 'submittedBy', 'type', 'updatedBy'].sort();
209
- exports.INDEX_STATIC_PARTS = INDEX_STATIC_PARTS;
210
- var TIMELINES = ['createdAt', 'updatedAt', 'submittedAt', 'closedAt'].sort();
211
- exports.TIMELINES = TIMELINES;
212
- var MAX_PART_LENGTH = 10;
213
- exports.MAX_PART_LENGTH = MAX_PART_LENGTH;
198
+ var INDEX_STATIC_PARTS = exports.INDEX_STATIC_PARTS = ['closedBy', 'coreState', 'createdBy', 'handle', 'submittedBy', 'type', 'updatedBy'].sort();
199
+ var TIMELINES = exports.TIMELINES = ['createdAt', 'updatedAt', 'submittedAt', 'closedAt'].sort();
200
+ var MAX_PART_LENGTH = exports.MAX_PART_LENGTH = 10;
package/lib/index.js CHANGED
@@ -61,7 +61,7 @@ Object.keys(_helpers).forEach(function (key) {
61
61
  });
62
62
  });
63
63
  var requestInterceptor = new _RequestInterceptor["default"](_store.store);
64
- var authInterceptor = new _AuthInterceptor["default"](_store.store,
64
+ var authInterceptor = exports.authInterceptor = new _AuthInterceptor["default"](_store.store,
65
65
  // callback to invoke when we get a 401 response
66
66
  function () {
67
67
  return (0, _store.action)('TIMEOUT');
@@ -74,12 +74,11 @@ function (state) {
74
74
  function (state) {
75
75
  return !state.getIn(['session', 'loggedIn']);
76
76
  });
77
- exports.authInterceptor = authInterceptor;
78
77
  _axios["default"].defaults.withCredentials = true;
79
78
  _axios["default"].interceptors.request.use(requestInterceptor.handleFulfilled);
80
79
  _axios["default"].interceptors.response.use(null, authInterceptor.handleRejected);
81
80
  (0, _store.commitStore)();
82
- var KineticLib = function KineticLib(props) {
81
+ var KineticLib = exports.KineticLib = function KineticLib(props) {
83
82
  return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
84
83
  store: _store.store,
85
84
  context: _store.context
@@ -94,6 +93,4 @@ var KineticLib = function KineticLib(props) {
94
93
  system: props.system
95
94
  }, props.children) : props.children))));
96
95
  };
97
- exports.KineticLib = KineticLib;
98
- var history = typeof window !== 'undefined' && window.bundle ? (0, _history.createHashHistory)() : null;
99
- exports.history = history;
96
+ var history = exports.history = typeof window !== 'undefined' && window.bundle ? (0, _history.createHashHistory)() : null;
package/lib/reducer.js CHANGED
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.regHandlers = exports.reducer = void 0;
7
7
  var handlers = {};
8
- var regHandlers = function regHandlers(newHandlers) {
8
+ var regHandlers = exports.regHandlers = function regHandlers(newHandlers) {
9
9
  Object.assign(handlers, newHandlers);
10
10
  };
11
- exports.regHandlers = regHandlers;
12
- var reducer = function reducer(state, action) {
11
+ var reducer = exports.reducer = function reducer(state, action) {
13
12
  return handlers[action.type] ? handlers[action.type](state, action) : state;
14
- };
15
- exports.reducer = reducer;
13
+ };
package/lib/saga.js CHANGED
@@ -15,52 +15,42 @@ var _symbols = require("@redux-saga/symbols");
15
15
  // regSaga function.
16
16
  var supportedEffects = [effects.takeEvery('NOOP', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
17
17
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
18
- while (1) {
19
- switch (_context.prev = _context.next) {
20
- case 0:
21
- case "end":
22
- return _context.stop();
23
- }
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ case "end":
21
+ return _context.stop();
24
22
  }
25
23
  }, _callee);
26
24
  })).payload.fn, effects.takeLatest('NOOP', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
27
25
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
28
- while (1) {
29
- switch (_context2.prev = _context2.next) {
30
- case 0:
31
- case "end":
32
- return _context2.stop();
33
- }
26
+ while (1) switch (_context2.prev = _context2.next) {
27
+ case 0:
28
+ case "end":
29
+ return _context2.stop();
34
30
  }
35
31
  }, _callee2);
36
32
  })).payload.fn, effects.takeLeading('NOOP', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
37
33
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
38
- while (1) {
39
- switch (_context3.prev = _context3.next) {
40
- case 0:
41
- case "end":
42
- return _context3.stop();
43
- }
34
+ while (1) switch (_context3.prev = _context3.next) {
35
+ case 0:
36
+ case "end":
37
+ return _context3.stop();
44
38
  }
45
39
  }, _callee3);
46
40
  })).payload.fn, effects.throttle(0, 'NOOP', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
47
41
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
48
- while (1) {
49
- switch (_context4.prev = _context4.next) {
50
- case 0:
51
- case "end":
52
- return _context4.stop();
53
- }
42
+ while (1) switch (_context4.prev = _context4.next) {
43
+ case 0:
44
+ case "end":
45
+ return _context4.stop();
54
46
  }
55
47
  }, _callee4);
56
48
  })).payload.fn, effects.debounce(0, 'NOOP', /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
57
49
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
58
- while (1) {
59
- switch (_context5.prev = _context5.next) {
60
- case 0:
61
- case "end":
62
- return _context5.stop();
63
- }
50
+ while (1) switch (_context5.prev = _context5.next) {
51
+ case 0:
52
+ case "end":
53
+ return _context5.stop();
64
54
  }
65
55
  }, _callee5);
66
56
  })).payload.fn];
@@ -85,8 +75,7 @@ var parseSagaEffect = function parseSagaEffect(sagaEffect) {
85
75
  throw new Error('regSaga called with single value that is not not a saga effect');
86
76
  }
87
77
  };
88
- var sagaMiddleware = (0, _reduxSaga["default"])();
89
- exports.sagaMiddleware = sagaMiddleware;
78
+ var sagaMiddleware = exports.sagaMiddleware = (0, _reduxSaga["default"])();
90
79
  var generatorFns = {};
91
80
  var runningTasks = {};
92
81
  var pendingTasks = {};
@@ -96,7 +85,7 @@ var pendingTasks = {};
96
85
  * extract from which we can extract the name automatically. Or a pair of
97
86
  * arguments, the name and the saga generator function.
98
87
  */
99
- var regSaga = function regSaga(arg0, arg1) {
88
+ var regSaga = exports.regSaga = function regSaga(arg0, arg1) {
100
89
  if (arg1) {
101
90
  pendingTasks[arg0] = arg1;
102
91
  generatorFns[arg0] = arg1;
@@ -106,23 +95,20 @@ var regSaga = function regSaga(arg0, arg1) {
106
95
  genFn = _parseSagaEffect.genFn;
107
96
  pendingTasks[name] = /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
108
97
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
109
- while (1) {
110
- switch (_context6.prev = _context6.next) {
111
- case 0:
112
- _context6.next = 2;
113
- return arg0;
114
- case 2:
115
- case "end":
116
- return _context6.stop();
117
- }
98
+ while (1) switch (_context6.prev = _context6.next) {
99
+ case 0:
100
+ _context6.next = 2;
101
+ return arg0;
102
+ case 2:
103
+ case "end":
104
+ return _context6.stop();
118
105
  }
119
106
  }, _callee6);
120
107
  });
121
108
  generatorFns[name] = genFn;
122
109
  }
123
110
  };
124
- exports.regSaga = regSaga;
125
- var commitSagas = function commitSagas() {
111
+ var commitSagas = exports.commitSagas = function commitSagas() {
126
112
  Object.entries(pendingTasks).forEach(function (_ref) {
127
113
  var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
128
114
  name = _ref2[0],
@@ -134,11 +120,9 @@ var commitSagas = function commitSagas() {
134
120
  delete pendingTasks[name];
135
121
  });
136
122
  };
137
- exports.commitSagas = commitSagas;
138
- var runSaga = function runSaga(name) {
123
+ var runSaga = exports.runSaga = function runSaga(name) {
139
124
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
140
125
  args[_key - 1] = arguments[_key];
141
126
  }
142
127
  return generatorFns[name].apply(generatorFns, args);
143
- };
144
- exports.runSaga = runSaga;
128
+ };