@atlaskit/link-create 3.1.1 → 4.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/CHANGELOG.md +18 -0
- package/dist/cjs/common/constants.js +1 -1
- package/dist/cjs/common/ui/error-boundary-modal/index.js +1 -9
- package/dist/cjs/common/ui/error-boundary-ui/error-svg/index.js +1 -10
- package/dist/cjs/common/ui/icon/index.js +1 -9
- package/dist/cjs/common/ui/message/index.compiled.css +1 -1
- package/dist/cjs/common/ui/message/index.js +2 -10
- package/dist/cjs/common/ui/modal-hero/index.js +1 -9
- package/dist/cjs/controllers/create-field/main.js +1 -9
- package/dist/cjs/i18n/en.js +2 -0
- package/dist/cjs/i18n/en_GB.js +2 -0
- package/dist/cjs/i18n/en_ZZ.js +2 -0
- package/dist/cjs/ui/create-form/async-select/main.js +1 -9
- package/dist/cjs/ui/create-form/form-footer/main.js +1 -9
- package/dist/cjs/ui/create-form/form-loader/main.js +1 -9
- package/dist/cjs/ui/create-form/main.js +1 -9
- package/dist/cjs/ui/create-form/select/main.js +7 -33
- package/dist/cjs/ui/create-form/textfield/main.js +3 -10
- package/dist/cjs/ui/create-form/user-picker/main.js +1 -9
- package/dist/cjs/ui/inline-create/index.js +1 -9
- package/dist/cjs/ui/inline-create/main.js +1 -9
- package/dist/cjs/ui/modal-create/index.js +1 -9
- package/dist/cjs/ui/modal-create/main.js +1 -9
- package/dist/es2019/common/constants.js +1 -1
- package/dist/es2019/common/ui/error-boundary-modal/index.js +1 -9
- package/dist/es2019/common/ui/error-boundary-ui/error-svg/index.js +1 -9
- package/dist/es2019/common/ui/icon/index.js +1 -9
- package/dist/es2019/common/ui/message/index.compiled.css +1 -1
- package/dist/es2019/common/ui/message/index.js +2 -10
- package/dist/es2019/common/ui/modal-hero/index.js +1 -9
- package/dist/es2019/controllers/create-field/main.js +1 -9
- package/dist/es2019/i18n/en.js +2 -0
- package/dist/es2019/i18n/en_GB.js +2 -0
- package/dist/es2019/i18n/en_ZZ.js +2 -0
- package/dist/es2019/ui/create-form/async-select/main.js +1 -9
- package/dist/es2019/ui/create-form/form-footer/main.js +1 -9
- package/dist/es2019/ui/create-form/form-loader/main.js +1 -9
- package/dist/es2019/ui/create-form/main.js +1 -9
- package/dist/es2019/ui/create-form/select/main.js +8 -34
- package/dist/es2019/ui/create-form/textfield/main.js +3 -10
- package/dist/es2019/ui/create-form/user-picker/main.js +1 -9
- package/dist/es2019/ui/inline-create/index.js +1 -9
- package/dist/es2019/ui/inline-create/main.js +1 -9
- package/dist/es2019/ui/modal-create/index.js +1 -9
- package/dist/es2019/ui/modal-create/main.js +1 -9
- package/dist/esm/common/constants.js +1 -1
- package/dist/esm/common/ui/error-boundary-modal/index.js +1 -9
- package/dist/esm/common/ui/error-boundary-ui/error-svg/index.js +1 -9
- package/dist/esm/common/ui/icon/index.js +1 -9
- package/dist/esm/common/ui/message/index.compiled.css +1 -1
- package/dist/esm/common/ui/message/index.js +2 -10
- package/dist/esm/common/ui/modal-hero/index.js +1 -9
- package/dist/esm/controllers/create-field/main.js +1 -9
- package/dist/esm/i18n/en.js +2 -0
- package/dist/esm/i18n/en_GB.js +2 -0
- package/dist/esm/i18n/en_ZZ.js +2 -0
- package/dist/esm/ui/create-form/async-select/main.js +1 -9
- package/dist/esm/ui/create-form/form-footer/main.js +1 -9
- package/dist/esm/ui/create-form/form-loader/main.js +1 -9
- package/dist/esm/ui/create-form/main.js +1 -9
- package/dist/esm/ui/create-form/select/main.js +7 -33
- package/dist/esm/ui/create-form/textfield/main.js +3 -10
- package/dist/esm/ui/create-form/user-picker/main.js +1 -9
- package/dist/esm/ui/inline-create/index.js +1 -9
- package/dist/esm/ui/inline-create/main.js +1 -9
- package/dist/esm/ui/modal-create/index.js +1 -9
- package/dist/esm/ui/modal-create/main.js +1 -9
- package/dist/types/common/ui/error-boundary-modal/index.d.ts +2 -2
- package/dist/types/common/ui/icon/index.d.ts +1 -1
- package/dist/types/common/ui/message/index.d.ts +1 -1
- package/dist/types/common/ui/modal-hero/index.d.ts +1 -1
- package/dist/types/controllers/create-field/main.d.ts +1 -1
- package/dist/types/i18n/en.d.ts +2 -0
- package/dist/types/i18n/en_GB.d.ts +2 -0
- package/dist/types/i18n/en_ZZ.d.ts +2 -0
- package/dist/types/ui/create-form/async-select/main.d.ts +8 -2
- package/dist/types/ui/create-form/form-footer/main.d.ts +6 -1
- package/dist/types/ui/create-form/form-loader/main.d.ts +5 -1
- package/dist/types/ui/create-form/main.d.ts +1 -1
- package/dist/types/ui/create-form/select/main.d.ts +11 -5
- package/dist/types/ui/create-form/textfield/main.d.ts +8 -2
- package/dist/types/ui/create-form/user-picker/main.d.ts +5 -2
- package/dist/types-ts4.5/common/ui/error-boundary-modal/index.d.ts +2 -2
- package/dist/types-ts4.5/common/ui/icon/index.d.ts +1 -1
- package/dist/types-ts4.5/common/ui/message/index.d.ts +1 -1
- package/dist/types-ts4.5/common/ui/modal-hero/index.d.ts +1 -1
- package/dist/types-ts4.5/controllers/create-field/main.d.ts +1 -1
- package/dist/types-ts4.5/i18n/en.d.ts +2 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +2 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +2 -0
- package/dist/types-ts4.5/ui/create-form/async-select/main.d.ts +8 -2
- package/dist/types-ts4.5/ui/create-form/form-footer/main.d.ts +6 -1
- package/dist/types-ts4.5/ui/create-form/form-loader/main.d.ts +5 -1
- package/dist/types-ts4.5/ui/create-form/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/create-form/select/main.d.ts +11 -5
- package/dist/types-ts4.5/ui/create-form/textfield/main.d.ts +8 -2
- package/dist/types-ts4.5/ui/create-form/user-picker/main.d.ts +5 -2
- package/package.json +3 -11
- package/report.api.md +1 -1
- package/dist/cjs/common/ui/error-boundary-modal/old/index.js +0 -34
- package/dist/cjs/common/ui/error-boundary-ui/error-svg/old/index.js +0 -67
- package/dist/cjs/common/ui/icon/old/index.js +0 -26
- package/dist/cjs/common/ui/message/old/index.js +0 -81
- package/dist/cjs/common/ui/modal-hero/old/index.js +0 -27
- package/dist/cjs/controllers/create-field/old/main.js +0 -76
- package/dist/cjs/ui/create-form/async-select/old/main.js +0 -195
- package/dist/cjs/ui/create-form/form-footer/old/main.js +0 -64
- package/dist/cjs/ui/create-form/form-loader/old/main.js +0 -39
- package/dist/cjs/ui/create-form/old/main.js +0 -177
- package/dist/cjs/ui/create-form/select/old/main.js +0 -127
- package/dist/cjs/ui/create-form/textfield/old/main.js +0 -55
- package/dist/cjs/ui/create-form/user-picker/old/main.js +0 -72
- package/dist/cjs/ui/inline-create/old/index.js +0 -38
- package/dist/cjs/ui/inline-create/old/main.js +0 -120
- package/dist/cjs/ui/modal-create/old/index.js +0 -44
- package/dist/cjs/ui/modal-create/old/main.js +0 -164
- package/dist/es2019/common/ui/error-boundary-modal/old/index.js +0 -26
- package/dist/es2019/common/ui/error-boundary-ui/error-svg/old/index.js +0 -58
- package/dist/es2019/common/ui/icon/old/index.js +0 -18
- package/dist/es2019/common/ui/message/old/index.js +0 -74
- package/dist/es2019/common/ui/modal-hero/old/index.js +0 -19
- package/dist/es2019/controllers/create-field/old/main.js +0 -74
- package/dist/es2019/ui/create-form/async-select/old/main.js +0 -137
- package/dist/es2019/ui/create-form/form-footer/old/main.js +0 -57
- package/dist/es2019/ui/create-form/form-loader/old/main.js +0 -31
- package/dist/es2019/ui/create-form/old/main.js +0 -145
- package/dist/es2019/ui/create-form/select/old/main.js +0 -106
- package/dist/es2019/ui/create-form/textfield/old/main.js +0 -45
- package/dist/es2019/ui/create-form/user-picker/old/main.js +0 -59
- package/dist/es2019/ui/inline-create/old/index.js +0 -30
- package/dist/es2019/ui/inline-create/old/main.js +0 -96
- package/dist/es2019/ui/modal-create/old/index.js +0 -36
- package/dist/es2019/ui/modal-create/old/main.js +0 -137
- package/dist/esm/common/ui/error-boundary-modal/old/index.js +0 -25
- package/dist/esm/common/ui/error-boundary-ui/error-svg/old/index.js +0 -60
- package/dist/esm/common/ui/icon/old/index.js +0 -18
- package/dist/esm/common/ui/message/old/index.js +0 -73
- package/dist/esm/common/ui/modal-hero/old/index.js +0 -18
- package/dist/esm/controllers/create-field/old/main.js +0 -72
- package/dist/esm/ui/create-form/async-select/old/main.js +0 -188
- package/dist/esm/ui/create-form/form-footer/old/main.js +0 -56
- package/dist/esm/ui/create-form/form-loader/old/main.js +0 -31
- package/dist/esm/ui/create-form/old/main.js +0 -174
- package/dist/esm/ui/create-form/select/old/main.js +0 -117
- package/dist/esm/ui/create-form/textfield/old/main.js +0 -47
- package/dist/esm/ui/create-form/user-picker/old/main.js +0 -64
- package/dist/esm/ui/inline-create/old/index.js +0 -30
- package/dist/esm/ui/inline-create/old/main.js +0 -112
- package/dist/esm/ui/modal-create/old/index.js +0 -36
- package/dist/esm/ui/modal-create/old/main.js +0 -156
- package/dist/types/common/ui/error-boundary-modal/old/index.d.ts +0 -11
- package/dist/types/common/ui/error-boundary-ui/error-svg/old/index.d.ts +0 -7
- package/dist/types/common/ui/icon/old/index.d.ts +0 -7
- package/dist/types/common/ui/message/old/index.d.ts +0 -15
- package/dist/types/common/ui/modal-hero/old/index.d.ts +0 -4
- package/dist/types/controllers/create-field/old/main.d.ts +0 -7
- package/dist/types/ui/create-form/async-select/old/main.d.ts +0 -11
- package/dist/types/ui/create-form/form-footer/old/main.d.ts +0 -16
- package/dist/types/ui/create-form/form-loader/old/main.d.ts +0 -11
- package/dist/types/ui/create-form/old/main.d.ts +0 -54
- package/dist/types/ui/create-form/select/old/main.d.ts +0 -24
- package/dist/types/ui/create-form/textfield/old/main.d.ts +0 -14
- package/dist/types/ui/create-form/user-picker/old/main.d.ts +0 -11
- package/dist/types/ui/inline-create/old/index.d.ts +0 -5
- package/dist/types/ui/inline-create/old/main.d.ts +0 -8
- package/dist/types/ui/modal-create/old/index.d.ts +0 -5
- package/dist/types/ui/modal-create/old/main.d.ts +0 -4
- package/dist/types-ts4.5/common/ui/error-boundary-modal/old/index.d.ts +0 -11
- package/dist/types-ts4.5/common/ui/error-boundary-ui/error-svg/old/index.d.ts +0 -7
- package/dist/types-ts4.5/common/ui/icon/old/index.d.ts +0 -7
- package/dist/types-ts4.5/common/ui/message/old/index.d.ts +0 -15
- package/dist/types-ts4.5/common/ui/modal-hero/old/index.d.ts +0 -4
- package/dist/types-ts4.5/controllers/create-field/old/main.d.ts +0 -7
- package/dist/types-ts4.5/ui/create-form/async-select/old/main.d.ts +0 -11
- package/dist/types-ts4.5/ui/create-form/form-footer/old/main.d.ts +0 -16
- package/dist/types-ts4.5/ui/create-form/form-loader/old/main.d.ts +0 -11
- package/dist/types-ts4.5/ui/create-form/old/main.d.ts +0 -56
- package/dist/types-ts4.5/ui/create-form/select/old/main.d.ts +0 -24
- package/dist/types-ts4.5/ui/create-form/textfield/old/main.d.ts +0 -14
- package/dist/types-ts4.5/ui/create-form/user-picker/old/main.d.ts +0 -11
- package/dist/types-ts4.5/ui/inline-create/old/index.d.ts +0 -5
- package/dist/types-ts4.5/ui/inline-create/old/main.d.ts +0 -8
- package/dist/types-ts4.5/ui/modal-create/old/index.d.ts +0 -5
- package/dist/types-ts4.5/ui/modal-create/old/main.d.ts +0 -4
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
-
var _excluded = ["submitError"];
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
10
|
-
/**
|
|
11
|
-
* @jsxRuntime classic
|
|
12
|
-
* @jsx jsx
|
|
13
|
-
*/
|
|
14
|
-
import { useCallback } from 'react';
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
|
-
import { css, jsx } from '@emotion/react';
|
|
18
|
-
import { FORM_ERROR } from 'final-form';
|
|
19
|
-
import { Form, FormSpy } from 'react-final-form';
|
|
20
|
-
import { useIntl } from 'react-intl-next';
|
|
21
|
-
import { RequiredAsterisk } from '@atlaskit/form';
|
|
22
|
-
import { Box, Text } from '@atlaskit/primitives';
|
|
23
|
-
import { CREATE_FORM_MAX_WIDTH_IN_PX, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../../common/constants';
|
|
24
|
-
import messages from '../../../common/messages';
|
|
25
|
-
import { useLinkCreateCallback } from '../../../controllers/callback-context';
|
|
26
|
-
import { useExitWarningModal } from '../../../controllers/exit-warning-modal-context';
|
|
27
|
-
import { useFormContext } from '../../../controllers/form-context';
|
|
28
|
-
import { CreateFormFooter } from '../form-footer';
|
|
29
|
-
import { CreateFormLoader } from '../form-loader';
|
|
30
|
-
var formStyles = css({
|
|
31
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
|
-
maxWidth: "".concat(CREATE_FORM_MAX_WIDTH_IN_PX, "px"),
|
|
33
|
-
padding: "0 0 ".concat("var(--ds-space-300, 24px)", " 0"),
|
|
34
|
-
margin: "var(--ds-space-0, 0px)".concat(" auto")
|
|
35
|
-
});
|
|
36
|
-
var RESERVED_FIELDS = [LINK_CREATE_FORM_POST_CREATE_FIELD];
|
|
37
|
-
export var TEST_ID = 'link-create-form';
|
|
38
|
-
export var CreateFormOld = function CreateFormOld(_ref) {
|
|
39
|
-
var children = _ref.children,
|
|
40
|
-
_ref$testId = _ref.testId,
|
|
41
|
-
testId = _ref$testId === void 0 ? TEST_ID : _ref$testId,
|
|
42
|
-
onSubmit = _ref.onSubmit,
|
|
43
|
-
onCancel = _ref.onCancel,
|
|
44
|
-
isLoading = _ref.isLoading,
|
|
45
|
-
hideFooter = _ref.hideFooter,
|
|
46
|
-
hideRequiredFieldMessage = _ref.hideRequiredFieldMessage,
|
|
47
|
-
initialValues = _ref.initialValues;
|
|
48
|
-
var _useFormContext = useFormContext(),
|
|
49
|
-
setFormErrorMessage = _useFormContext.setFormErrorMessage,
|
|
50
|
-
formErrorMessage = _useFormContext.formErrorMessage,
|
|
51
|
-
enableEditView = _useFormContext.enableEditView;
|
|
52
|
-
var intl = useIntl();
|
|
53
|
-
var _useExitWarningModal = useExitWarningModal(),
|
|
54
|
-
setShouldShowWarning = _useExitWarningModal.setShouldShowWarning;
|
|
55
|
-
var _useLinkCreateCallbac = useLinkCreateCallback(),
|
|
56
|
-
onFailure = _useLinkCreateCallbac.onFailure;
|
|
57
|
-
var handleSubmit = useCallback( /*#__PURE__*/function () {
|
|
58
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
59
|
-
var shouldEnableEditView, formData;
|
|
60
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
61
|
-
while (1) switch (_context.prev = _context.next) {
|
|
62
|
-
case 0:
|
|
63
|
-
shouldEnableEditView = data[LINK_CREATE_FORM_POST_CREATE_FIELD], formData = _objectWithoutProperties(data, [LINK_CREATE_FORM_POST_CREATE_FIELD].map(_toPropertyKey));
|
|
64
|
-
/**
|
|
65
|
-
* If form has post-create field set to trigger post-create edit
|
|
66
|
-
* send this to the form context so we know what to do next
|
|
67
|
-
* if submission is successful
|
|
68
|
-
*/
|
|
69
|
-
enableEditView === null || enableEditView === void 0 || enableEditView(!!shouldEnableEditView);
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* This is the onSubmit handler provided by the plugin
|
|
73
|
-
* It will be async, and it will likely involve awaiting `onCreate` (the adopters handler)
|
|
74
|
-
*/
|
|
75
|
-
return _context.abrupt("return", onSubmit(formData));
|
|
76
|
-
case 3:
|
|
77
|
-
case "end":
|
|
78
|
-
return _context.stop();
|
|
79
|
-
}
|
|
80
|
-
}, _callee);
|
|
81
|
-
}));
|
|
82
|
-
return function (_x) {
|
|
83
|
-
return _ref2.apply(this, arguments);
|
|
84
|
-
};
|
|
85
|
-
}(), [onSubmit, enableEditView]);
|
|
86
|
-
var handleSubmitWithErrorHandling = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
87
|
-
var _args2 = arguments;
|
|
88
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
89
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
90
|
-
case 0:
|
|
91
|
-
_context2.prev = 0;
|
|
92
|
-
/**
|
|
93
|
-
* Clear any error message that may have been set by async select fields
|
|
94
|
-
* This will immediately remove any indication of an error, but the form likely will fail to submit,
|
|
95
|
-
* it will be likely a 400 because the user probably could not set all fields anyway
|
|
96
|
-
*/
|
|
97
|
-
setFormErrorMessage();
|
|
98
|
-
_context2.next = 4;
|
|
99
|
-
return handleSubmit.apply(void 0, _args2);
|
|
100
|
-
case 4:
|
|
101
|
-
return _context2.abrupt("return", _context2.sent);
|
|
102
|
-
case 7:
|
|
103
|
-
_context2.prev = 7;
|
|
104
|
-
_context2.t0 = _context2["catch"](0);
|
|
105
|
-
/**
|
|
106
|
-
* Notify link create of failed experience
|
|
107
|
-
*/
|
|
108
|
-
onFailure === null || onFailure === void 0 || onFailure(_context2.t0);
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Return a generic message for react final form to render
|
|
112
|
-
*/
|
|
113
|
-
return _context2.abrupt("return", _defineProperty({}, FORM_ERROR, intl.formatMessage(messages.genericErrorMessage)));
|
|
114
|
-
case 11:
|
|
115
|
-
case "end":
|
|
116
|
-
return _context2.stop();
|
|
117
|
-
}
|
|
118
|
-
}, _callee2, null, [[0, 7]]);
|
|
119
|
-
})), [handleSubmit, setFormErrorMessage, intl, onFailure]);
|
|
120
|
-
var handleCancel = useCallback(function () {
|
|
121
|
-
onCancel && onCancel();
|
|
122
|
-
}, [onCancel]);
|
|
123
|
-
if (isLoading) {
|
|
124
|
-
return jsx(CreateFormLoader, null);
|
|
125
|
-
}
|
|
126
|
-
return jsx(Form, {
|
|
127
|
-
onSubmit: handleSubmitWithErrorHandling,
|
|
128
|
-
initialValues: initialValues,
|
|
129
|
-
mutators: {
|
|
130
|
-
setField: function setField(args, state, tools) {
|
|
131
|
-
tools.changeValue(state, args[0].toString(), function () {
|
|
132
|
-
return args[1];
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}, function (_ref5) {
|
|
137
|
-
var submitError = _ref5.submitError,
|
|
138
|
-
formProps = _objectWithoutProperties(_ref5, _excluded);
|
|
139
|
-
return jsx("form", {
|
|
140
|
-
onSubmit: formProps.handleSubmit,
|
|
141
|
-
name: "link-create-form",
|
|
142
|
-
noValidate: true,
|
|
143
|
-
"data-testid": testId,
|
|
144
|
-
css: formStyles
|
|
145
|
-
}, jsx(FormSpy, {
|
|
146
|
-
subscription: {
|
|
147
|
-
modified: true
|
|
148
|
-
},
|
|
149
|
-
onChange: function onChange(state) {
|
|
150
|
-
// determine if any of the fields have been modified
|
|
151
|
-
if (!state.modified) {
|
|
152
|
-
setShouldShowWarning(false);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
var isModified = Object.values(state.modified).some(function (value) {
|
|
156
|
-
return value;
|
|
157
|
-
});
|
|
158
|
-
setShouldShowWarning(isModified);
|
|
159
|
-
}
|
|
160
|
-
}), !hideRequiredFieldMessage && jsx(Text, {
|
|
161
|
-
as: "p"
|
|
162
|
-
}, intl.formatMessage(messages.requiredFieldInstruction), " ", jsx(RequiredAsterisk, null)), jsx(Box, null, children), !hideFooter && jsx(CreateFormFooter
|
|
163
|
-
/**
|
|
164
|
-
* We will prefer to render the error message connected to
|
|
165
|
-
* react final form state (submitError) otherwise we can
|
|
166
|
-
* default to the `formErrorMessage` that we sometimes use with our own
|
|
167
|
-
* "form context" (only currently used for AsyncSelect field reporting failed loading)
|
|
168
|
-
*/, {
|
|
169
|
-
formErrorMessage: submitError || formErrorMessage,
|
|
170
|
-
handleCancel: handleCancel,
|
|
171
|
-
testId: testId
|
|
172
|
-
}));
|
|
173
|
-
});
|
|
174
|
-
};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["id", "name", "label", "isRequired", "validators", "validationHelpText", "testId"],
|
|
5
|
-
_excluded2 = ["fieldId", "isRequired"],
|
|
6
|
-
_excluded3 = ["children"],
|
|
7
|
-
_excluded4 = ["children"];
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
11
|
-
/**
|
|
12
|
-
* @jsxRuntime classic
|
|
13
|
-
* @jsx jsx
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
|
-
import { jsx } from '@emotion/react';
|
|
18
|
-
import { useIntl } from 'react-intl-next';
|
|
19
|
-
import { Inline } from '@atlaskit/primitives';
|
|
20
|
-
import AkSelect, { components } from '@atlaskit/select';
|
|
21
|
-
import { layers } from '@atlaskit/theme/constants';
|
|
22
|
-
import { UrlIcon } from '../../../../common/ui/icon';
|
|
23
|
-
import { CreateField } from '../../../../controllers/create-field';
|
|
24
|
-
import { messages } from '../messages';
|
|
25
|
-
export var TEST_ID = 'link-create-select';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A select component utilising the Atlaskit Select and CreateField.
|
|
29
|
-
* Validation is handled by the form on form submission. Any
|
|
30
|
-
* errors returned by the handleSubmit function passed to the form <Form> that
|
|
31
|
-
* have a key matching the `name` of this field are shown below the field.
|
|
32
|
-
*/
|
|
33
|
-
export function SelectOld(_ref) {
|
|
34
|
-
var id = _ref.id,
|
|
35
|
-
name = _ref.name,
|
|
36
|
-
label = _ref.label,
|
|
37
|
-
isRequired = _ref.isRequired,
|
|
38
|
-
validators = _ref.validators,
|
|
39
|
-
validationHelpText = _ref.validationHelpText,
|
|
40
|
-
_ref$testId = _ref.testId,
|
|
41
|
-
testId = _ref$testId === void 0 ? TEST_ID : _ref$testId,
|
|
42
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
return jsx(CreateField, {
|
|
44
|
-
id: id,
|
|
45
|
-
name: name,
|
|
46
|
-
label: label,
|
|
47
|
-
isRequired: isRequired,
|
|
48
|
-
validators: validators,
|
|
49
|
-
validationHelpText: validationHelpText,
|
|
50
|
-
testId: testId
|
|
51
|
-
}, function (_ref2) {
|
|
52
|
-
var fieldId = _ref2.fieldId,
|
|
53
|
-
isRequired = _ref2.isRequired,
|
|
54
|
-
fieldProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
55
|
-
return jsx(AkSelect, _extends({
|
|
56
|
-
required: isRequired,
|
|
57
|
-
inputId: fieldId
|
|
58
|
-
}, fieldProps, restProps));
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
export var SiteSelectOld = function SiteSelectOld(_ref3) {
|
|
62
|
-
var options = _ref3.options,
|
|
63
|
-
name = _ref3.name,
|
|
64
|
-
testId = _ref3.testId;
|
|
65
|
-
var intl = useIntl();
|
|
66
|
-
var siteTestId = testId ? testId : 'link-create-site-picker';
|
|
67
|
-
return jsx(SelectOld, {
|
|
68
|
-
isRequired: true,
|
|
69
|
-
isSearchable: true,
|
|
70
|
-
name: name !== null && name !== void 0 ? name : 'site',
|
|
71
|
-
options: options,
|
|
72
|
-
label: intl.formatMessage(messages.siteLabel),
|
|
73
|
-
components: {
|
|
74
|
-
Option: SitePickerOptionOld,
|
|
75
|
-
SingleValue: SitePickerSingleValueOld
|
|
76
|
-
},
|
|
77
|
-
testId: siteTestId,
|
|
78
|
-
styles: {
|
|
79
|
-
menuPortal: function menuPortal(base) {
|
|
80
|
-
return _objectSpread(_objectSpread({}, base), {}, {
|
|
81
|
-
zIndex: layers.modal()
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
option: function option(base) {
|
|
85
|
-
return _objectSpread(_objectSpread({}, base), {}, {
|
|
86
|
-
display: 'flex',
|
|
87
|
-
alignItems: 'center',
|
|
88
|
-
cursor: 'pointer'
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
var SiteRow = function SiteRow(_ref4) {
|
|
95
|
-
var avatarUrl = _ref4.avatarUrl,
|
|
96
|
-
children = _ref4.children;
|
|
97
|
-
return jsx(Inline, {
|
|
98
|
-
space: "space.100",
|
|
99
|
-
alignBlock: "center"
|
|
100
|
-
}, avatarUrl ? jsx(UrlIcon, {
|
|
101
|
-
url: avatarUrl
|
|
102
|
-
}) : null, children);
|
|
103
|
-
};
|
|
104
|
-
export var SitePickerOptionOld = function SitePickerOptionOld(_ref5) {
|
|
105
|
-
var children = _ref5.children,
|
|
106
|
-
props = _objectWithoutProperties(_ref5, _excluded3);
|
|
107
|
-
return jsx(components.Option, props, jsx(SiteRow, {
|
|
108
|
-
avatarUrl: props.data.value.avatarUrl
|
|
109
|
-
}, children));
|
|
110
|
-
};
|
|
111
|
-
export var SitePickerSingleValueOld = function SitePickerSingleValueOld(_ref6) {
|
|
112
|
-
var children = _ref6.children,
|
|
113
|
-
props = _objectWithoutProperties(_ref6, _excluded4);
|
|
114
|
-
return jsx(components.SingleValue, props, jsx(SiteRow, {
|
|
115
|
-
avatarUrl: props.data.value.avatarUrl
|
|
116
|
-
}, children));
|
|
117
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["id", "name", "label", "isRequired", "validators", "validationHelpText", "testId"],
|
|
4
|
-
_excluded2 = ["fieldId"];
|
|
5
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
6
|
-
/**
|
|
7
|
-
* @jsxRuntime classic
|
|
8
|
-
* @jsx jsx
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
|
-
import { jsx } from '@emotion/react';
|
|
12
|
-
import AkTextfield from '@atlaskit/textfield';
|
|
13
|
-
import { CreateField } from '../../../../controllers/create-field';
|
|
14
|
-
export var TEST_ID = 'link-create-text-field';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A text field utilising the Atlaskit Textfield and CreateField.
|
|
18
|
-
* Validation is handled by the form as it is on form submission. Any errors returned by
|
|
19
|
-
* the handleSubmit function passed to the form <Form> that have a key matching the `name`
|
|
20
|
-
* of this text field are shown above the field.
|
|
21
|
-
*/
|
|
22
|
-
export function TextFieldOld(_ref) {
|
|
23
|
-
var id = _ref.id,
|
|
24
|
-
name = _ref.name,
|
|
25
|
-
label = _ref.label,
|
|
26
|
-
isRequired = _ref.isRequired,
|
|
27
|
-
validators = _ref.validators,
|
|
28
|
-
validationHelpText = _ref.validationHelpText,
|
|
29
|
-
_ref$testId = _ref.testId,
|
|
30
|
-
testId = _ref$testId === void 0 ? TEST_ID : _ref$testId,
|
|
31
|
-
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
return jsx(CreateField, {
|
|
33
|
-
id: id,
|
|
34
|
-
name: name,
|
|
35
|
-
label: label,
|
|
36
|
-
isRequired: isRequired,
|
|
37
|
-
validators: validators,
|
|
38
|
-
validationHelpText: validationHelpText,
|
|
39
|
-
testId: testId
|
|
40
|
-
}, function (_ref2) {
|
|
41
|
-
var fieldId = _ref2.fieldId,
|
|
42
|
-
fieldProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
43
|
-
return jsx(AkTextfield, _extends({
|
|
44
|
-
id: fieldId
|
|
45
|
-
}, fieldProps, restProps));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["fieldId", "isRequired"];
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
7
|
-
/**
|
|
8
|
-
* @jsxRuntime classic
|
|
9
|
-
* @jsx jsx
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
12
|
-
import { jsx } from '@emotion/react';
|
|
13
|
-
import SmartUserPicker from '@atlaskit/smart-user-picker';
|
|
14
|
-
import { CreateField } from '../../../../controllers/create-field';
|
|
15
|
-
export var TEST_ID = 'link-create-user-picker';
|
|
16
|
-
var DEFAULT_DEBOUNCE_TIME = 400;
|
|
17
|
-
var UserPickerWidth = '100%';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A user picker utilising the SmartUserPicker.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export function UserPickerOld(_ref) {
|
|
24
|
-
var productKey = _ref.productKey,
|
|
25
|
-
siteId = _ref.siteId,
|
|
26
|
-
name = _ref.name,
|
|
27
|
-
label = _ref.label,
|
|
28
|
-
placeholder = _ref.placeholder,
|
|
29
|
-
validators = _ref.validators,
|
|
30
|
-
_ref$testId = _ref.testId,
|
|
31
|
-
testId = _ref$testId === void 0 ? TEST_ID : _ref$testId,
|
|
32
|
-
defaultValue = _ref.defaultValue;
|
|
33
|
-
return jsx(CreateField, {
|
|
34
|
-
name: name,
|
|
35
|
-
label: label,
|
|
36
|
-
isRequired: true,
|
|
37
|
-
testId: testId,
|
|
38
|
-
validators: validators
|
|
39
|
-
}, function (_ref2) {
|
|
40
|
-
var fieldId = _ref2.fieldId,
|
|
41
|
-
isRequired = _ref2.isRequired,
|
|
42
|
-
fieldProps = _objectWithoutProperties(_ref2, _excluded);
|
|
43
|
-
return jsx(SmartUserPicker, {
|
|
44
|
-
defaultValue: defaultValue ? _objectSpread(_objectSpread({}, defaultValue), {}, {
|
|
45
|
-
type: 'user'
|
|
46
|
-
}) : undefined,
|
|
47
|
-
placeholder: placeholder,
|
|
48
|
-
onChange: function onChange(value) {
|
|
49
|
-
return fieldProps.onChange(value);
|
|
50
|
-
},
|
|
51
|
-
subtle: true,
|
|
52
|
-
isMulti: false,
|
|
53
|
-
productKey: productKey,
|
|
54
|
-
siteId: siteId,
|
|
55
|
-
fieldId: fieldId,
|
|
56
|
-
inputId: fieldId,
|
|
57
|
-
debounceTime: DEFAULT_DEBOUNCE_TIME,
|
|
58
|
-
prefetch: true,
|
|
59
|
-
isClearable: false,
|
|
60
|
-
width: UserPickerWidth,
|
|
61
|
-
required: isRequired
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
10
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
-
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
12
|
-
import { PACKAGE_DATA } from '../../../common/constants';
|
|
13
|
-
import { ErrorBoundary } from '../../../common/ui/error-boundary';
|
|
14
|
-
import { Experience } from '../../../common/ui/experience-tracker';
|
|
15
|
-
import { withLinkCreateAnalyticsContext } from '../../../common/utils/analytics';
|
|
16
|
-
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
17
|
-
import i18nEN from '../../../i18n/en';
|
|
18
|
-
import InlineCreate from '../main';
|
|
19
|
-
var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (props) {
|
|
20
|
-
return jsx(Experience, null, jsx(ErrorBoundary, null, jsx(InlineCreate, props)));
|
|
21
|
-
}));
|
|
22
|
-
var ComposedLinkCreateOld = /*#__PURE__*/memo(function (props) {
|
|
23
|
-
return jsx(AnalyticsContext, {
|
|
24
|
-
data: PACKAGE_DATA
|
|
25
|
-
}, jsx(IntlMessagesProvider, {
|
|
26
|
-
defaultMessages: i18nEN,
|
|
27
|
-
loaderFn: fetchMessagesForLocale
|
|
28
|
-
}, jsx(LinkCreateWithAnalyticsContext, props)));
|
|
29
|
-
});
|
|
30
|
-
export default ComposedLinkCreateOld;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
5
|
-
/**
|
|
6
|
-
* @jsxRuntime classic
|
|
7
|
-
* @jsx jsx
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { jsx } from '@emotion/react';
|
|
11
|
-
import { Box } from '@atlaskit/primitives';
|
|
12
|
-
import { DEFAULT_TEST_ID, SCREEN_ID } from '../../../common/constants';
|
|
13
|
-
import { ConfirmDismissDialog } from '../../../common/ui/confirm-dismiss-dialog';
|
|
14
|
-
import { EditModal } from '../../../common/ui/edit-modal';
|
|
15
|
-
import { ErrorBoundary } from '../../../common/ui/error-boundary';
|
|
16
|
-
import { LinkCreateContent } from '../../../common/ui/link-create-content';
|
|
17
|
-
import { LinkCreateCallbackProvider } from '../../../controllers/callback-context';
|
|
18
|
-
import { EditPostCreateModalProvider, useEditPostCreateModal } from '../../../controllers/edit-post-create-context';
|
|
19
|
-
import { useExitWarningModal } from '../../../controllers/exit-warning-modal-context';
|
|
20
|
-
import { FormContextProvider } from '../../../controllers/form-context';
|
|
21
|
-
import { LinkCreatePluginsProvider, useLinkCreatePlugins } from '../../../controllers/plugin-context';
|
|
22
|
-
import { InlineAnalytics } from '../inline-analytics';
|
|
23
|
-
var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
24
|
-
var onCreate = _ref.onCreate,
|
|
25
|
-
onFailure = _ref.onFailure,
|
|
26
|
-
onCancel = _ref.onCancel,
|
|
27
|
-
onComplete = _ref.onComplete,
|
|
28
|
-
plugins = _ref.plugins,
|
|
29
|
-
entityKey = _ref.entityKey,
|
|
30
|
-
_ref$testId = _ref.testId,
|
|
31
|
-
testId = _ref$testId === void 0 ? DEFAULT_TEST_ID : _ref$testId;
|
|
32
|
-
var _useExitWarningModal = useExitWarningModal(),
|
|
33
|
-
withExitWarning = _useExitWarningModal.withExitWarning,
|
|
34
|
-
showExitWarning = _useExitWarningModal.showExitWarning,
|
|
35
|
-
setShowExitWarning = _useExitWarningModal.setShowExitWarning;
|
|
36
|
-
var _useEditPostCreateMod = useEditPostCreateModal(),
|
|
37
|
-
editViewPayload = _useEditPostCreateMod.editViewPayload;
|
|
38
|
-
var _useLinkCreatePlugins = useLinkCreatePlugins(),
|
|
39
|
-
activePlugin = _useLinkCreatePlugins.activePlugin;
|
|
40
|
-
var handleCloseExitWarning = function handleCloseExitWarning() {
|
|
41
|
-
return setShowExitWarning(false);
|
|
42
|
-
};
|
|
43
|
-
return jsx(LinkCreateCallbackProvider, {
|
|
44
|
-
onCreate: onCreate,
|
|
45
|
-
onFailure: onFailure,
|
|
46
|
-
onCancel: withExitWarning(onCancel)
|
|
47
|
-
}, jsx(ErrorBoundary, null, jsx(InlineAnalytics, {
|
|
48
|
-
screen: SCREEN_ID
|
|
49
|
-
}, jsx(Box, {
|
|
50
|
-
testId: testId
|
|
51
|
-
}, jsx(LinkCreateContent, {
|
|
52
|
-
plugins: plugins,
|
|
53
|
-
entityKey: entityKey
|
|
54
|
-
})))), onComplete && jsx(EditModal, {
|
|
55
|
-
onClose: onComplete,
|
|
56
|
-
editViewPayload: editViewPayload,
|
|
57
|
-
activePlugin: activePlugin
|
|
58
|
-
}), jsx(ConfirmDismissDialog, {
|
|
59
|
-
active: showExitWarning,
|
|
60
|
-
onClose: handleCloseExitWarning,
|
|
61
|
-
onCancel: onCancel
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
64
|
-
var InlineCreateOld = function InlineCreateOld(props) {
|
|
65
|
-
return jsx(LinkCreatePluginsProvider, {
|
|
66
|
-
plugins: props.plugins,
|
|
67
|
-
entityKey: props.entityKey
|
|
68
|
-
}, function (pluginsProvider) {
|
|
69
|
-
return jsx(EditPostCreateModalProvider, {
|
|
70
|
-
active: true
|
|
71
|
-
}, function (_ref2) {
|
|
72
|
-
var _pluginsProvider$acti;
|
|
73
|
-
var setEditViewPayload = _ref2.setEditViewPayload,
|
|
74
|
-
shouldActivateEditView = _ref2.shouldActivateEditView,
|
|
75
|
-
enableEditView = _ref2.enableEditView;
|
|
76
|
-
return jsx(FormContextProvider, {
|
|
77
|
-
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView && props !== null && props !== void 0 && props.onComplete ? enableEditView : undefined
|
|
78
|
-
}, jsx(InlineCreateContent, _extends({}, props, {
|
|
79
|
-
onCreate: ( /*#__PURE__*/function () {
|
|
80
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
|
|
81
|
-
var _props$onCreate;
|
|
82
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
83
|
-
while (1) switch (_context.prev = _context.next) {
|
|
84
|
-
case 0:
|
|
85
|
-
_context.next = 2;
|
|
86
|
-
return (_props$onCreate = props.onCreate) === null || _props$onCreate === void 0 ? void 0 : _props$onCreate.call(props, payload);
|
|
87
|
-
case 2:
|
|
88
|
-
// if onComplete exists then there is an edit flow
|
|
89
|
-
if (props.onComplete) {
|
|
90
|
-
if (shouldActivateEditView()) {
|
|
91
|
-
//edit button is pressed
|
|
92
|
-
setEditViewPayload(payload);
|
|
93
|
-
} else {
|
|
94
|
-
//create button is pressed
|
|
95
|
-
props.onComplete();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
case 3:
|
|
99
|
-
case "end":
|
|
100
|
-
return _context.stop();
|
|
101
|
-
}
|
|
102
|
-
}, _callee);
|
|
103
|
-
}));
|
|
104
|
-
return function (_x) {
|
|
105
|
-
return _ref3.apply(this, arguments);
|
|
106
|
-
};
|
|
107
|
-
}())
|
|
108
|
-
})));
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
export default InlineCreateOld;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @atlassian/tangerine/import/no-parent-imports */
|
|
2
|
-
/**
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { memo } from 'react';
|
|
7
|
-
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
10
|
-
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
-
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
12
|
-
import { PACKAGE_DATA } from '../../../common/constants';
|
|
13
|
-
import { ErrorBoundary } from '../../../common/ui/error-boundary';
|
|
14
|
-
import { ErrorBoundaryModal } from '../../../common/ui/error-boundary-modal';
|
|
15
|
-
import { Experience } from '../../../common/ui/experience-tracker';
|
|
16
|
-
import { withLinkCreateAnalyticsContext } from '../../../common/utils/analytics';
|
|
17
|
-
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
18
|
-
import i18nEN from '../../../i18n/en';
|
|
19
|
-
import LinkCreate from '../main';
|
|
20
|
-
var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (props) {
|
|
21
|
-
return jsx(Experience, null, jsx(ErrorBoundary, {
|
|
22
|
-
errorComponent: jsx(ErrorBoundaryModal, {
|
|
23
|
-
active: props.active,
|
|
24
|
-
onClose: props.onCancel
|
|
25
|
-
})
|
|
26
|
-
}, jsx(LinkCreate, props)));
|
|
27
|
-
}));
|
|
28
|
-
var ComposedLinkCreateOld = /*#__PURE__*/memo(function (props) {
|
|
29
|
-
return jsx(AnalyticsContext, {
|
|
30
|
-
data: PACKAGE_DATA
|
|
31
|
-
}, jsx(IntlMessagesProvider, {
|
|
32
|
-
defaultMessages: i18nEN,
|
|
33
|
-
loaderFn: fetchMessagesForLocale
|
|
34
|
-
}, jsx(LinkCreateWithAnalyticsContext, props)));
|
|
35
|
-
});
|
|
36
|
-
export default ComposedLinkCreateOld;
|