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

Feature/persist browsing data #74

Merged
merged 30 commits into from
Dec 21, 2023
Merged

Conversation

crsct
Copy link
Collaborator

@crsct crsct commented Dec 4, 2023

closes #73

@lukasjelonek
Copy link
Member

[Vue warn]: Invalid prop: type check failed for prop "offset". Expected Number with value 0, got String with value "0". 
  at <BrowseView offset="0" limit="20" gc=undefined  ... > 
  at <RouterView> 
  at <App>

I get warnings when I use the browse page

@lukasjelonek
Copy link
Member

  1. Open browse
  2. Go to 2nd page
  3. use back button

-> Does not go back to first page

Copy link
Member

@lukasjelonek lukasjelonek left a comment

Choose a reason for hiding this comment

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

I added some comments that may be worth discussiong/thinking about

src/router/index.ts Outdated Show resolved Hide resolved
src/views/BrowseView.vue Outdated Show resolved Hide resolved
});
}

function decodeQuery() {
Copy link
Member

Choose a reason for hiding this comment

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

This method is named decode, but actually it decodes and replaces the components state. Is there a better name you can use for this behavior?

src/views/BrowseView.vue Outdated Show resolved Hide resolved
src/views/BrowseView.vue Show resolved Hide resolved
Comment on lines 158 to 163
watch(
() => route.query,
() => {
populateVariables();
},
);
Copy link
Member

Choose a reason for hiding this comment

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

Is this required when passing the query via props?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, without it the query values are not properly added to the references, i've tried computed references and those didn't seem to work either, if you know a better way, please let me know!

Copy link
Member

Choose a reason for hiding this comment

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

Okay, can you add a comment to this block? It should explain why this is done here.

src/views/BrowseView.vue Outdated Show resolved Hide resolved
src/model/Search.ts Outdated Show resolved Hide resolved
@lukasjelonek
Copy link
Member

  1. Open browse

    1. Go to 2nd page

    2. use back button

-> Does not go back to first page

This error is still there

Save filter values in an reactive object instead of single reactive variables
Replace `quality` with `completeness`
Add comments where it is not clear why something happens
Reduce parameters for route-query watcher
Hopefully this improve readability
@lukasjelonek lukasjelonek merged commit c8827fb into main Dec 21, 2023
1 check passed
@lukasjelonek lukasjelonek deleted the feature/persist-browsing-data branch December 21, 2023 09:55
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.

Persist Pagination and Browsing Parameters on Browse
2 participants