@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,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _CoreForm = require("./CoreForm");
|
|
2
4
|
describe('queryString', function () {
|
|
3
5
|
test('review passed true should not have a parameter value', function () {
|
|
4
|
-
expect(queryString({
|
|
6
|
+
expect((0, _CoreForm.queryString)({
|
|
5
7
|
review: true
|
|
6
8
|
}, {})).toBe('review');
|
|
7
9
|
});
|
|
8
10
|
test('review passed a string should have a parameter value', function () {
|
|
9
|
-
expect(queryString({
|
|
11
|
+
expect((0, _CoreForm.queryString)({
|
|
10
12
|
review: 'Page One'
|
|
11
13
|
}, {})).toBe('review=Page%20One');
|
|
12
14
|
});
|
|
13
15
|
test('review passed a truthy value and reviewPageIndex is a number should have a parameter value of the corresponding reviewPage name', function () {
|
|
14
|
-
expect(queryString({
|
|
16
|
+
expect((0, _CoreForm.queryString)({
|
|
15
17
|
review: true
|
|
16
18
|
}, {
|
|
17
19
|
reviewPages: ['Page One', 'Page Two'],
|
|
@@ -19,12 +21,12 @@ describe('queryString', function () {
|
|
|
19
21
|
})).toBe('review=Page%20Two');
|
|
20
22
|
});
|
|
21
23
|
test('review passed anything else should be omitted', function () {
|
|
22
|
-
expect(queryString({
|
|
24
|
+
expect((0, _CoreForm.queryString)({
|
|
23
25
|
review: false
|
|
24
26
|
}, {})).toBe('');
|
|
25
27
|
});
|
|
26
28
|
test('values should be wrapped with values[] and encoded', function () {
|
|
27
|
-
expect(queryString({
|
|
29
|
+
expect((0, _CoreForm.queryString)({
|
|
28
30
|
values: {
|
|
29
31
|
'First Name': 'Shayne',
|
|
30
32
|
'Last Name': 'Koestler'
|
|
@@ -32,21 +34,21 @@ describe('queryString', function () {
|
|
|
32
34
|
}, {})).toBe('values%5BFirst%20Name%5D=Shayne&values%5BLast%20Name%5D=Koestler');
|
|
33
35
|
});
|
|
34
36
|
test('values should be omitted when empty or non-object', function () {
|
|
35
|
-
expect(queryString({
|
|
37
|
+
expect((0, _CoreForm.queryString)({
|
|
36
38
|
values: {}
|
|
37
39
|
}, {})).toBe('');
|
|
38
|
-
expect(queryString({
|
|
40
|
+
expect((0, _CoreForm.queryString)({
|
|
39
41
|
values: 'asdf'
|
|
40
42
|
}, {})).toBe('');
|
|
41
43
|
});
|
|
42
44
|
test('combines review and values', function () {
|
|
43
|
-
expect(queryString({
|
|
45
|
+
expect((0, _CoreForm.queryString)({
|
|
44
46
|
review: true,
|
|
45
47
|
values: {
|
|
46
48
|
'Full Name': 'Don Demo'
|
|
47
49
|
}
|
|
48
50
|
}, {})).toMatch('review');
|
|
49
|
-
expect(queryString({
|
|
51
|
+
expect((0, _CoreForm.queryString)({
|
|
50
52
|
review: true,
|
|
51
53
|
values: {
|
|
52
54
|
'Full Name': 'Don Demo'
|
|
@@ -1,85 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import { I18n } from '../../i18n/I18n';
|
|
3
|
-
import { Moment } from '../../i18n/Moment';
|
|
4
|
-
import moment from 'moment';
|
|
5
|
-
import { Map } from 'immutable';
|
|
6
|
-
export var LOCKED_BY_FIELD = 'Locked By';
|
|
7
|
-
export var LOCKED_UNTIL_FIELD = 'Locked Until';
|
|
8
|
-
export var LOCK_TIME_ATTRIBUTE = 'Lock Time';
|
|
9
|
-
export var LOCK_CHECK_INTERVAL_ATTRIBUTE = 'Lock Check Interval';
|
|
10
|
-
export var LOCK_PROMPT_TIME_ATTRIBUTE = 'Lock Prompt Time';
|
|
11
|
-
export var LOCK_TIME_DEFAULT_VALUE = 1800; // seconds
|
|
12
|
-
|
|
13
|
-
export var LOCK_CHECK_INTERVAL_DEFAULT_VALUE = 30; // seconds
|
|
14
|
-
|
|
15
|
-
export var LOCK_PROMPT_TIME_DEFAULT_VALUE = 120; // seconds
|
|
1
|
+
"use strict";
|
|
16
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.LOCK_TIME_DEFAULT_VALUE = exports.LOCK_TIME_ATTRIBUTE = exports.LOCK_PROMPT_TIME_DEFAULT_VALUE = exports.LOCK_PROMPT_TIME_ATTRIBUTE = exports.LOCK_CHECK_INTERVAL_DEFAULT_VALUE = exports.LOCK_CHECK_INTERVAL_ATTRIBUTE = exports.LOCKED_UNTIL_FIELD = exports.LOCKED_BY_FIELD = exports.DefaultCoreFormConfig = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _I18n = require("../../i18n/I18n");
|
|
11
|
+
var _Moment = require("../../i18n/Moment");
|
|
12
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
+
var _immutable = require("immutable");
|
|
14
|
+
var LOCKED_BY_FIELD = 'Locked By';
|
|
15
|
+
exports.LOCKED_BY_FIELD = LOCKED_BY_FIELD;
|
|
16
|
+
var LOCKED_UNTIL_FIELD = 'Locked Until';
|
|
17
|
+
exports.LOCKED_UNTIL_FIELD = LOCKED_UNTIL_FIELD;
|
|
18
|
+
var LOCK_TIME_ATTRIBUTE = 'Lock Time';
|
|
19
|
+
exports.LOCK_TIME_ATTRIBUTE = LOCK_TIME_ATTRIBUTE;
|
|
20
|
+
var LOCK_CHECK_INTERVAL_ATTRIBUTE = 'Lock Check Interval';
|
|
21
|
+
exports.LOCK_CHECK_INTERVAL_ATTRIBUTE = LOCK_CHECK_INTERVAL_ATTRIBUTE;
|
|
22
|
+
var LOCK_PROMPT_TIME_ATTRIBUTE = 'Lock Prompt Time';
|
|
23
|
+
exports.LOCK_PROMPT_TIME_ATTRIBUTE = LOCK_PROMPT_TIME_ATTRIBUTE;
|
|
24
|
+
var LOCK_TIME_DEFAULT_VALUE = 1800; // seconds
|
|
25
|
+
exports.LOCK_TIME_DEFAULT_VALUE = LOCK_TIME_DEFAULT_VALUE;
|
|
26
|
+
var LOCK_CHECK_INTERVAL_DEFAULT_VALUE = 30; // seconds
|
|
27
|
+
exports.LOCK_CHECK_INTERVAL_DEFAULT_VALUE = LOCK_CHECK_INTERVAL_DEFAULT_VALUE;
|
|
28
|
+
var LOCK_PROMPT_TIME_DEFAULT_VALUE = 120; // seconds
|
|
29
|
+
exports.LOCK_PROMPT_TIME_DEFAULT_VALUE = LOCK_PROMPT_TIME_DEFAULT_VALUE;
|
|
17
30
|
var LoadingComponent = function LoadingComponent() {
|
|
18
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
19
32
|
className: "text-center p-3"
|
|
20
|
-
}, /*#__PURE__*/
|
|
33
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
21
34
|
className: "fa fa-spinner fa-spin fa-lg fa-fw"
|
|
22
35
|
})));
|
|
23
36
|
};
|
|
24
|
-
|
|
25
37
|
var ErrorComponent = function ErrorComponent(_ref) {
|
|
26
38
|
var message = _ref.message;
|
|
27
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
28
40
|
className: "text-center text-danger p-3"
|
|
29
|
-
}, /*#__PURE__*/
|
|
41
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("strong", null, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "Oops!"), " ", /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "An error occurred."))), message && /*#__PURE__*/_react["default"].createElement("small", null, /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, message)));
|
|
30
42
|
};
|
|
31
|
-
|
|
32
43
|
var ReviewPaginationControl = function ReviewPaginationControl(_ref2) {
|
|
33
44
|
var actions = _ref2.actions;
|
|
34
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("button", {
|
|
35
46
|
className: "btn btn-link",
|
|
36
47
|
onClick: actions.previousPage,
|
|
37
48
|
disabled: !actions.previousPage
|
|
38
|
-
}, "Previous Page"), /*#__PURE__*/
|
|
49
|
+
}, "Previous Page"), /*#__PURE__*/_react["default"].createElement("button", {
|
|
39
50
|
className: "btn btn-link",
|
|
40
51
|
onClick: actions.nextPage,
|
|
41
52
|
disabled: !actions.nextPage
|
|
42
53
|
}, "Next Page"));
|
|
43
54
|
};
|
|
44
|
-
|
|
45
55
|
var LockMessage = function LockMessage(_ref3) {
|
|
46
56
|
var lock = _ref3.lock,
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
actions = _ref3.actions;
|
|
49
58
|
if (!lock) {
|
|
50
59
|
return null;
|
|
51
60
|
}
|
|
52
|
-
|
|
53
|
-
return lock.isLocked ? !lock.isLockedByMe ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
|
|
61
|
+
return lock.isLocked ? !lock.isLockedByMe ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
54
62
|
className: "fa fa-lock fw-fw mr-1"
|
|
55
|
-
}), /*#__PURE__*/
|
|
56
|
-
timestamp:
|
|
57
|
-
format: Moment.formats.timeWithSeconds
|
|
58
|
-
}), "."), /*#__PURE__*/
|
|
63
|
+
}), /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "This submission is locked by"), " ", lock.lockedBy, ' ', /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "until"), ' ', /*#__PURE__*/_react["default"].createElement(_Moment.Moment, {
|
|
64
|
+
timestamp: (0, _moment["default"])().add(lock.timeLeft, 'ms'),
|
|
65
|
+
format: _Moment.Moment.formats.timeWithSeconds
|
|
66
|
+
}), "."), /*#__PURE__*/_react["default"].createElement("button", {
|
|
59
67
|
className: "btn btn-link",
|
|
60
68
|
onClick: actions.refreshSubmission
|
|
61
|
-
}, "Refresh"))) : lock.isExpiring ? /*#__PURE__*/
|
|
69
|
+
}, "Refresh"))) : lock.isExpiring ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
62
70
|
className: "fa fa-lock fw-fw mr-1"
|
|
63
|
-
}), /*#__PURE__*/
|
|
64
|
-
timestamp:
|
|
65
|
-
format: Moment.formats.timeWithSeconds
|
|
66
|
-
}), "."), /*#__PURE__*/
|
|
71
|
+
}), /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "Your lock on this submission will expire at"), ' ', /*#__PURE__*/_react["default"].createElement(_Moment.Moment, {
|
|
72
|
+
timestamp: (0, _moment["default"])().add(lock.timeLeft, 'ms'),
|
|
73
|
+
format: _Moment.Moment.formats.timeWithSeconds
|
|
74
|
+
}), "."), /*#__PURE__*/_react["default"].createElement("button", {
|
|
67
75
|
className: "btn btn-link",
|
|
68
76
|
onClick: actions.obtainLock
|
|
69
|
-
}, "Renew Lock"))) : null : /*#__PURE__*/
|
|
77
|
+
}, "Renew Lock"))) : null : /*#__PURE__*/_react["default"].createElement("div", null, !lock.lockLost ? /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
70
78
|
className: "fa fa-unlock fw-fw mr-1"
|
|
71
|
-
}), /*#__PURE__*/
|
|
79
|
+
}), /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "This submission is currently unlocked.")), /*#__PURE__*/_react["default"].createElement("button", {
|
|
72
80
|
className: "btn btn-link",
|
|
73
81
|
onClick: actions.obtainLock
|
|
74
|
-
}, "Obtain Lock")) : /*#__PURE__*/
|
|
82
|
+
}, "Obtain Lock")) : /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement("span", {
|
|
75
83
|
className: "fa fa-unlock fw-fw mr-1"
|
|
76
|
-
}), /*#__PURE__*/
|
|
84
|
+
}), /*#__PURE__*/_react["default"].createElement(_I18n.I18n, null, "Your lock on this submission has expired.")), /*#__PURE__*/_react["default"].createElement("button", {
|
|
77
85
|
className: "btn btn-link",
|
|
78
86
|
onClick: actions.obtainLock
|
|
79
87
|
}, "Obtain Lock")));
|
|
80
88
|
};
|
|
81
|
-
|
|
82
|
-
export var DefaultCoreFormConfig = Map({
|
|
89
|
+
var DefaultCoreFormConfig = (0, _immutable.Map)({
|
|
83
90
|
Pending: LoadingComponent,
|
|
84
91
|
Unauthorized: ErrorComponent,
|
|
85
92
|
Forbidden: ErrorComponent,
|
|
@@ -87,4 +94,5 @@ export var DefaultCoreFormConfig = Map({
|
|
|
87
94
|
NotFound: ErrorComponent,
|
|
88
95
|
LockMessage: LockMessage,
|
|
89
96
|
ReviewPaginationControl: ReviewPaginationControl
|
|
90
|
-
});
|
|
97
|
+
});
|
|
98
|
+
exports.DefaultCoreFormConfig = DefaultCoreFormConfig;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GlobalsProvider = exports.GlobalsContext = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var GlobalsContext = /*#__PURE__*/(0, _react.createContext)();
|
|
10
|
+
exports.GlobalsContext = GlobalsContext;
|
|
11
|
+
var GlobalsProvider = function GlobalsProvider(props) {
|
|
12
|
+
return /*#__PURE__*/_react["default"].createElement(GlobalsContext.Provider, {
|
|
5
13
|
value: props.globals
|
|
6
14
|
}, props.children);
|
|
7
|
-
};
|
|
15
|
+
};
|
|
16
|
+
exports.GlobalsProvider = GlobalsProvider;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import { fetchKapp, fetchSpace, updateKapp, updateSpace } from '../../../apis';
|
|
3
|
-
import { FIELD_DATA_TYPES } from './FieldDefinitionTable';
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FieldDefinitionForm = void 0;
|
|
7
|
+
var _Form = require("../../form/Form");
|
|
8
|
+
var _apis = require("../../../apis");
|
|
9
|
+
var _FieldDefinitionTable = require("./FieldDefinitionTable");
|
|
5
10
|
var dataSources = function dataSources(_ref) {
|
|
6
11
|
var kappSlug = _ref.kappSlug,
|
|
7
|
-
|
|
12
|
+
name = _ref.name;
|
|
8
13
|
return {
|
|
9
14
|
form: {
|
|
10
|
-
fn: kappSlug ? fetchKapp : fetchSpace,
|
|
15
|
+
fn: kappSlug ? _apis.fetchKapp : _apis.fetchSpace,
|
|
11
16
|
params: [{
|
|
12
17
|
kappSlug: kappSlug,
|
|
13
18
|
include: 'fields'
|
|
@@ -29,47 +34,43 @@ var dataSources = function dataSources(_ref) {
|
|
|
29
34
|
}
|
|
30
35
|
};
|
|
31
36
|
};
|
|
32
|
-
|
|
33
37
|
var handleSubmit = function handleSubmit(_ref3) {
|
|
34
38
|
var kappSlug = _ref3.kappSlug,
|
|
35
|
-
|
|
39
|
+
name = _ref3.name;
|
|
36
40
|
return function (values, _ref4) {
|
|
37
41
|
var form = _ref4.form;
|
|
38
|
-
var dataType = FIELD_DATA_TYPES.find(function (fdt) {
|
|
42
|
+
var dataType = _FieldDefinitionTable.FIELD_DATA_TYPES.find(function (fdt) {
|
|
39
43
|
return fdt.value === values.get('renderType');
|
|
40
44
|
}).dataType;
|
|
41
45
|
var field = values.set('dataType', dataType);
|
|
42
46
|
var fields = name ? form.get('fields').map(function (fd) {
|
|
43
47
|
return fd.get('name') === name ? field : fd;
|
|
44
48
|
}) : form.get('fields').push(field);
|
|
45
|
-
return (kappSlug ? updateKapp({
|
|
49
|
+
return (kappSlug ? (0, _apis.updateKapp)({
|
|
46
50
|
kapp: {
|
|
47
51
|
fields: fields
|
|
48
52
|
},
|
|
49
53
|
kappSlug: kappSlug
|
|
50
|
-
}) : updateSpace({
|
|
54
|
+
}) : (0, _apis.updateSpace)({
|
|
51
55
|
space: {
|
|
52
56
|
fields: fields
|
|
53
57
|
}
|
|
54
58
|
})).then(function (_ref5) {
|
|
55
59
|
var kapp = _ref5.kapp,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
space = _ref5.space,
|
|
61
|
+
error = _ref5.error;
|
|
59
62
|
if (error) {
|
|
60
63
|
throw error.statusCode === 400 && error.message || 'There was an error saving the field definition';
|
|
61
64
|
}
|
|
62
|
-
|
|
63
65
|
return kappSlug ? kapp : space;
|
|
64
66
|
});
|
|
65
67
|
};
|
|
66
68
|
};
|
|
67
|
-
|
|
68
69
|
var fields = function fields(_ref6) {
|
|
69
70
|
var name = _ref6.name;
|
|
70
71
|
return function (_ref7) {
|
|
71
72
|
var form = _ref7.form,
|
|
72
|
-
|
|
73
|
+
fieldDefinition = _ref7.fieldDefinition;
|
|
73
74
|
return (!name || fieldDefinition) && form && [{
|
|
74
75
|
name: 'name',
|
|
75
76
|
label: 'Name',
|
|
@@ -81,7 +82,7 @@ var fields = function fields(_ref6) {
|
|
|
81
82
|
label: 'Type',
|
|
82
83
|
type: 'select',
|
|
83
84
|
required: true,
|
|
84
|
-
options: FIELD_DATA_TYPES,
|
|
85
|
+
options: _FieldDefinitionTable.FIELD_DATA_TYPES,
|
|
85
86
|
initialValue: fieldDefinition ? fieldDefinition.get('renderType') : ''
|
|
86
87
|
}, {
|
|
87
88
|
name: 'createdAt',
|
|
@@ -110,20 +111,21 @@ var fields = function fields(_ref6) {
|
|
|
110
111
|
}];
|
|
111
112
|
};
|
|
112
113
|
};
|
|
114
|
+
|
|
113
115
|
/**
|
|
114
116
|
* @component
|
|
115
117
|
* A form for creating and updating Field Definitions within the Kinetic Platform
|
|
116
118
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export var FieldDefinitionForm = generateForm({
|
|
119
|
+
var FieldDefinitionForm = (0, _Form.generateForm)({
|
|
120
120
|
formOptions: ['kappSlug', 'name'],
|
|
121
121
|
dataSources: dataSources,
|
|
122
122
|
fields: fields,
|
|
123
123
|
handleSubmit: handleSubmit
|
|
124
124
|
});
|
|
125
|
-
FieldDefinitionForm
|
|
125
|
+
exports.FieldDefinitionForm = FieldDefinitionForm;
|
|
126
|
+
FieldDefinitionForm.displayName = 'FieldDefinitionForm';
|
|
126
127
|
|
|
128
|
+
// Specifies the default values for props:
|
|
127
129
|
FieldDefinitionForm.defaultProps = {
|
|
128
130
|
fieldName: null,
|
|
129
131
|
kappSlug: null
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FieldDefinitionTable = exports.FIELD_DATA_TYPES = void 0;
|
|
7
|
+
var _Table = require("../../table/Table");
|
|
8
|
+
var _apis = require("../../../apis");
|
|
9
|
+
var _helpers = require("../../../helpers");
|
|
10
|
+
var FIELD_DATA_TYPES = [{
|
|
5
11
|
value: 'checkbox',
|
|
6
12
|
label: 'Checkbox',
|
|
7
13
|
dataType: 'json'
|
|
@@ -30,12 +36,12 @@ export var FIELD_DATA_TYPES = [{
|
|
|
30
36
|
label: 'Time',
|
|
31
37
|
dataType: 'string'
|
|
32
38
|
}];
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
exports.FIELD_DATA_TYPES = FIELD_DATA_TYPES;
|
|
40
|
+
var clientSide = (0, _helpers.defineFilter)(true).startsWith('name', 'name').end();
|
|
35
41
|
var dataSource = function dataSource(_ref) {
|
|
36
42
|
var kappSlug = _ref.kappSlug;
|
|
37
43
|
return {
|
|
38
|
-
fn: kappSlug ? fetchKapp : fetchSpace,
|
|
44
|
+
fn: kappSlug ? _apis.fetchKapp : _apis.fetchSpace,
|
|
39
45
|
clientSide: clientSide,
|
|
40
46
|
params: function params() {
|
|
41
47
|
return [{
|
|
@@ -50,7 +56,6 @@ var dataSource = function dataSource(_ref) {
|
|
|
50
56
|
}
|
|
51
57
|
};
|
|
52
58
|
};
|
|
53
|
-
|
|
54
59
|
var filters = function filters() {
|
|
55
60
|
return function () {
|
|
56
61
|
return [{
|
|
@@ -60,7 +65,6 @@ var filters = function filters() {
|
|
|
60
65
|
}];
|
|
61
66
|
};
|
|
62
67
|
};
|
|
63
|
-
|
|
64
68
|
var columns = [{
|
|
65
69
|
value: 'name',
|
|
66
70
|
title: 'Name'
|
|
@@ -77,10 +81,11 @@ var columns = [{
|
|
|
77
81
|
value: 'updatedBy',
|
|
78
82
|
title: 'Updated By'
|
|
79
83
|
}];
|
|
80
|
-
|
|
84
|
+
var FieldDefinitionTable = (0, _Table.generateTable)({
|
|
81
85
|
tableOptions: ['kappSlug'],
|
|
82
86
|
columns: columns,
|
|
83
87
|
filters: filters,
|
|
84
88
|
dataSource: dataSource
|
|
85
89
|
});
|
|
90
|
+
exports.FieldDefinitionTable = FieldDefinitionTable;
|
|
86
91
|
FieldDefinitionTable.displayName = 'FieldDefinitionTable';
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
-
import { get, Map } from 'immutable';
|
|
4
|
-
import { createFileResource, fetchAgentComponents, fetchFileResource, fetchFilestores, fetchSecurityPolicyDefinitions, updateFileResource } from '../../../apis';
|
|
5
|
-
import { generateForm } from '../../form/Form';
|
|
6
|
-
import { handleFormErrors } from '../../form/Form.helpers';
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FileResourceForm = 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 _apis = require("../../../apis");
|
|
12
|
+
var _Form = require("../../form/Form");
|
|
13
|
+
var _Form2 = require("../../form/Form.helpers");
|
|
8
14
|
var dataSources = function dataSources(_ref) {
|
|
9
15
|
var fileResourceSlug = _ref.fileResourceSlug;
|
|
10
16
|
return {
|
|
11
17
|
fileResource: {
|
|
12
|
-
fn: fetchFileResource,
|
|
18
|
+
fn: _apis.fetchFileResource,
|
|
13
19
|
params: fileResourceSlug && [{
|
|
14
20
|
fileResourceSlug: fileResourceSlug,
|
|
15
21
|
include: 'details,securityPolicies'
|
|
@@ -19,13 +25,13 @@ var dataSources = function dataSources(_ref) {
|
|
|
19
25
|
}
|
|
20
26
|
},
|
|
21
27
|
agents: {
|
|
22
|
-
fn: fetchAgentComponents,
|
|
28
|
+
fn: _apis.fetchAgentComponents,
|
|
23
29
|
params: [],
|
|
24
30
|
transform: function transform(result) {
|
|
25
31
|
return [{
|
|
26
32
|
label: 'System',
|
|
27
33
|
value: 'system'
|
|
28
|
-
}].concat(
|
|
34
|
+
}].concat((0, _toConsumableArray2["default"])((0, _immutable.get)(result, 'agents', []).map(function (agent) {
|
|
29
35
|
return {
|
|
30
36
|
label: agent.name,
|
|
31
37
|
value: agent.slug
|
|
@@ -35,16 +41,16 @@ var dataSources = function dataSources(_ref) {
|
|
|
35
41
|
},
|
|
36
42
|
filestores: {
|
|
37
43
|
fn: function fn(options) {
|
|
38
|
-
return options && options.agentSlug ? fetchFilestores(options) : Promise.resolve([]);
|
|
44
|
+
return options && options.agentSlug ? (0, _apis.fetchFilestores)(options) : Promise.resolve([]);
|
|
39
45
|
},
|
|
40
46
|
params: function params(_ref2) {
|
|
41
47
|
var values = _ref2.values;
|
|
42
48
|
return [{
|
|
43
|
-
agentSlug: get(values, 'agentSlug', 'system')
|
|
49
|
+
agentSlug: (0, _immutable.get)(values, 'agentSlug', 'system')
|
|
44
50
|
}];
|
|
45
51
|
},
|
|
46
52
|
transform: function transform(result) {
|
|
47
|
-
return get(result, 'filestores', []).map(function (agent) {
|
|
53
|
+
return (0, _immutable.get)(result, 'filestores', []).map(function (agent) {
|
|
48
54
|
return {
|
|
49
55
|
label: agent.name,
|
|
50
56
|
value: agent.slug
|
|
@@ -53,7 +59,7 @@ var dataSources = function dataSources(_ref) {
|
|
|
53
59
|
}
|
|
54
60
|
},
|
|
55
61
|
securityPolicyDefinitions: {
|
|
56
|
-
fn: fetchSecurityPolicyDefinitions,
|
|
62
|
+
fn: _apis.fetchSecurityPolicyDefinitions,
|
|
57
63
|
params: [],
|
|
58
64
|
transform: function transform(result) {
|
|
59
65
|
return result.securityPolicyDefinitions;
|
|
@@ -61,17 +67,15 @@ var dataSources = function dataSources(_ref) {
|
|
|
61
67
|
}
|
|
62
68
|
};
|
|
63
69
|
};
|
|
64
|
-
|
|
65
70
|
var handleSubmit = function handleSubmit(_ref3) {
|
|
66
71
|
var fileResourceSlug = _ref3.fileResourceSlug;
|
|
67
72
|
return function (values) {
|
|
68
|
-
return (fileResourceSlug ? updateFileResource : createFileResource)({
|
|
73
|
+
return (fileResourceSlug ? _apis.updateFileResource : _apis.createFileResource)({
|
|
69
74
|
fileResourceSlug: fileResourceSlug,
|
|
70
75
|
fileResource: values.toJS()
|
|
71
|
-
}).then(handleFormErrors('fileResource', 'There was a problem saving the File Resource.'));
|
|
76
|
+
}).then((0, _Form2.handleFormErrors)('fileResource', 'There was a problem saving the File Resource.'));
|
|
72
77
|
};
|
|
73
78
|
};
|
|
74
|
-
|
|
75
79
|
var securityEndpoints = {
|
|
76
80
|
fileAccess: {
|
|
77
81
|
endpoint: 'File Access',
|
|
@@ -84,25 +88,24 @@ var securityEndpoints = {
|
|
|
84
88
|
types: ['Space', 'File Resource']
|
|
85
89
|
}
|
|
86
90
|
};
|
|
87
|
-
|
|
88
91
|
var fields = function fields(_ref4) {
|
|
89
92
|
var fileResourceSlug = _ref4.fileResourceSlug;
|
|
90
93
|
return function (_ref5) {
|
|
91
94
|
var fileResource = _ref5.fileResource,
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
agents = _ref5.agents,
|
|
96
|
+
securityPolicyDefinitions = _ref5.securityPolicyDefinitions;
|
|
94
97
|
return (!fileResourceSlug || fileResource) && securityPolicyDefinitions && agents && [{
|
|
95
98
|
name: 'slug',
|
|
96
99
|
label: 'Slug',
|
|
97
100
|
type: 'text',
|
|
98
101
|
required: true,
|
|
99
|
-
initialValue: get(fileResource, 'slug', '')
|
|
102
|
+
initialValue: (0, _immutable.get)(fileResource, 'slug', '')
|
|
100
103
|
}, {
|
|
101
104
|
name: 'agentSlug',
|
|
102
105
|
label: 'Agent Slug',
|
|
103
106
|
type: 'select',
|
|
104
107
|
required: true,
|
|
105
|
-
initialValue: get(fileResource, 'agentSlug', 'system'),
|
|
108
|
+
initialValue: (0, _immutable.get)(fileResource, 'agentSlug', 'system'),
|
|
106
109
|
options: function options(_ref6) {
|
|
107
110
|
var agents = _ref6.agents;
|
|
108
111
|
return agents;
|
|
@@ -116,16 +119,15 @@ var fields = function fields(_ref4) {
|
|
|
116
119
|
label: 'Filestore Slug',
|
|
117
120
|
type: 'select',
|
|
118
121
|
required: true,
|
|
119
|
-
initialValue: get(fileResource, 'filestoreSlug', ''),
|
|
122
|
+
initialValue: (0, _immutable.get)(fileResource, 'filestoreSlug', ''),
|
|
120
123
|
options: function options(_ref8) {
|
|
121
124
|
var filestores = _ref8.filestores;
|
|
122
125
|
return filestores;
|
|
123
126
|
}
|
|
124
|
-
}].concat(
|
|
125
|
-
var _ref10 =
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
}].concat((0, _toConsumableArray2["default"])(Object.entries(securityEndpoints).map(function (_ref9) {
|
|
128
|
+
var _ref10 = (0, _slicedToArray2["default"])(_ref9, 2),
|
|
129
|
+
endpointFieldName = _ref10[0],
|
|
130
|
+
endpoint = _ref10[1];
|
|
129
131
|
return {
|
|
130
132
|
name: endpointFieldName,
|
|
131
133
|
label: endpoint.label,
|
|
@@ -135,7 +137,7 @@ var fields = function fields(_ref4) {
|
|
|
135
137
|
return securityPolicyDefinitions ? securityPolicyDefinitions.filter(function (definition) {
|
|
136
138
|
return endpoint.types.includes(definition.get('type'));
|
|
137
139
|
}).map(function (definition) {
|
|
138
|
-
return Map({
|
|
140
|
+
return (0, _immutable.Map)({
|
|
139
141
|
value: definition.get('name'),
|
|
140
142
|
label: definition.get('name')
|
|
141
143
|
});
|
|
@@ -143,7 +145,7 @@ var fields = function fields(_ref4) {
|
|
|
143
145
|
},
|
|
144
146
|
initialValue: fileResource ? fileResource.get('securityPolicies').find(function (pol) {
|
|
145
147
|
return pol.get('endpoint') === endpoint.endpoint;
|
|
146
|
-
}, null, Map({})).get('name', '') : '',
|
|
148
|
+
}, null, (0, _immutable.Map)({})).get('name', '') : '',
|
|
147
149
|
"transient": true
|
|
148
150
|
};
|
|
149
151
|
})), [{
|
|
@@ -154,10 +156,9 @@ var fields = function fields(_ref4) {
|
|
|
154
156
|
serialize: function serialize(_ref12) {
|
|
155
157
|
var values = _ref12.values;
|
|
156
158
|
return Object.entries(securityEndpoints).map(function (_ref13) {
|
|
157
|
-
var _ref14 =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
var _ref14 = (0, _slicedToArray2["default"])(_ref13, 2),
|
|
160
|
+
endpointFieldName = _ref14[0],
|
|
161
|
+
policy = _ref14[1];
|
|
161
162
|
return {
|
|
162
163
|
endpoint: policy.endpoint,
|
|
163
164
|
name: values.get(endpointFieldName)
|
|
@@ -166,15 +167,15 @@ var fields = function fields(_ref4) {
|
|
|
166
167
|
return endpoint.name !== '';
|
|
167
168
|
});
|
|
168
169
|
},
|
|
169
|
-
initialValue: get(fileResource, 'securityPolicies')
|
|
170
|
+
initialValue: (0, _immutable.get)(fileResource, 'securityPolicies')
|
|
170
171
|
}]);
|
|
171
172
|
};
|
|
172
173
|
};
|
|
173
|
-
|
|
174
|
-
export var FileResourceForm = generateForm({
|
|
174
|
+
var FileResourceForm = (0, _Form.generateForm)({
|
|
175
175
|
formOptions: ['fileResourceSlug'],
|
|
176
176
|
dataSources: dataSources,
|
|
177
177
|
fields: fields,
|
|
178
178
|
handleSubmit: handleSubmit
|
|
179
179
|
});
|
|
180
|
+
exports.FileResourceForm = FileResourceForm;
|
|
180
181
|
FileResourceForm.displayName = 'FileResourceForm';
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineKqlQuery } from '../../../helpers';
|
|
3
|
-
import { fetchFileResources } from '../../../apis';
|
|
4
|
-
import { generatePaginationParams, generateSortParams } from '../../../apis/http';
|
|
5
|
-
import { generateTable } from '../../table/Table';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FileResourceTable = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _helpers = require("../../../helpers");
|
|
10
|
+
var _apis = require("../../../apis");
|
|
11
|
+
var _http = require("../../../apis/http");
|
|
12
|
+
var _Table = require("../../table/Table");
|
|
7
13
|
var filters = function filters() {
|
|
8
14
|
return function () {
|
|
9
15
|
return [{
|
|
@@ -13,14 +19,12 @@ var filters = function filters() {
|
|
|
13
19
|
}];
|
|
14
20
|
};
|
|
15
21
|
};
|
|
16
|
-
|
|
17
|
-
var fileResourceQuery = defineKqlQuery().matches('agentSlug', 'agentSlug').matches('filestoreSlug', 'filestoreSlug').matches('slug', 'slug').end();
|
|
18
|
-
|
|
22
|
+
var fileResourceQuery = (0, _helpers.defineKqlQuery)().matches('agentSlug', 'agentSlug').matches('filestoreSlug', 'filestoreSlug').matches('slug', 'slug').end();
|
|
19
23
|
var dataSource = function dataSource() {
|
|
20
24
|
return {
|
|
21
|
-
fn: fetchFileResources,
|
|
25
|
+
fn: _apis.fetchFileResources,
|
|
22
26
|
params: function params(paramData) {
|
|
23
|
-
return [
|
|
27
|
+
return [(0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _http.generateSortParams)(paramData)), (0, _http.generatePaginationParams)(paramData)), {}, {
|
|
24
28
|
q: fileResourceQuery(paramData.filters.toJS()),
|
|
25
29
|
include: 'details'
|
|
26
30
|
})];
|
|
@@ -33,7 +37,6 @@ var dataSource = function dataSource() {
|
|
|
33
37
|
}
|
|
34
38
|
};
|
|
35
39
|
};
|
|
36
|
-
|
|
37
40
|
var columns = [{
|
|
38
41
|
value: 'slug',
|
|
39
42
|
title: 'Slug',
|
|
@@ -62,10 +65,11 @@ var columns = [{
|
|
|
62
65
|
title: 'Updated By',
|
|
63
66
|
sortable: true
|
|
64
67
|
}];
|
|
65
|
-
|
|
68
|
+
var FileResourceTable = (0, _Table.generateTable)({
|
|
66
69
|
tableOptions: [],
|
|
67
70
|
columns: columns,
|
|
68
71
|
filters: filters,
|
|
69
72
|
dataSource: dataSource
|
|
70
73
|
});
|
|
74
|
+
exports.FileResourceTable = FileResourceTable;
|
|
71
75
|
FileResourceTable.displayName = 'FileResourceTable';
|