Skip to content

Commit 5c1647c

Browse files
rm chatbot feature flag
1 parent 0858747 commit 5c1647c

4 files changed

Lines changed: 67 additions & 119 deletions

File tree

assets/src/components/commandpalette/commands.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
AiSparkleOutlineIcon,
3-
BotIcon,
43
CatalogIcon,
54
ChatOutlineIcon,
65
ClusterIcon,
@@ -190,28 +189,6 @@ export function useCommands({
190189
deps: [setFeatureFlag],
191190
},
192191
]),
193-
...(!featureFlags.WorkbenchChatbots
194-
? [
195-
{
196-
id: 'enable-workbench-chatbots',
197-
label: 'Enable Workbench Chatbots',
198-
icon: BotIcon,
199-
callback: () => setFeatureFlag('WorkbenchChatbots', true),
200-
deps: [setFeatureFlag],
201-
},
202-
]
203-
: []),
204-
...(featureFlags.WorkbenchChatbots
205-
? [
206-
{
207-
id: 'disable-workbench-chatbots',
208-
label: 'Disable Workbench Chatbots',
209-
icon: BotIcon,
210-
callback: () => setFeatureFlag('WorkbenchChatbots', false),
211-
deps: [setFeatureFlag],
212-
},
213-
]
214-
: []),
215192
...(openServiceAccountImpersonation
216193
? [
217194
{
@@ -226,7 +203,7 @@ export function useCommands({
226203
],
227204
},
228205
],
229-
[featureFlags, openServiceAccountImpersonation, setFeatureFlag]
206+
[featureFlags.Edge, openServiceAccountImpersonation, setFeatureFlag]
230207
)
231208

232209
const commands = useMemo(

assets/src/components/flows/FeatureFlagContext.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ const defaultDocsUrl = 'https://docs.plural.sh/'
2020

2121
export type FeatureFlags = {
2222
Edge: boolean
23-
WorkbenchChatbots: boolean
2423
}
2524

2625
const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
2726
Edge: false,
28-
WorkbenchChatbots: false,
2927
}
3028

3129
const FEATURE_FLAG_LABELS: Record<keyof FeatureFlags, string> = {
3230
Edge: 'Edge',
33-
WorkbenchChatbots: 'Workbench Chatbots',
3431
}
3532

3633
export const FeatureFlagContext = createContext<{
@@ -79,7 +76,6 @@ export const FeatureFlagProvider = ({ children }: { children: ReactNode }) => {
7976
}}
8077
>
8178
{curType === 'Edge' && <EdgeBodyContent />}
82-
{curType === 'WorkbenchChatbots' && <WorkbenchChatbotsBodyContent />}
8379
</FeatureFlagConfirmationModal>
8480
<Toast
8581
show={showToast}
@@ -175,12 +171,3 @@ function EdgeBodyContent() {
175171
function featureFlagLabel(type: keyof FeatureFlags | null) {
176172
return type ? FEATURE_FLAG_LABELS[type] : ''
177173
}
178-
179-
function WorkbenchChatbotsBodyContent() {
180-
return (
181-
<span>
182-
<strong>Workbench Chatbots</strong> is an experimental feature that lets
183-
chat platforms trigger workbench runs.
184-
</span>
185-
)
186-
}

assets/src/components/workbenches/workbench/Workbench.tsx

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
WorkbenchTinyFragment,
2424
} from 'generated/graphql'
2525
import { GqlError } from 'components/utils/Alert'
26-
import { FeatureFlagContext } from 'components/flows/FeatureFlagContext'
2726
import { Confirm } from 'components/utils/Confirm'
2827
import { MoreMenu } from 'components/utils/MoreMenu'
2928
import { useSimpleToast } from 'components/utils/SimpleToastContext'
@@ -32,7 +31,7 @@ import { StretchedFlex } from 'components/utils/StretchedFlex'
3231
import { SubTabs } from 'components/utils/SubTabs'
3332
import { TRUNCATE } from 'components/utils/truncate'
3433
import { Subtitle2H1 } from 'components/utils/typography/Text'
35-
import { Key, ReactNode, use, useCallback, useMemo, useState } from 'react'
34+
import { Key, ReactNode, useCallback, useMemo, useState } from 'react'
3635
import { mapExistingNodes } from 'utils/graphql'
3736
import {
3837
Link,
@@ -111,7 +110,6 @@ export function WorkbenchPageLayout({
111110
}: WorkbenchPageLayoutProps) {
112111
const theme = useTheme()
113112
const navigate = useNavigate()
114-
const { featureFlags } = use(FeatureFlagContext)
115113
const { workbenchId, isLoading, workbench, openToolsEdit, openDelete } =
116114
useOutletContext<WorkbenchOutletContext>()
117115

@@ -175,7 +173,6 @@ export function WorkbenchPageLayout({
175173
navigate(getWorkbenchWebhookTriggersAbsPath(workbenchId))
176174
return
177175
case WorkbenchMoreMenuKey.Chatbots:
178-
if (!featureFlags.WorkbenchChatbots) return
179176
navigate(getWorkbenchChatbotsAbsPath(workbenchId))
180177
return
181178
case WorkbenchMoreMenuKey.Tools:
@@ -194,14 +191,7 @@ export function WorkbenchPageLayout({
194191
return
195192
}
196193
},
197-
[
198-
navigate,
199-
workbenchBasePath,
200-
workbenchId,
201-
openToolsEdit,
202-
openDelete,
203-
featureFlags.WorkbenchChatbots,
204-
]
194+
[navigate, workbenchBasePath, workbenchId, openToolsEdit, openDelete]
205195
)
206196

207197
return (
@@ -278,13 +268,11 @@ export function WorkbenchPageLayout({
278268
leftContent={<WebhooksIcon />}
279269
label="Webhook triggers"
280270
/>
281-
{featureFlags.WorkbenchChatbots && (
282-
<ListBoxItem
283-
key={WorkbenchMoreMenuKey.Chatbots}
284-
leftContent={<BotIcon />}
285-
label="Chatbots"
286-
/>
287-
)}
271+
<ListBoxItem
272+
key={WorkbenchMoreMenuKey.Chatbots}
273+
leftContent={<BotIcon />}
274+
label="Chatbots"
275+
/>
288276
<ListBoxItem
289277
key={WorkbenchMoreMenuKey.SavedPrompts}
290278
leftContent={<BookmarkIcon />}

assets/src/components/workbenches/workbench/WorkbenchSidePanel.tsx

Lines changed: 59 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import {
66
PencilIcon,
77
} from '@pluralsh/design-system'
88
import { useWorkbenchTriggersSummaryQuery } from 'generated/graphql'
9-
import { FeatureFlagContext } from 'components/flows/FeatureFlagContext'
109
import { isEmpty } from 'lodash'
11-
import { PropsWithChildren, use, useMemo } from 'react'
10+
import { PropsWithChildren, useMemo } from 'react'
1211
import { useNavigate } from 'react-router-dom'
1312
import styled from 'styled-components'
1413
import { mapExistingNodes } from 'utils/graphql'
@@ -36,7 +35,6 @@ export function WorkbenchSidePanel({
3635
onOpenToolsEdit: () => void
3736
}) {
3837
const navigate = useNavigate()
39-
const { featureFlags } = use(FeatureFlagContext)
4038

4139
const { data } = useWorkbenchTriggersSummaryQuery({
4240
variables: { id: workbenchId },
@@ -171,70 +169,68 @@ export function WorkbenchSidePanel({
171169
</ButtonSC>
172170
)}
173171
</SectionSC>
174-
{featureFlags.WorkbenchChatbots && (
175-
<SectionSC>
176-
<HeaderSC>
177-
<span>Chatbots</span>
178-
{hasChatbots && (
179-
<IconFrame
180-
clickable
181-
size="small"
182-
icon={<AddIcon size={12} />}
183-
tooltip="Add chatbot"
184-
onClick={() =>
185-
navigate(getWorkbenchChatbotCreateAbsPath(workbenchId))
186-
}
187-
/>
188-
)}
189-
</HeaderSC>
190-
{hasChatbots ? (
191-
<Flex
192-
gap="xxsmall"
193-
direction="column"
194-
>
195-
{chatbots.map((chatbot) => (
196-
<WorkbenchSidePanelEditRow
197-
key={chatbot.id}
198-
onClick={() =>
199-
navigate(
200-
getWorkbenchChatbotEditAbsPath({
201-
workbenchId,
202-
chatbotId: chatbot.id,
203-
})
204-
)
205-
}
206-
>
207-
<ItemIconContainerSC>
208-
<IconFrame
209-
icon={chatProviderConnectionIcon(
210-
chatbot.chatConnection?.type
211-
)}
212-
size="xsmall"
213-
/>
214-
</ItemIconContainerSC>
215-
<ItemNameSC>
216-
{formatChatbotChannelLabel({
217-
type: chatbot.chatConnection?.type,
218-
channel: chatbot.channel,
219-
})}
220-
</ItemNameSC>
221-
</WorkbenchSidePanelEditRow>
222-
))}
223-
</Flex>
224-
) : (
225-
<ButtonSC
226-
small
227-
startIcon={<AddIcon size={12} />}
228-
tertiary
172+
<SectionSC>
173+
<HeaderSC>
174+
<span>Chatbots</span>
175+
{hasChatbots && (
176+
<IconFrame
177+
clickable
178+
size="small"
179+
icon={<AddIcon size={12} />}
180+
tooltip="Add chatbot"
229181
onClick={() =>
230182
navigate(getWorkbenchChatbotCreateAbsPath(workbenchId))
231183
}
232-
>
233-
Add chatbot
234-
</ButtonSC>
184+
/>
235185
)}
236-
</SectionSC>
237-
)}
186+
</HeaderSC>
187+
{hasChatbots ? (
188+
<Flex
189+
gap="xxsmall"
190+
direction="column"
191+
>
192+
{chatbots.map((chatbot) => (
193+
<WorkbenchSidePanelEditRow
194+
key={chatbot.id}
195+
onClick={() =>
196+
navigate(
197+
getWorkbenchChatbotEditAbsPath({
198+
workbenchId,
199+
chatbotId: chatbot.id,
200+
})
201+
)
202+
}
203+
>
204+
<ItemIconContainerSC>
205+
<IconFrame
206+
icon={chatProviderConnectionIcon(
207+
chatbot.chatConnection?.type
208+
)}
209+
size="xsmall"
210+
/>
211+
</ItemIconContainerSC>
212+
<ItemNameSC>
213+
{formatChatbotChannelLabel({
214+
type: chatbot.chatConnection?.type,
215+
channel: chatbot.channel,
216+
})}
217+
</ItemNameSC>
218+
</WorkbenchSidePanelEditRow>
219+
))}
220+
</Flex>
221+
) : (
222+
<ButtonSC
223+
small
224+
startIcon={<AddIcon size={12} />}
225+
tertiary
226+
onClick={() =>
227+
navigate(getWorkbenchChatbotCreateAbsPath(workbenchId))
228+
}
229+
>
230+
Add chatbot
231+
</ButtonSC>
232+
)}
233+
</SectionSC>
238234
<SectionSC>
239235
<HeaderSC>
240236
<span>Cron schedules</span>

0 commit comments

Comments
 (0)