@atlaskit/link-datasource 4.26.0 → 4.27.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,13 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 4.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`9f7b37d4149bc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9f7b37d4149bc) -
8
+ [ux] Add optional `disableSiteSelector` prop to `confluence-search-modal`. Setting the prop to
9
+ true allows the consumer to hide the site selector dropdown in the modal header.
10
+
3
11
  ## 4.26.0
4
12
 
5
13
  ### Minor Changes
package/compass.yml CHANGED
@@ -7,7 +7,7 @@ description: >-
7
7
  resources or data points within the platform.
8
8
  configVersion: 1
9
9
  typeId: CAPABILITY
10
- ownerId: 'ari:cloud:identity::team/e738fbc3-d778-4660-aa11-5697a458ffa7'
10
+ ownerId: 'ari:cloud:identity::team/0e6dedf8-18d1-4531-b4b9-07648a425d47'
11
11
  fields:
12
12
  isMonorepoProject: false
13
13
  tier: 4
@@ -21,10 +21,10 @@ links:
21
21
  url: 'https://hello.jira.atlassian.cloud/jira/software/projects/NAVX/boards/14605'
22
22
  - name: ''
23
23
  type: CHAT_CHANNEL
24
- url: 'https://atlassian.enterprise.slack.com/archives/C07TNMDEVHC'
24
+ url: 'https://atlassian.enterprise.slack.com/archives/C09FTFN0APN'
25
25
  - name: ''
26
26
  type: ON_CALL
27
- url: 'https://hello.jira.atlassian.cloud/jira/ops/teams/e738fbc3-d778-4660-aa11-5697a458ffa7/on-call'
27
+ url: 'https://hello.jira.atlassian.cloud/jira/ops/teams/0e6dedf8-18d1-4531-b4b9-07648a425d47/on-call'
28
28
  relationships: null
29
29
  labels: null
30
30
  customFields:
@@ -55,7 +55,7 @@ customFields:
55
55
  value: null
56
56
  - name: Owner or Team Name
57
57
  type: single_select
58
- value: 1e93a963-fa64-4c3a-aebb-cc835e418a0a
58
+ value: 1e93a963-fa64-4c3a-aebb-cc835e418a0a # This means Yes
59
59
  - name: Perimeter
60
60
  type: single_select
61
61
  value: null
@@ -28,12 +28,14 @@ var styles = {
28
28
  };
29
29
  var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
30
30
  var availableSites = props.availableSites,
31
+ disableSiteSelector = props.disableSiteSelector,
31
32
  onSiteSelection = props.onSiteSelection,
32
33
  selectedSite = props.selectedSite,
33
34
  label = props.label,
34
35
  testId = props.testId;
35
36
  var _useIntl = (0, _reactIntlNext.useIntl)(),
36
37
  formatMessage = _useIntl.formatMessage;
38
+ var isSiteSelectorEnabled = !(0, _platformFeatureFlags.fg)('add-disablesiteselector') || !disableSiteSelector;
37
39
  var onChange = function onChange(newValue) {
38
40
  var selectedSite = availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (site) {
39
41
  return site.cloudId === (newValue === null || newValue === void 0 ? void 0 : newValue.value);
@@ -59,7 +61,7 @@ var SiteSelector = exports.SiteSelector = function SiteSelector(props) {
59
61
  }, /*#__PURE__*/React.createElement(_heading.default, {
60
62
  size: "medium",
61
63
  as: "h1"
62
- }, formatMessage(label)), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
64
+ }, formatMessage(label)), isSiteSelectorEnabled && availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
63
65
  "data-testid": "".concat(testId, "--trigger")
64
66
  }, /*#__PURE__*/React.createElement(_select.PopupSelect, {
65
67
  searchThreshold: 10,
@@ -17,6 +17,7 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
17
17
  var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
18
18
  var _link = _interopRequireDefault(require("@atlaskit/link"));
19
19
  var _modalDialog = require("@atlaskit/modal-dialog");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _compiled = require("@atlaskit/primitives/compiled");
21
22
  var _analytics = require("../../../analytics");
22
23
  var _types = require("../../../analytics/types");
@@ -63,7 +64,8 @@ var isValidParameters = function isValidParameters(parameters) {
63
64
  var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
64
65
  var onCancel = props.onCancel,
65
66
  urlBeingEdited = props.url,
66
- overrideParameters = props.overrideParameters;
67
+ overrideParameters = props.overrideParameters,
68
+ disableSiteSelector = props.disableSiteSelector;
67
69
  var _useViewModeContext = (0, _useViewModeContext2.useViewModeContext)(),
68
70
  currentViewMode = _useViewModeContext.currentViewMode;
69
71
  var _useIntl = (0, _reactIntlNext.useIntl)(),
@@ -152,7 +154,12 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
152
154
  shouldForceRequest: true
153
155
  });
154
156
  }, [reset, setParameters, userInteractions]);
155
- var siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
157
+ var siteSelectorLabel;
158
+ if (disableSiteSelector && (0, _platformFeatureFlags.fg)('add-disablesiteselector')) {
159
+ siteSelectorLabel = _messages.confluenceSearchModalMessages.insertIssuesTitle;
160
+ } else {
161
+ siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
162
+ }
156
163
  var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
157
164
  var hasConfluenceSearchParams = selectedConfluenceSite && (parameters === null || parameters === void 0 ? void 0 : parameters.searchString);
158
165
  var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
@@ -351,7 +358,8 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
351
358
  onSiteSelection: onSiteSelection,
352
359
  selectedSite: selectedConfluenceSite,
353
360
  testId: "confluence-search-datasource-modal--site-selector",
354
- label: siteSelectorLabel
361
+ label: siteSelectorLabel,
362
+ disableSiteSelector: disableSiteSelector
355
363
  }))))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, !hasNoConfluenceSites ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
356
364
  xcss: styles.inputContainerStyles
357
365
  }, /*#__PURE__*/_react.default.createElement(_confluenceSearchContainer.default, {
@@ -18,6 +18,7 @@ const styles = {
18
18
  export const SiteSelector = props => {
19
19
  const {
20
20
  availableSites,
21
+ disableSiteSelector,
21
22
  onSiteSelection,
22
23
  selectedSite,
23
24
  label,
@@ -26,6 +27,7 @@ export const SiteSelector = props => {
26
27
  const {
27
28
  formatMessage
28
29
  } = useIntl();
30
+ const isSiteSelectorEnabled = !fg('add-disablesiteselector') || !disableSiteSelector;
29
31
  const onChange = newValue => {
30
32
  const selectedSite = availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(site => site.cloudId === (newValue === null || newValue === void 0 ? void 0 : newValue.value));
31
33
  if (selectedSite) {
@@ -45,7 +47,7 @@ export const SiteSelector = props => {
45
47
  }, /*#__PURE__*/React.createElement(Heading, {
46
48
  size: "medium",
47
49
  as: "h1"
48
- }, formatMessage(label)), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
50
+ }, formatMessage(label)), isSiteSelectorEnabled && availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
49
51
  "data-testid": `${testId}--trigger`
50
52
  }, /*#__PURE__*/React.createElement(PopupSelect, {
51
53
  searchThreshold: 10,
@@ -8,6 +8,7 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
8
8
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
9
9
  import LinkComponent from '@atlaskit/link';
10
10
  import { CloseButton, ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box, Flex } from '@atlaskit/primitives/compiled';
12
13
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
13
14
  import { DatasourceAction, DatasourceSearchMethod } from '../../../analytics/types';
@@ -48,7 +49,8 @@ export const PlainConfluenceSearchConfigModal = props => {
48
49
  const {
49
50
  onCancel,
50
51
  url: urlBeingEdited,
51
- overrideParameters
52
+ overrideParameters,
53
+ disableSiteSelector
52
54
  } = props;
53
55
  const {
54
56
  currentViewMode
@@ -144,7 +146,12 @@ export const PlainConfluenceSearchConfigModal = props => {
144
146
  shouldForceRequest: true
145
147
  });
146
148
  }, [reset, setParameters, userInteractions]);
147
- const siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
149
+ let siteSelectorLabel;
150
+ if (disableSiteSelector && fg('add-disablesiteselector')) {
151
+ siteSelectorLabel = confluenceSearchModalMessages.insertIssuesTitle;
152
+ } else {
153
+ siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
154
+ }
148
155
  const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
149
156
  const hasConfluenceSearchParams = selectedConfluenceSite && (parameters === null || parameters === void 0 ? void 0 : parameters.searchString);
150
157
  const selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
@@ -334,7 +341,8 @@ export const PlainConfluenceSearchConfigModal = props => {
334
341
  onSiteSelection: onSiteSelection,
335
342
  selectedSite: selectedConfluenceSite,
336
343
  testId: "confluence-search-datasource-modal--site-selector",
337
- label: siteSelectorLabel
344
+ label: siteSelectorLabel,
345
+ disableSiteSelector: disableSiteSelector
338
346
  }))))), /*#__PURE__*/React.createElement(ModalBody, null, !hasNoConfluenceSites ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Box, {
339
347
  xcss: styles.inputContainerStyles
340
348
  }, /*#__PURE__*/React.createElement(ConfluenceSearchContainer, {
@@ -19,12 +19,14 @@ var styles = {
19
19
  };
20
20
  export var SiteSelector = function SiteSelector(props) {
21
21
  var availableSites = props.availableSites,
22
+ disableSiteSelector = props.disableSiteSelector,
22
23
  onSiteSelection = props.onSiteSelection,
23
24
  selectedSite = props.selectedSite,
24
25
  label = props.label,
25
26
  testId = props.testId;
26
27
  var _useIntl = useIntl(),
27
28
  formatMessage = _useIntl.formatMessage;
29
+ var isSiteSelectorEnabled = !fg('add-disablesiteselector') || !disableSiteSelector;
28
30
  var onChange = function onChange(newValue) {
29
31
  var selectedSite = availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (site) {
30
32
  return site.cloudId === (newValue === null || newValue === void 0 ? void 0 : newValue.value);
@@ -50,7 +52,7 @@ export var SiteSelector = function SiteSelector(props) {
50
52
  }, /*#__PURE__*/React.createElement(Heading, {
51
53
  size: "medium",
52
54
  as: "h1"
53
- }, formatMessage(label)), availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
55
+ }, formatMessage(label)), isSiteSelectorEnabled && availableSites && availableSites.length > 1 && /*#__PURE__*/React.createElement("span", {
54
56
  "data-testid": "".concat(testId, "--trigger")
55
57
  }, /*#__PURE__*/React.createElement(PopupSelect, {
56
58
  searchThreshold: 10,
@@ -11,6 +11,7 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
11
11
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
12
12
  import LinkComponent from '@atlaskit/link';
13
13
  import { CloseButton, ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { Box, Flex } from '@atlaskit/primitives/compiled';
15
16
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
16
17
  import { DatasourceAction, DatasourceSearchMethod } from '../../../analytics/types';
@@ -54,7 +55,8 @@ var isValidParameters = function isValidParameters(parameters) {
54
55
  export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
55
56
  var onCancel = props.onCancel,
56
57
  urlBeingEdited = props.url,
57
- overrideParameters = props.overrideParameters;
58
+ overrideParameters = props.overrideParameters,
59
+ disableSiteSelector = props.disableSiteSelector;
58
60
  var _useViewModeContext = useViewModeContext(),
59
61
  currentViewMode = _useViewModeContext.currentViewMode;
60
62
  var _useIntl = useIntl(),
@@ -143,7 +145,12 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
143
145
  shouldForceRequest: true
144
146
  });
145
147
  }, [reset, setParameters, userInteractions]);
146
- var siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
148
+ var siteSelectorLabel;
149
+ if (disableSiteSelector && fg('add-disablesiteselector')) {
150
+ siteSelectorLabel = confluenceSearchModalMessages.insertIssuesTitle;
151
+ } else {
152
+ siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
153
+ }
147
154
  var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
148
155
  var hasConfluenceSearchParams = selectedConfluenceSite && (parameters === null || parameters === void 0 ? void 0 : parameters.searchString);
149
156
  var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
@@ -342,7 +349,8 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
342
349
  onSiteSelection: onSiteSelection,
343
350
  selectedSite: selectedConfluenceSite,
344
351
  testId: "confluence-search-datasource-modal--site-selector",
345
- label: siteSelectorLabel
352
+ label: siteSelectorLabel,
353
+ disableSiteSelector: disableSiteSelector
346
354
  }))))), /*#__PURE__*/React.createElement(ModalBody, null, !hasNoConfluenceSites ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Box, {
347
355
  xcss: styles.inputContainerStyles
348
356
  }, /*#__PURE__*/React.createElement(ConfluenceSearchContainer, {
@@ -2,6 +2,7 @@ import { type MessageDescriptor } from 'react-intl-next';
2
2
  import type { Site } from '../../../../common/types';
3
3
  export interface SiteSelectorProps {
4
4
  availableSites: Site[] | undefined;
5
+ disableSiteSelector?: boolean;
5
6
  label: MessageDescriptor;
6
7
  onSiteSelection: (selectedSite: Site) => void;
7
8
  selectedSite?: Site;
@@ -4,9 +4,11 @@ import { type ConfigModalProps } from '../../common/types';
4
4
  import { type ConnectedConfigModalProps } from '../common/modal/datasource-modal/createDatasourceModal';
5
5
  import { type DateRangeType } from '../common/modal/popup-select/types';
6
6
  export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, DatasourceParameters | ConfluenceSearchDatasourceParameters> {
7
+ disableSiteSelector?: boolean;
7
8
  overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
8
9
  }
9
10
  export interface ConnectedConfluenceSearchConfigModalProps extends ConnectedConfigModalProps<ConfluenceSearchDatasourceParameters> {
11
+ disableSiteSelector?: boolean;
10
12
  overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
11
13
  }
12
14
  export type ConfluenceSearchDatasourceParameters = {
@@ -2,6 +2,7 @@ import { type MessageDescriptor } from 'react-intl-next';
2
2
  import type { Site } from '../../../../common/types';
3
3
  export interface SiteSelectorProps {
4
4
  availableSites: Site[] | undefined;
5
+ disableSiteSelector?: boolean;
5
6
  label: MessageDescriptor;
6
7
  onSiteSelection: (selectedSite: Site) => void;
7
8
  selectedSite?: Site;
@@ -4,9 +4,11 @@ import { type ConfigModalProps } from '../../common/types';
4
4
  import { type ConnectedConfigModalProps } from '../common/modal/datasource-modal/createDatasourceModal';
5
5
  import { type DateRangeType } from '../common/modal/popup-select/types';
6
6
  export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, DatasourceParameters | ConfluenceSearchDatasourceParameters> {
7
+ disableSiteSelector?: boolean;
7
8
  overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
8
9
  }
9
10
  export interface ConnectedConfluenceSearchConfigModalProps extends ConnectedConfigModalProps<ConfluenceSearchDatasourceParameters> {
11
+ disableSiteSelector?: boolean;
10
12
  overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
11
13
  }
12
14
  export type ConfluenceSearchDatasourceParameters = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "4.26.0",
3
+ "version": "4.27.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -79,14 +79,14 @@
79
79
  "@atlaskit/primitives": "^16.0.0",
80
80
  "@atlaskit/react-select": "^3.8.0",
81
81
  "@atlaskit/select": "^21.3.0",
82
- "@atlaskit/smart-card": "^43.1.0",
82
+ "@atlaskit/smart-card": "^43.2.0",
83
83
  "@atlaskit/smart-user-picker": "^8.3.0",
84
84
  "@atlaskit/spinner": "^19.0.0",
85
85
  "@atlaskit/tag": "^14.1.0",
86
86
  "@atlaskit/textfield": "^8.0.0",
87
87
  "@atlaskit/theme": "^21.0.0",
88
88
  "@atlaskit/tokens": "^7.0.0",
89
- "@atlaskit/tooltip": "^20.5.0",
89
+ "@atlaskit/tooltip": "^20.6.0",
90
90
  "@atlaskit/ufo": "^0.4.0",
91
91
  "@atlaskit/width-detector": "^5.0.0",
92
92
  "@babel/runtime": "^7.0.0",
@@ -110,7 +110,7 @@
110
110
  "@atlaskit/link-provider": "^4.0.0",
111
111
  "@atlaskit/link-test-helpers": "^8.4.0",
112
112
  "@atlaskit/ssr": "workspace:^",
113
- "@atlassian/feature-flags-test-utils": "^0.3.0",
113
+ "@atlassian/feature-flags-test-utils": "^1.0.0",
114
114
  "@faker-js/faker": "^7.5.0",
115
115
  "@testing-library/dom": "^10.1.0",
116
116
  "@testing-library/react": "^13.4.0",
@@ -155,6 +155,9 @@
155
155
  }
156
156
  },
157
157
  "platform-feature-flags": {
158
+ "add-disablesiteselector": {
159
+ "type": "boolean"
160
+ },
158
161
  "platform-datasources-enable-two-way-sync-assignee": {
159
162
  "type": "boolean"
160
163
  },