-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): 531 file management (#558)
* Adds a file management page accessible through the top right settings icon. * Allows multiple file upload and delete. * Show upload success and error icon animations that disappear after 1.5 seconds. Also has toasts. * Allows search by filename and created_at date. * Allows sort by filename or created_at fields. * Includes a refactor to change the data fetching and invalidation pattern for assistants and files. --------- Co-authored-by: John Alling <[email protected]> Co-authored-by: Jon Perry <[email protected]>
- Loading branch information
1 parent
5371956
commit 884761b
Showing
70 changed files
with
1,319 additions
and
294 deletions.
There are no files selected for viewing
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
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
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
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
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,20 @@ | ||
import { server } from '../../../vitest-setup'; | ||
import { delay, http, HttpResponse } from 'msw'; | ||
import type { FileObject } from 'openai/resources/files'; | ||
|
||
export const mockDeleteFile = () => { | ||
server.use(http.delete('/api/files/delete', () => new HttpResponse(null, { status: 204 }))); | ||
}; | ||
|
||
export const mockDeleteFileWithDelay = () => { | ||
server.use( | ||
http.delete('/api/files/delete', async () => { | ||
await delay(500); | ||
return new HttpResponse(null, { status: 204 }); | ||
}) | ||
); | ||
}; | ||
|
||
export const mockGetFiles = (files: FileObject[]) => { | ||
server.use(http.get('/api/files', () => HttpResponse.json(files))); | ||
}; |
Oops, something went wrong.