Skip to content

Commit

Permalink
fix(overlay): hide 'configure settings' when features are disabled (I…
Browse files Browse the repository at this point in the history
…ssue #2728) (#2769)
  • Loading branch information
Derikyan authored Dec 11, 2024
1 parent 975437b commit ef330b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 0 additions & 8 deletions apps/chat-e2e/src/tests/shareConversationWithContent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import dialSharedWithMeTest from '@/src/core/dialSharedWithMeFixtures';
import {
API,
Attachment,
ExpectedConstants,
ExpectedMessages,
FolderConversation,
MenuOptions,
Expand Down Expand Up @@ -756,11 +755,9 @@ dialSharedWithMeTest(
additionalShareUserChatMessages,
additionalShareUserChat,
additionalShareUserChatHeader,
additionalShareUserTalkToAgentDialog,
additionalShareUserPlaybackControl,
additionalShareUserSharedWithMeConversations,
additionalShareUserSharedWithMeConversationDropdownMenu,
additionalShareUserTalkToAgentDialogAssertion,
setTestIds,
}) => {
setTestIds('EPMRTC-3517');
Expand Down Expand Up @@ -840,11 +837,6 @@ dialSharedWithMeTest(
ExpectedMessages.chatBarConversationIconIsPlayback,
)
.toBeVisible();
await additionalShareUserChat.changeAgentButton.click();
await additionalShareUserTalkToAgentDialogAssertion.assertAgentIsSelected(
ExpectedConstants.playbackLabel,
);
await additionalShareUserTalkToAgentDialog.cancelButton.click();
await expect
.soft(
additionalShareUserPlaybackControl.playbackNextButton.getElementLocator(),
Expand Down
12 changes: 10 additions & 2 deletions apps/chat/src/components/Chat/EmptyChatDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useScreenState } from '@/src/hooks/useScreenState';

import { getModelDescription } from '@/src/utils/app/application';
import { getOpenAIEntityFullName } from '@/src/utils/app/conversation';
import { isEntityIdExternal } from '@/src/utils/app/id';

import { Conversation } from '@/src/types/chat';
import { ScreenState } from '@/src/types/common';
Expand All @@ -25,6 +26,8 @@ import { Spinner } from '../Common/Spinner';
import { FunctionStatusIndicator } from '../Marketplace/FunctionStatusIndicator';
import { ModelVersionSelect } from './ModelVersionSelect';

import { Feature } from '@epam/ai-dial-shared';

interface EmptyChatDescriptionViewProps {
conversation: Conversation;
onShowChangeModel: (conversationId: string) => void;
Expand All @@ -48,6 +51,10 @@ const EmptyChatDescriptionView = ({
);
const models = useAppSelector(ModelsSelectors.selectModels);
const isIsolatedView = useAppSelector(SettingsSelectors.selectIsIsolatedView);
const isEmptyChatSettingsEnabled = useAppSelector((state) =>
SettingsSelectors.isFeatureEnabled(state, Feature.EmptyChatSettings),
);
const isExternal = isEntityIdExternal(conversation);

const screenState = useScreenState();

Expand Down Expand Up @@ -149,7 +156,7 @@ const EmptyChatDescriptionView = ({
)}
</div>
</div>
{!isIsolatedView && (
{!isExternal && !isIsolatedView && (
<div className="flex gap-3 divide-x divide-primary leading-4">
<button
className="text-left text-accent-primary"
Expand All @@ -159,7 +166,8 @@ const EmptyChatDescriptionView = ({
{t('Change agent')}
</button>
{!conversation.replay?.replayAsIs &&
!conversation.playback?.isPlayback && (
!conversation.playback?.isPlayback &&
isEmptyChatSettingsEnabled && (
<button
className="pl-3 text-left text-accent-primary"
data-qa="configure-settings"
Expand Down

0 comments on commit ef330b7

Please sign in to comment.