@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
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getUsedFields = exports.getRemainingParts = exports.availableParts = void 0;
7
7
  var _immutable = require("immutable");
8
8
  var _helpers = require("../../../helpers");
9
- var getUsedFields = function getUsedFields(values, partIndex) {
9
+ var getUsedFields = exports.getUsedFields = function getUsedFields(values, partIndex) {
10
10
  var partType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'eq';
11
11
  var equalities = (0, _immutable.List)();
12
12
  if (partType === 'eq' && partIndex === 0) {
@@ -51,8 +51,7 @@ var getUsedFields = function getUsedFields(values, partIndex) {
51
51
  }
52
52
  return equalities;
53
53
  };
54
- exports.getUsedFields = getUsedFields;
55
- var availableParts = function availableParts(values, indexes, equalityFields) {
54
+ var availableParts = exports.availableParts = function availableParts(values, indexes, equalityFields) {
56
55
  var partType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'eq';
57
56
  var remainingParts = indexes.map(function (index) {
58
57
  return getRemainingParts(index.get('parts', (0, _immutable.List)()), equalityFields);
@@ -86,8 +85,7 @@ var availableParts = function availableParts(values, indexes, equalityFields) {
86
85
  });
87
86
  }
88
87
  };
89
- exports.availableParts = availableParts;
90
- var getRemainingParts = function getRemainingParts(src, dst) {
88
+ var getRemainingParts = exports.getRemainingParts = function getRemainingParts(src, dst) {
91
89
  if (src.size === 0 && dst.size === 0) return (0, _immutable.List)();
92
90
  // If we're matching so far, and the are no more to compare it's a match.
93
91
  if (src.size > 0 && dst.size === 0) return src;
@@ -95,5 +93,4 @@ var getRemainingParts = function getRemainingParts(src, dst) {
95
93
  if (src.size === 0 && dst.size > 0) return (0, _immutable.List)();
96
94
  if (src.first() === dst.first()) return getRemainingParts(src.shift(), dst.shift());
97
95
  return null;
98
- };
99
- exports.getRemainingParts = getRemainingParts;
96
+ };
@@ -9,7 +9,7 @@ var _apis = require("../../../apis");
9
9
  var _helpers = require("../../../helpers");
10
10
  var _immutable = require("immutable");
11
11
  var _Form2 = require("../../form/Form.helpers");
12
- var TEAM_INCLUDES = 'attributesMap,authorization,memberships.user';
12
+ var TEAM_INCLUDES = 'details,attributesMap,authorization,memberships.user';
13
13
  var dataSources = function dataSources(_ref) {
14
14
  var teamSlug = _ref.teamSlug;
15
15
  return {
@@ -116,11 +116,10 @@ var fields = function fields(_ref3) {
116
116
  }];
117
117
  };
118
118
  };
119
- var TeamForm = (0, _Form.generateForm)({
119
+ var TeamForm = exports.TeamForm = (0, _Form.generateForm)({
120
120
  formOptions: ['teamSlug'],
121
121
  dataSources: dataSources,
122
122
  fields: fields,
123
123
  handleSubmit: handleSubmit
124
124
  });
125
- exports.TeamForm = TeamForm;
126
125
  TeamForm.displayName = 'TeamForm';
@@ -40,28 +40,33 @@ var filters = function filters() {
40
40
  var columns = [{
41
41
  value: 'name',
42
42
  title: 'Name',
43
- sortable: true
43
+ sortable: true,
44
+ toggleable: false,
45
+ columnOrder: 'first'
44
46
  }, {
45
47
  value: 'updatedAt',
46
48
  title: 'Updated',
47
- sortable: true
49
+ sortable: true,
50
+ toggleable: true
48
51
  }, {
49
52
  value: 'createdAt',
50
53
  title: 'Created',
51
- sortable: true
54
+ sortable: true,
55
+ toggleable: true
52
56
  }, {
53
57
  value: 'description',
54
58
  title: 'Description',
55
- sortable: true
59
+ sortable: true,
60
+ toggleable: true
56
61
  }, {
57
62
  value: 'slug',
58
63
  title: 'Slug',
59
- sortable: true
64
+ sortable: true,
65
+ toggleable: true
60
66
  }];
61
- var TeamTable = (0, _Table.generateTable)({
67
+ var TeamTable = exports.TeamTable = (0, _Table.generateTable)({
62
68
  columns: columns,
63
69
  filters: filters,
64
70
  dataSource: dataSource
65
71
  });
66
- exports.TeamTable = TeamTable;
67
72
  TeamTable.displayName = 'TeamTable';
@@ -39,11 +39,10 @@ var fields = function fields(_ref2) {
39
39
  }];
40
40
  };
41
41
  };
42
- var ContextForm = (0, _Form.generateForm)({
42
+ var ContextForm = exports.ContextForm = (0, _Form.generateForm)({
43
43
  formOptions: ['contextName'],
44
44
  dataSources: dataSources,
45
45
  fields: fields,
46
46
  handleSubmit: handleSubmit
47
47
  });
48
- exports.ContextForm = ContextForm;
49
48
  ContextForm.displayName = 'ContextForm';
@@ -93,11 +93,10 @@ var columns = [{
93
93
  title: 'Context Name',
94
94
  sortable: true
95
95
  }];
96
- var ContextTable = (0, _Table.generateTable)({
96
+ var ContextTable = exports.ContextTable = (0, _Table.generateTable)({
97
97
  columns: columns,
98
98
  filters: filters,
99
99
  dataSource: dataSource,
100
100
  filterDataSources: filterDataSources
101
101
  });
102
- exports.ContextTable = ContextTable;
103
102
  ContextTable.displayName = 'ContextTable';
@@ -128,11 +128,10 @@ var fields = function fields(_ref2) {
128
128
  }];
129
129
  };
130
130
  };
131
- var EntryForm = (0, _Form.generateForm)({
131
+ var EntryForm = exports.EntryForm = (0, _Form.generateForm)({
132
132
  formOptions: ['tab', 'locale', 'contextName', 'keyHash'],
133
133
  dataSources: dataSources,
134
134
  fields: fields,
135
135
  handleSubmit: handleSubmit
136
136
  });
137
- exports.EntryForm = EntryForm;
138
137
  EntryForm.displayName = 'EntryForm';
@@ -97,12 +97,11 @@ var columns = [{
97
97
  title: 'New Translation',
98
98
  sortable: true
99
99
  }];
100
- var EntryTable = (0, _Table.generateTable)({
100
+ var EntryTable = exports.EntryTable = (0, _Table.generateTable)({
101
101
  tableOptions: ['staged', 'shared', 'locale', 'keyHash', 'context'],
102
102
  columns: columns,
103
103
  filters: filters,
104
104
  dataSource: dataSource,
105
105
  filterDataSources: filterDataSources
106
106
  });
107
- exports.EntryTable = EntryTable;
108
107
  EntryTable.displayName = 'EntryTable';
@@ -45,10 +45,9 @@ var fields = function fields() {
45
45
  }];
46
46
  };
47
47
  };
48
- var LocaleForm = (0, _Form.generateForm)({
48
+ var LocaleForm = exports.LocaleForm = (0, _Form.generateForm)({
49
49
  dataSources: dataSources,
50
50
  fields: fields,
51
51
  handleSubmit: handleSubmit
52
52
  });
53
- exports.LocaleForm = LocaleForm;
54
53
  LocaleForm.displayName = 'LocaleForm';
@@ -39,10 +39,9 @@ var columns = [{
39
39
  title: 'Code',
40
40
  sortable: true
41
41
  }];
42
- var LocaleTable = (0, _Table.generateTable)({
42
+ var LocaleTable = exports.LocaleTable = (0, _Table.generateTable)({
43
43
  columns: columns,
44
44
  filters: filters,
45
45
  dataSource: dataSource
46
46
  });
47
- exports.LocaleTable = LocaleTable;
48
47
  LocaleTable.displayName = 'LocaleTable';
@@ -244,11 +244,10 @@ var fields = function fields(_ref3) {
244
244
  }];
245
245
  };
246
246
  };
247
- var UserForm = (0, _Form.generateForm)({
247
+ var UserForm = exports.UserForm = (0, _Form.generateForm)({
248
248
  formOptions: ['username', 'spaceSlug'],
249
249
  dataSources: dataSources,
250
250
  fields: fields,
251
251
  handleSubmit: handleSubmit
252
252
  });
253
- exports.UserForm = UserForm;
254
253
  UserForm.displayName = 'UserForm';
@@ -77,27 +77,44 @@ var BooleanYesNoCell = function BooleanYesNoCell(props) {
77
77
  var columns = [{
78
78
  value: 'username',
79
79
  title: 'Username',
80
- sortable: true
80
+ sortable: true,
81
+ toggleable: false,
82
+ columnOrder: 'first'
81
83
  }, {
82
84
  value: 'email',
83
85
  title: 'Email',
84
- sortable: true
86
+ sortable: true,
87
+ toggleable: true
85
88
  }, {
86
89
  value: 'displayName',
87
90
  title: 'Display Name',
88
- sortable: true
91
+ sortable: true,
92
+ toggleable: true
89
93
  }, {
90
94
  value: 'createdAt',
91
95
  title: 'Created',
92
- sortable: true
96
+ sortable: true,
97
+ toggleable: true
98
+ }, {
99
+ value: 'createdBy',
100
+ title: 'Created By',
101
+ sortable: true,
102
+ toggleable: true
93
103
  }, {
94
104
  value: 'updatedAt',
95
105
  title: 'Updated',
96
- sortable: true
106
+ sortable: true,
107
+ toggleable: true
108
+ }, {
109
+ value: 'updatedBy',
110
+ title: 'Updated By',
111
+ sortable: true,
112
+ toggleable: true
97
113
  }, {
98
114
  value: 'enabled',
99
115
  title: 'Enabled?',
100
116
  sortable: false,
117
+ toggleable: true,
101
118
  components: {
102
119
  BodyCell: BooleanYesNoCell
103
120
  }
@@ -105,15 +122,15 @@ var columns = [{
105
122
  value: 'spaceAdmin',
106
123
  title: 'Space Admin?',
107
124
  sortable: false,
125
+ toggleable: true,
108
126
  components: {
109
127
  BodyCell: BooleanYesNoCell
110
128
  }
111
129
  }];
112
- var UserTable = (0, _Table.generateTable)({
130
+ var UserTable = exports.UserTable = (0, _Table.generateTable)({
113
131
  tableOptions: ['system', 'spaceSlug'],
114
132
  columns: columns,
115
133
  filters: filters,
116
134
  dataSource: dataSource
117
135
  });
118
- exports.UserTable = UserTable;
119
136
  UserTable.displayName = 'UserTable';
@@ -12,8 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
12
12
  var _Form = require("../../form/Form");
13
13
  var _immutable = require("immutable");
14
14
  var _apis = require("../../../apis");
15
- var WEB_API_METHODS = ['GET', 'POST', 'PUT', 'DELETE'];
16
- exports.WEB_API_METHODS = WEB_API_METHODS;
15
+ var WEB_API_METHODS = exports.WEB_API_METHODS = ['GET', 'POST', 'PUT', 'DELETE'];
17
16
  var securityEndpoints = {
18
17
  webApiExecution: {
19
18
  endpoint: 'Execution',
@@ -23,7 +22,12 @@ var securityEndpoints = {
23
22
  };
24
23
  var dataSources = function dataSources(_ref) {
25
24
  var kappSlug = _ref.kappSlug,
26
- webApi = _ref.webApi;
25
+ webApi = _ref.webApi,
26
+ cloneParams = _ref.cloneParams;
27
+ var _ref2 = cloneParams || {},
28
+ cloneWebApi = _ref2.cloneWebApi,
29
+ sourceGroup = _ref2.sourceGroup,
30
+ sourceName = _ref2.sourceName;
27
31
  return {
28
32
  securityPolicyDefinitions: {
29
33
  fn: _apis.fetchSecurityPolicyDefinitions,
@@ -33,130 +37,142 @@ var dataSources = function dataSources(_ref) {
33
37
  transform: function transform(result) {
34
38
  return result.securityPolicyDefinitions;
35
39
  }
40
+ },
41
+ tree: {
42
+ // if cloneWebApi is falsy fetchTree will not run
43
+ fn: _apis.fetchTree,
44
+ params: cloneWebApi && [{
45
+ name: cloneWebApi.get('slug'),
46
+ sourceGroup: sourceGroup,
47
+ sourceName: sourceName,
48
+ include: 'details,treeJson'
49
+ }],
50
+ transform: function transform(results) {
51
+ return results.tree;
52
+ }
36
53
  }
37
54
  };
38
55
  };
39
- var handleSubmit = function handleSubmit(_ref2) {
40
- var slug = _ref2.slug,
41
- kappSlug = _ref2.kappSlug,
42
- webApi = _ref2.webApi;
56
+ var handleSubmit = function handleSubmit(_ref3) {
57
+ var slug = _ref3.slug,
58
+ kappSlug = _ref3.kappSlug,
59
+ webApi = _ref3.webApi;
43
60
  return /*#__PURE__*/function () {
44
- var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(values) {
45
- var _yield$fetchSpace, space, sourceName, sourceGroup, _ref4, _webApi, error1, _ref5, tree, error2;
61
+ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(values, bindings) {
62
+ var _yield$fetchSpace, space, sourceName, sourceGroup, _ref5, _webApi, error1, _ref6, tree, error2;
46
63
  return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
47
- while (1) {
48
- switch (_context.prev = _context.next) {
49
- case 0:
50
- if (webApi) {
51
- _context.next = 38;
52
- break;
53
- }
54
- _context.next = 3;
55
- return (0, _apis.fetchSpace)({
56
- include: 'platformComponents'
57
- });
58
- case 3:
59
- _yield$fetchSpace = _context.sent;
60
- space = _yield$fetchSpace.space;
61
- sourceName = space.platformComponents.task.config.platformSourceName;
62
- sourceGroup = kappSlug ? "WebApis > ".concat(kappSlug) : 'WebApis';
63
- if (!slug) {
64
- _context.next = 13;
65
- break;
66
- }
67
- _context.next = 10;
68
- return (0, _apis.updateWebApi)({
69
- kappSlug: kappSlug,
70
- slug: slug,
71
- webApi: values.toJS(),
72
- include: 'securityPolicies'
73
- });
74
- case 10:
75
- _context.t0 = _context.sent;
76
- _context.next = 16;
64
+ while (1) switch (_context.prev = _context.next) {
65
+ case 0:
66
+ if (webApi) {
67
+ _context.next = 38;
77
68
  break;
78
- case 13:
79
- _context.next = 15;
80
- return (0, _apis.createWebApi)({
81
- kappSlug: kappSlug,
82
- webApi: values.toJS(),
83
- include: 'securityPolicies'
84
- });
85
- case 15:
86
- _context.t0 = _context.sent;
87
- case 16:
88
- _ref4 = _context.t0;
89
- _webApi = _ref4.webApi;
90
- error1 = _ref4.error;
91
- if (!error1) {
92
- _context.next = 21;
93
- break;
94
- }
95
- throw error1.statusCode === 400 && error1.message || 'There was an error saving the WebAPI';
96
- case 21:
97
- if (!slug) {
98
- _context.next = 27;
99
- break;
100
- }
101
- _context.next = 24;
102
- return (0, _apis.updateTree)({
69
+ }
70
+ _context.next = 3;
71
+ return (0, _apis.fetchSpace)({
72
+ include: 'platformComponents'
73
+ });
74
+ case 3:
75
+ _yield$fetchSpace = _context.sent;
76
+ space = _yield$fetchSpace.space;
77
+ sourceName = space.platformComponents.task.config.platformSourceName;
78
+ sourceGroup = kappSlug ? "WebApis > ".concat(kappSlug) : 'WebApis';
79
+ if (!slug) {
80
+ _context.next = 13;
81
+ break;
82
+ }
83
+ _context.next = 10;
84
+ return (0, _apis.updateWebApi)({
85
+ kappSlug: kappSlug,
86
+ slug: slug,
87
+ webApi: values.toJS(),
88
+ include: 'securityPolicies'
89
+ });
90
+ case 10:
91
+ _context.t0 = _context.sent;
92
+ _context.next = 16;
93
+ break;
94
+ case 13:
95
+ _context.next = 15;
96
+ return (0, _apis.createWebApi)({
97
+ kappSlug: kappSlug,
98
+ webApi: values.toJS(),
99
+ include: 'securityPolicies'
100
+ });
101
+ case 15:
102
+ _context.t0 = _context.sent;
103
+ case 16:
104
+ _ref5 = _context.t0;
105
+ _webApi = _ref5.webApi;
106
+ error1 = _ref5.error;
107
+ if (!error1) {
108
+ _context.next = 21;
109
+ break;
110
+ }
111
+ throw error1.statusCode === 400 && error1.message || 'There was an error saving the WebAPI';
112
+ case 21:
113
+ if (!slug) {
114
+ _context.next = 27;
115
+ break;
116
+ }
117
+ _context.next = 24;
118
+ return (0, _apis.updateTree)({
119
+ sourceName: sourceName,
120
+ sourceGroup: sourceGroup,
121
+ name: slug,
122
+ tree: {
103
123
  sourceName: sourceName,
104
124
  sourceGroup: sourceGroup,
105
- name: slug,
106
- tree: {
107
- sourceName: sourceName,
108
- sourceGroup: sourceGroup,
109
- name: values.get('slug')
110
- }
111
- });
112
- case 24:
113
- _context.t1 = _context.sent;
114
- _context.next = 30;
115
- break;
116
- case 27:
117
- _context.next = 29;
118
- return (0, _apis.createTree)({
119
- tree: {
120
- sourceGroup: sourceGroup,
121
- sourceName: sourceName,
122
- name: values.get('slug')
123
- }
124
- });
125
- case 29:
126
- _context.t1 = _context.sent;
127
- case 30:
128
- _ref5 = _context.t1;
129
- tree = _ref5.tree;
130
- error2 = _ref5.error;
131
- if (!error2) {
132
- _context.next = 35;
133
- break;
125
+ name: values.get('slug')
134
126
  }
135
- throw error2.statusCode === 400 && error2.message || 'There was an error saving the WebAPI tree';
136
- case 35:
137
- return _context.abrupt("return", {
138
- tree: tree,
139
- webApi: _webApi
140
- });
141
- case 38:
142
- return _context.abrupt("return", values.toObject());
143
- case 39:
144
- case "end":
145
- return _context.stop();
146
- }
127
+ });
128
+ case 24:
129
+ _context.t1 = _context.sent;
130
+ _context.next = 30;
131
+ break;
132
+ case 27:
133
+ _context.next = 29;
134
+ return (0, _apis.createTree)({
135
+ tree: {
136
+ sourceGroup: sourceGroup,
137
+ sourceName: sourceName,
138
+ name: values.get('slug'),
139
+ treeJson: bindings.tree && bindings.tree.get('treeJson') // used when the tree is cloned
140
+ }
141
+ });
142
+ case 29:
143
+ _context.t1 = _context.sent;
144
+ case 30:
145
+ _ref6 = _context.t1;
146
+ tree = _ref6.tree;
147
+ error2 = _ref6.error;
148
+ if (!error2) {
149
+ _context.next = 35;
150
+ break;
151
+ }
152
+ throw error2.statusCode === 400 && error2.message || 'There was an error saving the WebAPI tree';
153
+ case 35:
154
+ return _context.abrupt("return", {
155
+ tree: tree,
156
+ webApi: _webApi
157
+ });
158
+ case 38:
159
+ return _context.abrupt("return", values.toObject());
160
+ case 39:
161
+ case "end":
162
+ return _context.stop();
147
163
  }
148
164
  }, _callee);
149
165
  }));
150
- return function (_x) {
151
- return _ref3.apply(this, arguments);
166
+ return function (_x, _x2) {
167
+ return _ref4.apply(this, arguments);
152
168
  };
153
169
  }();
154
170
  };
155
- var fields = function fields(_ref6) {
156
- var webApi = _ref6.webApi,
157
- tree = _ref6.tree;
158
- return function (_ref7) {
159
- var securityPolicyDefinitions = _ref7.securityPolicyDefinitions;
171
+ var fields = function fields(_ref7) {
172
+ var webApi = _ref7.webApi,
173
+ tree = _ref7.tree;
174
+ return function (_ref8) {
175
+ var securityPolicyDefinitions = _ref8.securityPolicyDefinitions;
160
176
  return securityPolicyDefinitions && [{
161
177
  name: 'slug',
162
178
  label: 'Slug',
@@ -175,16 +191,16 @@ var fields = function fields(_ref6) {
175
191
  };
176
192
  }),
177
193
  initialValue: (0, _immutable.get)(webApi, 'method') || ''
178
- }].concat((0, _toConsumableArray2["default"])(Object.entries(securityEndpoints).map(function (_ref8) {
179
- var _ref9 = (0, _slicedToArray2["default"])(_ref8, 2),
180
- endpointFieldName = _ref9[0],
181
- endpoint = _ref9[1];
194
+ }].concat((0, _toConsumableArray2["default"])(Object.entries(securityEndpoints).map(function (_ref9) {
195
+ var _ref10 = (0, _slicedToArray2["default"])(_ref9, 2),
196
+ endpointFieldName = _ref10[0],
197
+ endpoint = _ref10[1];
182
198
  return {
183
199
  name: endpointFieldName,
184
200
  label: endpoint.label,
185
201
  type: 'select',
186
- options: function options(_ref10) {
187
- var securityPolicyDefinitions = _ref10.securityPolicyDefinitions;
202
+ options: function options(_ref11) {
203
+ var securityPolicyDefinitions = _ref11.securityPolicyDefinitions;
188
204
  return securityPolicyDefinitions ? securityPolicyDefinitions.filter(function (definition) {
189
205
  return endpoint.types.includes(definition.get('type'));
190
206
  }).map(function (definition) {
@@ -204,8 +220,8 @@ var fields = function fields(_ref6) {
204
220
  label: 'Security Policies',
205
221
  type: null,
206
222
  visible: false,
207
- serialize: function serialize(_ref11) {
208
- var values = _ref11.values;
223
+ serialize: function serialize(_ref12) {
224
+ var values = _ref12.values;
209
225
  return (0, _immutable.Map)(securityEndpoints).map(function (policy, endpointFieldName) {
210
226
  return (0, _immutable.Map)({
211
227
  endpoint: policy.endpoint,
@@ -225,11 +241,10 @@ var fields = function fields(_ref6) {
225
241
  }]);
226
242
  };
227
243
  };
228
- var WebApiForm = (0, _Form.generateForm)({
229
- formOptions: ['kappSlug', 'slug', 'webApi', 'tree'],
244
+ var WebApiForm = exports.WebApiForm = (0, _Form.generateForm)({
245
+ formOptions: ['kappSlug', 'slug', 'webApi', 'tree', 'cloneParams'],
230
246
  dataSources: dataSources,
231
247
  fields: fields,
232
248
  handleSubmit: handleSubmit
233
249
  });
234
- exports.WebApiForm = WebApiForm;
235
250
  WebApiForm.displayName = 'WebApiForm';
@@ -17,7 +17,7 @@ var dataSource = function dataSource(_ref) {
17
17
  params: function params() {
18
18
  return [{
19
19
  kappSlug: kappSlug,
20
- include: 'details'
20
+ include: 'details,securityPolicies'
21
21
  }];
22
22
  },
23
23
  transform: function transform(result) {
@@ -51,31 +51,37 @@ var filters = function filters() {
51
51
  var columns = [{
52
52
  value: 'slug',
53
53
  title: 'Slug',
54
- sortable: true
54
+ sortable: true,
55
+ toggleable: false,
56
+ columnOrder: 'first'
55
57
  }, {
56
58
  value: 'method',
57
59
  title: 'Method',
58
- sortable: true
60
+ sortable: true,
61
+ toggleable: true
59
62
  }, {
60
63
  value: 'createdAt',
61
64
  title: 'Created',
62
- sortable: true
65
+ sortable: true,
66
+ toggleable: true
63
67
  }, {
64
68
  value: 'createdBy',
65
- title: 'Created By'
69
+ title: 'Created By',
70
+ toggleable: true
66
71
  }, {
67
72
  value: 'updatedAt',
68
73
  title: 'Updated',
69
- sortable: true
74
+ sortable: true,
75
+ toggleable: true
70
76
  }, {
71
77
  value: 'updatedBy',
72
- title: 'Updated By'
78
+ title: 'Updated By',
79
+ toggleable: true
73
80
  }];
74
- var WebApiTable = (0, _Table.generateTable)({
81
+ var WebApiTable = exports.WebApiTable = (0, _Table.generateTable)({
75
82
  tableOptions: ['kappSlug'],
76
83
  columns: columns,
77
84
  filters: filters,
78
85
  dataSource: dataSource
79
86
  });
80
- exports.WebApiTable = WebApiTable;
81
87
  WebApiTable.displayName = 'WebApiTable';
@@ -154,11 +154,10 @@ var fields = function fields(_ref4) {
154
154
  }];
155
155
  };
156
156
  };
157
- var WebhookForm = (0, _Form.generateForm)({
157
+ var WebhookForm = exports.WebhookForm = (0, _Form.generateForm)({
158
158
  formOptions: ['kappSlug', 'name'],
159
159
  dataSources: dataSources,
160
160
  fields: fields,
161
161
  handleSubmit: handleSubmit
162
162
  });
163
- exports.WebhookForm = WebhookForm;
164
163
  WebhookForm.displayName = 'WebhookForm';