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

archive functionality added in document section #946

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Anky9972
Copy link

@Anky9972 Anky9972 commented Oct 14, 2024

#788
We added the archive document functionality in document section in which user can archive and retrieve the document and delete the document from archive section as required.

  1. We have added isArchive (Boolean) field in Document model.
  2. Added archived_document_card.tsx, archived_document_list.tsx and archived_empty_document.tsx in document folder inside components.
  3. Added document filter functionality on the basis of isArchived value.
Screencast.from.2024-10-14.15-45-07.mp4

@Anky9972 Anky9972 requested a review from mfts as a code owner October 14, 2024 10:29
Copy link

vercel bot commented Oct 14, 2024

@Anky9972 is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Oct 14, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Anky9972
Copy link
Author

recheck

@Anky9972
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@mfts
Copy link
Owner

mfts commented Oct 16, 2024

@Anky9972 can you make the Archive a tab inside the Document section.

I'm thinking about a tab that leads to /documents/archive in the document list header (as sketched here) instead of a Sidebar menu item

CleanShot 2024-10-16 at 19 26 35@2x

@Anky9972
Copy link
Author

@Anky9972 can you make the Archive a tab inside the Document section.

I'm thinking about a tab that leads to /documents/archive in the document list header (as sketched here) instead of a Sidebar menu item

CleanShot 2024-10-16 at 19 26 35@2x

Ok, I will do it as soon as possible.

@Anky9972
Copy link
Author

@mfts check it

Screencast.from.2024-10-16.16-46-11.mp4

@Anky9972
Copy link
Author

@mfts Did you review the changes?

Copy link
Owner

@mfts mfts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good progress. Some minor changes that will make maintaining it easier in the long run.

Focus on reusability. For example the documents-list can also serve for archived documents. Don't need to duplicate the same code.

components/Sidebar.tsx Show resolved Hide resolved
pages/api/links/[id]/archive.ts Show resolved Hide resolved
lib/types.ts Show resolved Hide resolved
pages/archive/index.tsx Show resolved Hide resolved
import { ArchivedDocumentsList } from "@/components/documents/archived-document-list";

export default function Documents() {
const { documents,error } = useDocuments();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would expect to only fetch archived documents here, not all documents. so you could add a variable to the useDocuments swr hook and then only fetch the archived documents.


export default function Documents() {
const { documents,error } = useDocuments();
const { folders } = useRootFolders();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this you probably don't need in the archive

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting is a bit off. why are there so many changes to parts of the file that have nothing to do with your implementation?

@mfts mfts added revisit Currently not required but important in the future 🕹️ oss.gg iteration-1 🕹️ 300 points labels Oct 19, 2024
@mfts
Copy link
Owner

mfts commented Oct 22, 2024

@Anky9972 please have a look at the latest change requests

@Anky9972
Copy link
Author

@mfts Sure working on them let you know in 2 or 3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iteration-2 🕹️ oss.gg revisit Currently not required but important in the future 🕹️ 300 points
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants