@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.
- package/CHANGELOG.md +86 -0
- package/lib/apis/agent/adapters.js +2 -3
- package/lib/apis/agent/bridges.js +7 -13
- package/lib/apis/agent/handlers.js +7 -13
- package/lib/apis/core/activity.js +2 -3
- package/lib/apis/core/attributeDefinitions.js +6 -11
- package/lib/apis/core/attributeDefinitions.test.js +201 -213
- package/lib/apis/core/authentication.js +74 -84
- package/lib/apis/core/backgroundJobs.js +5 -9
- package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
- package/lib/apis/core/bridgeModelAttributes.js +6 -11
- package/lib/apis/core/bridgeModelMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualifications.js +5 -10
- package/lib/apis/core/bridgeModels.js +7 -13
- package/lib/apis/core/bridgeModels.test.js +313 -333
- package/lib/apis/core/bridgedresources.js +7 -13
- package/lib/apis/core/categories.js +6 -11
- package/lib/apis/core/fileResources.js +5 -10
- package/lib/apis/core/filestores.js +5 -10
- package/lib/apis/core/formTypes.js +6 -11
- package/lib/apis/core/forms.js +6 -11
- package/lib/apis/core/forms.test.js +201 -213
- package/lib/apis/core/kapps.js +6 -11
- package/lib/apis/core/kapps.test.js +122 -130
- package/lib/apis/core/logs.js +3 -5
- package/lib/apis/core/memberships.js +3 -5
- package/lib/apis/core/meta.js +6 -11
- package/lib/apis/core/notices.js +2 -3
- package/lib/apis/core/oauthClients.js +6 -11
- package/lib/apis/core/platformComponents.js +10 -19
- package/lib/apis/core/platformItems.js +2 -3
- package/lib/apis/core/profile.js +3 -5
- package/lib/apis/core/securityPolicyDefinitions.js +6 -11
- package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
- package/lib/apis/core/space.js +3 -5
- package/lib/apis/core/space.test.js +106 -114
- package/lib/apis/core/submissions.js +19 -35
- package/lib/apis/core/teams.js +6 -11
- package/lib/apis/core/translations.js +18 -35
- package/lib/apis/core/translations.test.js +1343 -1437
- package/lib/apis/core/users.js +6 -11
- package/lib/apis/core/version.js +2 -3
- package/lib/apis/core/webApis.js +5 -10
- package/lib/apis/core/webhooks.js +6 -11
- package/lib/apis/core/webhooks.test.js +243 -257
- package/lib/apis/core/webhooksJobs.js +3 -5
- package/lib/apis/core/workflows.js +7 -13
- package/lib/apis/http.js +16 -31
- package/lib/apis/system/index.js +46 -91
- package/lib/apis/task/index.js +60 -119
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +1 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +1 -2
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
- package/lib/components/common/AttributeSelect.js +2 -3
- package/lib/components/common/BridgeSelect.js +16 -17
- package/lib/components/common/ComponentConfigContext.js +1 -2
- package/lib/components/common/ContentEditable.js +23 -3
- package/lib/components/common/FormSelect.js +16 -17
- package/lib/components/common/NodeSelect.js +2 -3
- package/lib/components/common/Scroller.js +2 -3
- package/lib/components/common/StaticSelect.js +14 -15
- package/lib/components/common/TableInput.js +276 -63
- package/lib/components/common/TeamSelect.js +16 -17
- package/lib/components/common/ToastContainer.js +7 -12
- package/lib/components/common/Typeahead.js +15 -2
- package/lib/components/common/UserSelect.js +16 -17
- package/lib/components/common/authentication/AuthInterceptor.js +2 -3
- package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
- package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
- package/lib/components/common/authentication/RequestInterceptor.js +2 -10
- package/lib/components/common/code_input/CodeInput.js +4 -9
- package/lib/components/common/code_input/draftHelpers.js +20 -37
- package/lib/components/common/code_input/languageHelpers.js +6 -12
- package/lib/components/common/code_input/languageHelpers.test.js +10 -8
- package/lib/components/common/defaults/Toast.js +1 -2
- package/lib/components/common/defaults/index.js +2 -3
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
- package/lib/components/core/category/CategoryForm.js +1 -2
- package/lib/components/core/category/CategoryTable.js +1 -2
- package/lib/components/core/core_form/CoreForm.js +11 -22
- package/lib/components/core/core_form/defaults/index.js +11 -19
- package/lib/components/core/core_form/globals.js +3 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
- package/lib/components/core/field_definition/FieldDefinitionTable.js +2 -4
- package/lib/components/core/file_resource/FileResourceForm.js +1 -2
- package/lib/components/core/file_resource/FileResourceTable.js +1 -2
- package/lib/components/core/form/FormForm.js +4 -4
- package/lib/components/core/form/FormTable.js +1 -2
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +1 -2
- package/lib/components/core/i18n/I18n.js +2 -4
- package/lib/components/core/i18n/I18nContext.js +1 -2
- package/lib/components/core/i18n/I18nProvider.js +2 -3
- package/lib/components/core/i18n/Moment.js +10 -9
- package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
- package/lib/components/core/index_definition/IndexDefinitionTable.js +1 -2
- package/lib/components/core/index_job/IndexJobTable.js +1 -2
- package/lib/components/core/kapp/KappForm.js +1 -2
- package/lib/components/core/kapp/KappTable.js +1 -2
- package/lib/components/core/log/LogTable.js +2 -4
- package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
- package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
- package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
- package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
- package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
- package/lib/components/core/profile/ProfileForm.js +1 -2
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +1 -2
- package/lib/components/core/space/SpaceForm.js +1 -2
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
- package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
- package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
- package/lib/components/core/submission/FormSubmissionTable.js +2 -4
- package/lib/components/core/submission/KappSubmissionTable.js +2 -4
- package/lib/components/core/submission/SubmissionForm.js +1 -2
- package/lib/components/core/submission/SubmissionTable.js +2 -3
- package/lib/components/core/submission/helpers.js +4 -7
- package/lib/components/core/team/TeamForm.js +1 -2
- package/lib/components/core/team/TeamTable.js +1 -2
- package/lib/components/core/translation/ContextForm.js +1 -2
- package/lib/components/core/translation/ContextTable.js +1 -2
- package/lib/components/core/translation/EntryForm.js +1 -2
- package/lib/components/core/translation/EntryTable.js +1 -2
- package/lib/components/core/translation/LocaleForm.js +1 -2
- package/lib/components/core/translation/LocaleTable.js +1 -2
- package/lib/components/core/user/UserForm.js +1 -2
- package/lib/components/core/user/UserTable.js +1 -2
- package/lib/components/core/webapi/WebApiForm.js +97 -101
- package/lib/components/core/webapi/WebApiTable.js +1 -2
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +1 -2
- package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
- package/lib/components/form/Form.helpers.js +10 -19
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +6 -11
- package/lib/components/form/FormState.js +3 -3
- package/lib/components/form/KitchenSinkForm.js +23 -3
- package/lib/components/form/SimpleForm.helpers.js +262 -0
- package/lib/components/form/SimpleForm.js +462 -0
- package/lib/components/form/SimpleForm.models.js +62 -0
- package/lib/components/form/defaults/AttributesField.js +3 -4
- package/lib/components/form/defaults/CheckboxField.js +2 -3
- package/lib/components/form/defaults/CodeField.js +2 -3
- package/lib/components/form/defaults/FormButtons.js +2 -3
- package/lib/components/form/defaults/FormError.js +2 -3
- package/lib/components/form/defaults/FormField.js +2 -3
- package/lib/components/form/defaults/FormLayout.js +2 -3
- package/lib/components/form/defaults/FormMultiField.js +2 -3
- package/lib/components/form/defaults/PasswordField.js +2 -3
- package/lib/components/form/defaults/RadioField.js +2 -3
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
- package/lib/components/form/defaults/SelectField.js +2 -3
- package/lib/components/form/defaults/SelectMultiField.js +2 -3
- package/lib/components/form/defaults/TableField.js +2 -3
- package/lib/components/form/defaults/TeamField.js +2 -3
- package/lib/components/form/defaults/TeamMultiField.js +2 -3
- package/lib/components/form/defaults/TextField.js +2 -3
- package/lib/components/form/defaults/TextMultiField.js +2 -3
- package/lib/components/form/defaults/UserField.js +2 -3
- package/lib/components/form/defaults/UserMultiField.js +2 -3
- package/lib/components/form/defaults/index.js +2 -3
- package/lib/components/form/tests/Form.test.js +4354 -4508
- package/lib/components/form/tests/components.js +73 -64
- package/lib/components/index.js +7 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +1 -2
- package/lib/components/system/SystemElasticSearchForm.js +1 -2
- package/lib/components/system/SystemFilestoreForm.js +2 -3
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +1 -2
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +11 -21
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +48 -51
- package/lib/components/table/Table.redux.js +161 -188
- package/lib/components/table/Table.test.js +115 -123
- package/lib/components/table/defaults/BodyCell.js +1 -2
- package/lib/components/table/defaults/BodyRow.js +1 -2
- package/lib/components/table/defaults/BooleanFilter.js +1 -2
- package/lib/components/table/defaults/ColumnControl.js +1 -2
- package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
- package/lib/components/table/defaults/FilterLayout.js +1 -2
- package/lib/components/table/defaults/Footer.js +1 -2
- package/lib/components/table/defaults/FooterCell.js +1 -2
- package/lib/components/table/defaults/FooterRow.js +1 -2
- package/lib/components/table/defaults/Header.js +1 -2
- package/lib/components/table/defaults/HeaderCell.js +1 -2
- package/lib/components/table/defaults/HeaderRow.js +1 -2
- package/lib/components/table/defaults/PaginationControl.js +2 -4
- package/lib/components/table/defaults/TableBody.js +1 -2
- package/lib/components/table/defaults/TableLayout.js +1 -2
- package/lib/components/table/defaults/TextFilter.js +1 -2
- package/lib/components/table/defaults/index.js +2 -3
- package/lib/components/table/tests/Table.redux.test.js +162 -0
- package/lib/components/table/tests/Table.test.js +767 -0
- package/lib/components/table/tests/components.js +182 -0
- package/lib/components/task/builder/Connector.js +26 -11
- package/lib/components/task/builder/ConnectorForm.js +1 -2
- package/lib/components/task/builder/Node.js +18 -9
- package/lib/components/task/builder/NodeForm.js +1 -2
- package/lib/components/task/builder/NodeParametersForm.js +1 -2
- package/lib/components/task/builder/SvgCanvas.js +2 -3
- package/lib/components/task/builder/SvgText.js +2 -3
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
- package/lib/components/task/builder/TreeBuilder.js +14 -5
- package/lib/components/task/builder/builder.redux.js +187 -186
- package/lib/components/task/builder/constants.js +38 -76
- package/lib/components/task/builder/helpers.js +23 -40
- package/lib/components/task/builder/models.js +24 -35
- package/lib/components/task/category/TaskCategoryForm.js +2 -3
- package/lib/components/task/category/TaskCategoryTable.js +1 -2
- package/lib/components/task/common/UsageTable.js +1 -2
- package/lib/components/task/engine/EngineSettingsForm.js +2 -3
- package/lib/components/task/errors/RunErrorTable.js +2 -3
- package/lib/components/task/errors/SystemErrorsTable.js +1 -2
- package/lib/components/task/handlers/HandlerForm.js +2 -3
- package/lib/components/task/handlers/HandlerTable.js +1 -2
- package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
- package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
- package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
- package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
- package/lib/components/task/runs/RunTable.js +2 -3
- package/lib/components/task/runs/RunTaskTable.js +1 -2
- package/lib/components/task/sources/SourceForm.js +1 -2
- package/lib/components/task/sources/SourceTable.js +1 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -3
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +91 -41
- package/lib/components/task/workflows/WorkflowTable.js +1 -2
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +3 -6
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +12 -15
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
|
@@ -8,7 +8,7 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
10
10
|
var tokenEndpointPattern = /\/app\/(loghub|system-coordinator)\/(refresh|components|api\/v\d)/;
|
|
11
|
-
var RequestInterceptor = /*#__PURE__*/function () {
|
|
11
|
+
var RequestInterceptor = exports["default"] = /*#__PURE__*/function () {
|
|
12
12
|
function RequestInterceptor(store) {
|
|
13
13
|
(0, _classCallCheck2["default"])(this, RequestInterceptor);
|
|
14
14
|
this.store = store;
|
|
@@ -28,7 +28,6 @@ var RequestInterceptor = /*#__PURE__*/function () {
|
|
|
28
28
|
var _this = this;
|
|
29
29
|
return config.__bypassInitInterceptor ? config : this.initPromise.then(function () {
|
|
30
30
|
var _this$store$getState$ = _this.store.getState().get('session').toObject(),
|
|
31
|
-
csrfToken = _this$store$getState$.csrfToken,
|
|
32
31
|
loggedIn = _this$store$getState$.loggedIn,
|
|
33
32
|
token = _this$store$getState$.token;
|
|
34
33
|
if (!loggedIn) {
|
|
@@ -37,16 +36,9 @@ var RequestInterceptor = /*#__PURE__*/function () {
|
|
|
37
36
|
if (token && config.url.match(tokenEndpointPattern)) {
|
|
38
37
|
config.headers.Authorization = 'Bearer ' + token;
|
|
39
38
|
}
|
|
40
|
-
if (csrfToken) {
|
|
41
|
-
// we need to set xsrfCookieName otherwise axios will override the
|
|
42
|
-
// xsrf header that we set manually
|
|
43
|
-
config.xsrfCookieName = 'DONT_USE_COOKIES_FOR_XSRF_TOKEN';
|
|
44
|
-
config.headers['X-XSRF-TOKEN'] = csrfToken;
|
|
45
|
-
}
|
|
46
39
|
return config;
|
|
47
40
|
});
|
|
48
41
|
}
|
|
49
42
|
}]);
|
|
50
43
|
return RequestInterceptor;
|
|
51
|
-
}();
|
|
52
|
-
exports["default"] = RequestInterceptor;
|
|
44
|
+
}();
|
|
@@ -20,7 +20,7 @@ var _reactPopper = require("react-popper");
|
|
|
20
20
|
var _draftHelpers = require("./draftHelpers");
|
|
21
21
|
var _languageHelpers = require("./languageHelpers");
|
|
22
22
|
var _Scroller = require("../Scroller");
|
|
23
|
-
var CodeInput = /*#__PURE__*/function (_Component) {
|
|
23
|
+
var CodeInput = exports.CodeInput = /*#__PURE__*/function (_Component) {
|
|
24
24
|
(0, _inherits2["default"])(CodeInput, _Component);
|
|
25
25
|
var _super = (0, _createSuper2["default"])(CodeInput);
|
|
26
26
|
function CodeInput(props) {
|
|
@@ -138,12 +138,8 @@ var CodeInput = /*#__PURE__*/function (_Component) {
|
|
|
138
138
|
_this.onChange((0, _draftHelpers.startTypeahead)(_this.state.editorState));
|
|
139
139
|
};
|
|
140
140
|
_this.copy = function () {
|
|
141
|
-
var
|
|
142
|
-
|
|
143
|
-
document.body.appendChild(el);
|
|
144
|
-
el.select();
|
|
145
|
-
document.execCommand('copy');
|
|
146
|
-
document.body.removeChild(el);
|
|
141
|
+
var value = _this.state.editorState.getCurrentContent().getFirstBlock().getText();
|
|
142
|
+
return navigator.clipboard.writeText(value);
|
|
147
143
|
};
|
|
148
144
|
_this.newLine = '\n';
|
|
149
145
|
_this.indentation = ' ';
|
|
@@ -313,5 +309,4 @@ var CodeInput = /*#__PURE__*/function (_Component) {
|
|
|
313
309
|
}
|
|
314
310
|
}]);
|
|
315
311
|
return CodeInput;
|
|
316
|
-
}(_react.Component);
|
|
317
|
-
exports.CodeInput = CodeInput;
|
|
312
|
+
}(_react.Component);
|
|
@@ -27,7 +27,7 @@ var selectionEntity = {
|
|
|
27
27
|
var matches = function matches(searcher, text) {
|
|
28
28
|
return text.toLowerCase().indexOf(searcher.toLowerCase()) > -1;
|
|
29
29
|
};
|
|
30
|
-
var nextTypeaheadItem = function nextTypeaheadItem(editorState) {
|
|
30
|
+
var nextTypeaheadItem = exports.nextTypeaheadItem = function nextTypeaheadItem(editorState) {
|
|
31
31
|
var filterEntity = getEntities(editorState).last();
|
|
32
32
|
var data = filterEntity.data;
|
|
33
33
|
var active = (data.active + 1) % data.options.size;
|
|
@@ -38,8 +38,7 @@ var nextTypeaheadItem = function nextTypeaheadItem(editorState) {
|
|
|
38
38
|
})
|
|
39
39
|
}))(editorState);
|
|
40
40
|
};
|
|
41
|
-
exports.
|
|
42
|
-
var previousTypeaheadItem = function previousTypeaheadItem(editorState) {
|
|
41
|
+
var previousTypeaheadItem = exports.previousTypeaheadItem = function previousTypeaheadItem(editorState) {
|
|
43
42
|
var filterEntity = getEntities(editorState).last();
|
|
44
43
|
var data = filterEntity.data;
|
|
45
44
|
var n = data.options.size;
|
|
@@ -52,15 +51,13 @@ var previousTypeaheadItem = function previousTypeaheadItem(editorState) {
|
|
|
52
51
|
})
|
|
53
52
|
}))(editorState);
|
|
54
53
|
};
|
|
55
|
-
exports.
|
|
56
|
-
var traverseBindings = function traverseBindings(bindings, _ref) {
|
|
54
|
+
var traverseBindings = exports.traverseBindings = function traverseBindings(bindings, _ref) {
|
|
57
55
|
var _ref2 = (0, _toArray2["default"])(_ref),
|
|
58
56
|
head = _ref2[0],
|
|
59
57
|
tail = _ref2.slice(1);
|
|
60
58
|
return head ? traverseBindings(bindings.get(head).get('children'), tail) : bindings;
|
|
61
59
|
};
|
|
62
|
-
exports.
|
|
63
|
-
var checkSelectionEntities = function checkSelectionEntities(editorState) {
|
|
60
|
+
var checkSelectionEntities = exports.checkSelectionEntities = function checkSelectionEntities(editorState) {
|
|
64
61
|
var entities = getEntities(editorState);
|
|
65
62
|
if (!entities.isEmpty()) {
|
|
66
63
|
var validEntities = entities.reduce(function (reduction, entity) {
|
|
@@ -92,8 +89,7 @@ var checkSelectionEntities = function checkSelectionEntities(editorState) {
|
|
|
92
89
|
}
|
|
93
90
|
return editorState;
|
|
94
91
|
};
|
|
95
|
-
exports.
|
|
96
|
-
var applyFilter = function applyFilter(bindings) {
|
|
92
|
+
var applyFilter = exports.applyFilter = function applyFilter(bindings) {
|
|
97
93
|
return function (editorState) {
|
|
98
94
|
var entities = getEntities(editorState);
|
|
99
95
|
if (!entities.isEmpty()) {
|
|
@@ -133,8 +129,7 @@ var applyFilter = function applyFilter(bindings) {
|
|
|
133
129
|
return editorState;
|
|
134
130
|
};
|
|
135
131
|
};
|
|
136
|
-
exports.
|
|
137
|
-
var checkSelectionPosition = function checkSelectionPosition(editorState) {
|
|
132
|
+
var checkSelectionPosition = exports.checkSelectionPosition = function checkSelectionPosition(editorState) {
|
|
138
133
|
var entities = getEntities(editorState);
|
|
139
134
|
if (!entities.isEmpty()) {
|
|
140
135
|
var selection = editorState.getSelection();
|
|
@@ -146,16 +141,14 @@ var checkSelectionPosition = function checkSelectionPosition(editorState) {
|
|
|
146
141
|
}
|
|
147
142
|
return editorState;
|
|
148
143
|
};
|
|
149
|
-
exports.
|
|
150
|
-
var checkFocus = function checkFocus(editorState) {
|
|
144
|
+
var checkFocus = exports.checkFocus = function checkFocus(editorState) {
|
|
151
145
|
var entities = getEntities(editorState);
|
|
152
146
|
if (!entities.isEmpty()) {
|
|
153
147
|
return editorState.getSelection().getHasFocus() ? editorState : closeTypeahead(editorState);
|
|
154
148
|
}
|
|
155
149
|
return editorState;
|
|
156
150
|
};
|
|
157
|
-
exports.
|
|
158
|
-
var startTypeahead = function startTypeahead(editorState) {
|
|
151
|
+
var startTypeahead = exports.startTypeahead = function startTypeahead(editorState) {
|
|
159
152
|
return apply(editorState, insertText({
|
|
160
153
|
text: '$',
|
|
161
154
|
entity: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, startEntity), {}, {
|
|
@@ -179,8 +172,7 @@ var startTypeahead = function startTypeahead(editorState) {
|
|
|
179
172
|
}
|
|
180
173
|
}));
|
|
181
174
|
};
|
|
182
|
-
exports.
|
|
183
|
-
var closeTypeahead = function closeTypeahead(editorState) {
|
|
175
|
+
var closeTypeahead = exports.closeTypeahead = function closeTypeahead(editorState) {
|
|
184
176
|
var entities = getEntities(editorState);
|
|
185
177
|
var start = entities.first().start;
|
|
186
178
|
var end = entities.last().end;
|
|
@@ -192,8 +184,7 @@ var closeTypeahead = function closeTypeahead(editorState) {
|
|
|
192
184
|
text: text
|
|
193
185
|
}));
|
|
194
186
|
};
|
|
195
|
-
exports.
|
|
196
|
-
var selectTypeaheadItem = function selectTypeaheadItem(self) {
|
|
187
|
+
var selectTypeaheadItem = exports.selectTypeaheadItem = function selectTypeaheadItem(self) {
|
|
197
188
|
return function (label, value, selection) {
|
|
198
189
|
return function () {
|
|
199
190
|
// determine how the selected value should be wrapped based on the language of
|
|
@@ -249,12 +240,10 @@ var selectTypeaheadItem = function selectTypeaheadItem(self) {
|
|
|
249
240
|
};
|
|
250
241
|
};
|
|
251
242
|
};
|
|
252
|
-
exports.
|
|
253
|
-
var getEntities = function getEntities(editorState) {
|
|
243
|
+
var getEntities = exports.getEntities = function getEntities(editorState) {
|
|
254
244
|
return getEntitiesImpl(editorState.getCurrentContent().getFirstBlock(), editorState.getCurrentContent());
|
|
255
245
|
};
|
|
256
|
-
exports.
|
|
257
|
-
var getEntitiesImpl = function getEntitiesImpl(block, content) {
|
|
246
|
+
var getEntitiesImpl = exports.getEntitiesImpl = function getEntitiesImpl(block, content) {
|
|
258
247
|
var text = block.getText();
|
|
259
248
|
var ranges = [];
|
|
260
249
|
block.findEntityRanges(function (character) {
|
|
@@ -285,8 +274,8 @@ var getEntitiesImpl = function getEntitiesImpl(block, content) {
|
|
|
285
274
|
};
|
|
286
275
|
|
|
287
276
|
// SUPER GENERIC HELPERS
|
|
288
|
-
|
|
289
|
-
var apply = function apply(editorState) {
|
|
277
|
+
|
|
278
|
+
var apply = exports.apply = function apply(editorState) {
|
|
290
279
|
for (var _len = arguments.length, operations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
291
280
|
operations[_key - 1] = arguments[_key];
|
|
292
281
|
}
|
|
@@ -296,8 +285,7 @@ var apply = function apply(editorState) {
|
|
|
296
285
|
return op(reduction);
|
|
297
286
|
}, editorState);
|
|
298
287
|
};
|
|
299
|
-
exports.
|
|
300
|
-
var select = function select(_ref7) {
|
|
288
|
+
var select = exports.select = function select(_ref7) {
|
|
301
289
|
var anchor = _ref7.anchor,
|
|
302
290
|
focus = _ref7.focus;
|
|
303
291
|
return function (editorState) {
|
|
@@ -307,8 +295,7 @@ var select = function select(_ref7) {
|
|
|
307
295
|
return _draftJs.EditorState.forceSelection(editorState, selection2);
|
|
308
296
|
};
|
|
309
297
|
};
|
|
310
|
-
exports.
|
|
311
|
-
var insertText = function insertText(_ref8) {
|
|
298
|
+
var insertText = exports.insertText = function insertText(_ref8) {
|
|
312
299
|
var text = _ref8.text,
|
|
313
300
|
entity = _ref8.entity;
|
|
314
301
|
return function (editorState) {
|
|
@@ -319,8 +306,7 @@ var insertText = function insertText(_ref8) {
|
|
|
319
306
|
return _draftJs.EditorState.push(editorState, contentState2, 'insert-characters', true);
|
|
320
307
|
};
|
|
321
308
|
};
|
|
322
|
-
exports.
|
|
323
|
-
var applyEntity = function applyEntity(_ref9) {
|
|
309
|
+
var applyEntity = exports.applyEntity = function applyEntity(_ref9) {
|
|
324
310
|
var data = _ref9.data,
|
|
325
311
|
end = _ref9.end,
|
|
326
312
|
key = _ref9.key,
|
|
@@ -336,19 +322,16 @@ var applyEntity = function applyEntity(_ref9) {
|
|
|
336
322
|
return _draftJs.EditorState.forceSelection(_draftJs.EditorState.push(editorState, contentState2, 'apply-entity'), editorState.getSelection());
|
|
337
323
|
};
|
|
338
324
|
};
|
|
339
|
-
exports.
|
|
340
|
-
var findByEntityType = function findByEntityType(type) {
|
|
325
|
+
var findByEntityType = exports.findByEntityType = function findByEntityType(type) {
|
|
341
326
|
return function (contentBlock, callback, contentState) {
|
|
342
327
|
return contentBlock.findEntityRanges(function (_char) {
|
|
343
328
|
return _char.getEntity() ? contentState.getEntity(_char.getEntity()).getType() === type : false;
|
|
344
329
|
}, callback);
|
|
345
330
|
};
|
|
346
331
|
};
|
|
347
|
-
exports.
|
|
348
|
-
var getCurrentIndentation = function getCurrentIndentation(newLine, editorState) {
|
|
332
|
+
var getCurrentIndentation = exports.getCurrentIndentation = function getCurrentIndentation(newLine, editorState) {
|
|
349
333
|
var text = editorState.getCurrentContent().getBlockForKey(editorState.getSelection().getStartKey()).getText();
|
|
350
334
|
var textBeforeCursor = text.slice(0, editorState.getSelection().getStartOffset());
|
|
351
335
|
var lineBeforeCursor = textBeforeCursor.slice(textBeforeCursor.lastIndexOf(newLine) + 1);
|
|
352
336
|
return lineBeforeCursor.replace(/\S.*$/, '');
|
|
353
|
-
};
|
|
354
|
-
exports.getCurrentIndentation = getCurrentIndentation;
|
|
337
|
+
};
|
|
@@ -25,7 +25,7 @@ var processToken = function processToken() {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
var processCode = function processCode(language) {
|
|
28
|
+
var processCode = exports.processCode = function processCode(language) {
|
|
29
29
|
return function (string) {
|
|
30
30
|
for (var _len2 = arguments.length, parentTypes = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
31
31
|
parentTypes[_key2 - 1] = arguments[_key2];
|
|
@@ -33,11 +33,8 @@ var processCode = function processCode(language) {
|
|
|
33
33
|
return _prismjs["default"].tokenize(string, language).flatMap(processToken.apply(void 0, parentTypes));
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
37
|
-
var
|
|
38
|
-
exports.processJavaScript = processJavaScript;
|
|
39
|
-
var processRuby = processCode(_prismjs["default"].languages.ruby);
|
|
40
|
-
exports.processRuby = processRuby;
|
|
36
|
+
var processJavaScript = exports.processJavaScript = processCode(_prismjs["default"].languages.javascript);
|
|
37
|
+
var processRuby = exports.processRuby = processCode(_prismjs["default"].languages.ruby);
|
|
41
38
|
var countLength = function countLength(tokens) {
|
|
42
39
|
return tokens.reduce(function (reduction, _ref) {
|
|
43
40
|
var _ref2 = (0, _slicedToArray2["default"])(_ref, 1),
|
|
@@ -114,14 +111,11 @@ var processInterpolation = function processInterpolation(string) {
|
|
|
114
111
|
});
|
|
115
112
|
return result.concat(processJavaScriptTemplate(string.slice(countLength(result))));
|
|
116
113
|
};
|
|
117
|
-
var processTemplate = function processTemplate(openingString, processor) {
|
|
114
|
+
var processTemplate = exports.processTemplate = function processTemplate(openingString, processor) {
|
|
118
115
|
return function (string) {
|
|
119
116
|
var openingIndex = string.indexOf(openingString);
|
|
120
117
|
return openingIndex > -1 ? [[string.slice(0, openingIndex)]].concat((0, _toConsumableArray2["default"])(processor(string.slice(openingIndex)))) : [[string]];
|
|
121
118
|
};
|
|
122
119
|
};
|
|
123
|
-
exports.
|
|
124
|
-
var
|
|
125
|
-
exports.processErbTemplate = processErbTemplate;
|
|
126
|
-
var processJavaScriptTemplate = processTemplate('${', processInterpolation);
|
|
127
|
-
exports.processJavaScriptTemplate = processJavaScriptTemplate;
|
|
120
|
+
var processErbTemplate = exports.processErbTemplate = processTemplate('<%', processEmbeddedRuby);
|
|
121
|
+
var processJavaScriptTemplate = exports.processJavaScriptTemplate = processTemplate('${', processInterpolation);
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var _languageHelpers = require("./languageHelpers");
|
|
4
4
|
describe('processErbTemplate', function () {
|
|
5
5
|
test('simple tokens', function () {
|
|
6
|
-
expect((0, _languageHelpers.processErbTemplate)("Hello <%= @results['Person'] %>")).toEqual([['Hello '], ['<%=', 'opening-tag', 'erb'], [' ', 'erb'], ['@results', 'variable', 'erb'], ['[', 'punctuation', 'erb'], ["'Person'", 'string', 'erb'], [']', 'punctuation', 'erb'], [' ', 'erb'], ['%>', 'closing-tag', 'erb'], ['']]);
|
|
6
|
+
expect((0, _languageHelpers.processErbTemplate)("Hello <%= @results['Person'] %>")).toEqual([['Hello '], ['<%=', 'opening-tag', 'erb'], [' ', 'erb'], ['@results', 'variable', 'erb'], ['[', 'punctuation', 'erb'], ["'Person'", 'string', 'string-literal', 'erb'], [']', 'punctuation', 'erb'], [' ', 'erb'], ['%>', 'closing-tag', 'erb'], ['']]);
|
|
7
7
|
});
|
|
8
8
|
test('should allow %> inside a string', function () {
|
|
9
|
-
expect((0, _languageHelpers.processErbTemplate)("Hello <%= '%>' %>")).toEqual([['Hello '], ['<%=', 'opening-tag', 'erb'], [' ', 'erb'], ["'%>'", 'string', 'erb'], [' ', 'erb'], ['%>', 'closing-tag', 'erb'], ['']]);
|
|
9
|
+
expect((0, _languageHelpers.processErbTemplate)("Hello <%= '%>' %>")).toEqual([['Hello '], ['<%=', 'opening-tag', 'erb'], [' ', 'erb'], ["'%>'", 'string', 'string-literal', 'erb'], [' ', 'erb'], ['%>', 'closing-tag', 'erb'], ['']]);
|
|
10
10
|
});
|
|
11
11
|
test('% and > need to be immediately adjacent', function () {
|
|
12
12
|
expect((0, _languageHelpers.processErbTemplate)('Hello <%= % > %>')).toEqual([['Hello '], ['<%=', 'opening-tag', 'erb'], [' ', 'erb'], ['%', 'operator', 'erb'], [' ', 'erb'], ['>', 'operator', 'erb'], [' ', 'erb'], ['%>', 'closing-tag', 'erb'], ['']]);
|
|
@@ -39,7 +39,7 @@ describe('processJavaScriptTemplate', function () {
|
|
|
39
39
|
});
|
|
40
40
|
test('add some objects inside to test curly behavior', function () {
|
|
41
41
|
// eslint-disable-next-line no-template-curly-in-string
|
|
42
|
-
expect((0, _languageHelpers.processJavaScriptTemplate)('Hello ${{foo:{"bar":2}}}')).toEqual([['Hello '], ['${', 'opening-interpolation', 'js-template'], ['{', 'punctuation', 'js-template'], ['foo', 'js-template'], [':', 'operator', 'js-template'], ['{', 'punctuation', 'js-template'], ['"bar"', 'string', 'js-template'], [':', 'operator', 'js-template'], ['2', 'number', 'js-template'], ['}', 'punctuation', 'js-template'], ['}', 'punctuation', 'js-template'], ['}', 'closing-interpolation', 'js-template'], ['']]);
|
|
42
|
+
expect((0, _languageHelpers.processJavaScriptTemplate)('Hello ${{foo:{"bar":2}}}')).toEqual([['Hello '], ['${', 'opening-interpolation', 'js-template'], ['{', 'punctuation', 'js-template'], ['foo', 'literal-property', 'js-template'], [':', 'operator', 'js-template'], ['{', 'punctuation', 'js-template'], ['"bar"', 'string-property', 'js-template'], [':', 'operator', 'js-template'], ['2', 'number', 'js-template'], ['}', 'punctuation', 'js-template'], ['}', 'punctuation', 'js-template'], ['}', 'closing-interpolation', 'js-template'], ['']]);
|
|
43
43
|
});
|
|
44
44
|
test('multiple interpolations', function () {
|
|
45
45
|
// eslint-disable-next-line no-template-curly-in-string
|
|
@@ -48,16 +48,18 @@ describe('processJavaScriptTemplate', function () {
|
|
|
48
48
|
});
|
|
49
49
|
describe('processRuby', function () {
|
|
50
50
|
test('simple tokens', function () {
|
|
51
|
-
expect((0, _languageHelpers.processRuby)("'Hello ' + @results['Person']")).toEqual([["'Hello '", 'string'], [' '], ['+', 'operator'], [' '], ['@results', 'variable'], ['[', 'punctuation'], ["'Person'", 'string'], [']', 'punctuation']]);
|
|
51
|
+
expect((0, _languageHelpers.processRuby)("'Hello ' + @results['Person']")).toEqual([["'Hello '", 'string', 'string-literal'], [' '], ['+', 'operator'], [' '], ['@results', 'variable'], ['[', 'punctuation'], ["'Person'", 'string', 'string-literal'], [']', 'punctuation']]);
|
|
52
52
|
});
|
|
53
53
|
test('string with interpolation', function () {
|
|
54
|
-
expect((0, _languageHelpers.processRuby)("%^Hello #{ @results['Person'] }^")).toEqual([['%^Hello ', 'string'], ['#{', 'delimiter', 'interpolation', 'string'], [' ', 'interpolation', 'string'], ['@results', 'variable', 'interpolation', 'string'], ['[', 'punctuation', 'interpolation', 'string'], ["'Person'", 'string', 'interpolation', 'string'], [']', 'punctuation', 'interpolation', 'string'], [' ', 'interpolation', 'string'], ['}', 'delimiter', 'interpolation', 'string'], ['^', 'string']]);
|
|
54
|
+
expect((0, _languageHelpers.processRuby)("%^Hello #{ @results['Person'] }^")).toEqual([['%^Hello ', 'string', 'string-literal'], ['#{', 'delimiter', 'interpolation', 'string-literal'], [' ', 'content', 'interpolation', 'string-literal'], ['@results', 'variable', 'content', 'interpolation', 'string-literal'], ['[', 'punctuation', 'content', 'interpolation', 'string-literal'], ["'Person'", 'string', 'string-literal', 'content', 'interpolation', 'string-literal'], [']', 'punctuation', 'content', 'interpolation', 'string-literal'], [' ', 'content', 'interpolation', 'string-literal'], ['}', 'delimiter', 'interpolation', 'string-literal'], ['^', 'string', 'string-literal']]);
|
|
55
55
|
});
|
|
56
56
|
test('nested interpolation', function () {
|
|
57
|
-
expect((0, _languageHelpers.processRuby)('"#{"#{2}"}"')).toEqual([
|
|
57
|
+
expect((0, _languageHelpers.processRuby)('"#{"#{2}"}"')).toEqual([
|
|
58
58
|
// prism's ruby parser does not support nested interpolation (thinks its a
|
|
59
59
|
// comment) the commented code below is what it should be if it did
|
|
60
60
|
// support that properly
|
|
61
|
+
// ['"', 'string'],
|
|
62
|
+
// ['#{', 'delimiter', 'interpolation', 'string'],
|
|
61
63
|
// ['"', 'string', 'interpolation', 'string'],
|
|
62
64
|
// ['#{', 'delimiter', 'interpolation', 'string', 'interpolation', 'string'],
|
|
63
65
|
// ['2', 'number', 'interpolation', 'string', 'interpolation', 'string'],
|
|
@@ -66,7 +68,7 @@ describe('processRuby', function () {
|
|
|
66
68
|
// ['}', 'delimiter', 'interpolation', 'string'],
|
|
67
69
|
// ['"', 'string'],
|
|
68
70
|
|
|
69
|
-
// the following is the
|
|
70
|
-
['"', '
|
|
71
|
+
// the following is the result due to the prism issue
|
|
72
|
+
['"#{"', 'string', 'string-literal'], ['#{', 'delimiter', 'interpolation', 'string-literal'], ['2', 'number', 'content', 'interpolation', 'string-literal'], ['}', 'delimiter', 'interpolation', 'string-literal'], ['"', 'string', 'string-literal'], ['}', 'punctuation'], ['"']]);
|
|
71
73
|
});
|
|
72
74
|
});
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.DefaultCommonConfig = void 0;
|
|
8
8
|
var _immutable = require("immutable");
|
|
9
9
|
var _Toast = _interopRequireDefault(require("./Toast"));
|
|
10
|
-
var DefaultCommonConfig = (0, _immutable.Map)({
|
|
10
|
+
var DefaultCommonConfig = exports.DefaultCommonConfig = (0, _immutable.Map)({
|
|
11
11
|
Toast: _Toast["default"]
|
|
12
|
-
});
|
|
13
|
-
exports.DefaultCommonConfig = DefaultCommonConfig;
|
|
12
|
+
});
|
|
@@ -79,13 +79,12 @@ var fields = function fields(_ref4) {
|
|
|
79
79
|
* @component
|
|
80
80
|
* A form for creating and updating Attribute Definitions within the Kinetic Platform
|
|
81
81
|
*/
|
|
82
|
-
var AttributeDefinitionForm = (0, _Form.generateForm)({
|
|
82
|
+
var AttributeDefinitionForm = exports.AttributeDefinitionForm = (0, _Form.generateForm)({
|
|
83
83
|
formOptions: ['kappSlug', 'attributeType', 'attributeName'],
|
|
84
84
|
dataSources: dataSources,
|
|
85
85
|
fields: fields,
|
|
86
86
|
handleSubmit: handleSubmit
|
|
87
87
|
});
|
|
88
|
-
exports.AttributeDefinitionForm = AttributeDefinitionForm;
|
|
89
88
|
AttributeDefinitionForm.displayName = 'AttributeDefinitionForm';
|
|
90
89
|
|
|
91
90
|
// Specifies the default values for props:
|
|
@@ -56,13 +56,12 @@ var columns = [{
|
|
|
56
56
|
sortable: false,
|
|
57
57
|
toggleable: true
|
|
58
58
|
}];
|
|
59
|
-
var AttributeDefinitionTable = (0, _Table.generateTable)({
|
|
59
|
+
var AttributeDefinitionTable = exports.AttributeDefinitionTable = (0, _Table.generateTable)({
|
|
60
60
|
tableOptions: ['kappSlug', 'attributeType'],
|
|
61
61
|
columns: columns,
|
|
62
62
|
filters: filters,
|
|
63
63
|
dataSource: dataSource
|
|
64
64
|
});
|
|
65
|
-
exports.AttributeDefinitionTable = AttributeDefinitionTable;
|
|
66
65
|
AttributeDefinitionTable.displayName = 'AttributeDefinitionTable';
|
|
67
66
|
AttributeDefinitionTable.propTypes = {
|
|
68
67
|
/** The Slug of the kapp required if the type of attribute is scoped to a kapp (ie, category * kapp attributes) */
|
|
@@ -62,61 +62,59 @@ var handleSubmit = function handleSubmit(_ref4) {
|
|
|
62
62
|
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(values, _ref5) {
|
|
63
63
|
var modelMapping, _values$toJS, name, status, bridgeSlug, agentSlug, structure, modelMethod, mappingName, mappingMethod, _yield$modelMethod, bridgeModel, modelError, _yield$mappingMethod, mappingError;
|
|
64
64
|
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
65
|
-
while (1) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
activeMappingName: name
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
case 7:
|
|
86
|
-
_yield$modelMethod = _context.sent;
|
|
87
|
-
bridgeModel = _yield$modelMethod.bridgeModel;
|
|
88
|
-
modelError = _yield$modelMethod.error;
|
|
89
|
-
if (!modelError) {
|
|
90
|
-
_context.next = 12;
|
|
91
|
-
break;
|
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
modelMapping = _ref5.modelMapping;
|
|
68
|
+
// destructure the values of the fields because they will be used in different
|
|
69
|
+
// payloads below
|
|
70
|
+
_values$toJS = values.toJS(), name = _values$toJS.name, status = _values$toJS.status, bridgeSlug = _values$toJS.bridgeSlug, agentSlug = _values$toJS.agentSlug, structure = _values$toJS.structure; // determine if we are creating / updating a model
|
|
71
|
+
modelMethod = modelName ? _apis.updateBridgeModel : _apis.createBridgeModel; // determine if we are creating / updating a model mapping, due to invalid
|
|
72
|
+
// states its possible that we can be updating a model but creating a mapping
|
|
73
|
+
mappingName = modelMapping && modelMapping.get('name');
|
|
74
|
+
mappingMethod = mappingName ? _apis.updateBridgeModelMapping : _apis.createBridgeModelMapping;
|
|
75
|
+
_context.next = 7;
|
|
76
|
+
return modelMethod({
|
|
77
|
+
modelName: modelName,
|
|
78
|
+
bridgeModel: {
|
|
79
|
+
name: name,
|
|
80
|
+
status: status,
|
|
81
|
+
activeMappingName: name
|
|
92
82
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
83
|
+
});
|
|
84
|
+
case 7:
|
|
85
|
+
_yield$modelMethod = _context.sent;
|
|
86
|
+
bridgeModel = _yield$modelMethod.bridgeModel;
|
|
87
|
+
modelError = _yield$modelMethod.error;
|
|
88
|
+
if (!modelError) {
|
|
89
|
+
_context.next = 12;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
throw modelError.statusCode === 400 && modelError.message || 'There was an error saving the model';
|
|
93
|
+
case 12:
|
|
94
|
+
_context.next = 14;
|
|
95
|
+
return mappingMethod({
|
|
96
|
+
modelName: name,
|
|
97
|
+
mappingName: mappingName,
|
|
98
|
+
bridgeModelMapping: {
|
|
99
|
+
name: name,
|
|
100
|
+
bridgeSlug: bridgeSlug,
|
|
101
|
+
agentSlug: agentSlug,
|
|
102
|
+
structure: structure
|
|
112
103
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
104
|
+
});
|
|
105
|
+
case 14:
|
|
106
|
+
_yield$mappingMethod = _context.sent;
|
|
107
|
+
mappingError = _yield$mappingMethod.error;
|
|
108
|
+
if (!mappingError) {
|
|
109
|
+
_context.next = 18;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
throw mappingError.statusCode === 400 && mappingError.message || 'There was an error saving the model mapping';
|
|
113
|
+
case 18:
|
|
114
|
+
return _context.abrupt("return", bridgeModel);
|
|
115
|
+
case 19:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context.stop();
|
|
120
118
|
}
|
|
121
119
|
}, _callee);
|
|
122
120
|
}));
|
|
@@ -203,11 +201,10 @@ var fields = function fields(_ref7) {
|
|
|
203
201
|
}];
|
|
204
202
|
};
|
|
205
203
|
};
|
|
206
|
-
var BridgeModelForm = (0, _Form.generateForm)({
|
|
204
|
+
var BridgeModelForm = exports.BridgeModelForm = (0, _Form.generateForm)({
|
|
207
205
|
formOptions: ['modelName'],
|
|
208
206
|
dataSources: dataSources,
|
|
209
207
|
fields: fields,
|
|
210
208
|
handleSubmit: handleSubmit
|
|
211
209
|
});
|
|
212
|
-
exports.BridgeModelForm = BridgeModelForm;
|
|
213
210
|
BridgeModelForm.displayName = 'BridgeModelForm';
|
|
@@ -57,10 +57,9 @@ var columns = [{
|
|
|
57
57
|
sortable: true,
|
|
58
58
|
toggleable: true
|
|
59
59
|
}];
|
|
60
|
-
var BridgeModelTable = (0, _Table.generateTable)({
|
|
60
|
+
var BridgeModelTable = exports.BridgeModelTable = (0, _Table.generateTable)({
|
|
61
61
|
columns: columns,
|
|
62
62
|
filters: filters,
|
|
63
63
|
dataSource: dataSource
|
|
64
64
|
});
|
|
65
|
-
exports.BridgeModelTable = BridgeModelTable;
|
|
66
65
|
BridgeModelTable.displayName = 'BridgeModelTable';
|
|
@@ -99,11 +99,10 @@ var fields = function fields(_ref6) {
|
|
|
99
99
|
}];
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
var BridgeModelAttributeForm = (0, _Form.generateForm)({
|
|
102
|
+
var BridgeModelAttributeForm = exports.BridgeModelAttributeForm = (0, _Form.generateForm)({
|
|
103
103
|
formOptions: ['modelName', 'attributeName'],
|
|
104
104
|
dataSources: dataSources,
|
|
105
105
|
fields: fields,
|
|
106
106
|
handleSubmit: handleSubmit
|
|
107
107
|
});
|
|
108
|
-
exports.BridgeModelAttributeForm = BridgeModelAttributeForm;
|
|
109
108
|
BridgeModelAttributeForm.displayName = 'BridgeModelAttributeForm';
|
|
@@ -83,11 +83,10 @@ var columns = [{
|
|
|
83
83
|
title: 'Mapping',
|
|
84
84
|
type: 'text'
|
|
85
85
|
}];
|
|
86
|
-
var BridgeModelAttributeTable = (0, _Table.generateTable)({
|
|
86
|
+
var BridgeModelAttributeTable = exports.BridgeModelAttributeTable = (0, _Table.generateTable)({
|
|
87
87
|
columns: columns,
|
|
88
88
|
// filters,
|
|
89
89
|
dataSource: dataSource,
|
|
90
90
|
tableOptions: ['modelName']
|
|
91
91
|
});
|
|
92
|
-
exports.BridgeModelAttributeTable = BridgeModelAttributeTable;
|
|
93
92
|
BridgeModelAttributeTable.displayName = 'BridgeModelAttributeTable';
|
|
@@ -137,11 +137,10 @@ var fields = function fields(_ref6) {
|
|
|
137
137
|
}];
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
var BridgeModelQualificationForm = (0, _Form.generateForm)({
|
|
140
|
+
var BridgeModelQualificationForm = exports.BridgeModelQualificationForm = (0, _Form.generateForm)({
|
|
141
141
|
formOptions: ['modelName', 'qualificationName'],
|
|
142
142
|
dataSources: dataSources,
|
|
143
143
|
fields: fields,
|
|
144
144
|
handleSubmit: handleSubmit
|
|
145
145
|
});
|
|
146
|
-
exports.BridgeModelQualificationForm = BridgeModelQualificationForm;
|
|
147
146
|
BridgeModelQualificationForm.displayName = 'BridgeModelQualificationForm';
|
|
@@ -95,11 +95,10 @@ var columns = [{
|
|
|
95
95
|
value: 'query',
|
|
96
96
|
title: 'Query'
|
|
97
97
|
}];
|
|
98
|
-
var BridgeModelQualificationTable = (0, _Table.generateTable)({
|
|
98
|
+
var BridgeModelQualificationTable = exports.BridgeModelQualificationTable = (0, _Table.generateTable)({
|
|
99
99
|
columns: columns,
|
|
100
100
|
// filters,
|
|
101
101
|
dataSource: dataSource,
|
|
102
102
|
tableOptions: ['modelName']
|
|
103
103
|
});
|
|
104
|
-
exports.BridgeModelQualificationTable = BridgeModelQualificationTable;
|
|
105
104
|
BridgeModelQualificationTable.displayName = 'BridgeModelQualificationTable';
|
|
@@ -104,13 +104,12 @@ var fields = function fields(_ref4) {
|
|
|
104
104
|
}];
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
|
-
var CategoryForm = (0, _Form.generateForm)({
|
|
107
|
+
var CategoryForm = exports.CategoryForm = (0, _Form.generateForm)({
|
|
108
108
|
formOptions: ['kappSlug', 'categorySlug'],
|
|
109
109
|
dataSources: dataSources,
|
|
110
110
|
fields: fields,
|
|
111
111
|
handleSubmit: handleSubmit
|
|
112
112
|
});
|
|
113
|
-
exports.CategoryForm = CategoryForm;
|
|
114
113
|
CategoryForm.displayName = 'CategoryForm';
|
|
115
114
|
CategoryForm.propTypes = {
|
|
116
115
|
/** The Slug of the kapp the category exists in, or should be created in */
|
|
@@ -73,13 +73,12 @@ var columns = [{
|
|
|
73
73
|
sortable: true,
|
|
74
74
|
toggleable: true
|
|
75
75
|
}];
|
|
76
|
-
var CategoryTable = (0, _Table.generateTable)({
|
|
76
|
+
var CategoryTable = exports.CategoryTable = (0, _Table.generateTable)({
|
|
77
77
|
tableOptions: ['kappSlug'],
|
|
78
78
|
columns: columns,
|
|
79
79
|
filters: filters,
|
|
80
80
|
dataSource: dataSource
|
|
81
81
|
});
|
|
82
|
-
exports.CategoryTable = CategoryTable;
|
|
83
82
|
CategoryTable.propTypes = {
|
|
84
83
|
/** The Slug of the kapp to display categories for */
|
|
85
84
|
kappSlug: _propTypes["default"].string.isRequired
|