@atlaskit/give-kudos 2.0.0 → 2.0.2
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 +28 -16
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/messages.js +1 -2
- package/dist/cjs/types.js +6 -5
- package/dist/cjs/ui/GiveKudosLauncher/index.js +2 -3
- package/dist/cjs/ui/GiveKudosLauncher/main.js +83 -76
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/types.js +4 -1
- package/dist/es2019/ui/GiveKudosLauncher/main.js +78 -70
- package/dist/esm/index.js +1 -1
- package/dist/esm/types.js +4 -1
- package/dist/esm/ui/GiveKudosLauncher/main.js +83 -75
- package/dist/types/index.d.ts +2 -2
- package/dist/types/types.d.ts +17 -0
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/types.d.ts +17 -0
- package/package.json +8 -8
- package/report.api.md +26 -0
- package/tmp/api-report-tmp.d.ts +26 -0
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
# @atlassian/give-kudos
|
|
2
2
|
|
|
3
|
+
## 2.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43141](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43141) [`90eb988ffd4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90eb988ffd4) - Add typecheck for GiveKudosLauncher JSON.parse call
|
|
8
|
+
|
|
9
|
+
## 2.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#38301](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38301) [`7490bbf65f2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7490bbf65f2) - Exporting types
|
|
14
|
+
|
|
3
15
|
## 2.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
|
6
18
|
|
|
7
|
-
- [`4ebab06438a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ebab06438a) - [ux] Added types for the flag event listener. Added new flags for jira kudos success and failure.
|
|
19
|
+
- [#36918](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36918) [`4ebab06438a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ebab06438a) - [ux] Added types for the flag event listener. Added new flags for jira kudos success and failure.
|
|
8
20
|
|
|
9
21
|
## 1.1.3
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
|
-
- [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
|
|
25
|
+
- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443) [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing unused dependencies and dev dependencies
|
|
14
26
|
|
|
15
27
|
## 1.1.2
|
|
16
28
|
|
|
17
29
|
### Patch Changes
|
|
18
30
|
|
|
19
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
31
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
20
32
|
|
|
21
33
|
## 1.1.1
|
|
22
34
|
|
|
23
35
|
### Patch Changes
|
|
24
36
|
|
|
25
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
37
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
26
38
|
|
|
27
39
|
## 1.1.0
|
|
28
40
|
|
|
29
41
|
### Minor Changes
|
|
30
42
|
|
|
31
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
43
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
32
44
|
|
|
33
45
|
### Patch Changes
|
|
34
46
|
|
|
@@ -38,7 +50,7 @@
|
|
|
38
50
|
|
|
39
51
|
### Patch Changes
|
|
40
52
|
|
|
41
|
-
- [`97a77b71c06`](https://bitbucket.org/atlassian/atlassian-frontend/commits/97a77b71c06) - Remove unneded @emotion/core devDep.
|
|
53
|
+
- [#30930](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30930) [`97a77b71c06`](https://bitbucket.org/atlassian/atlassian-frontend/commits/97a77b71c06) - Remove unneded @emotion/core devDep.
|
|
42
54
|
|
|
43
55
|
## 1.0.5
|
|
44
56
|
|
|
@@ -56,7 +68,7 @@
|
|
|
56
68
|
|
|
57
69
|
### Patch Changes
|
|
58
70
|
|
|
59
|
-
- [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving performance.
|
|
71
|
+
- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324) [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving performance.
|
|
60
72
|
|
|
61
73
|
## 1.0.2
|
|
62
74
|
|
|
@@ -74,7 +86,7 @@
|
|
|
74
86
|
|
|
75
87
|
### Major Changes
|
|
76
88
|
|
|
77
|
-
- [`e4c65882fae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4c65882fae) - Migrating from styled-components to emotion to fix VULN-1026121
|
|
89
|
+
- [#27889](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27889) [`e4c65882fae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e4c65882fae) - Migrating from styled-components to emotion to fix VULN-1026121
|
|
78
90
|
|
|
79
91
|
## 0.8.1
|
|
80
92
|
|
|
@@ -86,49 +98,49 @@
|
|
|
86
98
|
|
|
87
99
|
### Minor Changes
|
|
88
100
|
|
|
89
|
-
- [`62d324028bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62d324028bb) - Set z index for kudos drawer to modal layer
|
|
101
|
+
- [#25940](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25940) [`62d324028bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62d324028bb) - Set z index for kudos drawer to modal layer
|
|
90
102
|
|
|
91
103
|
## 0.7.0
|
|
92
104
|
|
|
93
105
|
### Minor Changes
|
|
94
106
|
|
|
95
|
-
- [`8561663af05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8561663af05) - Add analytics when kudos drawer opened
|
|
107
|
+
- [#23625](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23625) [`8561663af05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8561663af05) - Add analytics when kudos drawer opened
|
|
96
108
|
|
|
97
109
|
## 0.6.0
|
|
98
110
|
|
|
99
111
|
### Minor Changes
|
|
100
112
|
|
|
101
|
-
- [`5f8c2104be0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f8c2104be0) - [ux] Add icon to kudos created flag and increase kudos drawer z index
|
|
113
|
+
- [#23706](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23706) [`5f8c2104be0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f8c2104be0) - [ux] Add icon to kudos created flag and increase kudos drawer z index
|
|
102
114
|
|
|
103
115
|
## 0.5.0
|
|
104
116
|
|
|
105
117
|
### Minor Changes
|
|
106
118
|
|
|
107
|
-
- [`e5fbc101e73`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e5fbc101e73) - Remove analytics prop from give kudos component
|
|
119
|
+
- [#23074](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23074) [`e5fbc101e73`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e5fbc101e73) - Remove analytics prop from give kudos component
|
|
108
120
|
|
|
109
121
|
## 0.4.0
|
|
110
122
|
|
|
111
123
|
### Minor Changes
|
|
112
124
|
|
|
113
|
-
- [`f0564695480`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f0564695480) - Move GiveKudosLauncher into a Portal
|
|
125
|
+
- [#22915](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22915) [`f0564695480`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f0564695480) - Move GiveKudosLauncher into a Portal
|
|
114
126
|
|
|
115
127
|
## 0.3.0
|
|
116
128
|
|
|
117
129
|
### Minor Changes
|
|
118
130
|
|
|
119
|
-
- [`e2eac5d9f0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2eac5d9f0c) - [ux] Add lazy loading support
|
|
131
|
+
- [#22527](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22527) [`e2eac5d9f0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2eac5d9f0c) - [ux] Add lazy loading support
|
|
120
132
|
|
|
121
133
|
## 0.2.0
|
|
122
134
|
|
|
123
135
|
### Minor Changes
|
|
124
136
|
|
|
125
|
-
- [`dd476d8114a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd476d8114a) - [ux] Move give kudos to a public package and rename to atlaskit/give-kudos
|
|
137
|
+
- [#22495](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22495) [`dd476d8114a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd476d8114a) - [ux] Move give kudos to a public package and rename to atlaskit/give-kudos
|
|
126
138
|
|
|
127
139
|
## 0.1.0
|
|
128
140
|
|
|
129
141
|
### Minor Changes
|
|
130
142
|
|
|
131
|
-
- [`5bf301d7026`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bf301d7026) - [ux] Initial release
|
|
143
|
+
- [#22426](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22426) [`5bf301d7026`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bf301d7026) - [ux] Initial release
|
|
132
144
|
|
|
133
145
|
## 0.0.1
|
|
134
146
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "FlagEventType", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _types.FlagEventType;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "GiveKudosLauncher", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
package/dist/cjs/messages.js
CHANGED
package/dist/cjs/types.js
CHANGED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.KudosType = exports.FlagEventType = void 0;
|
|
7
|
-
var KudosType = /*#__PURE__*/function (KudosType) {
|
|
6
|
+
exports.isFlagEventTypeValue = exports.KudosType = exports.FlagEventType = void 0;
|
|
7
|
+
var KudosType = exports.KudosType = /*#__PURE__*/function (KudosType) {
|
|
8
8
|
KudosType["INDIVIDUAL"] = "individual";
|
|
9
9
|
KudosType["TEAM"] = "team";
|
|
10
10
|
return KudosType;
|
|
11
11
|
}({});
|
|
12
|
-
exports.
|
|
13
|
-
var FlagEventType = /*#__PURE__*/function (FlagEventType) {
|
|
12
|
+
var FlagEventType = exports.FlagEventType = /*#__PURE__*/function (FlagEventType) {
|
|
14
13
|
FlagEventType["KUDOS_CREATED"] = "kudos-created";
|
|
15
14
|
FlagEventType["JIRA_KUDOS_CREATED"] = "jira-kudos-created";
|
|
16
15
|
FlagEventType["JIRA_KUDOS_FAILED"] = "jira-kudos-failed";
|
|
@@ -18,4 +17,6 @@ var FlagEventType = /*#__PURE__*/function (FlagEventType) {
|
|
|
18
17
|
FlagEventType["CLOSE"] = "close";
|
|
19
18
|
return FlagEventType;
|
|
20
19
|
}({});
|
|
21
|
-
exports.
|
|
20
|
+
var isFlagEventTypeValue = exports.isFlagEventTypeValue = function isFlagEventTypeValue(value) {
|
|
21
|
+
return Object.values(FlagEventType).includes(value);
|
|
22
|
+
};
|
|
@@ -9,10 +9,9 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
var GiveKudosLauncherLazy = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
12
|
+
var GiveKudosLauncherLazy = exports.GiveKudosLauncherLazy = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
13
13
|
return Promise.resolve().then(function () {
|
|
14
14
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_lazy-give-kudos" */
|
|
15
15
|
'./main'));
|
|
16
16
|
});
|
|
17
|
-
});
|
|
18
|
-
exports.GiveKudosLauncherLazy = GiveKudosLauncherLazy;
|
|
17
|
+
});
|
|
@@ -25,8 +25,8 @@ var _messages = _interopRequireDefault(require("../../messages"));
|
|
|
25
25
|
var _types = require("../../types");
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
-
function ownKeys(
|
|
29
|
-
function _objectSpread(
|
|
28
|
+
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; }
|
|
29
|
+
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) { (0, _defineProperty2.default)(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; } /** @jsx jsx */
|
|
30
30
|
var iframeStyles = (0, _react2.css)({
|
|
31
31
|
border: 0
|
|
32
32
|
});
|
|
@@ -92,82 +92,83 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
|
|
|
92
92
|
setIsCloseConfirmModalOpen(false);
|
|
93
93
|
};
|
|
94
94
|
var createFlagWithJsonStringifiedInput = (0, _react.useCallback)(function (flagEvent) {
|
|
95
|
-
|
|
95
|
+
var handleCreateOrFail = function handleCreateOrFail(addFlagConfig) {
|
|
96
96
|
closeDrawer();
|
|
97
97
|
sendAnalytic('created', {});
|
|
98
|
-
if (
|
|
99
|
-
|
|
98
|
+
if (flagEvent.kudosUuid || flagEvent.jiraKudosUrl) {
|
|
99
|
+
addFlag && addFlag(addFlagConfig);
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
};
|
|
102
|
+
switch (flagEvent.eventType) {
|
|
103
|
+
case _types.FlagEventType.KUDOS_CREATED:
|
|
104
|
+
handleCreateOrFail({
|
|
105
|
+
title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.kudosCreatedFlag),
|
|
106
|
+
id: "kudosCreatedFlag-".concat(flagEvent.kudosUuid),
|
|
107
|
+
description: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.default.kudosCreatedDescriptionFlag, {
|
|
108
|
+
values: {
|
|
109
|
+
a: function a(s) {
|
|
110
|
+
return (0, _react2.jsx)("a", {
|
|
111
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
112
|
+
}, s);
|
|
113
|
+
}
|
|
110
114
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.JiraKudosCreationFailedFlag),
|
|
148
|
-
id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
|
|
149
|
-
description: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.default.JiraKudosCreationFailedDescriptionFlag, {
|
|
150
|
-
values: {
|
|
151
|
-
a: function a(s) {
|
|
152
|
-
return (0, _react2.jsx)("a", {
|
|
153
|
-
href: flagEvent.jiraKudosFormUrl
|
|
154
|
-
}, s);
|
|
115
|
+
})),
|
|
116
|
+
icon: (0, _react2.jsx)(_checkCircle.default, {
|
|
117
|
+
label: "success",
|
|
118
|
+
primaryColor: "var(--ds-icon-success, ".concat(_colors.G300, ")")
|
|
119
|
+
})
|
|
120
|
+
});
|
|
121
|
+
break;
|
|
122
|
+
case _types.FlagEventType.JIRA_KUDOS_CREATED:
|
|
123
|
+
handleCreateOrFail({
|
|
124
|
+
title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.JiraKudosCreatedFlag),
|
|
125
|
+
id: "kudosCreatedFlag-".concat(flagEvent.kudosUuid),
|
|
126
|
+
description: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.JiraKudosCreatedDescriptionFlag),
|
|
127
|
+
icon: (0, _react2.jsx)(_checkCircle.default, {
|
|
128
|
+
label: "success",
|
|
129
|
+
primaryColor: "var(--ds-icon-success, ".concat(_colors.G300, ")")
|
|
130
|
+
}),
|
|
131
|
+
actions: [{
|
|
132
|
+
content: 'Track gift request',
|
|
133
|
+
href: flagEvent.jiraKudosUrl
|
|
134
|
+
}, {
|
|
135
|
+
content: 'View kudos',
|
|
136
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
137
|
+
}]
|
|
138
|
+
});
|
|
139
|
+
break;
|
|
140
|
+
case _types.FlagEventType.JIRA_KUDOS_FAILED:
|
|
141
|
+
handleCreateOrFail({
|
|
142
|
+
title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.JiraKudosCreationFailedFlag),
|
|
143
|
+
id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
|
|
144
|
+
description: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.default.JiraKudosCreationFailedDescriptionFlag, {
|
|
145
|
+
values: {
|
|
146
|
+
a: function a(s) {
|
|
147
|
+
return (0, _react2.jsx)("a", {
|
|
148
|
+
href: flagEvent.jiraKudosFormUrl
|
|
149
|
+
}, s);
|
|
150
|
+
}
|
|
155
151
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
})),
|
|
153
|
+
type: 'warning',
|
|
154
|
+
actions: [{
|
|
155
|
+
content: 'Visit go/kudos',
|
|
156
|
+
href: flagEvent.jiraKudosFormUrl
|
|
157
|
+
}, {
|
|
158
|
+
content: 'View kudos',
|
|
159
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
160
|
+
}]
|
|
161
|
+
});
|
|
162
|
+
break;
|
|
163
|
+
case _types.FlagEventType.DIRTY:
|
|
164
|
+
setIsDirty(true);
|
|
165
|
+
break;
|
|
166
|
+
case _types.FlagEventType.CLOSE:
|
|
167
|
+
closeDrawer();
|
|
168
|
+
break;
|
|
169
|
+
default:
|
|
170
|
+
// Not a known FlagEventType
|
|
171
|
+
return;
|
|
171
172
|
}
|
|
172
173
|
}, [addFlag, closeDrawer, sendAnalytic, teamCentralBaseUrl]);
|
|
173
174
|
var messageListener = (0, _react.useCallback)(function (event) {
|
|
@@ -202,7 +203,14 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
|
|
|
202
203
|
closeDrawer();
|
|
203
204
|
}
|
|
204
205
|
} else {
|
|
205
|
-
|
|
206
|
+
try {
|
|
207
|
+
var eventData = JSON.parse(event.data);
|
|
208
|
+
if (eventData.eventType && (0, _types.isFlagEventTypeValue)(eventData.eventType)) {
|
|
209
|
+
createFlagWithJsonStringifiedInput(eventData);
|
|
210
|
+
}
|
|
211
|
+
} catch (e) {
|
|
212
|
+
// Swallow any errors
|
|
213
|
+
}
|
|
206
214
|
}
|
|
207
215
|
}, [props.isOpen, closeDrawer, sendAnalytic, addFlag, teamCentralBaseUrl, createFlagWithJsonStringifiedInput]);
|
|
208
216
|
(0, _react.useEffect)(function () {
|
|
@@ -306,5 +314,4 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
|
|
|
306
314
|
}
|
|
307
315
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.unsavedKudosWarningCloseButton))))), renderDrawer));
|
|
308
316
|
};
|
|
309
|
-
var _default = GiveKudosLauncher;
|
|
310
|
-
exports.default = _default;
|
|
317
|
+
var _default = exports.default = GiveKudosLauncher;
|
package/dist/es2019/index.js
CHANGED
package/dist/es2019/types.js
CHANGED
|
@@ -10,4 +10,7 @@ export let FlagEventType = /*#__PURE__*/function (FlagEventType) {
|
|
|
10
10
|
FlagEventType["DIRTY"] = "dirty";
|
|
11
11
|
FlagEventType["CLOSE"] = "close";
|
|
12
12
|
return FlagEventType;
|
|
13
|
-
}({});
|
|
13
|
+
}({});
|
|
14
|
+
export const isFlagEventTypeValue = value => {
|
|
15
|
+
return Object.values(FlagEventType).includes(value);
|
|
16
|
+
};
|
|
@@ -14,7 +14,7 @@ import Portal from '@atlaskit/portal';
|
|
|
14
14
|
import { G300 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { layers } from '@atlaskit/theme/constants';
|
|
16
16
|
import messages from '../../messages';
|
|
17
|
-
import { FlagEventType } from '../../types';
|
|
17
|
+
import { FlagEventType, isFlagEventTypeValue } from '../../types';
|
|
18
18
|
const iframeStyles = css({
|
|
19
19
|
border: 0
|
|
20
20
|
});
|
|
@@ -78,78 +78,79 @@ const GiveKudosLauncher = props => {
|
|
|
78
78
|
setIsCloseConfirmModalOpen(false);
|
|
79
79
|
};
|
|
80
80
|
const createFlagWithJsonStringifiedInput = useCallback(flagEvent => {
|
|
81
|
-
|
|
81
|
+
const handleCreateOrFail = addFlagConfig => {
|
|
82
82
|
closeDrawer();
|
|
83
83
|
sendAnalytic('created', {});
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
addFlag && addFlag({
|
|
88
|
-
title: jsx(FormattedMessage, messages.kudosCreatedFlag),
|
|
89
|
-
id: `kudosCreatedFlag-${flagEvent.kudosUuid}`,
|
|
90
|
-
description: jsx(FormattedMessage, _extends({}, messages.kudosCreatedDescriptionFlag, {
|
|
91
|
-
values: {
|
|
92
|
-
a: s => jsx("a", {
|
|
93
|
-
href: `${teamCentralBaseUrl}/people/kudos/${flagEvent.kudosUuid}`
|
|
94
|
-
}, s)
|
|
95
|
-
}
|
|
96
|
-
})),
|
|
97
|
-
icon: jsx(SuccessIcon, {
|
|
98
|
-
label: "success",
|
|
99
|
-
primaryColor: `var(--ds-icon-success, ${G300})`
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
} else if (flagEvent.eventType === FlagEventType.JIRA_KUDOS_CREATED) {
|
|
103
|
-
closeDrawer();
|
|
104
|
-
sendAnalytic('created', {});
|
|
105
|
-
if (!flagEvent.kudosUuid || !flagEvent.jiraKudosUrl) {
|
|
106
|
-
return;
|
|
84
|
+
if (flagEvent.kudosUuid || flagEvent.jiraKudosUrl) {
|
|
85
|
+
addFlag && addFlag(addFlagConfig);
|
|
107
86
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
87
|
+
};
|
|
88
|
+
switch (flagEvent.eventType) {
|
|
89
|
+
case FlagEventType.KUDOS_CREATED:
|
|
90
|
+
handleCreateOrFail({
|
|
91
|
+
title: jsx(FormattedMessage, messages.kudosCreatedFlag),
|
|
92
|
+
id: `kudosCreatedFlag-${flagEvent.kudosUuid}`,
|
|
93
|
+
description: jsx(FormattedMessage, _extends({}, messages.kudosCreatedDescriptionFlag, {
|
|
94
|
+
values: {
|
|
95
|
+
a: s => jsx("a", {
|
|
96
|
+
href: `${teamCentralBaseUrl}/people/kudos/${flagEvent.kudosUuid}`
|
|
97
|
+
}, s)
|
|
98
|
+
}
|
|
99
|
+
})),
|
|
100
|
+
icon: jsx(SuccessIcon, {
|
|
101
|
+
label: "success",
|
|
102
|
+
primaryColor: `var(--ds-icon-success, ${G300})`
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
case FlagEventType.JIRA_KUDOS_CREATED:
|
|
107
|
+
handleCreateOrFail({
|
|
108
|
+
title: jsx(FormattedMessage, messages.JiraKudosCreatedFlag),
|
|
109
|
+
id: `kudosCreatedFlag-${flagEvent.kudosUuid}`,
|
|
110
|
+
description: jsx(FormattedMessage, messages.JiraKudosCreatedDescriptionFlag),
|
|
111
|
+
icon: jsx(SuccessIcon, {
|
|
112
|
+
label: "success",
|
|
113
|
+
primaryColor: `var(--ds-icon-success, ${G300})`
|
|
114
|
+
}),
|
|
115
|
+
actions: [{
|
|
116
|
+
content: 'Track gift request',
|
|
117
|
+
href: flagEvent.jiraKudosUrl
|
|
118
|
+
}, {
|
|
119
|
+
content: 'View kudos',
|
|
120
|
+
href: `${teamCentralBaseUrl}/people/kudos/${flagEvent.kudosUuid}`
|
|
121
|
+
}]
|
|
122
|
+
});
|
|
123
|
+
break;
|
|
124
|
+
case FlagEventType.JIRA_KUDOS_FAILED:
|
|
125
|
+
handleCreateOrFail({
|
|
126
|
+
title: jsx(FormattedMessage, messages.JiraKudosCreationFailedFlag),
|
|
127
|
+
id: `jiraKudosCreationFailedFlag-${flagEvent.kudosUuid}`,
|
|
128
|
+
description: jsx(FormattedMessage, _extends({}, messages.JiraKudosCreationFailedDescriptionFlag, {
|
|
129
|
+
values: {
|
|
130
|
+
a: s => jsx("a", {
|
|
131
|
+
href: flagEvent.jiraKudosFormUrl
|
|
132
|
+
}, s)
|
|
133
|
+
}
|
|
134
|
+
})),
|
|
135
|
+
type: 'warning',
|
|
136
|
+
actions: [{
|
|
137
|
+
content: 'Visit go/kudos',
|
|
138
|
+
href: flagEvent.jiraKudosFormUrl
|
|
139
|
+
}, {
|
|
140
|
+
content: 'View kudos',
|
|
141
|
+
href: `${teamCentralBaseUrl}/people/kudos/${flagEvent.kudosUuid}`
|
|
142
|
+
}]
|
|
143
|
+
});
|
|
144
|
+
break;
|
|
145
|
+
case FlagEventType.DIRTY:
|
|
146
|
+
setIsDirty(true);
|
|
147
|
+
break;
|
|
148
|
+
case FlagEventType.CLOSE:
|
|
149
|
+
closeDrawer();
|
|
150
|
+
break;
|
|
151
|
+
default:
|
|
152
|
+
// Not a known FlagEventType
|
|
128
153
|
return;
|
|
129
|
-
}
|
|
130
|
-
addFlag && addFlag({
|
|
131
|
-
title: jsx(FormattedMessage, messages.JiraKudosCreationFailedFlag),
|
|
132
|
-
id: `jiraKudosCreationFailedFlag-${flagEvent.kudosUuid}`,
|
|
133
|
-
description: jsx(FormattedMessage, _extends({}, messages.JiraKudosCreationFailedDescriptionFlag, {
|
|
134
|
-
values: {
|
|
135
|
-
a: s => jsx("a", {
|
|
136
|
-
href: flagEvent.jiraKudosFormUrl
|
|
137
|
-
}, s)
|
|
138
|
-
}
|
|
139
|
-
})),
|
|
140
|
-
type: 'warning',
|
|
141
|
-
actions: [{
|
|
142
|
-
content: 'Visit go/kudos',
|
|
143
|
-
href: flagEvent.jiraKudosFormUrl
|
|
144
|
-
}, {
|
|
145
|
-
content: 'View kudos',
|
|
146
|
-
href: `${teamCentralBaseUrl}/people/kudos/${flagEvent.kudosUuid}`
|
|
147
|
-
}]
|
|
148
|
-
});
|
|
149
|
-
} else if (flagEvent.eventType === FlagEventType.DIRTY) {
|
|
150
|
-
setIsDirty(true);
|
|
151
|
-
} else if (flagEvent.eventType === FlagEventType.CLOSE) {
|
|
152
|
-
closeDrawer();
|
|
153
154
|
}
|
|
154
155
|
}, [addFlag, closeDrawer, sendAnalytic, teamCentralBaseUrl]);
|
|
155
156
|
const messageListener = useCallback(event => {
|
|
@@ -182,7 +183,14 @@ const GiveKudosLauncher = props => {
|
|
|
182
183
|
closeDrawer();
|
|
183
184
|
}
|
|
184
185
|
} else {
|
|
185
|
-
|
|
186
|
+
try {
|
|
187
|
+
const eventData = JSON.parse(event.data);
|
|
188
|
+
if (eventData.eventType && isFlagEventTypeValue(eventData.eventType)) {
|
|
189
|
+
createFlagWithJsonStringifiedInput(eventData);
|
|
190
|
+
}
|
|
191
|
+
} catch (e) {
|
|
192
|
+
// Swallow any errors
|
|
193
|
+
}
|
|
186
194
|
}
|
|
187
195
|
}, [props.isOpen, closeDrawer, sendAnalytic, addFlag, teamCentralBaseUrl, createFlagWithJsonStringifiedInput]);
|
|
188
196
|
useEffect(() => {
|
package/dist/esm/index.js
CHANGED
package/dist/esm/types.js
CHANGED
|
@@ -10,4 +10,7 @@ export var FlagEventType = /*#__PURE__*/function (FlagEventType) {
|
|
|
10
10
|
FlagEventType["DIRTY"] = "dirty";
|
|
11
11
|
FlagEventType["CLOSE"] = "close";
|
|
12
12
|
return FlagEventType;
|
|
13
|
-
}({});
|
|
13
|
+
}({});
|
|
14
|
+
export var isFlagEventTypeValue = function isFlagEventTypeValue(value) {
|
|
15
|
+
return Object.values(FlagEventType).includes(value);
|
|
16
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
function ownKeys(
|
|
5
|
-
function _objectSpread(
|
|
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
6
|
/** @jsx jsx */
|
|
7
7
|
|
|
8
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -18,7 +18,7 @@ import Portal from '@atlaskit/portal';
|
|
|
18
18
|
import { G300 } from '@atlaskit/theme/colors';
|
|
19
19
|
import { layers } from '@atlaskit/theme/constants';
|
|
20
20
|
import messages from '../../messages';
|
|
21
|
-
import { FlagEventType } from '../../types';
|
|
21
|
+
import { FlagEventType, isFlagEventTypeValue } from '../../types';
|
|
22
22
|
var iframeStyles = css({
|
|
23
23
|
border: 0
|
|
24
24
|
});
|
|
@@ -84,82 +84,83 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
|
|
|
84
84
|
setIsCloseConfirmModalOpen(false);
|
|
85
85
|
};
|
|
86
86
|
var createFlagWithJsonStringifiedInput = useCallback(function (flagEvent) {
|
|
87
|
-
|
|
87
|
+
var handleCreateOrFail = function handleCreateOrFail(addFlagConfig) {
|
|
88
88
|
closeDrawer();
|
|
89
89
|
sendAnalytic('created', {});
|
|
90
|
-
if (
|
|
91
|
-
|
|
90
|
+
if (flagEvent.kudosUuid || flagEvent.jiraKudosUrl) {
|
|
91
|
+
addFlag && addFlag(addFlagConfig);
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
};
|
|
94
|
+
switch (flagEvent.eventType) {
|
|
95
|
+
case FlagEventType.KUDOS_CREATED:
|
|
96
|
+
handleCreateOrFail({
|
|
97
|
+
title: jsx(FormattedMessage, messages.kudosCreatedFlag),
|
|
98
|
+
id: "kudosCreatedFlag-".concat(flagEvent.kudosUuid),
|
|
99
|
+
description: jsx(FormattedMessage, _extends({}, messages.kudosCreatedDescriptionFlag, {
|
|
100
|
+
values: {
|
|
101
|
+
a: function a(s) {
|
|
102
|
+
return jsx("a", {
|
|
103
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
104
|
+
}, s);
|
|
105
|
+
}
|
|
102
106
|
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
title: jsx(FormattedMessage, messages.JiraKudosCreationFailedFlag),
|
|
140
|
-
id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
|
|
141
|
-
description: jsx(FormattedMessage, _extends({}, messages.JiraKudosCreationFailedDescriptionFlag, {
|
|
142
|
-
values: {
|
|
143
|
-
a: function a(s) {
|
|
144
|
-
return jsx("a", {
|
|
145
|
-
href: flagEvent.jiraKudosFormUrl
|
|
146
|
-
}, s);
|
|
107
|
+
})),
|
|
108
|
+
icon: jsx(SuccessIcon, {
|
|
109
|
+
label: "success",
|
|
110
|
+
primaryColor: "var(--ds-icon-success, ".concat(G300, ")")
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
break;
|
|
114
|
+
case FlagEventType.JIRA_KUDOS_CREATED:
|
|
115
|
+
handleCreateOrFail({
|
|
116
|
+
title: jsx(FormattedMessage, messages.JiraKudosCreatedFlag),
|
|
117
|
+
id: "kudosCreatedFlag-".concat(flagEvent.kudosUuid),
|
|
118
|
+
description: jsx(FormattedMessage, messages.JiraKudosCreatedDescriptionFlag),
|
|
119
|
+
icon: jsx(SuccessIcon, {
|
|
120
|
+
label: "success",
|
|
121
|
+
primaryColor: "var(--ds-icon-success, ".concat(G300, ")")
|
|
122
|
+
}),
|
|
123
|
+
actions: [{
|
|
124
|
+
content: 'Track gift request',
|
|
125
|
+
href: flagEvent.jiraKudosUrl
|
|
126
|
+
}, {
|
|
127
|
+
content: 'View kudos',
|
|
128
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
129
|
+
}]
|
|
130
|
+
});
|
|
131
|
+
break;
|
|
132
|
+
case FlagEventType.JIRA_KUDOS_FAILED:
|
|
133
|
+
handleCreateOrFail({
|
|
134
|
+
title: jsx(FormattedMessage, messages.JiraKudosCreationFailedFlag),
|
|
135
|
+
id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
|
|
136
|
+
description: jsx(FormattedMessage, _extends({}, messages.JiraKudosCreationFailedDescriptionFlag, {
|
|
137
|
+
values: {
|
|
138
|
+
a: function a(s) {
|
|
139
|
+
return jsx("a", {
|
|
140
|
+
href: flagEvent.jiraKudosFormUrl
|
|
141
|
+
}, s);
|
|
142
|
+
}
|
|
147
143
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
144
|
+
})),
|
|
145
|
+
type: 'warning',
|
|
146
|
+
actions: [{
|
|
147
|
+
content: 'Visit go/kudos',
|
|
148
|
+
href: flagEvent.jiraKudosFormUrl
|
|
149
|
+
}, {
|
|
150
|
+
content: 'View kudos',
|
|
151
|
+
href: "".concat(teamCentralBaseUrl, "/people/kudos/").concat(flagEvent.kudosUuid)
|
|
152
|
+
}]
|
|
153
|
+
});
|
|
154
|
+
break;
|
|
155
|
+
case FlagEventType.DIRTY:
|
|
156
|
+
setIsDirty(true);
|
|
157
|
+
break;
|
|
158
|
+
case FlagEventType.CLOSE:
|
|
159
|
+
closeDrawer();
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
// Not a known FlagEventType
|
|
163
|
+
return;
|
|
163
164
|
}
|
|
164
165
|
}, [addFlag, closeDrawer, sendAnalytic, teamCentralBaseUrl]);
|
|
165
166
|
var messageListener = useCallback(function (event) {
|
|
@@ -194,7 +195,14 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
|
|
|
194
195
|
closeDrawer();
|
|
195
196
|
}
|
|
196
197
|
} else {
|
|
197
|
-
|
|
198
|
+
try {
|
|
199
|
+
var eventData = JSON.parse(event.data);
|
|
200
|
+
if (eventData.eventType && isFlagEventTypeValue(eventData.eventType)) {
|
|
201
|
+
createFlagWithJsonStringifiedInput(eventData);
|
|
202
|
+
}
|
|
203
|
+
} catch (e) {
|
|
204
|
+
// Swallow any errors
|
|
205
|
+
}
|
|
198
206
|
}
|
|
199
207
|
}, [props.isOpen, closeDrawer, sendAnalytic, addFlag, teamCentralBaseUrl, createFlagWithJsonStringifiedInput]);
|
|
200
208
|
useEffect(function () {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { KudosRecipient, GiveKudosDrawerProps } from './types';
|
|
2
|
-
export { KudosType } from './types';
|
|
1
|
+
export type { KudosRecipient, GiveKudosDrawerProps, FlagEvent } from './types';
|
|
2
|
+
export { KudosType, FlagEventType } from './types';
|
|
3
3
|
import GiveKudosLauncher from './ui/GiveKudosLauncher/main';
|
|
4
4
|
export { GiveKudosLauncher };
|
|
5
5
|
export { GiveKudosLauncherLazy } from './ui/GiveKudosLauncher';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare enum KudosType {
|
|
2
3
|
INDIVIDUAL = "individual",
|
|
3
4
|
TEAM = "team"
|
|
@@ -9,6 +10,21 @@ export declare enum FlagEventType {
|
|
|
9
10
|
DIRTY = "dirty",
|
|
10
11
|
CLOSE = "close"
|
|
11
12
|
}
|
|
13
|
+
export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
|
|
14
|
+
type FlagType = 'error' | 'warning' | 'success' | 'info';
|
|
15
|
+
interface FlagAction {
|
|
16
|
+
content: string | JSX.Element;
|
|
17
|
+
href?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface Flag {
|
|
21
|
+
id: string | number;
|
|
22
|
+
title: string | JSX.Element;
|
|
23
|
+
description: string | JSX.Element;
|
|
24
|
+
icon?: JSX.Element;
|
|
25
|
+
actions?: FlagAction[];
|
|
26
|
+
type?: FlagType;
|
|
27
|
+
}
|
|
12
28
|
export interface KudosRecipient {
|
|
13
29
|
type: KudosType;
|
|
14
30
|
recipientId: string;
|
|
@@ -29,3 +45,4 @@ export interface GiveKudosDrawerProps {
|
|
|
29
45
|
cloudId: string;
|
|
30
46
|
addFlag?: (flag: any) => void;
|
|
31
47
|
}
|
|
48
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { KudosRecipient, GiveKudosDrawerProps } from './types';
|
|
2
|
-
export { KudosType } from './types';
|
|
1
|
+
export type { KudosRecipient, GiveKudosDrawerProps, FlagEvent } from './types';
|
|
2
|
+
export { KudosType, FlagEventType } from './types';
|
|
3
3
|
import GiveKudosLauncher from './ui/GiveKudosLauncher/main';
|
|
4
4
|
export { GiveKudosLauncher };
|
|
5
5
|
export { GiveKudosLauncherLazy } from './ui/GiveKudosLauncher';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare enum KudosType {
|
|
2
3
|
INDIVIDUAL = "individual",
|
|
3
4
|
TEAM = "team"
|
|
@@ -9,6 +10,21 @@ export declare enum FlagEventType {
|
|
|
9
10
|
DIRTY = "dirty",
|
|
10
11
|
CLOSE = "close"
|
|
11
12
|
}
|
|
13
|
+
export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
|
|
14
|
+
type FlagType = 'error' | 'warning' | 'success' | 'info';
|
|
15
|
+
interface FlagAction {
|
|
16
|
+
content: string | JSX.Element;
|
|
17
|
+
href?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface Flag {
|
|
21
|
+
id: string | number;
|
|
22
|
+
title: string | JSX.Element;
|
|
23
|
+
description: string | JSX.Element;
|
|
24
|
+
icon?: JSX.Element;
|
|
25
|
+
actions?: FlagAction[];
|
|
26
|
+
type?: FlagType;
|
|
27
|
+
}
|
|
12
28
|
export interface KudosRecipient {
|
|
13
29
|
type: KudosType;
|
|
14
30
|
recipientId: string;
|
|
@@ -29,3 +45,4 @@ export interface GiveKudosDrawerProps {
|
|
|
29
45
|
cloudId: string;
|
|
30
46
|
addFlag?: (flag: any) => void;
|
|
31
47
|
}
|
|
48
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/give-kudos",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Give Kudos experience ",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
43
|
-
"@atlaskit/button": "^16.
|
|
44
|
-
"@atlaskit/drawer": "^7.
|
|
43
|
+
"@atlaskit/button": "^16.16.0",
|
|
44
|
+
"@atlaskit/drawer": "^7.6.0",
|
|
45
45
|
"@atlaskit/icon": "^21.12.0",
|
|
46
|
-
"@atlaskit/modal-dialog": "^12.
|
|
47
|
-
"@atlaskit/portal": "^4.
|
|
48
|
-
"@atlaskit/theme": "^12.
|
|
49
|
-
"@atlaskit/tokens": "^1.
|
|
46
|
+
"@atlaskit/modal-dialog": "^12.8.0",
|
|
47
|
+
"@atlaskit/portal": "^4.4.0",
|
|
48
|
+
"@atlaskit/theme": "^12.6.0",
|
|
49
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|
|
52
52
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react": "^16.8.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
+
"@af/integration-testing": "*",
|
|
58
59
|
"@atlaskit/ssr": "*",
|
|
59
|
-
"@atlaskit/tokens": "^1.12.0",
|
|
60
60
|
"@atlaskit/webdriver-runner": "*",
|
|
61
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
62
62
|
"@testing-library/react": "^12.1.5",
|
package/report.api.md
CHANGED
|
@@ -20,6 +20,32 @@
|
|
|
20
20
|
import { jsx } from '@emotion/react';
|
|
21
21
|
import { LazyExoticComponent } from 'react';
|
|
22
22
|
|
|
23
|
+
// @public (undocumented)
|
|
24
|
+
export interface FlagEvent {
|
|
25
|
+
// (undocumented)
|
|
26
|
+
eventType: FlagEventType;
|
|
27
|
+
// (undocumented)
|
|
28
|
+
jiraKudosFormUrl?: string;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
jiraKudosUrl?: string;
|
|
31
|
+
// (undocumented)
|
|
32
|
+
kudosUuid?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// @public (undocumented)
|
|
36
|
+
export enum FlagEventType {
|
|
37
|
+
// (undocumented)
|
|
38
|
+
CLOSE = 'close',
|
|
39
|
+
// (undocumented)
|
|
40
|
+
DIRTY = 'dirty',
|
|
41
|
+
// (undocumented)
|
|
42
|
+
JIRA_KUDOS_CREATED = 'jira-kudos-created',
|
|
43
|
+
// (undocumented)
|
|
44
|
+
JIRA_KUDOS_FAILED = 'jira-kudos-failed',
|
|
45
|
+
// (undocumented)
|
|
46
|
+
KUDOS_CREATED = 'kudos-created',
|
|
47
|
+
}
|
|
48
|
+
|
|
23
49
|
// @public (undocumented)
|
|
24
50
|
export interface GiveKudosDrawerProps {
|
|
25
51
|
// (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -9,6 +9,32 @@
|
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
10
|
import { LazyExoticComponent } from 'react';
|
|
11
11
|
|
|
12
|
+
// @public (undocumented)
|
|
13
|
+
export interface FlagEvent {
|
|
14
|
+
// (undocumented)
|
|
15
|
+
eventType: FlagEventType;
|
|
16
|
+
// (undocumented)
|
|
17
|
+
jiraKudosFormUrl?: string;
|
|
18
|
+
// (undocumented)
|
|
19
|
+
jiraKudosUrl?: string;
|
|
20
|
+
// (undocumented)
|
|
21
|
+
kudosUuid?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
export enum FlagEventType {
|
|
26
|
+
// (undocumented)
|
|
27
|
+
CLOSE = "close",
|
|
28
|
+
// (undocumented)
|
|
29
|
+
DIRTY = "dirty",
|
|
30
|
+
// (undocumented)
|
|
31
|
+
JIRA_KUDOS_CREATED = "jira-kudos-created",
|
|
32
|
+
// (undocumented)
|
|
33
|
+
JIRA_KUDOS_FAILED = "jira-kudos-failed",
|
|
34
|
+
// (undocumented)
|
|
35
|
+
KUDOS_CREATED = "kudos-created"
|
|
36
|
+
}
|
|
37
|
+
|
|
12
38
|
// @public (undocumented)
|
|
13
39
|
export interface GiveKudosDrawerProps {
|
|
14
40
|
// (undocumented)
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED