@kineticdata/react 5.1.2 → 6.0.0
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/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +280 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +12 -8
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +12 -8
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +12 -8
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +18 -15
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +12 -8
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +15 -10
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +15 -10
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +25 -22
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +12 -8
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +19 -11
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +17 -12
- package/lib/components/core/log/LogTable.js +35 -33
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +18 -13
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +27 -20
- package/lib/components/core/submission/KappSubmissionTable.js +30 -29
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +16 -11
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +19 -15
- package/lib/components/core/webapi/WebApiForm.js +49 -61
- package/lib/components/core/webapi/WebApiTable.js +14 -10
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +22 -20
- package/lib/components/core/webhook_job/WebhookJobTable.js +19 -16
- package/lib/components/form/Form.helpers.js +102 -90
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +38 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +981 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemFilestoreForm.js +28 -25
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +10 -9
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +21 -17
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +62 -60
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +43 -40
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +211 -224
- package/lib/components/table/Table.redux.js +292 -329
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +107 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +41 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +17 -13
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +12 -8
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +23 -20
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +14 -11
- package/lib/components/task/triggers/TriggerTable.js +21 -18
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -10
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +17 -14
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +86 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +3 -28
- package/proxyhelper.js +105 -46
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import { fromJS, get, Map } from 'immutable';
|
|
4
|
-
import t from 'prop-types';
|
|
5
|
-
import { generateForm } from '../../form/Form';
|
|
6
|
-
import { updateSpace, fetchSpace, fetchAttributeDefinitions, fetchLocales, fetchTimezones, fetchSecurityPolicyDefinitions } from '../../../apis';
|
|
7
|
-
import { slugify } from '../../../helpers';
|
|
8
|
-
var DISPLAY_TYPES = ['Display Page', 'Redirect', 'Single Page App'];
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SpaceForm = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
10
|
+
var _immutable = require("immutable");
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _Form = require("../../form/Form");
|
|
13
|
+
var _apis = require("../../../apis");
|
|
14
|
+
var _helpers = require("../../../helpers");
|
|
15
|
+
var DISPLAY_TYPES = ['Display Page', 'Redirect', 'Single Page App'];
|
|
10
16
|
var dataSources = function dataSources() {
|
|
11
17
|
return {
|
|
12
18
|
space: {
|
|
13
|
-
fn: fetchSpace,
|
|
19
|
+
fn: _apis.fetchSpace,
|
|
14
20
|
params: [{
|
|
15
21
|
include: 'allowedIps,attributesMap,securityPolicies,details'
|
|
16
22
|
}],
|
|
@@ -19,21 +25,21 @@ var dataSources = function dataSources() {
|
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
locales: {
|
|
22
|
-
fn: fetchLocales,
|
|
28
|
+
fn: _apis.fetchLocales,
|
|
23
29
|
params: [],
|
|
24
30
|
transform: function transform(result) {
|
|
25
31
|
return result.data.locales;
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
timezones: {
|
|
29
|
-
fn: fetchTimezones,
|
|
35
|
+
fn: _apis.fetchTimezones,
|
|
30
36
|
params: [],
|
|
31
37
|
transform: function transform(result) {
|
|
32
38
|
return result.data.timezones;
|
|
33
39
|
}
|
|
34
40
|
},
|
|
35
41
|
attributeDefinitions: {
|
|
36
|
-
fn: fetchAttributeDefinitions,
|
|
42
|
+
fn: _apis.fetchAttributeDefinitions,
|
|
37
43
|
params: [{
|
|
38
44
|
attributeType: 'spaceAttributeDefinitions'
|
|
39
45
|
}],
|
|
@@ -42,7 +48,7 @@ var dataSources = function dataSources() {
|
|
|
42
48
|
}
|
|
43
49
|
},
|
|
44
50
|
securityPolicyDefinitions: {
|
|
45
|
-
fn: fetchSecurityPolicyDefinitions,
|
|
51
|
+
fn: _apis.fetchSecurityPolicyDefinitions,
|
|
46
52
|
params: [],
|
|
47
53
|
transform: function transform(result) {
|
|
48
54
|
return result.securityPolicyDefinitions;
|
|
@@ -50,30 +56,21 @@ var dataSources = function dataSources() {
|
|
|
50
56
|
}
|
|
51
57
|
};
|
|
52
58
|
};
|
|
53
|
-
|
|
54
59
|
var handleSubmit = function handleSubmit() {
|
|
55
60
|
return function (values) {
|
|
56
|
-
return updateSpace({
|
|
61
|
+
return (0, _apis.updateSpace)({
|
|
57
62
|
space: values
|
|
58
63
|
}).then(function (_ref) {
|
|
59
64
|
var space = _ref.space,
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
error = _ref.error;
|
|
62
66
|
if (error) {
|
|
63
67
|
throw error.statusCode === 400 && error.message || 'There was an error saving the space';
|
|
64
68
|
}
|
|
65
|
-
|
|
66
69
|
return space;
|
|
67
70
|
});
|
|
68
71
|
};
|
|
69
72
|
};
|
|
70
|
-
|
|
71
73
|
var securityEndpoints = {
|
|
72
|
-
discussionCreation: {
|
|
73
|
-
endpoint: 'Discussion Creation',
|
|
74
|
-
label: 'Discussion Creation',
|
|
75
|
-
types: ['Space']
|
|
76
|
-
},
|
|
77
74
|
spaceDisplay: {
|
|
78
75
|
endpoint: 'Display',
|
|
79
76
|
label: 'Space Display',
|
|
@@ -135,55 +132,54 @@ var securityEndpoints = {
|
|
|
135
132
|
types: ['Form', 'Submission']
|
|
136
133
|
}
|
|
137
134
|
};
|
|
138
|
-
|
|
139
135
|
var fields = function fields() {
|
|
140
136
|
return function (_ref2) {
|
|
141
137
|
var attributeDefinitions = _ref2.attributeDefinitions,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
138
|
+
locales = _ref2.locales,
|
|
139
|
+
securityPolicyDefinitions = _ref2.securityPolicyDefinitions,
|
|
140
|
+
space = _ref2.space,
|
|
141
|
+
timezones = _ref2.timezones;
|
|
146
142
|
return space && locales && timezones && attributeDefinitions && securityPolicyDefinitions && [{
|
|
147
143
|
name: 'afterLogoutPath',
|
|
148
144
|
label: 'After Logout Path',
|
|
149
145
|
type: 'text',
|
|
150
|
-
initialValue: get(space, 'afterLogoutPath'),
|
|
146
|
+
initialValue: (0, _immutable.get)(space, 'afterLogoutPath'),
|
|
151
147
|
placeholder: function placeholder(_ref3) {
|
|
152
148
|
var space = _ref3.space;
|
|
153
|
-
return "/".concat(get(space, 'slug'));
|
|
149
|
+
return "/".concat((0, _immutable.get)(space, 'slug'));
|
|
154
150
|
},
|
|
155
151
|
visible: function visible(_ref4) {
|
|
156
152
|
var values = _ref4.values;
|
|
157
|
-
return get(values, 'displayType') !== 'Single Page App';
|
|
153
|
+
return (0, _immutable.get)(values, 'displayType') !== 'Single Page App';
|
|
158
154
|
}
|
|
159
155
|
}, {
|
|
160
156
|
name: 'bundlePath',
|
|
161
157
|
label: 'Bundle Path',
|
|
162
158
|
type: 'text',
|
|
163
|
-
initialValue: get(space, 'bundlePath'),
|
|
159
|
+
initialValue: (0, _immutable.get)(space, 'bundlePath'),
|
|
164
160
|
required: function required(_ref5) {
|
|
165
161
|
var values = _ref5.values;
|
|
166
|
-
return get(values, 'sharedBundleBase') !== '' && get(values, 'displayType') === 'Display Page';
|
|
162
|
+
return (0, _immutable.get)(values, 'sharedBundleBase') !== '' && (0, _immutable.get)(values, 'displayType') === 'Display Page';
|
|
167
163
|
}
|
|
168
164
|
}, {
|
|
169
165
|
name: 'defaultFormConfirmationPage',
|
|
170
166
|
label: 'Default Form Confirmation Page',
|
|
171
167
|
type: 'text',
|
|
172
|
-
initialValue: get(space, 'defaultFormConfirmationPage'),
|
|
168
|
+
initialValue: (0, _immutable.get)(space, 'defaultFormConfirmationPage'),
|
|
173
169
|
placeholder: 'confirmation.jsp',
|
|
174
170
|
visible: function visible(_ref6) {
|
|
175
171
|
var values = _ref6.values;
|
|
176
|
-
return get(values, 'displayType') !== 'Single Page App';
|
|
172
|
+
return (0, _immutable.get)(values, 'displayType') !== 'Single Page App';
|
|
177
173
|
}
|
|
178
174
|
}, {
|
|
179
175
|
name: 'defaultFormDisplayPage',
|
|
180
176
|
label: 'Default Form Display Page',
|
|
181
177
|
type: 'text',
|
|
182
|
-
initialValue: get(space, 'defaultFormDisplayPage'),
|
|
178
|
+
initialValue: (0, _immutable.get)(space, 'defaultFormDisplayPage'),
|
|
183
179
|
placeholder: 'form.jsp',
|
|
184
180
|
visible: function visible(_ref7) {
|
|
185
181
|
var values = _ref7.values;
|
|
186
|
-
return get(values, 'displayType') !== 'Single Page App';
|
|
182
|
+
return (0, _immutable.get)(values, 'displayType') !== 'Single Page App';
|
|
187
183
|
}
|
|
188
184
|
}, {
|
|
189
185
|
name: 'defaultLocale',
|
|
@@ -192,13 +188,13 @@ var fields = function fields() {
|
|
|
192
188
|
options: function options(_ref8) {
|
|
193
189
|
var locales = _ref8.locales;
|
|
194
190
|
return locales.map(function (locale) {
|
|
195
|
-
return Map({
|
|
191
|
+
return (0, _immutable.Map)({
|
|
196
192
|
value: locale.get('code'),
|
|
197
193
|
label: locale.get('name')
|
|
198
194
|
});
|
|
199
195
|
});
|
|
200
196
|
},
|
|
201
|
-
initialValue: get(space, 'defaultLocale') || ''
|
|
197
|
+
initialValue: (0, _immutable.get)(space, 'defaultLocale') || ''
|
|
202
198
|
}, {
|
|
203
199
|
name: 'defaultTimezone',
|
|
204
200
|
label: 'Default Timezone',
|
|
@@ -206,13 +202,13 @@ var fields = function fields() {
|
|
|
206
202
|
options: function options(_ref9) {
|
|
207
203
|
var timezones = _ref9.timezones;
|
|
208
204
|
return timezones.map(function (timezone) {
|
|
209
|
-
return Map({
|
|
205
|
+
return (0, _immutable.Map)({
|
|
210
206
|
value: timezone.get('id'),
|
|
211
207
|
label: "".concat(timezone.get('name'), " (").concat(timezone.get('id'), ")")
|
|
212
208
|
});
|
|
213
209
|
});
|
|
214
210
|
},
|
|
215
|
-
initialValue: get(space, 'defaultTimezone') || ''
|
|
211
|
+
initialValue: (0, _immutable.get)(space, 'defaultTimezone') || ''
|
|
216
212
|
}, {
|
|
217
213
|
name: 'displayType',
|
|
218
214
|
label: 'Display Type',
|
|
@@ -224,7 +220,7 @@ var fields = function fields() {
|
|
|
224
220
|
};
|
|
225
221
|
}),
|
|
226
222
|
required: true,
|
|
227
|
-
initialValue: get(space, 'displayType') || 'Display Page',
|
|
223
|
+
initialValue: (0, _immutable.get)(space, 'displayType') || 'Display Page',
|
|
228
224
|
helpText: 'Determines how the application works. For kinops, Single Page App is used.'
|
|
229
225
|
}, {
|
|
230
226
|
name: 'displayValueJSP',
|
|
@@ -234,13 +230,13 @@ var fields = function fields() {
|
|
|
234
230
|
placeholder: 'space.jsp',
|
|
235
231
|
visible: function visible(_ref10) {
|
|
236
232
|
var values = _ref10.values;
|
|
237
|
-
return get(values, 'displayType') === 'Display Page';
|
|
233
|
+
return (0, _immutable.get)(values, 'displayType') === 'Display Page';
|
|
238
234
|
},
|
|
239
235
|
required: function required(_ref11) {
|
|
240
236
|
var values = _ref11.values;
|
|
241
|
-
return get(values, 'displayType') === 'Display Page';
|
|
237
|
+
return (0, _immutable.get)(values, 'displayType') === 'Display Page';
|
|
242
238
|
},
|
|
243
|
-
initialValue: get(space, 'displayType') === 'Display Page' ? get(space, 'displayValue') : ''
|
|
239
|
+
initialValue: (0, _immutable.get)(space, 'displayType') === 'Display Page' ? (0, _immutable.get)(space, 'displayValue') : ''
|
|
244
240
|
}, {
|
|
245
241
|
name: 'displayValueRedirect',
|
|
246
242
|
label: 'Redirect URL',
|
|
@@ -248,14 +244,14 @@ var fields = function fields() {
|
|
|
248
244
|
"transient": true,
|
|
249
245
|
visible: function visible(_ref12) {
|
|
250
246
|
var values = _ref12.values;
|
|
251
|
-
return get(values, 'displayType') === 'Redirect';
|
|
247
|
+
return (0, _immutable.get)(values, 'displayType') === 'Redirect';
|
|
252
248
|
},
|
|
253
249
|
required: function required(_ref13) {
|
|
254
250
|
var values = _ref13.values;
|
|
255
|
-
return get(values, 'displayType') === 'Redirect';
|
|
251
|
+
return (0, _immutable.get)(values, 'displayType') === 'Redirect';
|
|
256
252
|
},
|
|
257
253
|
requiredMessage: "This field is required, when display type is 'Redirect'",
|
|
258
|
-
initialValue: get(space, 'displayType') === 'Redirect' ? get(space, 'displayValue') : ''
|
|
254
|
+
initialValue: (0, _immutable.get)(space, 'displayType') === 'Redirect' ? (0, _immutable.get)(space, 'displayValue') : ''
|
|
259
255
|
}, {
|
|
260
256
|
name: 'displayValueSPA',
|
|
261
257
|
label: 'Location',
|
|
@@ -263,27 +259,26 @@ var fields = function fields() {
|
|
|
263
259
|
"transient": true,
|
|
264
260
|
visible: function visible(_ref14) {
|
|
265
261
|
var values = _ref14.values;
|
|
266
|
-
return get(values, 'displayType') === 'Single Page App';
|
|
262
|
+
return (0, _immutable.get)(values, 'displayType') === 'Single Page App';
|
|
267
263
|
},
|
|
268
264
|
required: function required(_ref15) {
|
|
269
265
|
var values = _ref15.values;
|
|
270
|
-
return get(values, 'displayType') === 'Single Page App';
|
|
266
|
+
return (0, _immutable.get)(values, 'displayType') === 'Single Page App';
|
|
271
267
|
},
|
|
272
|
-
initialValue: get(space, 'displayType') === 'Single Page App' ? (get(space, 'displayValue') || '').replace('spa.jsp', '').replace('?location=', '') : '',
|
|
268
|
+
initialValue: (0, _immutable.get)(space, 'displayType') === 'Single Page App' ? ((0, _immutable.get)(space, 'displayValue') || '').replace('spa.jsp', '').replace('?location=', '') : '',
|
|
273
269
|
helpText: 'See explanation below for external and embedded asset modes.'
|
|
274
270
|
}, {
|
|
275
271
|
name: 'displayValue',
|
|
276
272
|
label: 'Dispaly Value',
|
|
277
273
|
type: 'text',
|
|
278
274
|
visible: false,
|
|
279
|
-
initialValue: get(space, 'displayValue'),
|
|
275
|
+
initialValue: (0, _immutable.get)(space, 'displayValue'),
|
|
280
276
|
serialize: function serialize(_ref16) {
|
|
281
277
|
var values = _ref16.values;
|
|
282
278
|
var displayType = values.get('displayType');
|
|
283
279
|
var displayValueSPA = values.get('displayValueSPA');
|
|
284
280
|
var displayValueJSP = values.get('displayValueJSP');
|
|
285
281
|
var displayValueRedirect = values.get('displayValueRedirect');
|
|
286
|
-
|
|
287
282
|
if (displayType === 'Single Page App') {
|
|
288
283
|
return displayValueSPA && displayValueSPA.endsWith('index.html') ? displayValueSPA : "spa.jsp".concat(displayValueSPA && '?location=' + displayValueSPA);
|
|
289
284
|
} else {
|
|
@@ -294,24 +289,23 @@ var fields = function fields() {
|
|
|
294
289
|
name: 'loginPage',
|
|
295
290
|
label: 'Login Page',
|
|
296
291
|
type: 'text',
|
|
297
|
-
initialValue: get(space, 'loginPage'),
|
|
292
|
+
initialValue: (0, _immutable.get)(space, 'loginPage'),
|
|
298
293
|
placeholder: 'login.jsp',
|
|
299
294
|
visible: function visible(_ref17) {
|
|
300
295
|
var values = _ref17.values;
|
|
301
|
-
return get(values, 'displayType') !== 'Single Page App';
|
|
296
|
+
return (0, _immutable.get)(values, 'displayType') !== 'Single Page App';
|
|
302
297
|
}
|
|
303
298
|
}, {
|
|
304
299
|
name: 'name',
|
|
305
300
|
label: 'Space Name',
|
|
306
301
|
type: 'text',
|
|
307
302
|
required: true,
|
|
308
|
-
initialValue: get(space, 'name'),
|
|
303
|
+
initialValue: (0, _immutable.get)(space, 'name'),
|
|
309
304
|
onChange: function onChange(_ref18, _ref19) {
|
|
310
305
|
var values = _ref18.values;
|
|
311
306
|
var setValue = _ref19.setValue;
|
|
312
|
-
|
|
313
307
|
if (values.get('linked')) {
|
|
314
|
-
setValue('slug', slugify(values.get('name')), false);
|
|
308
|
+
setValue('slug', (0, _helpers.slugify)(values.get('name')), false);
|
|
315
309
|
}
|
|
316
310
|
},
|
|
317
311
|
helpText: 'User friendly name for space, used throughout the application.'
|
|
@@ -319,11 +313,11 @@ var fields = function fields() {
|
|
|
319
313
|
name: 'resetPasswordPage',
|
|
320
314
|
label: 'Reset Password Page',
|
|
321
315
|
type: 'text',
|
|
322
|
-
initialValue: get(space, 'resetPasswordPage'),
|
|
316
|
+
initialValue: (0, _immutable.get)(space, 'resetPasswordPage'),
|
|
323
317
|
placeholder: 'resetPassword.jsp',
|
|
324
318
|
visible: function visible(_ref20) {
|
|
325
319
|
var values = _ref20.values;
|
|
326
|
-
return get(values, 'displayType') !== 'Single Page App';
|
|
320
|
+
return (0, _immutable.get)(values, 'displayType') !== 'Single Page App';
|
|
327
321
|
}
|
|
328
322
|
}, {
|
|
329
323
|
name: 'oauthSigningKey',
|
|
@@ -351,7 +345,6 @@ var fields = function fields() {
|
|
|
351
345
|
onChange: function onChange(_ref24, _ref25) {
|
|
352
346
|
var values = _ref24.values;
|
|
353
347
|
var setValue = _ref25.setValue;
|
|
354
|
-
|
|
355
348
|
if (values.get('oauthSigningKey') !== '') {
|
|
356
349
|
setValue('oauthSigningKey', '');
|
|
357
350
|
}
|
|
@@ -360,7 +353,7 @@ var fields = function fields() {
|
|
|
360
353
|
name: 'sessionInactiveLimitInSeconds',
|
|
361
354
|
label: 'Inactive Session Limit (in seconds)',
|
|
362
355
|
type: 'text',
|
|
363
|
-
initialValue: get(space, 'sessionInactiveLimitInSeconds'),
|
|
356
|
+
initialValue: (0, _immutable.get)(space, 'sessionInactiveLimitInSeconds'),
|
|
364
357
|
helpText: 'Users will be logged out automatically if inactive for this amount of time.',
|
|
365
358
|
serialize: function serialize(_ref26) {
|
|
366
359
|
var values = _ref26.values;
|
|
@@ -370,14 +363,14 @@ var fields = function fields() {
|
|
|
370
363
|
name: 'sharedBundleBase',
|
|
371
364
|
label: 'Shared Bundle Base',
|
|
372
365
|
type: 'text',
|
|
373
|
-
initialValue: get(space, 'sharedBundleBase'),
|
|
366
|
+
initialValue: (0, _immutable.get)(space, 'sharedBundleBase'),
|
|
374
367
|
helpText: 'Directory used as path prefix for bundles.'
|
|
375
368
|
}, {
|
|
376
369
|
name: 'slug',
|
|
377
370
|
label: 'Slug',
|
|
378
371
|
type: 'text',
|
|
379
372
|
required: true,
|
|
380
|
-
initialValue: get(space, 'slug'),
|
|
373
|
+
initialValue: (0, _immutable.get)(space, 'slug'),
|
|
381
374
|
onChange: function onChange(_bindings, _ref27) {
|
|
382
375
|
var setValue = _ref27.setValue;
|
|
383
376
|
setValue('linked', false);
|
|
@@ -394,17 +387,16 @@ var fields = function fields() {
|
|
|
394
387
|
name: 'trustedFrameDomains',
|
|
395
388
|
label: 'Trusted Frame Domains',
|
|
396
389
|
type: 'text-multi',
|
|
397
|
-
initialValue: get(space, 'trustedFrameDomains')
|
|
390
|
+
initialValue: (0, _immutable.get)(space, 'trustedFrameDomains')
|
|
398
391
|
}, {
|
|
399
392
|
name: 'trustedResourceDomains',
|
|
400
393
|
label: 'Trusted Resource Domains',
|
|
401
394
|
type: 'text-multi',
|
|
402
|
-
initialValue: get(space, 'trustedResourceDomains')
|
|
403
|
-
}].concat(
|
|
404
|
-
var _ref29 =
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
395
|
+
initialValue: (0, _immutable.get)(space, 'trustedResourceDomains')
|
|
396
|
+
}].concat((0, _toConsumableArray2["default"])(Object.entries(securityEndpoints).map(function (_ref28) {
|
|
397
|
+
var _ref29 = (0, _slicedToArray2["default"])(_ref28, 2),
|
|
398
|
+
endpointFieldName = _ref29[0],
|
|
399
|
+
endpoint = _ref29[1];
|
|
408
400
|
return {
|
|
409
401
|
name: endpointFieldName,
|
|
410
402
|
label: endpoint.label,
|
|
@@ -414,7 +406,7 @@ var fields = function fields() {
|
|
|
414
406
|
return securityPolicyDefinitions.filter(function (definition) {
|
|
415
407
|
return endpoint.types.includes(definition.get('type'));
|
|
416
408
|
}).map(function (definition) {
|
|
417
|
-
return Map({
|
|
409
|
+
return (0, _immutable.Map)({
|
|
418
410
|
value: definition.get('name'),
|
|
419
411
|
label: definition.get('name')
|
|
420
412
|
});
|
|
@@ -422,7 +414,7 @@ var fields = function fields() {
|
|
|
422
414
|
},
|
|
423
415
|
initialValue: space ? space.get('securityPolicies').find(function (pol) {
|
|
424
416
|
return pol.get('endpoint') === endpoint.endpoint;
|
|
425
|
-
}, null, Map({})).get('name', '') : '',
|
|
417
|
+
}, null, (0, _immutable.Map)({})).get('name', '') : '',
|
|
426
418
|
"transient": true
|
|
427
419
|
};
|
|
428
420
|
})), [{
|
|
@@ -433,10 +425,9 @@ var fields = function fields() {
|
|
|
433
425
|
serialize: function serialize(_ref31) {
|
|
434
426
|
var values = _ref31.values;
|
|
435
427
|
return Object.entries(securityEndpoints).map(function (_ref32) {
|
|
436
|
-
var _ref33 =
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
428
|
+
var _ref33 = (0, _slicedToArray2["default"])(_ref32, 2),
|
|
429
|
+
endpointFieldName = _ref33[0],
|
|
430
|
+
policy = _ref33[1];
|
|
440
431
|
return {
|
|
441
432
|
endpoint: policy.endpoint,
|
|
442
433
|
name: values.get(endpointFieldName)
|
|
@@ -445,13 +436,13 @@ var fields = function fields() {
|
|
|
445
436
|
return endpoint.name !== '';
|
|
446
437
|
});
|
|
447
438
|
},
|
|
448
|
-
initialValue: get(space, 'securityPolicies')
|
|
439
|
+
initialValue: (0, _immutable.get)(space, 'securityPolicies')
|
|
449
440
|
}, {
|
|
450
441
|
name: 'allowedIps',
|
|
451
442
|
label: 'Allowed IPs',
|
|
452
443
|
type: 'select',
|
|
453
444
|
options: function options() {
|
|
454
|
-
return fromJS([{
|
|
445
|
+
return (0, _immutable.fromJS)([{
|
|
455
446
|
name: 'description',
|
|
456
447
|
label: 'Description',
|
|
457
448
|
type: 'text'
|
|
@@ -465,7 +456,7 @@ var fields = function fields() {
|
|
|
465
456
|
var values = _ref34.values;
|
|
466
457
|
return values.get('allowedIpsEnabled', false);
|
|
467
458
|
},
|
|
468
|
-
initialValue: get(space, 'allowedIps', []),
|
|
459
|
+
initialValue: (0, _immutable.get)(space, 'allowedIps', []),
|
|
469
460
|
serialize: function serialize(_ref35) {
|
|
470
461
|
var values = _ref35.values;
|
|
471
462
|
return values.get('allowedIpsEnabled', false) ? values.get('allowedIps') : [];
|
|
@@ -474,7 +465,7 @@ var fields = function fields() {
|
|
|
474
465
|
name: 'allowedIpsEnabled',
|
|
475
466
|
label: 'Enabled Allowed IP Restrictions?',
|
|
476
467
|
type: 'checkbox',
|
|
477
|
-
initialValue: get(space, 'allowedIpsEnabled', false) || false
|
|
468
|
+
initialValue: (0, _immutable.get)(space, 'allowedIpsEnabled', false) || false
|
|
478
469
|
}, {
|
|
479
470
|
name: 'attributesMap',
|
|
480
471
|
label: 'Attributes',
|
|
@@ -484,17 +475,17 @@ var fields = function fields() {
|
|
|
484
475
|
var attributeDefinitions = _ref36.attributeDefinitions;
|
|
485
476
|
return attributeDefinitions;
|
|
486
477
|
},
|
|
487
|
-
initialValue: get(space, 'attributesMap')
|
|
478
|
+
initialValue: (0, _immutable.get)(space, 'attributesMap')
|
|
488
479
|
}]);
|
|
489
480
|
};
|
|
490
481
|
};
|
|
491
|
-
|
|
492
|
-
export var SpaceForm = generateForm({
|
|
482
|
+
var SpaceForm = (0, _Form.generateForm)({
|
|
493
483
|
formOptions: [],
|
|
494
484
|
dataSources: dataSources,
|
|
495
485
|
fields: fields,
|
|
496
486
|
handleSubmit: handleSubmit
|
|
497
487
|
});
|
|
488
|
+
exports.SpaceForm = SpaceForm;
|
|
498
489
|
SpaceForm.displayName = 'SpaceForm';
|
|
499
490
|
SpaceForm.propTypes = {
|
|
500
491
|
/**
|
|
@@ -505,18 +496,16 @@ SpaceForm.propTypes = {
|
|
|
505
496
|
* If a formKey is provided, the form won't render until the
|
|
506
497
|
* `mountForm` action is dispatched.
|
|
507
498
|
*/
|
|
508
|
-
formKey:
|
|
509
|
-
|
|
499
|
+
formKey: _propTypes["default"].string,
|
|
510
500
|
/**
|
|
511
501
|
* A set of fields that should be added to the form
|
|
512
502
|
*/
|
|
513
|
-
addFields:
|
|
514
|
-
|
|
503
|
+
addFields: _propTypes["default"].oneOfType([_propTypes["default"].array, _propTypes["default"].func]),
|
|
515
504
|
/**
|
|
516
505
|
* The layout of the form.
|
|
517
506
|
* - @param {Node} form The react `Node` of the rendered form
|
|
518
507
|
* - @param {Object} bindings all bindings fetched when the form was loaded
|
|
519
508
|
* - @param {Boolean} initialized If the form has been initialized
|
|
520
509
|
*/
|
|
521
|
-
children:
|
|
510
|
+
children: _propTypes["default"].func
|
|
522
511
|
};
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.filters = exports.filterDataSources = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
9
|
+
var _immutable = require("immutable");
|
|
10
|
+
var _apis = require("../../../apis");
|
|
11
|
+
var _helpers = require("../../../helpers");
|
|
12
|
+
var filterDataSources = function filterDataSources(_ref) {
|
|
6
13
|
var formSlug = _ref.formSlug;
|
|
7
14
|
return {
|
|
8
15
|
form: {
|
|
9
|
-
fn: fetchForm,
|
|
16
|
+
fn: _apis.fetchForm,
|
|
10
17
|
params: [{
|
|
11
18
|
datastore: true,
|
|
12
19
|
formSlug: formSlug,
|
|
@@ -49,23 +56,22 @@ export var filterDataSources = function filterDataSources(_ref) {
|
|
|
49
56
|
},
|
|
50
57
|
params: function params(_ref4) {
|
|
51
58
|
var form = _ref4.form,
|
|
52
|
-
|
|
59
|
+
values = _ref4.values;
|
|
53
60
|
return values && [form, values.get('index')];
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
};
|
|
57
64
|
};
|
|
58
|
-
|
|
65
|
+
exports.filterDataSources = filterDataSources;
|
|
59
66
|
var getOperatorIndex = function getOperatorIndex(name) {
|
|
60
67
|
var match = name.match(/op(\d+)-operator/);
|
|
61
68
|
return match && parseInt(match[1]);
|
|
62
69
|
};
|
|
63
|
-
|
|
64
70
|
var indexChangeFn = function indexChangeFn(_ref5, _ref6) {
|
|
65
71
|
var maxLength = _ref5.maxLength,
|
|
66
|
-
|
|
72
|
+
values = _ref5.values;
|
|
67
73
|
var setValue = _ref6.setValue;
|
|
68
|
-
Range(0, maxLength).map(function (i) {
|
|
74
|
+
(0, _immutable.Range)(0, maxLength).map(function (i) {
|
|
69
75
|
return "op".concat(i, "-operator");
|
|
70
76
|
}).filter(function (name) {
|
|
71
77
|
return !!values.get(name);
|
|
@@ -73,85 +79,77 @@ var indexChangeFn = function indexChangeFn(_ref5, _ref6) {
|
|
|
73
79
|
return setValue(name, '');
|
|
74
80
|
});
|
|
75
81
|
};
|
|
76
|
-
|
|
77
82
|
var operatorChangeFn = function operatorChangeFn(i) {
|
|
78
83
|
return function (_ref7, _ref8) {
|
|
79
84
|
var values = _ref7.values;
|
|
80
85
|
var setValue = _ref8.setValue;
|
|
81
|
-
var value = values.get("op".concat(i, "-operator"));
|
|
86
|
+
var value = values.get("op".concat(i, "-operator"));
|
|
87
|
+
// If the operator was set to something besides 'eq' or 'in' clear any
|
|
82
88
|
// operators after this. Their change events will then fire and clear the
|
|
83
89
|
// corresponding operands.
|
|
84
|
-
|
|
85
90
|
if (!['equals', 'in'].includes(value)) {
|
|
86
91
|
values.filter(function (value, name) {
|
|
87
92
|
return getOperatorIndex(name) > i;
|
|
88
93
|
}).forEach(function (_value, name) {
|
|
89
94
|
return setValue(name, '');
|
|
90
95
|
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
}
|
|
97
|
+
// If the operator was set to '' and the first operand is set, clear it.
|
|
94
98
|
if (!value && values.get("op".concat(i, "-operand1"))) {
|
|
95
99
|
setValue("op".concat(i, "-operand1"), '');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
}
|
|
101
|
+
// If the operator is not 'bt' and the second operand is set, clear it.
|
|
99
102
|
if (value !== 'between' && values.get("op".concat(i, "-operand2"))) {
|
|
100
103
|
setValue("op".concat(i, "-operand2"), '');
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
}
|
|
105
|
+
// If the operator is not 'in and the third operand is set, clear it.
|
|
104
106
|
if (value !== 'in' && !values.get("op".concat(i, "-operand3")).isEmpty()) {
|
|
105
|
-
setValue("op".concat(i, "-operand3"), List());
|
|
107
|
+
setValue("op".concat(i, "-operand3"), (0, _immutable.List)());
|
|
106
108
|
}
|
|
107
109
|
};
|
|
108
110
|
};
|
|
109
|
-
|
|
110
111
|
var enabledFn = function enabledFn(i) {
|
|
111
112
|
return function (_ref9) {
|
|
112
113
|
var values = _ref9.values;
|
|
113
|
-
return Range(0, i, -1).map(function (i) {
|
|
114
|
+
return (0, _immutable.Range)(0, i, -1).map(function (i) {
|
|
114
115
|
return values.get("op".concat(i, "-operator"));
|
|
115
116
|
}).every(function (value) {
|
|
116
117
|
return ['equals', 'in'].includes(value);
|
|
117
118
|
});
|
|
118
119
|
};
|
|
119
120
|
};
|
|
120
|
-
|
|
121
121
|
var visibleFn = function visibleFn(i, operatorType) {
|
|
122
122
|
return function (_ref10) {
|
|
123
123
|
var selectedIndexDefinition = _ref10.selectedIndexDefinition,
|
|
124
|
-
|
|
124
|
+
values = _ref10.values;
|
|
125
125
|
return selectedIndexDefinition && i < selectedIndexDefinition.get('parts').size && (!operatorType || values.get("op".concat(i, "-operator")) === operatorType);
|
|
126
126
|
};
|
|
127
127
|
};
|
|
128
|
-
|
|
129
128
|
var serializeQuery = function serializeQuery(_ref11) {
|
|
130
129
|
var selectedIndexDefinition = _ref11.selectedIndexDefinition,
|
|
131
|
-
|
|
130
|
+
values = _ref11.values;
|
|
132
131
|
return {
|
|
133
132
|
index: values.get('index'),
|
|
134
133
|
parts: selectedIndexDefinition.get('parts').reduce(function (reduction, part, i) {
|
|
135
134
|
var operator = values.get("op".concat(i, "-operator"));
|
|
136
135
|
var rValues = operator === 'between' ? [values.get("op".concat(i, "-operand1")), values.get("op".concat(i, "-operand2"))] : operator === 'in' ? [values.get("op".concat(i, "-operand3"))] : [values.get("op".concat(i, "-operand1"))];
|
|
137
|
-
return reduction.push(List([part, operator].concat(rValues)));
|
|
138
|
-
}, List()).filter(function (part) {
|
|
136
|
+
return reduction.push((0, _immutable.List)([part, operator].concat(rValues)));
|
|
137
|
+
}, (0, _immutable.List)()).filter(function (part) {
|
|
139
138
|
return !part.some(function (term) {
|
|
140
|
-
return isImmutable(term) && term.isEmpty() || term.length === 0;
|
|
139
|
+
return (0, _immutable.isImmutable)(term) && term.isEmpty() || term.length === 0;
|
|
141
140
|
});
|
|
142
141
|
}),
|
|
143
142
|
q: selectedIndexDefinition.get('parts').reduce(function (query, part, i) {
|
|
144
143
|
var op = values.get("op".concat(i, "-operator"));
|
|
145
144
|
return op === 'between' ? query.between(part, "op".concat(i, "-operand1"), "op".concat(i, "-operand2")) : op === 'in' ? query["in"](part, "op".concat(i, "-operand3")) : op ? query[op](part, "op".concat(i, "-operand1")) : query;
|
|
146
|
-
}, defineKqlQuery()).end()(values.toJS())
|
|
145
|
+
}, (0, _helpers.defineKqlQuery)()).end()(values.toJS())
|
|
147
146
|
};
|
|
148
147
|
};
|
|
149
|
-
|
|
150
|
-
export var filters = function filters() {
|
|
148
|
+
var filters = function filters() {
|
|
151
149
|
return function (_ref12) {
|
|
152
150
|
var form = _ref12.form,
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
indexOptions = _ref12.indexOptions,
|
|
152
|
+
maxLength = _ref12.maxLength;
|
|
155
153
|
return form && indexOptions && maxLength && [{
|
|
156
154
|
label: 'Search By',
|
|
157
155
|
initialValue: indexOptions.first().get('value'),
|
|
@@ -160,7 +158,7 @@ export var filters = function filters() {
|
|
|
160
158
|
options: indexOptions,
|
|
161
159
|
"transient": true,
|
|
162
160
|
type: 'select'
|
|
163
|
-
}].concat(
|
|
161
|
+
}].concat((0, _toConsumableArray2["default"])((0, _immutable.Range)(0, maxLength).flatMap(function (i) {
|
|
164
162
|
return [{
|
|
165
163
|
enabled: enabledFn(i),
|
|
166
164
|
name: "op".concat(i, "-operator"),
|
|
@@ -218,4 +216,5 @@ export var filters = function filters() {
|
|
|
218
216
|
serialize: serializeQuery
|
|
219
217
|
}]);
|
|
220
218
|
};
|
|
221
|
-
};
|
|
219
|
+
};
|
|
220
|
+
exports.filters = filters;
|