@atlaskit/link-datasource 7.5.3 → 7.6.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,26 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 7.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`366c86f823ba6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/366c86f823ba6) -
8
+ Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 7.5.4
15
+
16
+ ### Patch Changes
17
+
18
+ - [`007cec4e0b312`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/007cec4e0b312) -
19
+ Assets config modal: selecting an object schema now populates the AQL input with objectSchema =
20
+ "<schema name>" and runs the search immediately, so the schema's objects are shown without the
21
+ user having to type a query first. Any existing AQL is replaced when the schema changes. Behind
22
+ platform_lp_sllv_assets_default_schema_aql.
23
+
3
24
  ## 7.5.3
4
25
 
5
26
  ### Patch Changes
@@ -15,8 +15,10 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
15
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
16
  var _form = _interopRequireDefault(require("@atlaskit/form/form"));
17
17
  var _closeButton = require("@atlaskit/modal-dialog/close-button");
18
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
18
19
  var _flex = require("@atlaskit/primitives/compiled/flex");
19
20
  var _analytics = require("../../../analytics");
21
+ var _types = require("../../../types/assets/types");
20
22
  var _aqlSearchInput = require("./aql-search-input");
21
23
  var _objectSchemaSelect = require("./object-schema-select");
22
24
  var _styled = require("./styled");
@@ -66,7 +68,15 @@ var AssetsSearchContainer = exports.AssetsSearchContainer = function AssetsSearc
66
68
  onSubmit: onFormSubmit
67
69
  }, function (_ref2) {
68
70
  var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
69
- var formProps = _ref2.formProps;
71
+ var formProps = _ref2.formProps,
72
+ setFieldValue = _ref2.setFieldValue;
73
+ var onSchemaChange = function onSchemaChange(schema) {
74
+ if ((0, _fg.fg)('platform_lp_sllv_assets_default_schema_aql')) {
75
+ var defaultAql = "objectSchema = \"".concat(schema.label, "\"");
76
+ setFieldValue(_types.aqlKey, defaultAql);
77
+ onSearch(defaultAql, schema.value);
78
+ }
79
+ };
70
80
  return /*#__PURE__*/React.createElement(FormContainer, (0, _extends2.default)({}, formProps, {
71
81
  id: SEARCH_FORM_ID
72
82
  }), /*#__PURE__*/React.createElement(_styled.FormRowContainer, {
@@ -86,7 +96,8 @@ var AssetsSearchContainer = exports.AssetsSearchContainer = function AssetsSearc
86
96
  value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
87
97
  workspaceId: workspaceId,
88
98
  initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
89
- classNamePrefix: "assets-datasource-modal--object-schema-select"
99
+ classNamePrefix: "assets-datasource-modal--object-schema-select",
100
+ onSchemaChange: onSchemaChange
90
101
  })))), /*#__PURE__*/React.createElement(_styled.FormRowContainer, null, /*#__PURE__*/React.createElement(_aqlSearchInput.AqlSearchInput, {
91
102
  value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
92
103
  workspaceId: workspaceId,
@@ -74,6 +74,7 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
74
74
  var value = _ref2.value,
75
75
  workspaceId = _ref2.workspaceId,
76
76
  initialObjectSchemas = _ref2.initialObjectSchemas,
77
+ onSchemaChange = _ref2.onSchemaChange,
77
78
  _ref2$classNamePrefix = _ref2.classNamePrefix,
78
79
  _classNamePrefix = _ref2$classNamePrefix === void 0 ? 'assets-datasource-modal--object-schema-select' : _ref2$classNamePrefix,
79
80
  _ref2$testId = _ref2.testId,
@@ -185,7 +186,10 @@ var AssetsObjectSchemaSelect = exports.AssetsObjectSchemaSelect = function Asset
185
186
  options: options,
186
187
  placeholder: formatMessage(_messages.objectSchemaSelectMessages.placeholder),
187
188
  onChange: function onChange(newOption) {
188
- return newOption && _onChange(newOption);
189
+ if (newOption) {
190
+ _onChange(newOption);
191
+ onSchemaChange === null || onSchemaChange === void 0 || onSchemaChange(newOption);
192
+ }
189
193
  },
190
194
  inputValue: searchTerm,
191
195
  onInputChange: handleInputChange,
@@ -6,8 +6,10 @@ import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import Form from '@atlaskit/form/form';
8
8
  import { CloseButton } from '@atlaskit/modal-dialog/close-button';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
9
10
  import { Flex } from '@atlaskit/primitives/compiled/flex';
10
11
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
12
+ import { aqlKey } from '../../../types/assets/types';
11
13
  import { AqlSearchInput } from './aql-search-input';
12
14
  import { AssetsObjectSchemaSelect } from './object-schema-select';
13
15
  import { FormRowContainer } from './styled';
@@ -59,9 +61,17 @@ export const AssetsSearchContainer = props => {
59
61
  return /*#__PURE__*/React.createElement(Form, {
60
62
  onSubmit: onFormSubmit
61
63
  }, ({
62
- formProps
64
+ formProps,
65
+ setFieldValue
63
66
  }) => {
64
67
  var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
68
+ const onSchemaChange = schema => {
69
+ if (fg('platform_lp_sllv_assets_default_schema_aql')) {
70
+ const defaultAql = `objectSchema = "${schema.label}"`;
71
+ setFieldValue(aqlKey, defaultAql);
72
+ onSearch(defaultAql, schema.value);
73
+ }
74
+ };
65
75
  return /*#__PURE__*/React.createElement(FormContainer, _extends({}, formProps, {
66
76
  id: SEARCH_FORM_ID
67
77
  }), /*#__PURE__*/React.createElement(FormRowContainer, {
@@ -81,7 +91,8 @@ export const AssetsSearchContainer = props => {
81
91
  value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
82
92
  workspaceId: workspaceId,
83
93
  initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
84
- classNamePrefix: "assets-datasource-modal--object-schema-select"
94
+ classNamePrefix: "assets-datasource-modal--object-schema-select",
95
+ onSchemaChange: onSchemaChange
85
96
  })))), /*#__PURE__*/React.createElement(FormRowContainer, null, /*#__PURE__*/React.createElement(AqlSearchInput, {
86
97
  value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
87
98
  workspaceId: workspaceId,
@@ -55,6 +55,7 @@ export const AssetsObjectSchemaSelect = ({
55
55
  value,
56
56
  workspaceId,
57
57
  initialObjectSchemas,
58
+ onSchemaChange,
58
59
  classNamePrefix: _classNamePrefix = 'assets-datasource-modal--object-schema-select',
59
60
  testId = 'assets-datasource-modal--object-schema-select'
60
61
  }) => {
@@ -117,7 +118,12 @@ export const AssetsObjectSchemaSelect = ({
117
118
  isLoading: objectSchemasLoading,
118
119
  options: options,
119
120
  placeholder: formatMessage(objectSchemaSelectMessages.placeholder),
120
- onChange: newOption => newOption && onChange(newOption),
121
+ onChange: newOption => {
122
+ if (newOption) {
123
+ onChange(newOption);
124
+ onSchemaChange === null || onSchemaChange === void 0 ? void 0 : onSchemaChange(newOption);
125
+ }
126
+ },
121
127
  inputValue: searchTerm,
122
128
  onInputChange: handleInputChange,
123
129
  onMenuClose: onClose
@@ -8,8 +8,10 @@ import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  import Form from '@atlaskit/form/form';
10
10
  import { CloseButton } from '@atlaskit/modal-dialog/close-button';
11
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
11
12
  import { Flex } from '@atlaskit/primitives/compiled/flex';
12
13
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
14
+ import { aqlKey } from '../../../types/assets/types';
13
15
  import { AqlSearchInput } from './aql-search-input';
14
16
  import { AssetsObjectSchemaSelect } from './object-schema-select';
15
17
  import { FormRowContainer } from './styled';
@@ -57,7 +59,15 @@ export var AssetsSearchContainer = function AssetsSearchContainer(props) {
57
59
  onSubmit: onFormSubmit
58
60
  }, function (_ref2) {
59
61
  var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
60
- var formProps = _ref2.formProps;
62
+ var formProps = _ref2.formProps,
63
+ setFieldValue = _ref2.setFieldValue;
64
+ var onSchemaChange = function onSchemaChange(schema) {
65
+ if (fg('platform_lp_sllv_assets_default_schema_aql')) {
66
+ var defaultAql = "objectSchema = \"".concat(schema.label, "\"");
67
+ setFieldValue(aqlKey, defaultAql);
68
+ onSearch(defaultAql, schema.value);
69
+ }
70
+ };
61
71
  return /*#__PURE__*/React.createElement(FormContainer, _extends({}, formProps, {
62
72
  id: SEARCH_FORM_ID
63
73
  }), /*#__PURE__*/React.createElement(FormRowContainer, {
@@ -77,7 +87,8 @@ export var AssetsSearchContainer = function AssetsSearchContainer(props) {
77
87
  value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
78
88
  workspaceId: workspaceId,
79
89
  initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
80
- classNamePrefix: "assets-datasource-modal--object-schema-select"
90
+ classNamePrefix: "assets-datasource-modal--object-schema-select",
91
+ onSchemaChange: onSchemaChange
81
92
  })))), /*#__PURE__*/React.createElement(FormRowContainer, null, /*#__PURE__*/React.createElement(AqlSearchInput, {
82
93
  value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
83
94
  workspaceId: workspaceId,
@@ -68,6 +68,7 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
68
68
  var value = _ref2.value,
69
69
  workspaceId = _ref2.workspaceId,
70
70
  initialObjectSchemas = _ref2.initialObjectSchemas,
71
+ onSchemaChange = _ref2.onSchemaChange,
71
72
  _ref2$classNamePrefix = _ref2.classNamePrefix,
72
73
  _classNamePrefix = _ref2$classNamePrefix === void 0 ? 'assets-datasource-modal--object-schema-select' : _ref2$classNamePrefix,
73
74
  _ref2$testId = _ref2.testId,
@@ -179,7 +180,10 @@ export var AssetsObjectSchemaSelect = function AssetsObjectSchemaSelect(_ref2) {
179
180
  options: options,
180
181
  placeholder: formatMessage(objectSchemaSelectMessages.placeholder),
181
182
  onChange: function onChange(newOption) {
182
- return newOption && _onChange(newOption);
183
+ if (newOption) {
184
+ _onChange(newOption);
185
+ onSchemaChange === null || onSchemaChange === void 0 || onSchemaChange(newOption);
186
+ }
183
187
  },
184
188
  inputValue: searchTerm,
185
189
  onInputChange: handleInputChange,
@@ -1,4 +1,4 @@
1
- import type { ObjectSchema } from '../../../types/assets/types';
1
+ import { type ObjectSchema } from '../../../types/assets/types';
2
2
  export type InitialSearchData = {
3
3
  aql?: string;
4
4
  objectSchema?: ObjectSchema;
@@ -2,10 +2,11 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { type ObjectSchema } from '../../../../types/assets/types';
5
+ import { type ObjectSchema, type ObjectSchemaOption } from '../../../../types/assets/types';
6
6
  type AssetsObjectSchemaSelectProps = {
7
7
  classNamePrefix?: string;
8
8
  initialObjectSchemas: ObjectSchema[] | undefined;
9
+ onSchemaChange?: (schema: ObjectSchemaOption) => void;
9
10
  testId?: string;
10
11
  value: ObjectSchema | undefined;
11
12
  workspaceId: string;
@@ -21,5 +22,5 @@ export declare const selectInAModalStyleFixProps: {
21
22
  menuPortal: (base: any) => any;
22
23
  };
23
24
  };
24
- export declare const AssetsObjectSchemaSelect: ({ value, workspaceId, initialObjectSchemas, classNamePrefix: _classNamePrefix, testId, }: AssetsObjectSchemaSelectProps) => JSX.Element;
25
+ export declare const AssetsObjectSchemaSelect: ({ value, workspaceId, initialObjectSchemas, onSchemaChange, classNamePrefix: _classNamePrefix, testId, }: AssetsObjectSchemaSelectProps) => JSX.Element;
25
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "7.5.3",
3
+ "version": "7.6.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@atlaskit/adf-schema": "^57.7.0",
42
- "@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.280.0",
42
+ "@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.288.0",
43
43
  "@atlaskit/analytics-cross-product": "^2.3.0",
44
44
  "@atlaskit/analytics-next": "^12.6.0",
45
45
  "@atlaskit/atlassian-context": "^2.0.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/badge": "^22.0.0",
49
49
  "@atlaskit/button": "^25.6.0",
50
50
  "@atlaskit/css": "^1.1.0",
51
- "@atlaskit/datetime-picker": "^19.3.0",
51
+ "@atlaskit/datetime-picker": "^19.4.0",
52
52
  "@atlaskit/dropdown-menu": "^21.0.0",
53
53
  "@atlaskit/editor-prosemirror": "^9.0.0",
54
54
  "@atlaskit/empty-state": "^12.2.0",
@@ -86,18 +86,18 @@
86
86
  "@atlaskit/react-compiler-gating": "^0.2.0",
87
87
  "@atlaskit/react-select": "^4.12.0",
88
88
  "@atlaskit/select": "^23.1.0",
89
- "@atlaskit/smart-card": "^46.7.0",
90
- "@atlaskit/smart-user-picker": "^12.5.0",
89
+ "@atlaskit/smart-card": "^46.8.0",
90
+ "@atlaskit/smart-user-picker": "^12.6.0",
91
91
  "@atlaskit/spinner": "^20.4.0",
92
92
  "@atlaskit/tag": "^17.0.0",
93
93
  "@atlaskit/textfield": "^10.2.0",
94
94
  "@atlaskit/theme": "^28.2.0",
95
95
  "@atlaskit/toggle": "^17.3.0",
96
- "@atlaskit/tokens": "^20.6.0",
96
+ "@atlaskit/tokens": "^20.7.0",
97
97
  "@atlaskit/tooltip": "^24.4.0",
98
- "@atlaskit/top-layer": "^6.6.0",
98
+ "@atlaskit/top-layer": "^6.7.0",
99
99
  "@atlaskit/ufo": "^2.0.0",
100
- "@atlaskit/user-picker": "^14.2.0",
100
+ "@atlaskit/user-picker": "^14.3.0",
101
101
  "@atlaskit/visually-hidden": "^4.4.0",
102
102
  "@atlaskit/width-detector": "^7.2.0",
103
103
  "@babel/runtime": "^7.0.0",
@@ -178,6 +178,9 @@
178
178
  "astral_units_workspace_host_resolver": {
179
179
  "type": "boolean"
180
180
  },
181
+ "platform_lp_sllv_assets_default_schema_aql": {
182
+ "type": "boolean"
183
+ },
181
184
  "electric_issue_like_table_xpc_url_wrapping": {
182
185
  "type": "boolean"
183
186
  },