Skip to content

Commit 3dda183

Browse files
zacharyparikhakowalska622
authored andcommitted
[Workchat] Hide disabled integrations when creating a new tool (elastic#221306)
## Summary ![Screenshot 2025-05-22 at 1 33 11 PM](https://github.com/user-attachments/assets/f6e4c373-353c-4faa-b13a-004668fb2218) ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ...
1 parent 313a4b0 commit 3dda183

File tree

3 files changed

+31
-15
lines changed

3 files changed

+31
-15
lines changed

x-pack/solutions/chat/plugins/workchat-app/public/application/components/integrations/edit/integration_edit_view.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { useIntegrationDelete } from '../../../hooks/use_integration_delete';
3333
import { useIntegrationConfigurationForm } from '../../../hooks/use_integration_configuration_form';
3434
import { appPaths } from '../../../app_paths';
3535
import { toolLabels } from '../i18n';
36-
import { integrationTypeToLabel } from '../utils';
36+
import { integrationTypeToLabel, isIntegrationDisabled } from '../utils';
3737

3838
interface IntegrationEditViewProps {
3939
integrationId: string | undefined;
@@ -87,10 +87,12 @@ export const IntegrationEditView: React.FC<IntegrationEditViewProps> = ({ integr
8787

8888
const integrationTypes = [
8989
{ value: '', text: 'Pick a type' },
90-
...Object.values(IntegrationType).map((type) => ({
91-
value: type,
92-
text: integrationTypeToLabel(type),
93-
})),
90+
...Object.values(IntegrationType)
91+
.filter((type) => !isIntegrationDisabled(type))
92+
.map((type) => ({
93+
value: type,
94+
text: integrationTypeToLabel(type),
95+
})),
9496
];
9597

9698
const onDeleteSuccess = useCallback(() => {

x-pack/solutions/chat/plugins/workchat-app/public/application/components/integrations/listing/integration_catalog_view.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
2323
import { i18n } from '@kbn/i18n';
2424
import { css } from '@emotion/css';
2525
import { IntegrationListView } from './integration_list_view';
26-
import { getIntegrationIcon } from '../utils';
26+
import { getIntegrationIcon, isIntegrationDisabled } from '../utils';
2727
import { useNavigation } from '../../../hooks/use_navigation';
2828
import { appPaths } from '../../../app_paths';
2929

@@ -44,7 +44,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
4444
defaultMessage:
4545
'Choose an existing index to connect and start using it in your workflows without re-importing your data',
4646
}),
47-
disabled: false,
47+
disabled: isIntegrationDisabled(IntegrationType.index_source),
4848
},
4949
[IntegrationType.external_server]: {
5050
title: i18n.translate('workchatApp.integrations.listView.externalServerCard', {
@@ -54,7 +54,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
5454
description: i18n.translate('workchatApp.integrations.listView.externalServerDescription', {
5555
defaultMessage: 'Connect to external servers for data processing.',
5656
}),
57-
disabled: false,
57+
disabled: isIntegrationDisabled(IntegrationType.external_server),
5858
},
5959
[IntegrationType.salesforce]: {
6060
title: i18n.translate('workchatApp.integrations.listView.salesforceCard', {
@@ -65,7 +65,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
6565
defaultMessage:
6666
'Connect your Salesforce account to bring in customer records, case data, and account insights for use in workflows',
6767
}),
68-
disabled: false,
68+
disabled: isIntegrationDisabled(IntegrationType.salesforce),
6969
},
7070
[IntegrationType.google_drive]: {
7171
title: i18n.translate('workchatApp.integrations.listView.googleDriveCard', {
@@ -75,7 +75,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
7575
description: i18n.translate('workchatApp.integrations.listView.googleDriveDescription', {
7676
defaultMessage: 'Search and summarize content from your Drive files',
7777
}),
78-
disabled: true,
78+
disabled: isIntegrationDisabled(IntegrationType.google_drive),
7979
},
8080
[IntegrationType.sharepoint]: {
8181
title: i18n.translate('workchatApp.integrations.listView.sharepointCard', {
@@ -85,7 +85,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
8585
description: i18n.translate('workchatApp.integrations.listView.sharepointDescription', {
8686
defaultMessage: 'Connect internal documents and sites for enterprise-wide search.',
8787
}),
88-
disabled: true,
88+
disabled: isIntegrationDisabled(IntegrationType.sharepoint),
8989
},
9090
[IntegrationType.slack]: {
9191
title: i18n.translate('workchatApp.integrations.listView.slackCard', {
@@ -95,7 +95,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
9595
description: i18n.translate('workchatApp.integrations.listView.slackDescription', {
9696
defaultMessage: 'Search conversations and surface relevant team discussions.',
9797
}),
98-
disabled: true,
98+
disabled: isIntegrationDisabled(IntegrationType.slack),
9999
},
100100
[IntegrationType.confluence]: {
101101
title: i18n.translate('workchatApp.integrations.listView.confluenceCard', {
@@ -105,7 +105,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
105105
description: i18n.translate('workchatApp.integrations.listView.confluenceDescription', {
106106
defaultMessage: 'Tap into your internal knowledge base for accurate answers.',
107107
}),
108-
disabled: true,
108+
disabled: isIntegrationDisabled(IntegrationType.confluence),
109109
},
110110
[IntegrationType.jira]: {
111111
title: i18n.translate('workchatApp.integrations.listView.jiraCard', {
@@ -115,7 +115,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
115115
description: i18n.translate('workchatApp.integrations.listView.jiraDescription', {
116116
defaultMessage: 'Bring in issue tracking, tickets, and project context.',
117117
}),
118-
disabled: true,
118+
disabled: isIntegrationDisabled(IntegrationType.jira),
119119
},
120120
[IntegrationType.github]: {
121121
title: i18n.translate('workchatApp.integrations.listView.githubCard', {
@@ -125,7 +125,7 @@ const integrationCards: Record<IntegrationType, IntegrationCardData> = {
125125
description: i18n.translate('workchatApp.integrations.listView.githubDescription', {
126126
defaultMessage: 'Search repos, issues, and documentation for engineering insights.',
127127
}),
128-
disabled: true,
128+
disabled: isIntegrationDisabled(IntegrationType.github),
129129
},
130130
};
131131

x-pack/solutions/chat/plugins/workchat-app/public/application/components/integrations/utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,17 @@ export const getIntegrationIcon = (type: IntegrationType) => {
6363
return '';
6464
}
6565
};
66+
67+
export const isIntegrationDisabled = (type: IntegrationType) => {
68+
switch (type) {
69+
case IntegrationType.google_drive:
70+
case IntegrationType.sharepoint:
71+
case IntegrationType.slack:
72+
case IntegrationType.confluence:
73+
case IntegrationType.jira:
74+
case IntegrationType.github:
75+
return true;
76+
default:
77+
return false;
78+
}
79+
};

0 commit comments

Comments
 (0)