@atlaskit/link-datasource 0.24.3 → 0.25.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,22 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`f427908df3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f427908df3d) - change the datasource response type to include the meta data section and the data response will wrap in the data section
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 0.24.4
14
+
15
+ ### Patch Changes
16
+
17
+ - [`b75c571b91b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b75c571b91b) - Fix up problem where we don't set react's "key" for list of content we show in each cell (like tags)
18
+ - Updated dependencies
19
+
3
20
  ## 0.24.3
4
21
 
5
22
  ### Patch Changes
@@ -73,7 +73,7 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
73
73
  return column.key === col.key;
74
74
  });
75
75
  };
76
- allColumns = result.schema.properties;
76
+ allColumns = result.data.schema.properties;
77
77
  newColumns = allColumns.filter(isColumnNotPresentInCurrentColumnsList);
78
78
  newColumns.length > 0 && setColumns([].concat((0, _toConsumableArray2.default)(columns), (0, _toConsumableArray2.default)(newColumns)));
79
79
  case 9:
@@ -106,7 +106,8 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
106
106
  shouldRequestFirstPage,
107
107
  datasourceDataRequest,
108
108
  _yield$getDatasourceD,
109
- data,
109
+ _yield$getDatasourceD2,
110
+ items,
110
111
  nextPageCursor,
111
112
  _totalCount,
112
113
  schema,
@@ -135,17 +136,18 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
135
136
  return getDatasourceData(datasourceId, datasourceDataRequest);
136
137
  case 9:
137
138
  _yield$getDatasourceD = _context2.sent;
138
- data = _yield$getDatasourceD.data;
139
- nextPageCursor = _yield$getDatasourceD.nextPageCursor;
140
- _totalCount = _yield$getDatasourceD.totalCount;
141
- schema = _yield$getDatasourceD.schema;
139
+ _yield$getDatasourceD2 = _yield$getDatasourceD.data;
140
+ items = _yield$getDatasourceD2.items;
141
+ nextPageCursor = _yield$getDatasourceD2.nextPageCursor;
142
+ _totalCount = _yield$getDatasourceD2.totalCount;
143
+ schema = _yield$getDatasourceD2.schema;
142
144
  setTotalCount(_totalCount);
143
145
  setNextCursor(nextPageCursor);
144
146
  setResponseItems(function (currentResponseItems) {
145
147
  if (shouldRequestFirstPage) {
146
- return data;
148
+ return items;
147
149
  }
148
- return [].concat((0, _toConsumableArray2.default)(currentResponseItems), (0, _toConsumableArray2.default)(data));
150
+ return [].concat((0, _toConsumableArray2.default)(currentResponseItems), (0, _toConsumableArray2.default)(items));
149
151
  });
150
152
  setStatus('resolved');
151
153
  setHasNextPage(Boolean(nextPageCursor));
@@ -155,17 +157,17 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
155
157
  if (isSchemaFromData && schema) {
156
158
  applySchemaProperties(schema.properties);
157
159
  }
158
- _context2.next = 26;
160
+ _context2.next = 27;
159
161
  break;
160
- case 23:
161
- _context2.prev = 23;
162
+ case 24:
163
+ _context2.prev = 24;
162
164
  _context2.t0 = _context2["catch"](6);
163
165
  setStatus('rejected');
164
- case 26:
166
+ case 27:
165
167
  case "end":
166
168
  return _context2.stop();
167
169
  }
168
- }, _callee2, null, [[6, 23]]);
170
+ }, _callee2, null, [[6, 24]]);
169
171
  })), [parameters, fieldKeys, getDatasourceData, datasourceId, nextCursor, applySchemaProperties]);
170
172
  var reset = (0, _react.useCallback)(function () {
171
173
  setStatus('empty');
@@ -262,7 +262,7 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
262
262
  });
263
263
  return {
264
264
  key: key,
265
- content: content,
265
+ content: content.length === 1 ? content[0] : content,
266
266
  maxWidth: getColumnWidth(key, type)
267
267
  };
268
268
  }),
@@ -366,11 +366,11 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
366
366
  "data-testid": testId && "".concat(testId, "--row-").concat(key),
367
367
  ref: ref
368
368
  }, cells.map(function (_ref13, cellIndex) {
369
- var key = _ref13.key,
369
+ var cellKey = _ref13.key,
370
370
  content = _ref13.content,
371
371
  maxWidth = _ref13.maxWidth;
372
372
  return (0, _react2.jsx)("td", {
373
- key: key,
373
+ key: cellKey,
374
374
  "data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
375
375
  colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
376
376
  css: truncatedCellStyles,
@@ -16,6 +16,7 @@ var _tag = _interopRequireDefault(require("./tag"));
16
16
  var _text = _interopRequireDefault(require("./text"));
17
17
  var _user = _interopRequireDefault(require("./user"));
18
18
  var fallbackRenderType = function fallbackRenderType(item) {
19
+ var _item$value, _item$value2;
19
20
  switch (item.type) {
20
21
  case 'boolean':
21
22
  return /*#__PURE__*/_react.default.createElement(_boolean.default, {
@@ -47,6 +48,7 @@ var fallbackRenderType = function fallbackRenderType(item) {
47
48
  });
48
49
  case 'tag':
49
50
  return /*#__PURE__*/_react.default.createElement(_tag.default, {
51
+ key: ((_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.id) || ((_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.text),
50
52
  tag: item.value
51
53
  });
52
54
  case 'time':
@@ -193,7 +193,11 @@ var JiraIssuesConfigModal = function JiraIssuesConfigModal(props) {
193
193
  views: [{
194
194
  type: 'table',
195
195
  properties: {
196
- columnKeys: visibleColumnKeys
196
+ columns: visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.map(function (key) {
197
+ return {
198
+ key: key
199
+ };
200
+ })
197
201
  }
198
202
  }]
199
203
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "sideEffects": false
5
5
  }
@@ -25,7 +25,7 @@ export const useDatasourceTableState = ({
25
25
  parameters
26
26
  });
27
27
  const isColumnNotPresentInCurrentColumnsList = col => !columns.find(column => column.key === col.key);
28
- const allColumns = result.schema.properties;
28
+ const allColumns = result.data.schema.properties;
29
29
  const newColumns = allColumns.filter(isColumnNotPresentInCurrentColumnsList);
30
30
  newColumns.length > 0 && setColumns([...columns, ...newColumns]);
31
31
  }, [columns, datasourceId, getDatasourceDetails, parameters]);
@@ -62,18 +62,20 @@ export const useDatasourceTableState = ({
62
62
  setStatus('loading');
63
63
  try {
64
64
  const {
65
- data,
66
- nextPageCursor,
67
- totalCount,
68
- schema
65
+ data: {
66
+ items,
67
+ nextPageCursor,
68
+ totalCount,
69
+ schema
70
+ }
69
71
  } = await getDatasourceData(datasourceId, datasourceDataRequest);
70
72
  setTotalCount(totalCount);
71
73
  setNextCursor(nextPageCursor);
72
74
  setResponseItems(currentResponseItems => {
73
75
  if (shouldRequestFirstPage) {
74
- return data;
76
+ return items;
75
77
  }
76
- return [...currentResponseItems, ...data];
78
+ return [...currentResponseItems, ...items];
77
79
  });
78
80
  setStatus('resolved');
79
81
  setHasNextPage(Boolean(nextPageCursor));
@@ -230,7 +230,7 @@ export const IssueLikeDataTableView = ({
230
230
  }));
231
231
  return {
232
232
  key,
233
- content,
233
+ content: content.length === 1 ? content[0] : content,
234
234
  maxWidth: getColumnWidth(key, type)
235
235
  };
236
236
  }),
@@ -309,11 +309,11 @@ export const IssueLikeDataTableView = ({
309
309
  "data-testid": testId && `${testId}--row-${key}`,
310
310
  ref: ref
311
311
  }, cells.map(({
312
- key,
312
+ key: cellKey,
313
313
  content,
314
314
  maxWidth
315
315
  }, cellIndex) => jsx("td", {
316
- key: key,
316
+ key: cellKey,
317
317
  "data-testid": testId && `${testId}--cell-${cellIndex}`,
318
318
  colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
319
319
  css: truncatedCellStyles,
@@ -9,6 +9,7 @@ import TagRenderType from './tag';
9
9
  import StringRenderType from './text';
10
10
  import UserRenderType from './user';
11
11
  export const fallbackRenderType = item => {
12
+ var _item$value, _item$value2;
12
13
  switch (item.type) {
13
14
  case 'boolean':
14
15
  return /*#__PURE__*/React.createElement(BooleanRenderType, {
@@ -40,6 +41,7 @@ export const fallbackRenderType = item => {
40
41
  });
41
42
  case 'tag':
42
43
  return /*#__PURE__*/React.createElement(TagRenderType, {
44
+ key: ((_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.id) || ((_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.text),
43
45
  tag: item.value
44
46
  });
45
47
  case 'time':
@@ -144,7 +144,9 @@ export const JiraIssuesConfigModal = props => {
144
144
  views: [{
145
145
  type: 'table',
146
146
  properties: {
147
- columnKeys: visibleColumnKeys
147
+ columns: visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.map(key => ({
148
+ key
149
+ }))
148
150
  }
149
151
  }]
150
152
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "sideEffects": false
5
5
  }
@@ -66,7 +66,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
66
66
  return column.key === col.key;
67
67
  });
68
68
  };
69
- allColumns = result.schema.properties;
69
+ allColumns = result.data.schema.properties;
70
70
  newColumns = allColumns.filter(isColumnNotPresentInCurrentColumnsList);
71
71
  newColumns.length > 0 && setColumns([].concat(_toConsumableArray(columns), _toConsumableArray(newColumns)));
72
72
  case 9:
@@ -99,7 +99,8 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
99
99
  shouldRequestFirstPage,
100
100
  datasourceDataRequest,
101
101
  _yield$getDatasourceD,
102
- data,
102
+ _yield$getDatasourceD2,
103
+ items,
103
104
  nextPageCursor,
104
105
  _totalCount,
105
106
  schema,
@@ -128,17 +129,18 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
128
129
  return getDatasourceData(datasourceId, datasourceDataRequest);
129
130
  case 9:
130
131
  _yield$getDatasourceD = _context2.sent;
131
- data = _yield$getDatasourceD.data;
132
- nextPageCursor = _yield$getDatasourceD.nextPageCursor;
133
- _totalCount = _yield$getDatasourceD.totalCount;
134
- schema = _yield$getDatasourceD.schema;
132
+ _yield$getDatasourceD2 = _yield$getDatasourceD.data;
133
+ items = _yield$getDatasourceD2.items;
134
+ nextPageCursor = _yield$getDatasourceD2.nextPageCursor;
135
+ _totalCount = _yield$getDatasourceD2.totalCount;
136
+ schema = _yield$getDatasourceD2.schema;
135
137
  setTotalCount(_totalCount);
136
138
  setNextCursor(nextPageCursor);
137
139
  setResponseItems(function (currentResponseItems) {
138
140
  if (shouldRequestFirstPage) {
139
- return data;
141
+ return items;
140
142
  }
141
- return [].concat(_toConsumableArray(currentResponseItems), _toConsumableArray(data));
143
+ return [].concat(_toConsumableArray(currentResponseItems), _toConsumableArray(items));
142
144
  });
143
145
  setStatus('resolved');
144
146
  setHasNextPage(Boolean(nextPageCursor));
@@ -148,17 +150,17 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
148
150
  if (isSchemaFromData && schema) {
149
151
  applySchemaProperties(schema.properties);
150
152
  }
151
- _context2.next = 26;
153
+ _context2.next = 27;
152
154
  break;
153
- case 23:
154
- _context2.prev = 23;
155
+ case 24:
156
+ _context2.prev = 24;
155
157
  _context2.t0 = _context2["catch"](6);
156
158
  setStatus('rejected');
157
- case 26:
159
+ case 27:
158
160
  case "end":
159
161
  return _context2.stop();
160
162
  }
161
- }, _callee2, null, [[6, 23]]);
163
+ }, _callee2, null, [[6, 24]]);
162
164
  })), [parameters, fieldKeys, getDatasourceData, datasourceId, nextCursor, applySchemaProperties]);
163
165
  var reset = useCallback(function () {
164
166
  setStatus('empty');
@@ -256,7 +256,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
256
256
  });
257
257
  return {
258
258
  key: key,
259
- content: content,
259
+ content: content.length === 1 ? content[0] : content,
260
260
  maxWidth: getColumnWidth(key, type)
261
261
  };
262
262
  }),
@@ -360,11 +360,11 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
360
360
  "data-testid": testId && "".concat(testId, "--row-").concat(key),
361
361
  ref: ref
362
362
  }, cells.map(function (_ref13, cellIndex) {
363
- var key = _ref13.key,
363
+ var cellKey = _ref13.key,
364
364
  content = _ref13.content,
365
365
  maxWidth = _ref13.maxWidth;
366
366
  return jsx("td", {
367
- key: key,
367
+ key: cellKey,
368
368
  "data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
369
369
  colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
370
370
  css: truncatedCellStyles,
@@ -9,6 +9,7 @@ import TagRenderType from './tag';
9
9
  import StringRenderType from './text';
10
10
  import UserRenderType from './user';
11
11
  export var fallbackRenderType = function fallbackRenderType(item) {
12
+ var _item$value, _item$value2;
12
13
  switch (item.type) {
13
14
  case 'boolean':
14
15
  return /*#__PURE__*/React.createElement(BooleanRenderType, {
@@ -40,6 +41,7 @@ export var fallbackRenderType = function fallbackRenderType(item) {
40
41
  });
41
42
  case 'tag':
42
43
  return /*#__PURE__*/React.createElement(TagRenderType, {
44
+ key: ((_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.id) || ((_item$value2 = item.value) === null || _item$value2 === void 0 ? void 0 : _item$value2.text),
43
45
  tag: item.value
44
46
  });
45
47
  case 'time':
@@ -182,7 +182,11 @@ export var JiraIssuesConfigModal = function JiraIssuesConfigModal(props) {
182
182
  views: [{
183
183
  type: 'table',
184
184
  properties: {
185
- columnKeys: visibleColumnKeys
185
+ columns: visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.map(function (key) {
186
+ return {
187
+ key: key
188
+ };
189
+ })
186
190
  }
187
191
  }]
188
192
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "sideEffects": false
5
5
  }
@@ -23,7 +23,9 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
23
23
  {
24
24
  type: 'table';
25
25
  properties?: {
26
- columnKeys: string[];
26
+ columns: {
27
+ key: string;
28
+ }[];
27
29
  };
28
30
  }
29
31
  ];
@@ -23,7 +23,9 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
23
23
  {
24
24
  type: 'table';
25
25
  properties?: {
26
- columnKeys: string[];
26
+ columns: {
27
+ key: string;
28
+ }[];
27
29
  };
28
30
  }
29
31
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.24.3",
3
+ "version": "0.25.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,15 +28,15 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@atlaskit/avatar": "^21.3.0",
31
- "@atlaskit/button": "^16.7.0",
32
- "@atlaskit/dropdown-menu": "^11.9.0",
31
+ "@atlaskit/button": "^16.8.0",
32
+ "@atlaskit/dropdown-menu": "^11.10.0",
33
33
  "@atlaskit/heading": "^1.3.0",
34
34
  "@atlaskit/icon": "^21.12.0",
35
35
  "@atlaskit/icon-object": "^6.3.0",
36
36
  "@atlaskit/image": "^1.1.0",
37
- "@atlaskit/link-client-extension": "^1.2.1",
38
- "@atlaskit/linking-common": "^2.15.0",
39
- "@atlaskit/linking-types": "^6.0.0",
37
+ "@atlaskit/link-client-extension": "^1.3.0",
38
+ "@atlaskit/linking-common": "^3.0.0",
39
+ "@atlaskit/linking-types": "^7.0.0",
40
40
  "@atlaskit/lozenge": "^11.4.0",
41
41
  "@atlaskit/modal-dialog": "^12.6.0",
42
42
  "@atlaskit/pragmatic-drag-and-drop": "^0.19.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/tag": "^11.5.0",
50
50
  "@atlaskit/textfield": "5.5.2",
51
51
  "@atlaskit/theme": "^12.5.0",
52
- "@atlaskit/tokens": "^1.8.0",
52
+ "@atlaskit/tokens": "^1.9.0",
53
53
  "@atlassianlabs/jql-editor": "^1.2.0",
54
54
  "@atlassianlabs/jql-editor-autocomplete-rest": "^1.0.1",
55
55
  "@babel/runtime": "^7.0.0",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@atlaskit/link-provider": "^1.6.0",
67
- "@atlaskit/link-test-helpers": "^4.0.0",
67
+ "@atlaskit/link-test-helpers": "^4.1.0",
68
68
  "@atlaskit/ssr": "*",
69
69
  "@atlaskit/visual-regression": "*",
70
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
package/report.api.md CHANGED
@@ -97,7 +97,9 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
97
97
  {
98
98
  type: 'table';
99
99
  properties?: {
100
- columnKeys: string[];
100
+ columns: {
101
+ key: string;
102
+ }[];
101
103
  };
102
104
  },
103
105
  ];
@@ -78,7 +78,9 @@ export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
78
78
  {
79
79
  type: 'table';
80
80
  properties?: {
81
- columnKeys: string[];
81
+ columns: {
82
+ key: string;
83
+ }[];
82
84
  };
83
85
  }
84
86
  ];