@kineticdata/react 5.1.2 → 6.0.1
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 +121 -80
- package/lib/apis/http.test.js +137 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +363 -215
- package/lib/apis/task/index.js +294 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +16 -9
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +16 -9
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +17 -10
- 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/ToastContainer.js +170 -0
- 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/common/defaults/Toast.js +26 -0
- package/lib/components/common/defaults/index.js +13 -0
- 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 +25 -18
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +17 -10
- 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 +28 -16
- 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 +26 -15
- 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 +47 -33
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +15 -9
- 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 +31 -16
- 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 +34 -44
- package/lib/components/core/log/LogTable.js +42 -34
- 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 +27 -17
- 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 +64 -39
- package/lib/components/core/submission/KappSubmissionTable.js +67 -48
- 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 +27 -16
- 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 +42 -20
- package/lib/components/core/webapi/WebApiForm.js +87 -80
- package/lib/components/core/webapi/WebApiTable.js +28 -17
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +41 -29
- package/lib/components/core/webhook_job/WebhookJobTable.js +58 -35
- package/lib/components/form/Form.helpers.js +182 -108
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +39 -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 +1034 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemCassandraForm.js +98 -0
- package/lib/components/system/SystemElasticSearchForm.js +98 -0
- package/lib/components/system/SystemFilestoreForm.js +36 -28
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +85 -36
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +49 -21
- package/lib/components/system/SystemTrustedCertificateForm.js +40 -0
- package/lib/components/system/SystemTrustedCertificatesTable.js +74 -0
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +281 -98
- 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 +112 -68
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +295 -227
- package/lib/components/table/Table.redux.js +339 -355
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +146 -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/ColumnControl.js +26 -0
- 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 +43 -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 +50 -27
- 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 +35 -19
- 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 +45 -29
- 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 +29 -18
- package/lib/components/task/triggers/TriggerTable.js +71 -41
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +46 -26
- 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 +47 -29
- 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 +87 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +17 -29
- package/proxyhelper.js +122 -57
- 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,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import axios from 'axios';
|
|
4
|
-
import createError from 'axios/lib/core/createError';
|
|
5
|
-
import { fetchAttributeDefinitions, fetchAttributeDefinition, createAttributeDefinition, updateAttributeDefinition } from './attributeDefinitions';
|
|
6
|
-
jest.mock('axios'); // Mock out the bundle object from a dependency.
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
|
|
5
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
6
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
7
|
+
var _createError = _interopRequireDefault(require("axios/lib/core/createError"));
|
|
8
|
+
var _attributeDefinitions = require("./attributeDefinitions");
|
|
9
|
+
jest.mock('axios');
|
|
10
|
+
|
|
11
|
+
// Mock out the bundle object from a dependency.
|
|
8
12
|
jest.mock('../../helpers', function () {
|
|
9
13
|
return {
|
|
10
14
|
bundle: {
|
|
@@ -17,15 +21,15 @@ jest.mock('../../helpers', function () {
|
|
|
17
21
|
describe('attributeDefinitions api', function () {
|
|
18
22
|
describe('fetchAttributeDefinitions', function () {
|
|
19
23
|
beforeEach(function () {
|
|
20
|
-
|
|
24
|
+
_axios["default"].get.mockReset();
|
|
21
25
|
});
|
|
22
|
-
test('success space scoped attribute', /*#__PURE__*/
|
|
26
|
+
test('success space scoped attribute', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
23
27
|
var result;
|
|
24
|
-
return
|
|
28
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
25
29
|
while (1) {
|
|
26
30
|
switch (_context.prev = _context.next) {
|
|
27
31
|
case 0:
|
|
28
|
-
|
|
32
|
+
_axios["default"].get.mockResolvedValue({
|
|
29
33
|
status: 200,
|
|
30
34
|
data: {
|
|
31
35
|
spaceAttributeDefinitions: [{
|
|
@@ -40,13 +44,12 @@ describe('attributeDefinitions api', function () {
|
|
|
40
44
|
}
|
|
41
45
|
});
|
|
42
46
|
_context.next = 3;
|
|
43
|
-
return fetchAttributeDefinitions({
|
|
47
|
+
return (0, _attributeDefinitions.fetchAttributeDefinitions)({
|
|
44
48
|
attributeType: 'spaceAttributeDefinitions'
|
|
45
49
|
});
|
|
46
|
-
|
|
47
50
|
case 3:
|
|
48
51
|
result = _context.sent;
|
|
49
|
-
expect(
|
|
52
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
|
|
50
53
|
params: {},
|
|
51
54
|
headers: {
|
|
52
55
|
'X-Kinetic-AuthAssumed': 'true'
|
|
@@ -63,7 +66,6 @@ describe('attributeDefinitions api', function () {
|
|
|
63
66
|
name: 'Bundle Package Version'
|
|
64
67
|
}]
|
|
65
68
|
});
|
|
66
|
-
|
|
67
69
|
case 6:
|
|
68
70
|
case "end":
|
|
69
71
|
return _context.stop();
|
|
@@ -71,13 +73,13 @@ describe('attributeDefinitions api', function () {
|
|
|
71
73
|
}
|
|
72
74
|
}, _callee);
|
|
73
75
|
})));
|
|
74
|
-
test('success kapp scoped attribute', /*#__PURE__*/
|
|
76
|
+
test('success kapp scoped attribute', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2() {
|
|
75
77
|
var result;
|
|
76
|
-
return
|
|
78
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
77
79
|
while (1) {
|
|
78
80
|
switch (_context2.prev = _context2.next) {
|
|
79
81
|
case 0:
|
|
80
|
-
|
|
82
|
+
_axios["default"].get.mockResolvedValue({
|
|
81
83
|
status: 200,
|
|
82
84
|
data: {
|
|
83
85
|
categoryAttributeDefinitions: [{
|
|
@@ -92,14 +94,13 @@ describe('attributeDefinitions api', function () {
|
|
|
92
94
|
}
|
|
93
95
|
});
|
|
94
96
|
_context2.next = 3;
|
|
95
|
-
return fetchAttributeDefinitions({
|
|
97
|
+
return (0, _attributeDefinitions.fetchAttributeDefinitions)({
|
|
96
98
|
attributeType: 'categoryAttributeDefinitions',
|
|
97
99
|
kappSlug: 'services'
|
|
98
100
|
});
|
|
99
|
-
|
|
100
101
|
case 3:
|
|
101
102
|
result = _context2.sent;
|
|
102
|
-
expect(
|
|
103
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/kapps/services/categoryAttributeDefinitions', {
|
|
103
104
|
params: {},
|
|
104
105
|
headers: {
|
|
105
106
|
'X-Kinetic-AuthAssumed': 'true'
|
|
@@ -116,7 +117,6 @@ describe('attributeDefinitions api', function () {
|
|
|
116
117
|
name: 'Bundle Package Version'
|
|
117
118
|
}]
|
|
118
119
|
});
|
|
119
|
-
|
|
120
120
|
case 6:
|
|
121
121
|
case "end":
|
|
122
122
|
return _context2.stop();
|
|
@@ -126,29 +126,28 @@ describe('attributeDefinitions api', function () {
|
|
|
126
126
|
})));
|
|
127
127
|
test('failure kapp scoped attribute - missing kappSlug', function () {
|
|
128
128
|
expect(function () {
|
|
129
|
-
fetchAttributeDefinitions({
|
|
129
|
+
(0, _attributeDefinitions.fetchAttributeDefinitions)({
|
|
130
130
|
attributeType: 'categoryAttributeDefinitions'
|
|
131
131
|
});
|
|
132
132
|
}).toThrowError('fetchAttributeDefinitions failed! A kappSlug is required when using categoryAttributeDefinitions');
|
|
133
133
|
});
|
|
134
|
-
test('forbidden', /*#__PURE__*/
|
|
134
|
+
test('forbidden', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
135
135
|
var result;
|
|
136
|
-
return
|
|
136
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
137
137
|
while (1) {
|
|
138
138
|
switch (_context3.prev = _context3.next) {
|
|
139
139
|
case 0:
|
|
140
|
-
|
|
140
|
+
_axios["default"].get.mockRejectedValue((0, _createError["default"])('Request failed with status code 403', null, 403, null, {
|
|
141
141
|
status: 403,
|
|
142
142
|
statusText: 'Forbidden'
|
|
143
143
|
}));
|
|
144
144
|
_context3.next = 3;
|
|
145
|
-
return fetchAttributeDefinitions({
|
|
145
|
+
return (0, _attributeDefinitions.fetchAttributeDefinitions)({
|
|
146
146
|
attributeType: 'spaceAttributeDefinitions'
|
|
147
147
|
});
|
|
148
|
-
|
|
149
148
|
case 3:
|
|
150
149
|
result = _context3.sent;
|
|
151
|
-
expect(
|
|
150
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
|
|
152
151
|
params: {},
|
|
153
152
|
headers: {
|
|
154
153
|
'X-Kinetic-AuthAssumed': 'true'
|
|
@@ -162,7 +161,6 @@ describe('attributeDefinitions api', function () {
|
|
|
162
161
|
message: 'Forbidden'
|
|
163
162
|
}
|
|
164
163
|
});
|
|
165
|
-
|
|
166
164
|
case 6:
|
|
167
165
|
case "end":
|
|
168
166
|
return _context3.stop();
|
|
@@ -173,15 +171,15 @@ describe('attributeDefinitions api', function () {
|
|
|
173
171
|
});
|
|
174
172
|
describe('fetchAttributeDefinition', function () {
|
|
175
173
|
beforeEach(function () {
|
|
176
|
-
|
|
174
|
+
_axios["default"].get.mockReset();
|
|
177
175
|
});
|
|
178
|
-
test('success', /*#__PURE__*/
|
|
176
|
+
test('success', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee4() {
|
|
179
177
|
var result;
|
|
180
|
-
return
|
|
178
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee4$(_context4) {
|
|
181
179
|
while (1) {
|
|
182
180
|
switch (_context4.prev = _context4.next) {
|
|
183
181
|
case 0:
|
|
184
|
-
|
|
182
|
+
_axios["default"].get.mockResolvedValue({
|
|
185
183
|
status: 200,
|
|
186
184
|
data: {
|
|
187
185
|
spaceAttributeDefinition: {
|
|
@@ -191,14 +189,13 @@ describe('attributeDefinitions api', function () {
|
|
|
191
189
|
}
|
|
192
190
|
});
|
|
193
191
|
_context4.next = 3;
|
|
194
|
-
return fetchAttributeDefinition({
|
|
192
|
+
return (0, _attributeDefinitions.fetchAttributeDefinition)({
|
|
195
193
|
attributeType: 'spaceAttributeDefinitions',
|
|
196
194
|
attributeName: 'Foo'
|
|
197
195
|
});
|
|
198
|
-
|
|
199
196
|
case 3:
|
|
200
197
|
result = _context4.sent;
|
|
201
|
-
expect(
|
|
198
|
+
expect(_axios["default"].get.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Foo', {
|
|
202
199
|
params: {},
|
|
203
200
|
headers: {
|
|
204
201
|
'X-Kinetic-AuthAssumed': 'true'
|
|
@@ -210,7 +207,6 @@ describe('attributeDefinitions api', function () {
|
|
|
210
207
|
name: 'Foo'
|
|
211
208
|
}
|
|
212
209
|
});
|
|
213
|
-
|
|
214
210
|
case 6:
|
|
215
211
|
case "end":
|
|
216
212
|
return _context4.stop();
|
|
@@ -220,7 +216,7 @@ describe('attributeDefinitions api', function () {
|
|
|
220
216
|
})));
|
|
221
217
|
test('invalid attributeType', function () {
|
|
222
218
|
expect(function () {
|
|
223
|
-
fetchAttributeDefinition({
|
|
219
|
+
(0, _attributeDefinitions.fetchAttributeDefinition)({
|
|
224
220
|
attributeType: 'notAValidAttributeType',
|
|
225
221
|
attributeName: 'Foo'
|
|
226
222
|
});
|
|
@@ -229,15 +225,15 @@ describe('attributeDefinitions api', function () {
|
|
|
229
225
|
});
|
|
230
226
|
describe('createAttributeDefinition', function () {
|
|
231
227
|
beforeEach(function () {
|
|
232
|
-
|
|
228
|
+
_axios["default"].post.mockReset();
|
|
233
229
|
});
|
|
234
|
-
test('success create attribute definition', /*#__PURE__*/
|
|
230
|
+
test('success create attribute definition', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee5() {
|
|
235
231
|
var result;
|
|
236
|
-
return
|
|
232
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee5$(_context5) {
|
|
237
233
|
while (1) {
|
|
238
234
|
switch (_context5.prev = _context5.next) {
|
|
239
235
|
case 0:
|
|
240
|
-
|
|
236
|
+
_axios["default"].post.mockResolvedValue({
|
|
241
237
|
status: 200,
|
|
242
238
|
data: {
|
|
243
239
|
spaceAttributeDefinition: {
|
|
@@ -248,7 +244,7 @@ describe('attributeDefinitions api', function () {
|
|
|
248
244
|
}
|
|
249
245
|
});
|
|
250
246
|
_context5.next = 3;
|
|
251
|
-
return createAttributeDefinition({
|
|
247
|
+
return (0, _attributeDefinitions.createAttributeDefinition)({
|
|
252
248
|
attributeType: 'spaceAttributeDefinitions',
|
|
253
249
|
attributeDefinition: {
|
|
254
250
|
name: 'Test Attribute',
|
|
@@ -256,10 +252,9 @@ describe('attributeDefinitions api', function () {
|
|
|
256
252
|
allowsMultiple: true
|
|
257
253
|
}
|
|
258
254
|
});
|
|
259
|
-
|
|
260
255
|
case 3:
|
|
261
256
|
result = _context5.sent;
|
|
262
|
-
expect(
|
|
257
|
+
expect(_axios["default"].post.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions', {
|
|
263
258
|
name: 'Test Attribute',
|
|
264
259
|
description: 'Test Attr Desc',
|
|
265
260
|
allowsMultiple: true
|
|
@@ -276,7 +271,6 @@ describe('attributeDefinitions api', function () {
|
|
|
276
271
|
allowsMultiple: true
|
|
277
272
|
}
|
|
278
273
|
});
|
|
279
|
-
|
|
280
274
|
case 6:
|
|
281
275
|
case "end":
|
|
282
276
|
return _context5.stop();
|
|
@@ -286,7 +280,7 @@ describe('attributeDefinitions api', function () {
|
|
|
286
280
|
})));
|
|
287
281
|
test('missing name', function () {
|
|
288
282
|
expect(function () {
|
|
289
|
-
createAttributeDefinition({
|
|
283
|
+
(0, _attributeDefinitions.createAttributeDefinition)({
|
|
290
284
|
attributeType: 'spaceAttributeDefinitions'
|
|
291
285
|
});
|
|
292
286
|
}).toThrowError('createAttributeDefinition failed! The following required options are missing: attributeDefinition');
|
|
@@ -294,15 +288,15 @@ describe('attributeDefinitions api', function () {
|
|
|
294
288
|
});
|
|
295
289
|
describe('updateAttributeDefinition', function () {
|
|
296
290
|
beforeEach(function () {
|
|
297
|
-
|
|
291
|
+
_axios["default"].put.mockReset();
|
|
298
292
|
});
|
|
299
|
-
test('success update attribute definition', /*#__PURE__*/
|
|
293
|
+
test('success update attribute definition', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee6() {
|
|
300
294
|
var result;
|
|
301
|
-
return
|
|
295
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee6$(_context6) {
|
|
302
296
|
while (1) {
|
|
303
297
|
switch (_context6.prev = _context6.next) {
|
|
304
298
|
case 0:
|
|
305
|
-
|
|
299
|
+
_axios["default"].put.mockResolvedValue({
|
|
306
300
|
status: 200,
|
|
307
301
|
data: {
|
|
308
302
|
spaceAttributeDefinition: {
|
|
@@ -313,7 +307,7 @@ describe('attributeDefinitions api', function () {
|
|
|
313
307
|
}
|
|
314
308
|
});
|
|
315
309
|
_context6.next = 3;
|
|
316
|
-
return updateAttributeDefinition({
|
|
310
|
+
return (0, _attributeDefinitions.updateAttributeDefinition)({
|
|
317
311
|
attributeType: 'spaceAttributeDefinitions',
|
|
318
312
|
attributeName: 'Test Attribute',
|
|
319
313
|
attributeDefinition: {
|
|
@@ -322,10 +316,9 @@ describe('attributeDefinitions api', function () {
|
|
|
322
316
|
allowsMultiple: true
|
|
323
317
|
}
|
|
324
318
|
});
|
|
325
|
-
|
|
326
319
|
case 3:
|
|
327
320
|
result = _context6.sent;
|
|
328
|
-
expect(
|
|
321
|
+
expect(_axios["default"].put.mock.calls).toEqual([['space/app/api/v1/spaceAttributeDefinitions/Test%20Attribute', {
|
|
329
322
|
name: 'Test Attribute',
|
|
330
323
|
description: 'Test Attr Desc',
|
|
331
324
|
allowsMultiple: true
|
|
@@ -342,7 +335,6 @@ describe('attributeDefinitions api', function () {
|
|
|
342
335
|
allowsMultiple: true
|
|
343
336
|
}
|
|
344
337
|
});
|
|
345
|
-
|
|
346
338
|
case 6:
|
|
347
339
|
case "end":
|
|
348
340
|
return _context6.stop();
|
|
@@ -1,84 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.singleSignOn = exports.retrieveJwt = exports.logoutDirect = exports.login = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
12
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
13
|
+
var _helpers = require("../../helpers");
|
|
14
|
+
var _profile = require("./profile");
|
|
15
|
+
var _http = require("../http");
|
|
16
|
+
var login = function login(_ref) {
|
|
10
17
|
var username = _ref.username,
|
|
11
|
-
|
|
12
|
-
return
|
|
18
|
+
password = _ref.password;
|
|
19
|
+
return _axios["default"].post("".concat(_helpers.bundle.spaceLocation(), "/app/login.do"), {
|
|
13
20
|
j_username: username,
|
|
14
21
|
j_password: password
|
|
15
22
|
}, {
|
|
16
23
|
__bypassAuthInterceptor: true
|
|
17
|
-
})["catch"](handleErrors);
|
|
24
|
+
})["catch"](_http.handleErrors);
|
|
18
25
|
};
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
exports.login = login;
|
|
27
|
+
var logoutDirect = function logoutDirect() {
|
|
28
|
+
return _axios["default"].get("".concat(_helpers.bundle.spaceLocation(), "/app/logout"));
|
|
21
29
|
};
|
|
30
|
+
exports.logoutDirect = logoutDirect;
|
|
22
31
|
var checkedOrigin = process.env.REACT_APP_API_HOST ? process.env.REACT_APP_API_HOST : typeof window !== 'undefined' ? window.location.origin : null;
|
|
23
32
|
var clientId = process.env.REACT_APP_OAUTH_CLIENT_ID ? process.env.REACT_APP_OAUTH_CLIENT_ID : process.env.NODE_ENV === 'production' ? 'system' : 'system-dev';
|
|
24
|
-
|
|
33
|
+
var retrieveJwt = function retrieveJwt() {
|
|
25
34
|
return new Promise(function (resolve) {
|
|
26
35
|
var iframe = document.createElement('iframe');
|
|
27
|
-
iframe.src = bundle.spaceLocation() + '/app/oauth/authorize?grant_type=implicit&response_type=token&client_id=' + clientId;
|
|
36
|
+
iframe.src = _helpers.bundle.spaceLocation() + '/app/oauth/authorize?grant_type=implicit&response_type=token&client_id=' + clientId;
|
|
28
37
|
iframe.title = 'oauth jwt iframe';
|
|
29
38
|
iframe.style.cssText = 'display: none';
|
|
30
|
-
|
|
31
39
|
var listener = function listener(e) {
|
|
32
40
|
if (e.origin === checkedOrigin && e.data.token) {
|
|
33
41
|
window.removeEventListener('message', listener);
|
|
34
42
|
document.body.removeChild(iframe);
|
|
35
43
|
resolve(e.data.token);
|
|
36
44
|
}
|
|
37
|
-
|
|
38
45
|
if (e.origin === checkedOrigin && e.data.type === 'ping') {
|
|
39
46
|
e.source.postMessage({
|
|
40
47
|
type: 'pong'
|
|
41
48
|
}, e.origin);
|
|
42
49
|
}
|
|
43
50
|
};
|
|
44
|
-
|
|
45
51
|
window.addEventListener('message', listener);
|
|
46
52
|
document.body.appendChild(iframe);
|
|
47
53
|
});
|
|
48
54
|
};
|
|
49
|
-
|
|
55
|
+
exports.retrieveJwt = retrieveJwt;
|
|
56
|
+
var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
50
57
|
var target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '_blank';
|
|
51
58
|
return new Promise(function (resolve) {
|
|
52
|
-
var options =
|
|
53
|
-
|
|
54
|
-
var endpoint = bundle.spaceLocation() + '/app/saml/login/alias/' + spaceSlug;
|
|
59
|
+
var options = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, dimensions), getPopupPosition(window, dimensions));
|
|
60
|
+
var endpoint = _helpers.bundle.spaceLocation() + '/app/saml/login/alias/' + spaceSlug;
|
|
55
61
|
var popup = window.open(endpoint, target, stringifyOptions(options));
|
|
56
|
-
|
|
57
62
|
if (!popup) {
|
|
58
63
|
resolve({
|
|
59
64
|
error: 'Enterprise Sign In popup was blocked by the browser.'
|
|
60
65
|
});
|
|
61
66
|
return;
|
|
62
|
-
}
|
|
63
|
-
// parent window
|
|
64
|
-
|
|
67
|
+
}
|
|
65
68
|
|
|
69
|
+
// Create an event handler that closes the popup window if we focus the
|
|
70
|
+
// parent window
|
|
66
71
|
var windowFocusHandler = function windowFocusHandler() {
|
|
67
72
|
popup.close();
|
|
68
73
|
window.removeEventListener('focus', windowFocusHandler);
|
|
69
74
|
};
|
|
75
|
+
window.addEventListener('focus', windowFocusHandler);
|
|
70
76
|
|
|
71
|
-
|
|
77
|
+
// use a larger interval in dev mode because we are going to be checking
|
|
72
78
|
// by making an ajax call
|
|
73
|
-
|
|
74
79
|
var popupPollingInterval = 2000;
|
|
75
|
-
var pollCounter = 30;
|
|
80
|
+
var pollCounter = 30;
|
|
81
|
+
|
|
82
|
+
// Check the status of the popup window. If closed or open for too long,
|
|
76
83
|
// show error. Otherwise, check if profile is avilable to verify successful
|
|
77
84
|
// authentication.
|
|
78
|
-
|
|
79
85
|
var checkPopup = /*#__PURE__*/function () {
|
|
80
|
-
var _ref2 =
|
|
81
|
-
return
|
|
86
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee() {
|
|
87
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
82
88
|
while (1) {
|
|
83
89
|
switch (_context.prev = _context.next) {
|
|
84
90
|
case 0:
|
|
@@ -86,28 +92,23 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
86
92
|
_context.next = 4;
|
|
87
93
|
break;
|
|
88
94
|
}
|
|
89
|
-
|
|
90
95
|
resolve({
|
|
91
96
|
error: 'Enterprise Sign In was cancelled.'
|
|
92
97
|
});
|
|
93
98
|
_context.next = 12;
|
|
94
99
|
break;
|
|
95
|
-
|
|
96
100
|
case 4:
|
|
97
101
|
_context.next = 6;
|
|
98
102
|
return profileAvailable();
|
|
99
|
-
|
|
100
103
|
case 6:
|
|
101
104
|
if (!_context.sent) {
|
|
102
105
|
_context.next = 11;
|
|
103
106
|
break;
|
|
104
107
|
}
|
|
105
|
-
|
|
106
108
|
popup.close();
|
|
107
109
|
resolve({});
|
|
108
110
|
_context.next = 12;
|
|
109
111
|
break;
|
|
110
|
-
|
|
111
112
|
case 11:
|
|
112
113
|
if (pollCounter > 0) {
|
|
113
114
|
pollCounter--;
|
|
@@ -118,7 +119,6 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
118
119
|
error: 'Enterprise Sign In timed out.'
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
|
|
122
122
|
case 12:
|
|
123
123
|
case "end":
|
|
124
124
|
return _context.stop();
|
|
@@ -126,48 +126,46 @@ export var singleSignOn = function singleSignOn(spaceSlug, dimensions) {
|
|
|
126
126
|
}
|
|
127
127
|
}, _callee);
|
|
128
128
|
}));
|
|
129
|
-
|
|
130
129
|
return function checkPopup() {
|
|
131
130
|
return _ref2.apply(this, arguments);
|
|
132
131
|
};
|
|
133
|
-
}();
|
|
134
|
-
|
|
132
|
+
}();
|
|
135
133
|
|
|
134
|
+
// Start the recursive checkPopup calls.
|
|
136
135
|
setTimeout(checkPopup, popupPollingInterval);
|
|
137
136
|
});
|
|
138
|
-
};
|
|
139
|
-
// profile endpoint successfully returns data.
|
|
137
|
+
};
|
|
140
138
|
|
|
139
|
+
// Checks to see if the user has been authenticated via SSO by checking if the
|
|
140
|
+
// profile endpoint successfully returns data.
|
|
141
|
+
exports.singleSignOn = singleSignOn;
|
|
141
142
|
var profileAvailable = /*#__PURE__*/function () {
|
|
142
|
-
var _ref3 =
|
|
143
|
-
return
|
|
143
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee3() {
|
|
144
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee3$(_context3) {
|
|
144
145
|
while (1) {
|
|
145
146
|
switch (_context3.prev = _context3.next) {
|
|
146
147
|
case 0:
|
|
147
148
|
return _context3.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
148
|
-
var _ref4 =
|
|
149
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee2(resolve) {
|
|
149
150
|
var result;
|
|
150
|
-
return
|
|
151
|
+
return (0, _regeneratorRuntime2["default"])().wrap(function _callee2$(_context2) {
|
|
151
152
|
while (1) {
|
|
152
153
|
switch (_context2.prev = _context2.next) {
|
|
153
154
|
case 0:
|
|
154
155
|
_context2.prev = 0;
|
|
155
156
|
_context2.next = 3;
|
|
156
|
-
return fetchProfile({
|
|
157
|
+
return (0, _profile.fetchProfile)({
|
|
157
158
|
"public": true
|
|
158
159
|
});
|
|
159
|
-
|
|
160
160
|
case 3:
|
|
161
161
|
result = _context2.sent;
|
|
162
162
|
resolve(!!result.profile);
|
|
163
163
|
_context2.next = 10;
|
|
164
164
|
break;
|
|
165
|
-
|
|
166
165
|
case 7:
|
|
167
166
|
_context2.prev = 7;
|
|
168
167
|
_context2.t0 = _context2["catch"](0);
|
|
169
168
|
resolve(false);
|
|
170
|
-
|
|
171
169
|
case 10:
|
|
172
170
|
case "end":
|
|
173
171
|
return _context2.stop();
|
|
@@ -175,12 +173,10 @@ var profileAvailable = /*#__PURE__*/function () {
|
|
|
175
173
|
}
|
|
176
174
|
}, _callee2, null, [[0, 7]]);
|
|
177
175
|
}));
|
|
178
|
-
|
|
179
176
|
return function (_x) {
|
|
180
177
|
return _ref4.apply(this, arguments);
|
|
181
178
|
};
|
|
182
179
|
}()));
|
|
183
|
-
|
|
184
180
|
case 1:
|
|
185
181
|
case "end":
|
|
186
182
|
return _context3.stop();
|
|
@@ -188,25 +184,24 @@ var profileAvailable = /*#__PURE__*/function () {
|
|
|
188
184
|
}
|
|
189
185
|
}, _callee3);
|
|
190
186
|
}));
|
|
191
|
-
|
|
192
187
|
return function profileAvailable() {
|
|
193
188
|
return _ref3.apply(this, arguments);
|
|
194
189
|
};
|
|
195
|
-
}();
|
|
196
|
-
// helper to do that conversion.
|
|
197
|
-
|
|
190
|
+
}();
|
|
198
191
|
|
|
192
|
+
// window.open takes a string of options rather than a JS object so we use this
|
|
193
|
+
// helper to do that conversion.
|
|
199
194
|
var stringifyOptions = function stringifyOptions(options) {
|
|
200
195
|
return Object.keys(options).reduce(function (reduction, option) {
|
|
201
|
-
return [].concat(
|
|
196
|
+
return [].concat((0, _toConsumableArray2["default"])(reduction), ["".concat(option, "=").concat(options[option])]);
|
|
202
197
|
}, []).join(',');
|
|
203
|
-
};
|
|
204
|
-
// position for the popup to be centered within the parent.
|
|
205
|
-
|
|
198
|
+
};
|
|
206
199
|
|
|
200
|
+
// Given the dimensions of the popup and the parent window returns the correct
|
|
201
|
+
// position for the popup to be centered within the parent.
|
|
207
202
|
var getPopupPosition = function getPopupPosition(window, _ref5) {
|
|
208
203
|
var width = _ref5.width,
|
|
209
|
-
|
|
204
|
+
height = _ref5.height;
|
|
210
205
|
return {
|
|
211
206
|
top: window.screenY + window.innerHeight / 2 - height / 2,
|
|
212
207
|
left: window.screenX + window.innerWidth / 2 - width / 2
|