Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chat): marketplace application view (Issue #2037) #2077

Merged
merged 32 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
99765d3
init application view
Alexander-Kezik Sep 6, 2024
09ad8aa
revert ort
Alexander-Kezik Sep 6, 2024
7790b86
revert ort
Alexander-Kezik Sep 6, 2024
3ac2ffa
revert Chat
Alexander-Kezik Sep 6, 2024
c7f7fdf
remove imports
Alexander-Kezik Sep 9, 2024
7a7ba57
ui correction, fix stars rating
Alexander-Kezik Sep 9, 2024
b689e60
mobile adaptation + add user session icon + swipes for mobile + full …
Alexander-Kezik Sep 9, 2024
5958153
revert ChatView
Alexander-Kezik Sep 9, 2024
55d38a7
clean imports
Alexander-Kezik Sep 9, 2024
c9205be
add rating progress bar component
Alexander-Kezik Sep 9, 2024
9c617c5
rename files
Alexander-Kezik Sep 9, 2024
cdaf6f6
toasts + sharing + comments
Alexander-Kezik Sep 10, 2024
cda5eb6
add cursor pointer to images
Alexander-Kezik Sep 10, 2024
2a31514
refactor
Alexander-Kezik Sep 10, 2024
a573831
comments for MVP + fixed styes
Alexander-Kezik Sep 10, 2024
e53cb02
fix styles
Alexander-Kezik Sep 10, 2024
584e31c
hide tags
Alexander-Kezik Sep 10, 2024
cdc899a
update imports
Alexander-Kezik Sep 10, 2024
1c7431a
refactor
Alexander-Kezik Sep 10, 2024
7230ba6
add versions selector, hide discussed elemets
Alexander-Kezik Sep 11, 2024
6e60d49
Merge branch 'feat/marketplace' into feat/application-view
Alexander-Kezik Sep 11, 2024
8b1ae03
Merge branch 'feat/marketplace' into feat/application-view
IlyaBondar Sep 11, 2024
7b15441
Merge branch 'feat/marketplace' into feat/application-view
Alexander-Kezik Sep 11, 2024
c3a626b
integrate with cards + applying model
Alexander-Kezik Sep 11, 2024
3da45e1
apply according to query param
Alexander-Kezik Sep 11, 2024
0bd4866
move method to utils
Alexander-Kezik Sep 11, 2024
5bb5946
resolve comment
Alexander-Kezik Sep 11, 2024
9f1f393
create new conversation
Alexander-Kezik Sep 11, 2024
9224e1f
resolve comments
Alexander-Kezik Sep 12, 2024
09ed30b
do not pass callback as a prop
Alexander-Kezik Sep 12, 2024
ddc2dd5
resolve comments
Alexander-Kezik Sep 12, 2024
e11f5f4
Merge branch 'feat/marketplace' into feat/application-view
Alexander-Kezik Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/chat/src/components/Chatbar/ModelIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const ModelIcon = ({
<Tooltip
hideTooltip={isCustomTooltip}
tooltip={entity ? getOpenAIEntityFullName(entity) : entityId}
triggerClassName="flex shrink-0 relative z-[60]"
triggerClassName="flex shrink-0 relative"
>
<ModelIconTemplate
entity={entity}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useCallback, useMemo, useState } from 'react';

import { useSearchParams } from 'next/navigation';
import { useRouter } from 'next/router';

import { getConversationModelParams } from '@/src/utils/app/conversation';
import { ApiUtils } from '@/src/utils/server/api';

Check failure on line 7 in apps/chat/src/components/Marketplace/ApplicationDetails/ApplicationDetails.tsx

View workflow job for this annotation

GitHub Actions / run_tests / test / style_checks

'ApiUtils' is defined but never used. Allowed unused vars must match /^__/u

import { EntityType } from '@/src/types/common';
import { ModalState } from '@/src/types/modal';
Expand All @@ -19,6 +21,11 @@
ModelsSelectors,
} from '@/src/store/models/models.reducers';

import {
MarketplaceQueryParams,
compareIdWithQueryParamId,
} from '@/src/constants/marketplace';

import Modal from '../../Common/Modal';
import { ApplicationDetailsContent } from './ApplicationContent';
import { ApplicationDetailsFooter } from './ApplicationFooter';
Expand All @@ -33,6 +40,7 @@
const dispatch = useAppDispatch();

const router = useRouter();
const searchParams = useSearchParams();

const [selectedVersionEntity, setSelectedVersionEntity] = useState(entity);

Expand All @@ -49,20 +57,26 @@
}, [entities, entity.name]);

const handleUseEntity = useCallback(() => {
selectedConversations.forEach((conv) =>
dispatch(
ConversationsActions.updateConversation({
id: conv.id,
values: {
...getConversationModelParams(
conv,
entity.id,
modelsMap,
addonsMap,
),
},
}),
),
const conversationToApplyModel =
selectedConversations.find((conv) =>
compareIdWithQueryParamId(
conv.id,
searchParams.get(MarketplaceQueryParams.fromConversation),
Alexander-Kezik marked this conversation as resolved.
Show resolved Hide resolved
),
) ?? selectedConversations[0];

dispatch(
ConversationsActions.updateConversation({
id: conversationToApplyModel.id,
values: {
...getConversationModelParams(
conversationToApplyModel,
entity.id,
modelsMap,
addonsMap,
),
},
}),
);
dispatch(
ModelsActions.updateRecentModels({
Expand All @@ -77,6 +91,7 @@
entity.id,
modelsMap,
router,
searchParams,
selectedConversations,
]);

Expand Down
10 changes: 10 additions & 0 deletions apps/chat/src/constants/marketplace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { ApiUtils } from '../utils/server/api';

export enum MarketplaceQueryParams {
fromConversation = 'fromConversation',
}

export const compareIdWithQueryParamId = (
id: string,
queryParamId: string | null,
) => ApiUtils.encodeApiUrl(id) === queryParamId;
Loading