@atlaskit/link-datasource 3.12.1 → 3.13.1

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 (53) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/hooks/useLoadOptions.js +100 -0
  3. package/dist/cjs/ui/common/error-state/loading-error.js +11 -12
  4. package/dist/cjs/ui/common/error-state/modal-loading-error.js +10 -17
  5. package/dist/cjs/ui/common/error-state/no-instances.js +11 -11
  6. package/dist/cjs/ui/common/error-state/no-results.js +15 -19
  7. package/dist/cjs/ui/common/modal/count-view-smart-link/index.js +19 -15
  8. package/dist/cjs/ui/issue-like-table/edit-type/icon/index.js +16 -106
  9. package/dist/cjs/ui/issue-like-table/edit-type/index.js +26 -9
  10. package/dist/cjs/ui/issue-like-table/edit-type/status/index.js +10 -112
  11. package/dist/cjs/ui/issue-like-table/edit-type/text/index.js +4 -6
  12. package/dist/cjs/ui/issue-like-table/edit-type/user/index.js +97 -0
  13. package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +5 -2
  14. package/dist/es2019/hooks/useLoadOptions.js +63 -0
  15. package/dist/es2019/ui/common/error-state/loading-error.js +11 -12
  16. package/dist/es2019/ui/common/error-state/modal-loading-error.js +10 -17
  17. package/dist/es2019/ui/common/error-state/no-instances.js +13 -13
  18. package/dist/es2019/ui/common/error-state/no-results.js +16 -20
  19. package/dist/es2019/ui/common/modal/count-view-smart-link/index.js +20 -16
  20. package/dist/es2019/ui/issue-like-table/edit-type/icon/index.js +13 -74
  21. package/dist/es2019/ui/issue-like-table/edit-type/index.js +24 -5
  22. package/dist/es2019/ui/issue-like-table/edit-type/status/index.js +8 -76
  23. package/dist/es2019/ui/issue-like-table/edit-type/text/index.js +5 -5
  24. package/dist/es2019/ui/issue-like-table/edit-type/user/index.js +74 -0
  25. package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +5 -2
  26. package/dist/esm/hooks/useLoadOptions.js +93 -0
  27. package/dist/esm/ui/common/error-state/loading-error.js +11 -12
  28. package/dist/esm/ui/common/error-state/modal-loading-error.js +10 -17
  29. package/dist/esm/ui/common/error-state/no-instances.js +13 -13
  30. package/dist/esm/ui/common/error-state/no-results.js +16 -20
  31. package/dist/esm/ui/common/modal/count-view-smart-link/index.js +20 -16
  32. package/dist/esm/ui/issue-like-table/edit-type/icon/index.js +18 -107
  33. package/dist/esm/ui/issue-like-table/edit-type/index.js +25 -5
  34. package/dist/esm/ui/issue-like-table/edit-type/status/index.js +11 -113
  35. package/dist/esm/ui/issue-like-table/edit-type/text/index.js +3 -5
  36. package/dist/esm/ui/issue-like-table/edit-type/user/index.js +87 -0
  37. package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +5 -2
  38. package/dist/types/hooks/useLoadOptions.d.ts +11 -0
  39. package/dist/types/ui/issue-like-table/edit-type/icon/index.d.ts +2 -2
  40. package/dist/types/ui/issue-like-table/edit-type/index.d.ts +1 -0
  41. package/dist/types/ui/issue-like-table/edit-type/status/index.d.ts +4 -4
  42. package/dist/types/ui/issue-like-table/edit-type/text/index.d.ts +2 -3
  43. package/dist/types/ui/issue-like-table/edit-type/user/index.d.ts +11 -0
  44. package/dist/types/ui/issue-like-table/types.d.ts +3 -0
  45. package/dist/types-ts4.5/hooks/useLoadOptions.d.ts +11 -0
  46. package/dist/types-ts4.5/ui/issue-like-table/edit-type/icon/index.d.ts +2 -2
  47. package/dist/types-ts4.5/ui/issue-like-table/edit-type/index.d.ts +1 -0
  48. package/dist/types-ts4.5/ui/issue-like-table/edit-type/status/index.d.ts +4 -4
  49. package/dist/types-ts4.5/ui/issue-like-table/edit-type/text/index.d.ts +2 -3
  50. package/dist/types-ts4.5/ui/issue-like-table/edit-type/user/index.d.ts +11 -0
  51. package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +3 -0
  52. package/examples-helpers/buildIssueLikeTable.tsx +2 -1
  53. package/package.json +8 -5
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
3
  import { type ExecuteFetch } from '../../../../state/actions';
4
4
  import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
- interface Props extends Omit<FieldProps<string>, 'value'> {
5
+ interface IconEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
6
  currentValue: DatasourceTypeWithOnlyTypeValues<'icon'>;
7
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
8
  executeFetch?: ExecuteFetch;
@@ -10,5 +10,5 @@ interface Props extends Omit<FieldProps<string>, 'value'> {
10
10
  /**
11
11
  * Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
12
12
  */
13
- declare const IconEditType: (props: Props) => JSX.Element;
13
+ declare const IconEditType: (props: IconEditTypeProps) => JSX.Element;
14
14
  export default IconEditType;
@@ -11,3 +11,4 @@ export declare const editType: ({ defaultValue, currentValue, setEditValues, exe
11
11
  }) => Pick<React.ComponentProps<typeof InlineEdit>, 'defaultValue' | 'editView'>;
12
12
  export declare const isEditTypeSupported: (type: DatasourceType['type']) => boolean;
13
13
  export declare const isEditTypeSelectable: (type: DatasourceType['type']) => boolean;
14
+ export declare const toValueType: <T>(typeWithValues: DatasourceTypeWithOnlyValues) => T;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
3
  import type { ExecuteFetch } from '../../../../state/actions';
4
- import type { DatasourceTypeWithOnlyValues } from '../../types';
5
- interface Props extends Omit<FieldProps<string>, 'value'> {
6
- currentValue: DatasourceTypeWithOnlyValues;
4
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
+ interface StatusEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
+ currentValue: DatasourceTypeWithOnlyTypeValues<'status'>;
7
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
8
  executeFetch?: ExecuteFetch;
9
9
  }
10
- declare const StatusEditType: (props: Props) => JSX.Element;
10
+ declare const StatusEditType: (props: StatusEditTypeProps) => JSX.Element;
11
11
  export default StatusEditType;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
- import type { DatasourceTypeWithOnlyValues } from '../../types';
3
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
4
4
  interface TextEditTypeProps extends Omit<FieldProps<string>, 'value'> {
5
- currentValue: DatasourceTypeWithOnlyValues;
5
+ currentValue: DatasourceTypeWithOnlyTypeValues<'string'>;
6
6
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
7
7
  }
8
- export declare const toTextValue: (typeWithValues: DatasourceTypeWithOnlyValues) => string;
9
8
  declare const TextEditType: (props: TextEditTypeProps) => JSX.Element;
10
9
  export default TextEditType;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { type FieldProps } from '@atlaskit/form';
3
+ import type { ExecuteFetch } from '../../../../state/actions';
4
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
+ interface UserEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
+ currentValue: DatasourceTypeWithOnlyTypeValues<'user'>;
7
+ setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
+ executeFetch?: ExecuteFetch;
9
+ }
10
+ declare const UserEditType: (props: UserEditTypeProps) => JSX.Element;
11
+ export default UserEditType;
@@ -16,6 +16,9 @@ export type DatasourceTypeWithOnlyTypeValues<K> = {
16
16
  type: K;
17
17
  }>['value'][];
18
18
  };
19
+ export type DatasourceTypeValueType<K> = Extract<DatasourceType, {
20
+ type: K;
21
+ }>['value'];
19
22
  export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
20
23
  export interface ColumnSizesMap {
21
24
  [key: string]: number;
@@ -0,0 +1,11 @@
1
+ import { type AtomicActionExecuteRequest } from '@atlaskit/linking-types';
2
+ import type { ExecuteFetch } from '../state/actions';
3
+ export type LoadOptionsProps = {
4
+ fetchInputs?: AtomicActionExecuteRequest['parameters']['inputs'];
5
+ executeFetch?: ExecuteFetch;
6
+ };
7
+ export declare const useLoadOptions: <T>({ fetchInputs, executeFetch }: LoadOptionsProps) => {
8
+ options: T[];
9
+ isLoading: boolean;
10
+ hasFailed: boolean;
11
+ };
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
3
  import { type ExecuteFetch } from '../../../../state/actions';
4
4
  import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
- interface Props extends Omit<FieldProps<string>, 'value'> {
5
+ interface IconEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
6
  currentValue: DatasourceTypeWithOnlyTypeValues<'icon'>;
7
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
8
  executeFetch?: ExecuteFetch;
@@ -10,5 +10,5 @@ interface Props extends Omit<FieldProps<string>, 'value'> {
10
10
  /**
11
11
  * Should be gated by FF rollout of platform-datasources-enable-two-way-sync-priority
12
12
  */
13
- declare const IconEditType: (props: Props) => JSX.Element;
13
+ declare const IconEditType: (props: IconEditTypeProps) => JSX.Element;
14
14
  export default IconEditType;
@@ -11,3 +11,4 @@ export declare const editType: ({ defaultValue, currentValue, setEditValues, exe
11
11
  }) => Pick<React.ComponentProps<typeof InlineEdit>, 'defaultValue' | 'editView'>;
12
12
  export declare const isEditTypeSupported: (type: DatasourceType['type']) => boolean;
13
13
  export declare const isEditTypeSelectable: (type: DatasourceType['type']) => boolean;
14
+ export declare const toValueType: <T>(typeWithValues: DatasourceTypeWithOnlyValues) => T;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
3
  import type { ExecuteFetch } from '../../../../state/actions';
4
- import type { DatasourceTypeWithOnlyValues } from '../../types';
5
- interface Props extends Omit<FieldProps<string>, 'value'> {
6
- currentValue: DatasourceTypeWithOnlyValues;
4
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
+ interface StatusEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
+ currentValue: DatasourceTypeWithOnlyTypeValues<'status'>;
7
7
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
8
  executeFetch?: ExecuteFetch;
9
9
  }
10
- declare const StatusEditType: (props: Props) => JSX.Element;
10
+ declare const StatusEditType: (props: StatusEditTypeProps) => JSX.Element;
11
11
  export default StatusEditType;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
  import { type FieldProps } from '@atlaskit/form';
3
- import type { DatasourceTypeWithOnlyValues } from '../../types';
3
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
4
4
  interface TextEditTypeProps extends Omit<FieldProps<string>, 'value'> {
5
- currentValue: DatasourceTypeWithOnlyValues;
5
+ currentValue: DatasourceTypeWithOnlyTypeValues<'string'>;
6
6
  setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
7
7
  }
8
- export declare const toTextValue: (typeWithValues: DatasourceTypeWithOnlyValues) => string;
9
8
  declare const TextEditType: (props: TextEditTypeProps) => JSX.Element;
10
9
  export default TextEditType;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { type FieldProps } from '@atlaskit/form';
3
+ import type { ExecuteFetch } from '../../../../state/actions';
4
+ import type { DatasourceTypeWithOnlyTypeValues, DatasourceTypeWithOnlyValues } from '../../types';
5
+ interface UserEditTypeProps extends Omit<FieldProps<string>, 'value'> {
6
+ currentValue: DatasourceTypeWithOnlyTypeValues<'user'>;
7
+ setEditValues: React.Dispatch<React.SetStateAction<DatasourceTypeWithOnlyValues>>;
8
+ executeFetch?: ExecuteFetch;
9
+ }
10
+ declare const UserEditType: (props: UserEditTypeProps) => JSX.Element;
11
+ export default UserEditType;
@@ -16,6 +16,9 @@ export type DatasourceTypeWithOnlyTypeValues<K> = {
16
16
  type: K;
17
17
  }>['value'][];
18
18
  };
19
+ export type DatasourceTypeValueType<K> = Extract<DatasourceType, {
20
+ type: K;
21
+ }>['value'];
19
22
  export type TableViewPropsRenderType = (item: DatasourceTypeWithOnlyValues) => React.ReactNode;
20
23
  export interface ColumnSizesMap {
21
24
  [key: string]: number;
@@ -12,6 +12,7 @@ import styled from '@emotion/styled';
12
12
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
13
13
  import { SmartCardProvider } from '@atlaskit/link-provider';
14
14
  import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
15
+ import { Text } from '@atlaskit/primitives';
15
16
 
16
17
  import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
17
18
  import { DatasourceExperienceIdProvider } from '../src/contexts/datasource-experience-id';
@@ -119,7 +120,7 @@ const ExampleBody = ({
119
120
  wrappedColumnKeys={wrappedColumnKeys}
120
121
  />
121
122
  ) : (
122
- <span>Loading ...</span>
123
+ <Text as="span">Loading ...</Text>
123
124
  )}
124
125
  </TableViewWrapper>
125
126
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.12.1",
3
+ "version": "3.13.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,13 +42,13 @@
42
42
  "@atlaskit/badge": "^16.4.0",
43
43
  "@atlaskit/button": "^20.3.0",
44
44
  "@atlaskit/datetime-picker": "^15.9.0",
45
- "@atlaskit/dropdown-menu": "^12.22.0",
45
+ "@atlaskit/dropdown-menu": "^12.23.0",
46
46
  "@atlaskit/editor-prosemirror": "6.0.0",
47
47
  "@atlaskit/empty-state": "^7.12.0",
48
48
  "@atlaskit/flag": "^15.8.0",
49
49
  "@atlaskit/form": "^10.5.0",
50
50
  "@atlaskit/heading": "^3.1.0",
51
- "@atlaskit/icon": "^22.25.0",
51
+ "@atlaskit/icon": "^22.26.0",
52
52
  "@atlaskit/icon-object": "^6.7.0",
53
53
  "@atlaskit/image": "^1.3.0",
54
54
  "@atlaskit/inline-edit": "^13.7.0",
@@ -72,8 +72,8 @@
72
72
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
73
73
  "@atlaskit/primitives": "^13.2.0",
74
74
  "@atlaskit/react-select": "^1.4.0",
75
- "@atlaskit/select": "^18.5.0",
76
- "@atlaskit/smart-card": "^30.3.0",
75
+ "@atlaskit/select": "^18.6.0",
76
+ "@atlaskit/smart-card": "^31.0.0",
77
77
  "@atlaskit/smart-user-picker": "6.11.2",
78
78
  "@atlaskit/spinner": "^16.3.0",
79
79
  "@atlaskit/tag": "^12.6.0",
@@ -171,6 +171,9 @@
171
171
  "platform-datasources-enable-two-way-sync-priority": {
172
172
  "type": "boolean"
173
173
  },
174
+ "platform-datasources-enable-two-way-sync-assignee": {
175
+ "type": "boolean"
176
+ },
174
177
  "platform.linking-platform.datasource-assets_update_refresh_button_dt3qk": {
175
178
  "type": "boolean"
176
179
  },