@atlaskit/link-datasource 1.1.3 → 1.1.4
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 +6 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +13 -4
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +11 -2
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +13 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`067fe62a1dc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/067fe62a1dc) - [ux] Updated logic for site selector to default to current site
|
|
8
|
+
|
|
3
9
|
## 1.1.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -231,7 +231,7 @@ var analyticsContextAttributes = {
|
|
|
231
231
|
};
|
|
232
232
|
var analyticsContextData = {
|
|
233
233
|
packageName: "@atlaskit/link-datasource",
|
|
234
|
-
packageVersion: "1.1.
|
|
234
|
+
packageVersion: "1.1.4",
|
|
235
235
|
source: 'datasourceConfigModal'
|
|
236
236
|
};
|
|
237
237
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -146,9 +146,18 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
146
146
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
147
147
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
148
148
|
var selectedJiraSite = (0, _react.useMemo)(function () {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
if (cloudId) {
|
|
150
|
+
// if the cloud id we're editing isn't in available sites then user is likely unauthorized for that site
|
|
151
|
+
// TODO: unauthorized to edit flow https://product-fabric.atlassian.net/browse/EDM-7216
|
|
152
|
+
return availableSites.find(function (jiraSite) {
|
|
153
|
+
return jiraSite.cloudId === cloudId;
|
|
154
|
+
}) || availableSites[0];
|
|
155
|
+
} else {
|
|
156
|
+
var currentlyLoggedInSiteUrl = window.location.origin;
|
|
157
|
+
return availableSites.find(function (jiraSite) {
|
|
158
|
+
return jiraSite.url === currentlyLoggedInSiteUrl;
|
|
159
|
+
}) || availableSites[0];
|
|
160
|
+
}
|
|
152
161
|
}, [availableSites, cloudId]);
|
|
153
162
|
var buttonClickedAnalyticsPayload = (0, _react.useMemo)(function () {
|
|
154
163
|
return {
|
|
@@ -196,7 +205,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
196
205
|
void fetchSiteDisplayNames();
|
|
197
206
|
}, [fireEvent]);
|
|
198
207
|
(0, _react.useEffect)(function () {
|
|
199
|
-
if (!cloudId
|
|
208
|
+
if (selectedJiraSite && (!cloudId || cloudId !== selectedJiraSite.cloudId)) {
|
|
200
209
|
setCloudId(selectedJiraSite.cloudId);
|
|
201
210
|
}
|
|
202
211
|
}, [cloudId, selectedJiraSite]);
|
|
@@ -116,7 +116,16 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
116
116
|
const {
|
|
117
117
|
fireEvent
|
|
118
118
|
} = useDatasourceAnalyticsEvents();
|
|
119
|
-
const selectedJiraSite = useMemo(() =>
|
|
119
|
+
const selectedJiraSite = useMemo(() => {
|
|
120
|
+
if (cloudId) {
|
|
121
|
+
// if the cloud id we're editing isn't in available sites then user is likely unauthorized for that site
|
|
122
|
+
// TODO: unauthorized to edit flow https://product-fabric.atlassian.net/browse/EDM-7216
|
|
123
|
+
return availableSites.find(jiraSite => jiraSite.cloudId === cloudId) || availableSites[0];
|
|
124
|
+
} else {
|
|
125
|
+
const currentlyLoggedInSiteUrl = window.location.origin;
|
|
126
|
+
return availableSites.find(jiraSite => jiraSite.url === currentlyLoggedInSiteUrl) || availableSites[0];
|
|
127
|
+
}
|
|
128
|
+
}, [availableSites, cloudId]);
|
|
120
129
|
const buttonClickedAnalyticsPayload = useMemo(() => {
|
|
121
130
|
return {
|
|
122
131
|
extensionKey: extensionKey,
|
|
@@ -146,7 +155,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
146
155
|
void fetchSiteDisplayNames();
|
|
147
156
|
}, [fireEvent]);
|
|
148
157
|
useEffect(() => {
|
|
149
|
-
if (!cloudId
|
|
158
|
+
if (selectedJiraSite && (!cloudId || cloudId !== selectedJiraSite.cloudId)) {
|
|
150
159
|
setCloudId(selectedJiraSite.cloudId);
|
|
151
160
|
}
|
|
152
161
|
}, [cloudId, selectedJiraSite]);
|
|
@@ -222,7 +222,7 @@ var analyticsContextAttributes = {
|
|
|
222
222
|
};
|
|
223
223
|
var analyticsContextData = {
|
|
224
224
|
packageName: "@atlaskit/link-datasource",
|
|
225
|
-
packageVersion: "1.1.
|
|
225
|
+
packageVersion: "1.1.4",
|
|
226
226
|
source: 'datasourceConfigModal'
|
|
227
227
|
};
|
|
228
228
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -136,9 +136,18 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
136
136
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
137
137
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
138
138
|
var selectedJiraSite = useMemo(function () {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
if (cloudId) {
|
|
140
|
+
// if the cloud id we're editing isn't in available sites then user is likely unauthorized for that site
|
|
141
|
+
// TODO: unauthorized to edit flow https://product-fabric.atlassian.net/browse/EDM-7216
|
|
142
|
+
return availableSites.find(function (jiraSite) {
|
|
143
|
+
return jiraSite.cloudId === cloudId;
|
|
144
|
+
}) || availableSites[0];
|
|
145
|
+
} else {
|
|
146
|
+
var currentlyLoggedInSiteUrl = window.location.origin;
|
|
147
|
+
return availableSites.find(function (jiraSite) {
|
|
148
|
+
return jiraSite.url === currentlyLoggedInSiteUrl;
|
|
149
|
+
}) || availableSites[0];
|
|
150
|
+
}
|
|
142
151
|
}, [availableSites, cloudId]);
|
|
143
152
|
var buttonClickedAnalyticsPayload = useMemo(function () {
|
|
144
153
|
return {
|
|
@@ -186,7 +195,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
186
195
|
void fetchSiteDisplayNames();
|
|
187
196
|
}, [fireEvent]);
|
|
188
197
|
useEffect(function () {
|
|
189
|
-
if (!cloudId
|
|
198
|
+
if (selectedJiraSite && (!cloudId || cloudId !== selectedJiraSite.cloudId)) {
|
|
190
199
|
setCloudId(selectedJiraSite.cloudId);
|
|
191
200
|
}
|
|
192
201
|
}, [cloudId, selectedJiraSite]);
|