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

Implement document detail page #10

Merged
merged 2 commits into from
May 7, 2022

Conversation

chacha912
Copy link
Contributor

@chacha912 chacha912 commented Apr 28, 2022

What this PR does / why we need it?

The document detail page is shown when the user selects a document from the document list page.
Users can see snapshots of the document on the document detail page.
The user can access the document again using the URL of a specific document.

  • document list page: /documents
  • document detail page: /documents/{documentId}

TODO

  • Use a nested/hierarchical URL
    • It is convenient for users to use the DocumentKey instead of the id for the URL since users are more familiar with the key they define than with the id.
    • DocumentKey is unique for each project rather than a system global, so the URL becomes like this. /projects/{proiectID}/documents/{documentKey} Isolate clients and documents for each project yorkie#319
  • Handle some cases to improve user experience
    • Show the document list to which the document belongs when users access the detail page using the URL directly
    • Keep a document list when users go back to the previous page

Any background context you want to provide?

What are the relevant tickets?

Fixes #9

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@hackerwins
Copy link
Member

Thanks for your contribution. It's still in draft, but I'll leave a brief comment.

The detail page can be accessed from the list, but the user can also directly access the URL. We need to handle the case when the user directly opens the project details page as well.

Before, the snapshot data only passed when users clicked the link.
Implement to fetch data when the DocumentDetail component is mounted
to show the document data when entering the URL directly.

This commit also adds some codes by pasting the grpc protocol.
(to keep a single source of truth)
- Add project list command
- Remove collection from document
- Rename agent to server 
- Rename `db` package to `database`

Co-authored-by: Youngteac Hong <youngteac.hong@navercorp.com>
@hackerwins
Copy link
Member

@chacha912
I would suggest merging the current work into main and creating the remaining TODO as separate issues. When you are ready to review, please change the draft status.

@chacha912 chacha912 marked this pull request as ready for review May 6, 2022 09:14
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

unknown,
Action<string>
>;
export type AppThunk<ReturnType = void> = ThunkAction<ReturnType, RootState, unknown, Action<string>>;
Copy link
Member

Choose a reason for hiding this comment

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

@hackerwins hackerwins merged commit c483aa0 into yorkie-team:main May 7, 2022
hackerwins added a commit that referenced this pull request May 7, 2022
Fetch document data when the DocumentDetail component is mounted.

Before, the snapshot data only passed when users clicked the link.
Implement to fetch data when the DocumentDetail component is mounted
to show the document data when entering the URL directly.

This commit also adds some codes by pasting the grpc protocol.
(to keep a single source of truth)
- Add project list command
- Remove collection from document
- Rename agent to server 
- Rename `db` package to `database`

Co-authored-by: Youngteac Hong <youngteac.hong@navercorp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement document detail page
2 participants