@atlaskit/give-kudos 2.1.13 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlassian/give-kudos
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#144464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144464)
8
+ [`6c617d6eb76ba`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6c617d6eb76ba) -
9
+ [ux] Added flag event type KUDOS_FAILED for when a generic error occurs while creating a kudos.
10
+ You can now send a message to the parent which will add a generic kudos error flag in the root
11
+ container.
12
+
3
13
  ## 2.1.13
4
14
 
5
15
  ### Patch Changes
@@ -21,6 +21,16 @@ var messages = (0, _reactIntlNext.defineMessages)({
21
21
  defaultMessage: 'Your kudos has been sent. <a>View kudos</a>',
22
22
  description: 'Description text for the kudos created flag. This includes a link to view the newly created kudos.'
23
23
  },
24
+ kudosCreationFailedFlag: {
25
+ id: 'team-central.give-kudos.creation.failed.title.flag',
26
+ defaultMessage: 'Something went wrong',
27
+ description: 'Title text for kudos creation failed flag.'
28
+ },
29
+ kudosCreationFailedDescriptionFlag: {
30
+ id: 'team-central.give-kudos.creation.failed.description.flag',
31
+ defaultMessage: "We couldn't create your kudos.",
32
+ description: 'Description text for the kudos creation failed flag.'
33
+ },
24
34
  JiraKudosCreatedFlag: {
25
35
  id: 'team-central.give-jira-kudos.created.title.flag',
26
36
  defaultMessage: 'Kudos created',
@@ -33,13 +43,13 @@ var messages = (0, _reactIntlNext.defineMessages)({
33
43
  },
34
44
  JiraKudosCreationFailedFlag: {
35
45
  id: 'team-central.give-jira-kudos.creation.failed.title.flag',
36
- defaultMessage: "We couldn't send the gift",
46
+ defaultMessage: 'Something went wrong',
37
47
  description: 'Title text for jira kudos creation failed flag.'
38
48
  },
39
49
  JiraKudosCreationFailedDescriptionFlag: {
40
50
  id: 'team-central.give-jira-kudos.creation.failed.description.flag',
41
- defaultMessage: "We sent the kudos but we couldn't send the gift due to an error. Please raise a separate ticket at <a>go/kudos</a>.",
42
- description: 'Description text for the jira kudos creation failed flag. This includes a link to the atlas kudos and jira kudos form.'
51
+ defaultMessage: "We couldn't create your kudos or send the gift. Try raising a separate ticket at <a>go/kudos</a>..",
52
+ description: 'Description text for the jira kudos creation failed flag. This includes a link to the jira kudos form.'
43
53
  },
44
54
  unsavedKudosWarning: {
45
55
  id: 'team-central.give-kudos.unsaved.warning',
package/dist/cjs/types.js CHANGED
@@ -11,6 +11,7 @@ var KudosType = exports.KudosType = /*#__PURE__*/function (KudosType) {
11
11
  }({});
12
12
  var FlagEventType = exports.FlagEventType = /*#__PURE__*/function (FlagEventType) {
13
13
  FlagEventType["KUDOS_CREATED"] = "kudos-created";
14
+ FlagEventType["KUDOS_FAILED"] = "kudos-failed";
14
15
  FlagEventType["JIRA_KUDOS_CREATED"] = "jira-kudos-created";
15
16
  FlagEventType["JIRA_KUDOS_FAILED"] = "jira-kudos-failed";
16
17
  FlagEventType["DIRTY"] = "dirty";
@@ -125,6 +125,13 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
125
125
  })
126
126
  });
127
127
  break;
128
+ case _types.FlagEventType.KUDOS_FAILED:
129
+ handleCreateOrFail({
130
+ title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.kudosCreationFailedFlag),
131
+ id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
132
+ description: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.kudosCreationFailedDescriptionFlag)
133
+ });
134
+ break;
128
135
  case _types.FlagEventType.JIRA_KUDOS_CREATED:
129
136
  handleCreateOrFail({
130
137
  title: (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.default.JiraKudosCreatedFlag),
@@ -15,6 +15,16 @@ const messages = defineMessages({
15
15
  defaultMessage: 'Your kudos has been sent. <a>View kudos</a>',
16
16
  description: 'Description text for the kudos created flag. This includes a link to view the newly created kudos.'
17
17
  },
18
+ kudosCreationFailedFlag: {
19
+ id: 'team-central.give-kudos.creation.failed.title.flag',
20
+ defaultMessage: 'Something went wrong',
21
+ description: 'Title text for kudos creation failed flag.'
22
+ },
23
+ kudosCreationFailedDescriptionFlag: {
24
+ id: 'team-central.give-kudos.creation.failed.description.flag',
25
+ defaultMessage: "We couldn't create your kudos.",
26
+ description: 'Description text for the kudos creation failed flag.'
27
+ },
18
28
  JiraKudosCreatedFlag: {
19
29
  id: 'team-central.give-jira-kudos.created.title.flag',
20
30
  defaultMessage: 'Kudos created',
@@ -27,13 +37,13 @@ const messages = defineMessages({
27
37
  },
28
38
  JiraKudosCreationFailedFlag: {
29
39
  id: 'team-central.give-jira-kudos.creation.failed.title.flag',
30
- defaultMessage: "We couldn't send the gift",
40
+ defaultMessage: 'Something went wrong',
31
41
  description: 'Title text for jira kudos creation failed flag.'
32
42
  },
33
43
  JiraKudosCreationFailedDescriptionFlag: {
34
44
  id: 'team-central.give-jira-kudos.creation.failed.description.flag',
35
- defaultMessage: "We sent the kudos but we couldn't send the gift due to an error. Please raise a separate ticket at <a>go/kudos</a>.",
36
- description: 'Description text for the jira kudos creation failed flag. This includes a link to the atlas kudos and jira kudos form.'
45
+ defaultMessage: "We couldn't create your kudos or send the gift. Try raising a separate ticket at <a>go/kudos</a>..",
46
+ description: 'Description text for the jira kudos creation failed flag. This includes a link to the jira kudos form.'
37
47
  },
38
48
  unsavedKudosWarning: {
39
49
  id: 'team-central.give-kudos.unsaved.warning',
@@ -5,6 +5,7 @@ export let KudosType = /*#__PURE__*/function (KudosType) {
5
5
  }({});
6
6
  export let FlagEventType = /*#__PURE__*/function (FlagEventType) {
7
7
  FlagEventType["KUDOS_CREATED"] = "kudos-created";
8
+ FlagEventType["KUDOS_FAILED"] = "kudos-failed";
8
9
  FlagEventType["JIRA_KUDOS_CREATED"] = "jira-kudos-created";
9
10
  FlagEventType["JIRA_KUDOS_FAILED"] = "jira-kudos-failed";
10
11
  FlagEventType["DIRTY"] = "dirty";
@@ -111,6 +111,13 @@ const GiveKudosLauncher = props => {
111
111
  })
112
112
  });
113
113
  break;
114
+ case FlagEventType.KUDOS_FAILED:
115
+ handleCreateOrFail({
116
+ title: jsx(FormattedMessage, messages.kudosCreationFailedFlag),
117
+ id: `jiraKudosCreationFailedFlag-${flagEvent.kudosUuid}`,
118
+ description: jsx(FormattedMessage, messages.kudosCreationFailedDescriptionFlag)
119
+ });
120
+ break;
114
121
  case FlagEventType.JIRA_KUDOS_CREATED:
115
122
  handleCreateOrFail({
116
123
  title: jsx(FormattedMessage, messages.JiraKudosCreatedFlag),
@@ -15,6 +15,16 @@ var messages = defineMessages({
15
15
  defaultMessage: 'Your kudos has been sent. <a>View kudos</a>',
16
16
  description: 'Description text for the kudos created flag. This includes a link to view the newly created kudos.'
17
17
  },
18
+ kudosCreationFailedFlag: {
19
+ id: 'team-central.give-kudos.creation.failed.title.flag',
20
+ defaultMessage: 'Something went wrong',
21
+ description: 'Title text for kudos creation failed flag.'
22
+ },
23
+ kudosCreationFailedDescriptionFlag: {
24
+ id: 'team-central.give-kudos.creation.failed.description.flag',
25
+ defaultMessage: "We couldn't create your kudos.",
26
+ description: 'Description text for the kudos creation failed flag.'
27
+ },
18
28
  JiraKudosCreatedFlag: {
19
29
  id: 'team-central.give-jira-kudos.created.title.flag',
20
30
  defaultMessage: 'Kudos created',
@@ -27,13 +37,13 @@ var messages = defineMessages({
27
37
  },
28
38
  JiraKudosCreationFailedFlag: {
29
39
  id: 'team-central.give-jira-kudos.creation.failed.title.flag',
30
- defaultMessage: "We couldn't send the gift",
40
+ defaultMessage: 'Something went wrong',
31
41
  description: 'Title text for jira kudos creation failed flag.'
32
42
  },
33
43
  JiraKudosCreationFailedDescriptionFlag: {
34
44
  id: 'team-central.give-jira-kudos.creation.failed.description.flag',
35
- defaultMessage: "We sent the kudos but we couldn't send the gift due to an error. Please raise a separate ticket at <a>go/kudos</a>.",
36
- description: 'Description text for the jira kudos creation failed flag. This includes a link to the atlas kudos and jira kudos form.'
45
+ defaultMessage: "We couldn't create your kudos or send the gift. Try raising a separate ticket at <a>go/kudos</a>..",
46
+ description: 'Description text for the jira kudos creation failed flag. This includes a link to the jira kudos form.'
37
47
  },
38
48
  unsavedKudosWarning: {
39
49
  id: 'team-central.give-kudos.unsaved.warning',
package/dist/esm/types.js CHANGED
@@ -5,6 +5,7 @@ export var KudosType = /*#__PURE__*/function (KudosType) {
5
5
  }({});
6
6
  export var FlagEventType = /*#__PURE__*/function (FlagEventType) {
7
7
  FlagEventType["KUDOS_CREATED"] = "kudos-created";
8
+ FlagEventType["KUDOS_FAILED"] = "kudos-failed";
8
9
  FlagEventType["JIRA_KUDOS_CREATED"] = "jira-kudos-created";
9
10
  FlagEventType["JIRA_KUDOS_FAILED"] = "jira-kudos-failed";
10
11
  FlagEventType["DIRTY"] = "dirty";
@@ -119,6 +119,13 @@ var GiveKudosLauncher = function GiveKudosLauncher(props) {
119
119
  })
120
120
  });
121
121
  break;
122
+ case FlagEventType.KUDOS_FAILED:
123
+ handleCreateOrFail({
124
+ title: jsx(FormattedMessage, messages.kudosCreationFailedFlag),
125
+ id: "jiraKudosCreationFailedFlag-".concat(flagEvent.kudosUuid),
126
+ description: jsx(FormattedMessage, messages.kudosCreationFailedDescriptionFlag)
127
+ });
128
+ break;
122
129
  case FlagEventType.JIRA_KUDOS_CREATED:
123
130
  handleCreateOrFail({
124
131
  title: jsx(FormattedMessage, messages.JiraKudosCreatedFlag),
@@ -14,6 +14,16 @@ declare const messages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ kudosCreationFailedFlag: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ kudosCreationFailedDescriptionFlag: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  JiraKudosCreatedFlag: {
18
28
  id: string;
19
29
  defaultMessage: string;
@@ -5,12 +5,13 @@ export declare enum KudosType {
5
5
  }
6
6
  export declare enum FlagEventType {
7
7
  KUDOS_CREATED = "kudos-created",
8
+ KUDOS_FAILED = "kudos-failed",
8
9
  JIRA_KUDOS_CREATED = "jira-kudos-created",
9
10
  JIRA_KUDOS_FAILED = "jira-kudos-failed",
10
11
  DIRTY = "dirty",
11
12
  CLOSE = "close"
12
13
  }
13
- export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
14
+ export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "kudos-failed" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
14
15
  type FlagType = 'error' | 'warning' | 'success' | 'info';
15
16
  interface FlagAction {
16
17
  content: string | JSX.Element;
@@ -14,6 +14,16 @@ declare const messages: {
14
14
  defaultMessage: string;
15
15
  description: string;
16
16
  };
17
+ kudosCreationFailedFlag: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ kudosCreationFailedDescriptionFlag: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  JiraKudosCreatedFlag: {
18
28
  id: string;
19
29
  defaultMessage: string;
@@ -5,12 +5,13 @@ export declare enum KudosType {
5
5
  }
6
6
  export declare enum FlagEventType {
7
7
  KUDOS_CREATED = "kudos-created",
8
+ KUDOS_FAILED = "kudos-failed",
8
9
  JIRA_KUDOS_CREATED = "jira-kudos-created",
9
10
  JIRA_KUDOS_FAILED = "jira-kudos-failed",
10
11
  DIRTY = "dirty",
11
12
  CLOSE = "close"
12
13
  }
13
- export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
14
+ export declare const isFlagEventTypeValue: (value: string) => value is "kudos-created" | "kudos-failed" | "jira-kudos-created" | "jira-kudos-failed" | "dirty" | "close";
14
15
  type FlagType = 'error' | 'warning' | 'success' | 'info';
15
16
  interface FlagAction {
16
17
  content: string | JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/give-kudos",
3
- "version": "2.1.13",
3
+ "version": "2.2.0",
4
4
  "description": "Give Kudos experience ",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/analytics-next": "^10.1.0",
43
43
  "@atlaskit/button": "^20.2.0",
44
44
  "@atlaskit/drawer": "^9.0.0",
45
- "@atlaskit/icon": "^22.18.0",
45
+ "@atlaskit/icon": "^22.19.0",
46
46
  "@atlaskit/intl-messages-provider": "^1.0.2",
47
47
  "@atlaskit/modal-dialog": "^12.17.0",
48
48
  "@atlaskit/portal": "^4.9.0",