Skip to content

Commit f7efb90

Browse files
committed
Merge branch 'main' into cezudas/OPS-3021-infrastructure
2 parents 3188ec6 + 940f221 commit f7efb90

17 files changed

Lines changed: 96 additions & 60 deletions

File tree

.github/workflows/chromatic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v5.0.0
14+
uses: actions/checkout@v5.0.1
1515
with:
1616
fetch-depth: 0
1717

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Install Dependencies
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v5.0.0
16+
- uses: actions/checkout@v5.0.1
1717
- name: Lookup node_modules cache
1818
id: node-modules-cache
1919
uses: actions/cache@v4.3.0
@@ -30,7 +30,7 @@ jobs:
3030
needs: install
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v5.0.0
33+
- uses: actions/checkout@v5.0.1
3434
- name: Restore node_modules cache
3535
id: node-modules-cache
3636
uses: actions/cache/restore@v4.3.0
@@ -61,12 +61,12 @@ jobs:
6161
steps:
6262
- name: Checkout for Dependabot PR
6363
if: ${{ startsWith(github.head_ref || '', 'dependabot/') }}
64-
uses: actions/checkout@v5.0.0
64+
uses: actions/checkout@v5.0.1
6565
with:
6666
ref: ${{ github.head_ref }}
6767
- name: Checkout for others
6868
if: ${{ !startsWith(github.head_ref || '', 'dependabot/') }}
69-
uses: actions/checkout@v5.0.0
69+
uses: actions/checkout@v5.0.1
7070
- name: Restore node_modules cache
7171
id: node-modules-cache
7272
uses: actions/cache/restore@v4.3.0
@@ -109,7 +109,7 @@ jobs:
109109
needs: install
110110
runs-on: ubuntu-latest
111111
steps:
112-
- uses: actions/checkout@v5.0.0
112+
- uses: actions/checkout@v5.0.1
113113
- name: Restore node_modules cache
114114
id: node-modules-cache
115115
uses: actions/cache/restore@v4.3.0
@@ -142,7 +142,7 @@ jobs:
142142
needs: install
143143
runs-on: ubuntu-latest
144144
steps:
145-
- uses: actions/checkout@v5.0.0
145+
- uses: actions/checkout@v5.0.1
146146
- name: Restore node_modules cache
147147
id: node-modules-cache
148148
uses: actions/cache/restore@v4.3.0
@@ -183,7 +183,7 @@ jobs:
183183
needs: build
184184
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-latest' || 'ubuntu-arm64' }}
185185
steps:
186-
- uses: actions/checkout@v5.0.0
186+
- uses: actions/checkout@v5.0.1
187187
- name: Restore build cache
188188
uses: actions/cache/restore@v4.3.0
189189
with:

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
VERSION: ${{ needs.get-version.outputs.version }}
8585
RELEASE_DC_FILENAME: openops-dc-${{ needs.get-version.outputs.version }}.zip
8686
steps:
87-
- uses: actions/checkout@v5.0.0
87+
- uses: actions/checkout@v5.0.1
8888
- name: Create a release file
8989
run: |
9090
cp THIRD_PARTY_LICENSES.txt LICENSE NOTICE deploy/docker-compose
@@ -94,7 +94,7 @@ jobs:
9494
- name: Create a GitHub release
9595
id: create-github-release
9696
if: inputs.github_release
97-
uses: softprops/action-gh-release@v2.4.1
97+
uses: softprops/action-gh-release@v2.4.2
9898
with:
9999
target_commitish: ${{ github.sha }}
100100
tag_name: ${{ env.VERSION }}

packages/react-ui/public/locales/en/translation.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"Refresh Page": "Refresh Page",
1717
"Contact Support": "Contact Support",
1818
"AI Assistant": "AI Assistant",
19+
"OpenOps Assistant": "OpenOps Assistant",
20+
"OpenOps Agent": "OpenOps Agent",
1921
"Enable AI": "Enable AI",
2022
"Save": "Save",
2123
"Valid Connection": "Valid Connection",

packages/react-ui/src/app/common/hooks/flags-hooks.ts

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { usePrefetchQuery, useSuspenseQuery } from '@tanstack/react-query';
22

33
import { QueryKeys } from '@/app/constants/query-keys';
44
import { flagsApi, FlagsMap } from '@/app/lib/flags-api';
5-
import { FlagId } from '@openops/shared';
5+
import { FlagId, OpenOpsFlag } from '@openops/shared';
66

77
type WebsiteBrand = {
88
websiteName: string;
@@ -48,7 +48,7 @@ export const flagsHooks = {
4848
const { data: theme } = flagsHooks.useFlag<WebsiteBrand>(FlagId.THEME);
4949
return theme!;
5050
},
51-
useFlag: <T>(flagId: FlagId) => {
51+
useFlag: <T>(flagId: OpenOpsFlag) => {
5252
const data = useSuspenseQuery<FlagsMap, Error>({
5353
queryKey: [QueryKeys.flags],
5454
queryFn: flagsApi.getAll,
@@ -59,9 +59,28 @@ export const flagsHooks = {
5959
};
6060
},
6161
useShouldFetchCloudTemplates: () => {
62-
return (
63-
!flagsHooks.useFlag<boolean>(FlagId.CLOUD_CONNECTION_PAGE_ENABLED).data ||
64-
false
65-
);
62+
const cloudConnectionPageEnabled = flagsHooks.useFlag<boolean>(
63+
FlagId.CLOUD_CONNECTION_PAGE_ENABLED,
64+
).data;
65+
const federatedLoginEnabled = flagsHooks.useFlag<boolean>(
66+
FlagId.FEDERATED_LOGIN_ENABLED,
67+
).data;
68+
69+
// Fetch cloud templates when cloud connection page is disabled
70+
// OR when federated login is enabled
71+
return !cloudConnectionPageEnabled || federatedLoginEnabled;
72+
},
73+
74+
useShouldShowCloudUserInMenu: () => {
75+
const cloudConnectionPageEnabled = flagsHooks.useFlag<boolean>(
76+
FlagId.CLOUD_CONNECTION_PAGE_ENABLED,
77+
).data;
78+
const federatedLoginEnabled = flagsHooks.useFlag<boolean>(
79+
FlagId.FEDERATED_LOGIN_ENABLED,
80+
).data;
81+
82+
// Show cloud user in menu only when:
83+
// - Cloud connection page is disabled AND federated login is also disabled
84+
return !cloudConnectionPageEnabled && !federatedLoginEnabled;
6685
},
6786
};

packages/react-ui/src/app/features/ai/ai-assistant-button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
12
import { useAppStore } from '@/app/store/app-store';
23
import { Button, cn, TooltipWrapper } from '@openops/components/ui';
3-
import { t } from 'i18next';
44
import { Bot } from 'lucide-react';
55
import { useCallback } from 'react';
66

@@ -10,12 +10,14 @@ const AiAssistantButton = ({ className }: { className?: string }) => {
1010
setIsAiChatOpened: s.setIsAiChatOpened,
1111
}));
1212

13+
const assistantName = useAssistantName();
14+
1315
const onToggleAiChat = useCallback(() => {
1416
setIsAiChatOpened(!isAiChatOpened);
1517
}, [isAiChatOpened, setIsAiChatOpened]);
1618

1719
return (
18-
<TooltipWrapper tooltipText={t('AI Assistant')} tooltipPlacement="right">
20+
<TooltipWrapper tooltipText={assistantName} tooltipPlacement="right">
1921
<Button
2022
variant="ai"
2123
className={cn('size-9 p-0 gap-2', className, {

packages/react-ui/src/app/features/ai/ai-configuration-prompt.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { aiSettingsHooks } from '@/app/features/ai/lib/ai-settings-hooks';
2+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
23
import { useAppStore } from '@/app/store/app-store';
34
import { cn, NoAiEnabledPopover } from '@openops/components/ui';
45

@@ -15,12 +16,15 @@ const AiConfigurationPrompt = ({ className }: AiConfigurationPromptProps) => {
1516
setIsAiChatOpened: s.setIsAiChatOpened,
1617
}));
1718

19+
const assistantName = useAssistantName();
20+
1821
if (isLoading || hasActiveAiSettings || !isAiChatOpened) return null;
1922

2023
return (
2124
<NoAiEnabledPopover
2225
className={cn('absolute left-4 bottom-[17px] z-50', className)}
2326
onCloseClick={() => setIsAiChatOpened(false)}
27+
title={assistantName}
2428
/>
2529
);
2630
};

packages/react-ui/src/app/features/ai/assistant/ai-chat-resizable-panel.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useResizablePanelGroup } from '@/app/common/hooks/use-resizable-panel-g
22
import { RESIZABLE_PANEL_IDS } from '@/app/constants/layout';
33
import AssistantUiChat from '@/app/features/ai/assistant/assistant-ui-chat';
44
import { aiSettingsHooks } from '@/app/features/ai/lib/ai-settings-hooks';
5+
import { useAssistantName } from '@/app/features/ai/lib/use-assistant-name';
56
import { useAppStore } from '@/app/store/app-store';
67
import { cn, ResizableHandle, ResizablePanel } from '@openops/components/ui';
7-
import { t } from 'i18next';
88
import { useCallback, useEffect, useMemo, useRef } from 'react';
99
import { ImperativePanelHandle } from 'react-resizable-panels';
1010

@@ -21,6 +21,8 @@ const AiChatResizablePanel = ({ onDragging }: AiChatResizablePanelProps) => {
2121
const { hasActiveAiSettings, isLoading } =
2222
aiSettingsHooks.useHasActiveAiSettings();
2323

24+
const assistantName = useAssistantName();
25+
2426
const resizablePanelRef = useRef<ImperativePanelHandle | null>(null);
2527

2628
const { getPanelSize } = useResizablePanelGroup();
@@ -71,7 +73,7 @@ const AiChatResizablePanel = ({ onDragging }: AiChatResizablePanelProps) => {
7173
>
7274
<div className="w-full h-full flex bg-secondary overflow-hidden border-r">
7375
<AssistantUiChat
74-
title={t('AI Assistant')}
76+
title={assistantName}
7577
onClose={() => setIsAiChatOpened(false)}
7678
/>
7779
</div>

packages/react-ui/src/app/features/ai/assistant/assistant-ui-chat.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ const AssistantUiChat = ({
9191
return title;
9292
}, [chatId, chats, title]);
9393

94+
const isTitleDefault = currentChatTitle === title;
95+
9496
const onChatSelected = useCallback(
9597
(id: string) => {
9698
onChatIdChange(id);
@@ -139,6 +141,7 @@ const AssistantUiChat = ({
139141
runtime={runtime}
140142
onNewChat={onNewChatClick}
141143
title={currentChatTitle}
144+
isTitleDefault={isTitleDefault}
142145
availableModels={availableModels}
143146
onModelSelected={onModelSelected}
144147
isModelSelectorLoading={isModelSelectorLoading}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { flagsHooks } from '@/app/common/hooks/flags-hooks';
2+
import { FlagId, OpsEdition } from '@openops/shared';
3+
import { t } from 'i18next';
4+
5+
export const useAssistantName = () => {
6+
const edition = flagsHooks.useFlag<OpsEdition>(FlagId.EDITION).data;
7+
return edition === OpsEdition.COMMUNITY
8+
? t('OpenOps Assistant')
9+
: t('OpenOps Agent');
10+
};

0 commit comments

Comments
 (0)