-
Notifications
You must be signed in to change notification settings - Fork 2
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
New Search and Profile Frontend #62
Merged
Merged
Changes from 37 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
f1e381e
remove unused code
saifullah-talukder 7acf61a
use appropriate svg property name in react
saifullah-talukder ec20f5f
implement error handling (prevent app from crashing when no data is f…
saifullah-talukder eb198d9
remove unused context
saifullah-talukder dc90d06
handle automatic signout whenever 405 status code received from backend
saifullah-talukder cdaed6c
add search result and thread component file
saifullah-talukder 84026e8
Merge branch 'eng-184' into eng-190
saifullah-talukder 64fcb7b
Merge branch 'eng-179' into eng-190
saifullah-talukder 50ce615
temp stash
saifullah-talukder 3ca997f
Merge branch 'develop' into eng-190
saifullah-talukder cddf923
thread page implemented
saifullah-talukder 1835110
update source menu height calculation
saifullah-talukder a1d15ac
implement streaming response
saifullah-talukder bc43474
implement thread history
saifullah-talukder 903f71d
remove unnecessary code
saifullah-talukder 838730a
bug fix in search history navigation
saifullah-talukder b4cf36e
source menu style fix
saifullah-talukder 6b7b3f1
frontend stash (working on profile page)
saifullah-talukder e64c400
Merge branch 'develop' into eng-190
saifullah-talukder d5335f4
implement proxy api for streaming
saifullah-talukder a02b084
design fix in streaming response component
saifullah-talukder 79f43b6
implement profile settings UI
saifullah-talukder c0a57a1
integrate profile update api
saifullah-talukder 4032a8e
remove unsued code
saifullah-talukder 67de95a
implement email edit functionality
saifullah-talukder afbcb13
implement update password design
saifullah-talukder a9089f0
implement update password
saifullah-talukder 24a4a7b
Merge branch 'eng-179' into eng-190
saifullah-talukder 0bc64bf
remove console logs
saifullah-talukder 805ce6f
Merge branch 'develop' into eng-190
saifullah-talukder 1377e4a
adjust the parameters for rephrasing query
saifullah-talukder df29c7c
remove unnecessary code
saifullah-talukder 9904f6b
adjust the logic on splitting respinse by new line
saifullah-talukder 2b6dcef
fix bug in thread and streaming response UI
saifullah-talukder 606ce06
adjust fade in time for search response
saifullah-talukder ac9dbd1
improve design for streaming response
saifullah-talukder 62edfce
implement viewing source description using backend provided HTML
saifullah-talukder 50ff8a9
add two new env variables for deployment
saifullah-talukder 193098e
Merge branch 'develop' into eng-190
saifullah-talukder 6c98cee
add new env for server deployment
saifullah-talukder c8c13db
resolve potential risk of having \n in response
saifullah-talukder 876dd05
implement properly setting the content encoding header
saifullah-talukder dd4846f
refactoring: improve code readability for stream response splitting
saifullah-talukder 15dadc1
indentation related bug fix in makefile_ecr
saifullah-talukder c41d0bc
add sqlx prepared queries
saifullah-talukder ea31473
update server readme to add instructions related to adding sqlx query
saifullah-talukder 891ec4e
update agency values in helm
saifullah-talukder 598a141
Update deployment.yaml
AsmiKloud acee6ac
Merge pull request #65 from curieo-org/search-server-deployment-issue…
rathijitpapon c3b4ba5
hide refresh button in search response
saifullah-talukder 9696baa
hide thread title
saifullah-talukder 5937c2f
unhide search title. (only thread title should be hidden)
saifullah-talukder 9f486c5
Update service.yaml
AsmiKloud be83004
Update deployment.yaml
AsmiKloud 87c21f9
Merge pull request #67 from curieo-org/eng-190-patch-for-helmchart
rathijitpapon 85cbc94
Update virtualservice.yaml
AsmiKloud da61e70
Update deployment.yaml
AsmiKloud 6002582
:construction: fix the dockerfile ca-certificate issue
rathijitpapon 4aa63cb
:construction: fix the cluster json parsing issue
rathijitpapon 8a4e194
:bug: fix linting
rathijitpapon 87a8a50
resolve stream data splitting issue
saifullah-talukder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Image = curieo-agency | ||
ECR = 698471419283.dkr.ecr.eu-central-1.amazonaws.com/curieo-agency | ||
TAG = 2.0 | ||
TAG = 3.0 | ||
|
||
ecr_deploy: login | ||
docker buildx build --platform linux/amd64 -t $(Image) . | ||
docker buildx build --platform linux/amd64 -t $(Image) . | ||
docker tag $(Image) $(ECR):$(TAG) | ||
docker push $(ECR):$(TAG) | ||
docker push $(ECR):$(TAG) | ||
|
||
login: | ||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 698471419283.dkr.ecr.eu-central-1.amazonaws.com | ||
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 698471419283.dkr.ecr.eu-central-1.amazonaws.com |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
'use server' | ||
|
||
import { UpdatePasswordBody, UpdateProfileBody, UserProfile } from '@/types/settings' | ||
import { encodeAsUrlSearchParams } from '@/utils' | ||
import { curieoFetch } from './fetch' | ||
|
||
export async function fetchUserProfile(): Promise<UserProfile> { | ||
const response = await curieoFetch('/users/me') | ||
if (response.ok) { | ||
return (await response.json()) as UserProfile | ||
} | ||
throw new Error('Could not retrieve user profile') | ||
} | ||
|
||
export async function updateUserProfile(payload: UpdateProfileBody): Promise<UserProfile> { | ||
const response = await curieoFetch('/users/me', { | ||
method: 'PATCH', | ||
body: JSON.stringify(payload), | ||
}) | ||
if (response.ok) { | ||
return (await response.json()) as UserProfile | ||
} | ||
throw new Error('Could not update user profile') | ||
} | ||
|
||
export async function updatePassword(payload: UpdatePasswordBody): Promise<void> { | ||
const response = await curieoFetch('/users/update-password', { | ||
method: 'PATCH', | ||
headers: { | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}, | ||
body: encodeAsUrlSearchParams(payload), | ||
}) | ||
if (response.ok) { | ||
return | ||
} | ||
throw new Error('Could not update password') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { curieoFetch } from '@/actions/fetch' | ||
import { NextRequest, NextResponse } from 'next/server' | ||
|
||
export const GET = async (req: NextRequest) => { | ||
const { searchParams } = new URL(req.url) | ||
const searchQuery = searchParams.get('searchQuery') | ||
const threadId = searchParams.get('threadId') | ||
|
||
if (!searchQuery) { | ||
return NextResponse.json({ error: 'searchQuery is required' }, { status: 400 }) | ||
} | ||
|
||
async function pump(reader: ReadableStreamDefaultReader<Uint8Array>, writer: WritableStreamDefaultWriter<any>) { | ||
while (true) { | ||
const { done, value } = await reader.read() | ||
if (done) break | ||
writer.write(value) | ||
} | ||
writer.close() | ||
} | ||
|
||
try { | ||
const response = await curieoFetch(`/search?query=${searchQuery}${threadId ? `&thread_id=${threadId}` : ``}`) | ||
|
||
if (!response.ok) { | ||
return NextResponse.json({ error: 'Failed to fetch data from external API' }, { status: response.status }) | ||
} | ||
|
||
const reader = response.body?.getReader() | ||
if (!reader) { | ||
return NextResponse.json({ error: 'Failed to read from external API stream' }, { status: 500 }) | ||
} | ||
|
||
const headers = new Headers(response.headers) | ||
headers.delete('content-encoding') | ||
headers.set('content-encoding', 'none') | ||
ivarflakstad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const { readable, writable } = new TransformStream() | ||
const writer = writable.getWriter() | ||
|
||
pump(reader!, writer).catch(err => err) | ||
|
||
return new NextResponse(readable, { headers }) | ||
} catch (error) { | ||
return NextResponse.json({ error: 'Internal server error' }, { status: 500 }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's something we need to fix both in the backend and the frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this resolved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not till now. Working on it in a separate PR.