@atlaskit/link-datasource 2.3.5 → 2.3.7

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/LICENSE.md +6 -8
  3. package/dist/cjs/hooks/useDatasourceTableState.js +3 -3
  4. package/dist/cjs/hooks/useValidateAqlText.js +3 -3
  5. package/dist/cjs/ui/assets-modal/modal/index.js +21 -9
  6. package/dist/cjs/ui/common/modal/popup-select/index.js +4 -4
  7. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +3 -3
  8. package/dist/cjs/ui/issue-like-table/index.js +1 -1
  9. package/dist/cjs/ui/issue-like-table/render-type/date-time/index.js +4 -4
  10. package/dist/cjs/ui/issue-like-table/styled.js +7 -7
  11. package/dist/es2019/hooks/useDatasourceTableState.js +3 -3
  12. package/dist/es2019/hooks/useValidateAqlText.js +3 -3
  13. package/dist/es2019/ui/assets-modal/modal/index.js +21 -7
  14. package/dist/es2019/ui/common/modal/popup-select/index.js +4 -4
  15. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +3 -3
  16. package/dist/es2019/ui/issue-like-table/index.js +1 -1
  17. package/dist/es2019/ui/issue-like-table/render-type/date-time/index.js +4 -4
  18. package/dist/es2019/ui/issue-like-table/styled.js +7 -7
  19. package/dist/esm/hooks/useDatasourceTableState.js +3 -3
  20. package/dist/esm/hooks/useValidateAqlText.js +3 -3
  21. package/dist/esm/ui/assets-modal/modal/index.js +21 -9
  22. package/dist/esm/ui/common/modal/popup-select/index.js +4 -4
  23. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +3 -3
  24. package/dist/esm/ui/issue-like-table/index.js +1 -1
  25. package/dist/esm/ui/issue-like-table/render-type/date-time/index.js +4 -4
  26. package/dist/esm/ui/issue-like-table/styled.js +7 -7
  27. package/dist/types/contexts/datasource-experience-id/index.d.ts +1 -1
  28. package/dist/types/contexts/user-interactions/index.d.ts +1 -1
  29. package/dist/types/index.d.ts +1 -1
  30. package/dist/types/services/useBasicFilterAGG.d.ts +1 -1
  31. package/dist/types/ui/assets-modal/search-container/loading-state.d.ts +1 -1
  32. package/dist/types/ui/assets-modal/types.d.ts +1 -0
  33. package/dist/types/ui/common/error-state/no-instances.d.ts +1 -1
  34. package/dist/types/ui/common/modal/cancel-button/index.d.ts +1 -1
  35. package/dist/types/ui/common/modal/content-container/index.d.ts +1 -1
  36. package/dist/types/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +1 -1
  37. package/dist/types/ui/common/modal/popup-select/footer.d.ts +1 -1
  38. package/dist/types/ui/common/modal/popup-select/menu-list/errorMessage.d.ts +1 -1
  39. package/dist/types/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +1 -1
  40. package/dist/types/ui/common/modal/popup-select/menu-list/selectMessage.d.ts +1 -1
  41. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.d.ts +1 -1
  42. package/dist/types/ui/issue-like-table/render-type/boolean/index.d.ts +1 -1
  43. package/dist/types/ui/issue-like-table/render-type/icon/index.d.ts +1 -1
  44. package/dist/types/ui/issue-like-table/render-type/link/index.d.ts +1 -1
  45. package/dist/types/ui/issue-like-table/render-type/number/index.d.ts +1 -1
  46. package/dist/types/ui/issue-like-table/render-type/status/index.d.ts +1 -1
  47. package/dist/types/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +1 -1
  48. package/dist/types/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -2
  49. package/dist/types-ts4.5/contexts/datasource-experience-id/index.d.ts +1 -1
  50. package/dist/types-ts4.5/contexts/user-interactions/index.d.ts +1 -1
  51. package/dist/types-ts4.5/index.d.ts +1 -1
  52. package/dist/types-ts4.5/services/useBasicFilterAGG.d.ts +1 -1
  53. package/dist/types-ts4.5/ui/assets-modal/search-container/loading-state.d.ts +1 -1
  54. package/dist/types-ts4.5/ui/assets-modal/types.d.ts +1 -0
  55. package/dist/types-ts4.5/ui/common/error-state/no-instances.d.ts +1 -1
  56. package/dist/types-ts4.5/ui/common/modal/cancel-button/index.d.ts +1 -1
  57. package/dist/types-ts4.5/ui/common/modal/content-container/index.d.ts +1 -1
  58. package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +1 -1
  59. package/dist/types-ts4.5/ui/common/modal/popup-select/footer.d.ts +1 -1
  60. package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/errorMessage.d.ts +1 -1
  61. package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +1 -1
  62. package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/selectMessage.d.ts +1 -1
  63. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.d.ts +1 -1
  64. package/dist/types-ts4.5/ui/issue-like-table/render-type/boolean/index.d.ts +1 -1
  65. package/dist/types-ts4.5/ui/issue-like-table/render-type/icon/index.d.ts +1 -1
  66. package/dist/types-ts4.5/ui/issue-like-table/render-type/link/index.d.ts +1 -1
  67. package/dist/types-ts4.5/ui/issue-like-table/render-type/number/index.d.ts +1 -1
  68. package/dist/types-ts4.5/ui/issue-like-table/render-type/status/index.d.ts +1 -1
  69. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +1 -1
  70. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -2
  71. package/examples-helpers/buildAssetsIssuesTable.tsx +44 -44
  72. package/examples-helpers/buildConfluenceSearchTable.tsx +49 -51
  73. package/examples-helpers/buildIssueLikeTable.tsx +82 -92
  74. package/examples-helpers/buildJiraIssuesTable.tsx +50 -50
  75. package/examples-helpers/hoverableContainer.tsx +12 -14
  76. package/examples-helpers/mockJqlSmartLinkData.ts +64 -66
  77. package/examples-helpers/mockSmartLinkData.ts +154 -154
  78. package/examples-helpers/smartLinkCustomClient.ts +32 -32
  79. package/examples-helpers/useAssetsTableProps.tsx +46 -46
  80. package/examples-helpers/useCommonTableProps.tsx +23 -25
  81. package/package.json +17 -12
  82. package/report.api.md +94 -106
@@ -3,158 +3,158 @@ import { type JsonLd } from 'json-ld-types';
3
3
  import * as Image from './images.json';
4
4
 
5
5
  export const mocks = {
6
- unauthorized: {
7
- meta: {
8
- access: 'unauthorized',
9
- visibility: 'restricted',
10
- auth: [{}],
11
- },
12
- data: {
13
- '@context': {
14
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
15
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
16
- schema: 'http://schema.org/',
17
- },
18
- '@type': 'Object',
19
- generator: {
20
- '@type': 'Application',
21
- name: 'Asana',
22
- icon: {
23
- '@type': 'Image',
24
- url: Image.asana,
25
- },
26
- },
27
- url: 'https://some.url',
28
- },
29
- } as JsonLd.Response,
30
- resolved: {
31
- meta: {
32
- auth: [],
33
- visibility: 'restricted',
34
- access: 'granted',
35
- resourceType: 'issue',
36
- },
37
- data: {
38
- '@context': {
39
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
40
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
41
- schema: 'http://schema.org/',
42
- },
43
- generator: {
44
- '@type': 'Application',
45
- '@id': 'https://www.atlassian.com/#Jira',
46
- name: 'Jira',
47
- },
48
- '@type': ['atlassian:Task', 'Object'],
49
- name: 'EDM-5941: Implement mapping between data type and visual component',
50
- tag: {
51
- '@type': 'Object',
52
- name: 'In Progress',
53
- appearance: 'inprogress',
54
- },
55
- taskType: {
56
- '@type': ['Object', 'atlassian:TaskType'],
57
- '@id': 'https://www.atlassian.com/#JiraCustomTaskType',
58
- name: 'Task',
59
- icon: {
60
- '@type': 'Image',
61
- url: Image.task,
62
- },
63
- },
64
- url: 'https://product-fabric.atlassian.net/browse/EDM-5941',
65
- },
66
- } as JsonLd.Response,
67
- notFound: {
68
- meta: {
69
- visibility: 'not_found',
70
- access: 'forbidden',
71
- auth: [],
72
- definitionId: 'd1',
73
- key: 'object-provider',
74
- },
75
- data: {
76
- '@context': {
77
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
78
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
79
- schema: 'http://schema.org/',
80
- },
81
- '@type': 'Object',
82
- name: 'I love cheese',
83
- url: 'https://some.url',
84
- },
85
- } as JsonLd.Response,
86
- forbidden: {
87
- meta: {
88
- visibility: 'restricted',
89
- access: 'forbidden',
90
- auth: [
91
- {
92
- key: 'some-flow',
93
- displayName: 'Flow',
94
- url: 'https://outbound-auth/flow',
95
- },
96
- ],
97
- definitionId: 'd1',
98
- key: 'object-provider',
99
- },
100
- data: {
101
- '@context': {
102
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
103
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
104
- schema: 'http://schema.org/',
105
- },
106
- '@type': 'Object',
107
- name: 'I love cheese',
108
- url: 'https://some.url',
109
- },
110
- } as JsonLd.Response,
111
- confluenceSearchResolved: {
112
- meta: {
113
- auth: [],
114
- definitionId: 'confluence-object-provider',
115
- product: 'confluence',
116
- visibility: 'restricted',
117
- access: 'granted',
118
- resourceType: 'search',
119
- objectId: 'text=searchsomething',
120
- tenantId: 'DUMMY-a5a01d21-1cc3-4f29-9565-f2bb8cd969f5',
121
- category: 'object',
122
- key: 'confluence-object-provider',
123
- },
124
- data: {
125
- '@context': {
126
- '@vocab': 'https://www.w3.org/ns/activitystreams#',
127
- atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
128
- schema: 'http://schema.org/',
129
- },
130
- generator: {
131
- '@type': 'Application',
132
- '@id': 'https://www.atlassian.com/#Confluence',
133
- name: 'Confluence',
134
- icon: {
135
- '@type': 'Image',
136
- url: 'https://cdn.bfldr.com/K3MHR9G8/at/hcwrtqnwvz33bn73b84ncpt5/confluence-mark-contained-gradient-blue.svg?auto=webp&format=png&width=320&height=320',
137
- },
138
- },
139
- '@type': ['Object'],
140
- url: 'https://pug.jira-dev.com/wiki/search?text=searchsomething',
141
- name: '55 Results',
142
- 'atlassian:titlePrefix': {
143
- text: '',
144
- '@type': 'atlassian:Emoji',
145
- },
146
- },
147
- datasources: [
148
- {
149
- key: 'datasource-confluence-search',
150
- parameters: {
151
- searchString: 'searchsomething',
152
- },
153
- id: '768fc736-3af4-4a8f-b27e-203602bff8ca',
154
- ari: 'ari:cloud:linking-platform::datasource/768fc736-3af4-4a8f-b27e-203602bff8ca',
155
- description: 'For extracting a list of Confluence search results',
156
- name: 'Confluence search',
157
- },
158
- ],
159
- } as JsonLd.Response,
6
+ unauthorized: {
7
+ meta: {
8
+ access: 'unauthorized',
9
+ visibility: 'restricted',
10
+ auth: [{}],
11
+ },
12
+ data: {
13
+ '@context': {
14
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
15
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
16
+ schema: 'http://schema.org/',
17
+ },
18
+ '@type': 'Object',
19
+ generator: {
20
+ '@type': 'Application',
21
+ name: 'Asana',
22
+ icon: {
23
+ '@type': 'Image',
24
+ url: Image.asana,
25
+ },
26
+ },
27
+ url: 'https://some.url',
28
+ },
29
+ } as JsonLd.Response,
30
+ resolved: {
31
+ meta: {
32
+ auth: [],
33
+ visibility: 'restricted',
34
+ access: 'granted',
35
+ resourceType: 'issue',
36
+ },
37
+ data: {
38
+ '@context': {
39
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
40
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
41
+ schema: 'http://schema.org/',
42
+ },
43
+ generator: {
44
+ '@type': 'Application',
45
+ '@id': 'https://www.atlassian.com/#Jira',
46
+ name: 'Jira',
47
+ },
48
+ '@type': ['atlassian:Task', 'Object'],
49
+ name: 'EDM-5941: Implement mapping between data type and visual component',
50
+ tag: {
51
+ '@type': 'Object',
52
+ name: 'In Progress',
53
+ appearance: 'inprogress',
54
+ },
55
+ taskType: {
56
+ '@type': ['Object', 'atlassian:TaskType'],
57
+ '@id': 'https://www.atlassian.com/#JiraCustomTaskType',
58
+ name: 'Task',
59
+ icon: {
60
+ '@type': 'Image',
61
+ url: Image.task,
62
+ },
63
+ },
64
+ url: 'https://product-fabric.atlassian.net/browse/EDM-5941',
65
+ },
66
+ } as JsonLd.Response,
67
+ notFound: {
68
+ meta: {
69
+ visibility: 'not_found',
70
+ access: 'forbidden',
71
+ auth: [],
72
+ definitionId: 'd1',
73
+ key: 'object-provider',
74
+ },
75
+ data: {
76
+ '@context': {
77
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
78
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
79
+ schema: 'http://schema.org/',
80
+ },
81
+ '@type': 'Object',
82
+ name: 'I love cheese',
83
+ url: 'https://some.url',
84
+ },
85
+ } as JsonLd.Response,
86
+ forbidden: {
87
+ meta: {
88
+ visibility: 'restricted',
89
+ access: 'forbidden',
90
+ auth: [
91
+ {
92
+ key: 'some-flow',
93
+ displayName: 'Flow',
94
+ url: 'https://outbound-auth/flow',
95
+ },
96
+ ],
97
+ definitionId: 'd1',
98
+ key: 'object-provider',
99
+ },
100
+ data: {
101
+ '@context': {
102
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
103
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
104
+ schema: 'http://schema.org/',
105
+ },
106
+ '@type': 'Object',
107
+ name: 'I love cheese',
108
+ url: 'https://some.url',
109
+ },
110
+ } as JsonLd.Response,
111
+ confluenceSearchResolved: {
112
+ meta: {
113
+ auth: [],
114
+ definitionId: 'confluence-object-provider',
115
+ product: 'confluence',
116
+ visibility: 'restricted',
117
+ access: 'granted',
118
+ resourceType: 'search',
119
+ objectId: 'text=searchsomething',
120
+ tenantId: 'DUMMY-a5a01d21-1cc3-4f29-9565-f2bb8cd969f5',
121
+ category: 'object',
122
+ key: 'confluence-object-provider',
123
+ },
124
+ data: {
125
+ '@context': {
126
+ '@vocab': 'https://www.w3.org/ns/activitystreams#',
127
+ atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
128
+ schema: 'http://schema.org/',
129
+ },
130
+ generator: {
131
+ '@type': 'Application',
132
+ '@id': 'https://www.atlassian.com/#Confluence',
133
+ name: 'Confluence',
134
+ icon: {
135
+ '@type': 'Image',
136
+ url: 'https://cdn.bfldr.com/K3MHR9G8/at/hcwrtqnwvz33bn73b84ncpt5/confluence-mark-contained-gradient-blue.svg?auto=webp&format=png&width=320&height=320',
137
+ },
138
+ },
139
+ '@type': ['Object'],
140
+ url: 'https://pug.jira-dev.com/wiki/search?text=searchsomething',
141
+ name: '55 Results',
142
+ 'atlassian:titlePrefix': {
143
+ text: '',
144
+ '@type': 'atlassian:Emoji',
145
+ },
146
+ },
147
+ datasources: [
148
+ {
149
+ key: 'datasource-confluence-search',
150
+ parameters: {
151
+ searchString: 'searchsomething',
152
+ },
153
+ id: '768fc736-3af4-4a8f-b27e-203602bff8ca',
154
+ ari: 'ari:cloud:linking-platform::datasource/768fc736-3af4-4a8f-b27e-203602bff8ca',
155
+ description: 'For extracting a list of Confluence search results',
156
+ name: 'Confluence search',
157
+ },
158
+ ],
159
+ } as JsonLd.Response,
160
160
  };
@@ -10,41 +10,41 @@ const jqlUrlRegExp = /.*[?&]jql=.*/;
10
10
  const confluenceSearchRegExp = /^https?:\/\/[^\/]+\/wiki\/spaces\/.*/;
11
11
 
12
12
  const mockedFetch = (url: string): Promise<JsonLd.Response> => {
13
- if (confluenceSearchRegExp.test(url)) {
14
- return Promise.resolve(mocks.confluenceSearchResolved);
15
- }
16
- if (jqlUrlRegExp.test(url)) {
17
- return Promise.resolve(mockJqlSmartLinkData.resolved);
18
- }
19
- switch (url) {
20
- case 'https://product-fabric.atlassian.net/browse/EDM-5941':
21
- case 'https://product-fabric.atlassian.net/browse/EDM-5591':
22
- return Promise.resolve(mocks.resolved);
23
- case 'https://link-that-does-not-resolve.com':
24
- return Promise.reject(`Can't resolve from ${url}`);
25
- case 'https://link-that-is-still-resolving.com/long-url/very-very-very-very-very-very-very-long':
26
- return new Promise(() => {});
27
- case 'https://link-that-is-unauthorized.com':
28
- return Promise.resolve(mocks.unauthorized);
29
- case 'https://link-that-is-not-found.com/long':
30
- return Promise.resolve(mocks.notFound);
31
- case 'https://link-that-is-forbidden.com':
32
- return Promise.resolve(mocks.forbidden);
33
- case 'https://link-that-is-unsupported.com':
34
- throw new APIError(
35
- 'fatal',
36
- new URL(url).hostname,
37
- 'received unsupported error',
38
- 'ResolveUnsupportedError',
39
- );
40
- default:
41
- return Promise.resolve(mocks.unauthorized);
42
- }
13
+ if (confluenceSearchRegExp.test(url)) {
14
+ return Promise.resolve(mocks.confluenceSearchResolved);
15
+ }
16
+ if (jqlUrlRegExp.test(url)) {
17
+ return Promise.resolve(mockJqlSmartLinkData.resolved);
18
+ }
19
+ switch (url) {
20
+ case 'https://product-fabric.atlassian.net/browse/EDM-5941':
21
+ case 'https://product-fabric.atlassian.net/browse/EDM-5591':
22
+ return Promise.resolve(mocks.resolved);
23
+ case 'https://link-that-does-not-resolve.com':
24
+ return Promise.reject(`Can't resolve from ${url}`);
25
+ case 'https://link-that-is-still-resolving.com/long-url/very-very-very-very-very-very-very-long':
26
+ return new Promise(() => {});
27
+ case 'https://link-that-is-unauthorized.com':
28
+ return Promise.resolve(mocks.unauthorized);
29
+ case 'https://link-that-is-not-found.com/long':
30
+ return Promise.resolve(mocks.notFound);
31
+ case 'https://link-that-is-forbidden.com':
32
+ return Promise.resolve(mocks.forbidden);
33
+ case 'https://link-that-is-unsupported.com':
34
+ throw new APIError(
35
+ 'fatal',
36
+ new URL(url).hostname,
37
+ 'received unsupported error',
38
+ 'ResolveUnsupportedError',
39
+ );
40
+ default:
41
+ return Promise.resolve(mocks.unauthorized);
42
+ }
43
43
  };
44
44
 
45
45
  class SmartLinkClient extends CardClient {
46
- prefetchData = mockedFetch;
47
- fetchData = mockedFetch;
46
+ prefetchData = mockedFetch;
47
+ fetchData = mockedFetch;
48
48
  }
49
49
 
50
50
  export default SmartLinkClient;
@@ -6,52 +6,52 @@ import { type DatasourceTableViewProps } from '../src/ui/datasource-table-view/t
6
6
  import { type ColumnSizesMap } from '../src/ui/issue-like-table/types';
7
7
 
8
8
  export const useAssetsTableProps = (
9
- props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
9
+ props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
10
10
  ): Required<
11
- Pick<
12
- DatasourceTableViewProps,
13
- | 'visibleColumnKeys'
14
- | 'onVisibleColumnKeysChange'
15
- | 'wrappedColumnKeys'
16
- | 'onWrappedColumnChange'
17
- | 'onColumnResize'
18
- >
11
+ Pick<
12
+ DatasourceTableViewProps,
13
+ | 'visibleColumnKeys'
14
+ | 'onVisibleColumnKeysChange'
15
+ | 'wrappedColumnKeys'
16
+ | 'onWrappedColumnChange'
17
+ | 'onColumnResize'
18
+ >
19
19
  > &
20
- Pick<DatasourceTableViewProps, 'columnCustomSizes'> => {
21
- const [visibleColumnKeys, onVisibleColumnKeysChange] = useState<string[]>(
22
- assetsDefaultInitialVisibleColumnKeys,
23
- );
24
-
25
- const [columnCustomSizes, setColumnCustomSizes] = useState<
26
- ColumnSizesMap | undefined
27
- >(props.defaultColumnCustomSizes);
28
-
29
- const onColumnResize = useCallback(
30
- (key: string, width: number) => {
31
- setColumnCustomSizes({ ...columnCustomSizes, [key]: width });
32
- },
33
- [columnCustomSizes],
34
- );
35
-
36
- const [wrappedColumnKeys, setWrappedColumnKeys] = useState<string[]>([]);
37
-
38
- const onWrappedColumnChange = useCallback(
39
- (key: string, shouldWrap: boolean) => {
40
- if (shouldWrap) {
41
- setWrappedColumnKeys([...wrappedColumnKeys, key]);
42
- } else {
43
- setWrappedColumnKeys(wrappedColumnKeys.filter(k => k !== key));
44
- }
45
- },
46
- [wrappedColumnKeys],
47
- );
48
-
49
- return {
50
- visibleColumnKeys,
51
- onVisibleColumnKeysChange,
52
- columnCustomSizes,
53
- onColumnResize,
54
- wrappedColumnKeys,
55
- onWrappedColumnChange,
56
- };
20
+ Pick<DatasourceTableViewProps, 'columnCustomSizes'> => {
21
+ const [visibleColumnKeys, onVisibleColumnKeysChange] = useState<string[]>(
22
+ assetsDefaultInitialVisibleColumnKeys,
23
+ );
24
+
25
+ const [columnCustomSizes, setColumnCustomSizes] = useState<ColumnSizesMap | undefined>(
26
+ props.defaultColumnCustomSizes,
27
+ );
28
+
29
+ const onColumnResize = useCallback(
30
+ (key: string, width: number) => {
31
+ setColumnCustomSizes({ ...columnCustomSizes, [key]: width });
32
+ },
33
+ [columnCustomSizes],
34
+ );
35
+
36
+ const [wrappedColumnKeys, setWrappedColumnKeys] = useState<string[]>([]);
37
+
38
+ const onWrappedColumnChange = useCallback(
39
+ (key: string, shouldWrap: boolean) => {
40
+ if (shouldWrap) {
41
+ setWrappedColumnKeys([...wrappedColumnKeys, key]);
42
+ } else {
43
+ setWrappedColumnKeys(wrappedColumnKeys.filter((k) => k !== key));
44
+ }
45
+ },
46
+ [wrappedColumnKeys],
47
+ );
48
+
49
+ return {
50
+ visibleColumnKeys,
51
+ onVisibleColumnKeysChange,
52
+ columnCustomSizes,
53
+ onColumnResize,
54
+ wrappedColumnKeys,
55
+ onWrappedColumnChange,
56
+ };
57
57
  };
@@ -8,34 +8,32 @@ import { useColumnResize } from '../src/ui/issue-like-table/use-column-resize';
8
8
  import { useColumnWrapping } from '../src/ui/issue-like-table/use-column-wrapping';
9
9
 
10
10
  export const useCommonTableProps = (
11
- props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
11
+ props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
12
12
  ): Required<
13
- Pick<
14
- DatasourceTableViewProps,
15
- | 'visibleColumnKeys'
16
- | 'onVisibleColumnKeysChange'
17
- | 'wrappedColumnKeys'
18
- | 'onWrappedColumnChange'
19
- | 'onColumnResize'
20
- >
13
+ Pick<
14
+ DatasourceTableViewProps,
15
+ | 'visibleColumnKeys'
16
+ | 'onVisibleColumnKeysChange'
17
+ | 'wrappedColumnKeys'
18
+ | 'onWrappedColumnChange'
19
+ | 'onColumnResize'
20
+ >
21
21
  > &
22
- Pick<DatasourceTableViewProps, 'columnCustomSizes'> => {
23
- const [visibleColumnKeys, onVisibleColumnKeysChange] = useState<string[]>(
24
- defaultInitialVisibleJiraColumnKeys,
25
- );
22
+ Pick<DatasourceTableViewProps, 'columnCustomSizes'> => {
23
+ const [visibleColumnKeys, onVisibleColumnKeysChange] = useState<string[]>(
24
+ defaultInitialVisibleJiraColumnKeys,
25
+ );
26
26
 
27
- const { columnCustomSizes, onColumnResize } = useColumnResize(
28
- props.defaultColumnCustomSizes,
29
- );
27
+ const { columnCustomSizes, onColumnResize } = useColumnResize(props.defaultColumnCustomSizes);
30
28
 
31
- const { wrappedColumnKeys, onWrappedColumnChange } = useColumnWrapping([]);
29
+ const { wrappedColumnKeys, onWrappedColumnChange } = useColumnWrapping([]);
32
30
 
33
- return {
34
- visibleColumnKeys,
35
- onVisibleColumnKeysChange,
36
- columnCustomSizes,
37
- onColumnResize,
38
- wrappedColumnKeys,
39
- onWrappedColumnChange,
40
- };
31
+ return {
32
+ visibleColumnKeys,
33
+ onVisibleColumnKeysChange,
34
+ columnCustomSizes,
35
+ onColumnResize,
36
+ wrappedColumnKeys,
37
+ onWrappedColumnChange,
38
+ };
41
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,22 +42,22 @@
42
42
  "@atlaskit/badge": "^16.1.0",
43
43
  "@atlaskit/button": "^17.17.0",
44
44
  "@atlaskit/datetime-picker": "^13.5.0",
45
- "@atlaskit/dropdown-menu": "^12.10.0",
45
+ "@atlaskit/dropdown-menu": "^12.11.0",
46
46
  "@atlaskit/editor-prosemirror": "4.0.1",
47
47
  "@atlaskit/empty-state": "^7.8.0",
48
- "@atlaskit/form": "^10.2.0",
48
+ "@atlaskit/form": "^10.3.0",
49
49
  "@atlaskit/heading": "^2.3.0",
50
50
  "@atlaskit/icon": "^22.3.0",
51
51
  "@atlaskit/icon-object": "^6.4.0",
52
52
  "@atlaskit/image": "^1.2.0",
53
53
  "@atlaskit/intl-messages-provider": "^1.0.0",
54
- "@atlaskit/jql-ast": "^3.2.0",
54
+ "@atlaskit/jql-ast": "^3.3.0",
55
55
  "@atlaskit/jql-editor": "^4.3.0",
56
56
  "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
57
- "@atlaskit/link-client-extension": "^1.8.0",
57
+ "@atlaskit/link-client-extension": "^1.9.0",
58
58
  "@atlaskit/linking-common": "^5.7.0",
59
59
  "@atlaskit/linking-types": "^8.9.0",
60
- "@atlaskit/logo": "^13.17.0",
60
+ "@atlaskit/logo": "^14.0.0",
61
61
  "@atlaskit/lozenge": "^11.7.0",
62
62
  "@atlaskit/modal-dialog": "^12.13.0",
63
63
  "@atlaskit/outbound-auth-flow-client": "^3.4.5",
@@ -67,14 +67,14 @@
67
67
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
68
68
  "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.1.0",
69
69
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
70
- "@atlaskit/primitives": "^6.3.0",
70
+ "@atlaskit/primitives": "^7.0.0",
71
71
  "@atlaskit/select": "^17.10.0",
72
- "@atlaskit/smart-card": "^27.3.0",
72
+ "@atlaskit/smart-card": "^27.5.0",
73
73
  "@atlaskit/smart-user-picker": "6.9.3",
74
74
  "@atlaskit/spinner": "^16.1.0",
75
75
  "@atlaskit/tag": "^12.2.0",
76
76
  "@atlaskit/textfield": "6.3.1",
77
- "@atlaskit/theme": "^12.8.0",
77
+ "@atlaskit/theme": "^12.9.0",
78
78
  "@atlaskit/tokens": "^1.49.0",
79
79
  "@atlaskit/tooltip": "^18.4.0",
80
80
  "@atlaskit/ufo": "^0.2.4",
@@ -96,11 +96,10 @@
96
96
  "devDependencies": {
97
97
  "@af/integration-testing": "*",
98
98
  "@af/visual-regression": "*",
99
- "@atlaskit/link-provider": "^1.9.0",
99
+ "@atlaskit/link-provider": "^1.11.0",
100
100
  "@atlaskit/link-test-helpers": "^7.0.0",
101
101
  "@atlaskit/ssr": "*",
102
102
  "@atlaskit/visual-regression": "*",
103
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
104
103
  "@atlassian/feature-flags-test-utils": "^0.2.0",
105
104
  "@faker-js/faker": "^7.5.0",
106
105
  "@testing-library/dom": "^8.17.1",
@@ -151,8 +150,14 @@
151
150
  ".": "./src/index.ts",
152
151
  "./elements": "./src/elements.ts"
153
152
  },
154
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
155
153
  "platform-feature-flags": {
154
+ "platform.linking-platform.datasource.add-timezone-header": {
155
+ "type": "boolean",
156
+ "referenceOnly": "true"
157
+ },
158
+ "platform.linking-platform.datasource-assets_add_version_parameter": {
159
+ "type": "boolean"
160
+ },
156
161
  "platform.linking-platform.datasource.show-jlol-basic-filters": {
157
162
  "type": "boolean"
158
163
  },