Skip to content
This repository has been archived by the owner on Aug 16, 2020. It is now read-only.

TableView / Loading data on demand #4

Open
JohannesLichtenberger opened this issue Oct 4, 2019 · 9 comments
Open

TableView / Loading data on demand #4

JohannesLichtenberger opened this issue Oct 4, 2019 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest https://hacktoberfest.digitalocean.com/ help wanted Extra attention is needed

Comments

@JohannesLichtenberger
Copy link
Member

As SirixDB is able to store Integer.MAX - 1 revisions, we have to take paging into account.

So the table should be loaded at first with the metadata from most-recent-revision-number to most-recent-revision-number - N revisions, to display the metadata from the most recent n revisions. Then on page 2 or when scrolling down the next 10 should be requested from the HTTP-Server...

@JohannesLichtenberger JohannesLichtenberger added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers hacktoberfest https://hacktoberfest.digitalocean.com/ labels Oct 4, 2019
@JohannesLichtenberger
Copy link
Member Author

Check the events in https://element.eleme.io/#/en-US/component/pagination

@viettrung9012
Copy link

viettrung9012 commented Oct 5, 2019

let me take a look at this

@JohannesLichtenberger
Copy link
Member Author

Hey, basically SirixDB provides a generic REST-API (should not only be used by our web application in the future):

https://localhost:9443/database/resource/history?startRevision=233&endRevision=183

For instance for the first page

https://localhost:9443/database/resource/history?startRevision=182&endRevision=132

For the second page and so on if a page has 50 rows :slight_smile: start and end revisions are always included.

So you need to calculate the revisions. page=3&count=50 would obviously be easier.

@viettrung9012
Copy link

@JohannesLichtenberger sorry it seems like my attempts so far did not work, so I hope someone else might pick this up. Element has infinite scroll option too so it might be more suitable for lazy loading data from server compare to pagination https://element.eleme.io/#/en-US/component/infiniteScroll

@JohannesLichtenberger
Copy link
Member Author

I think that would be even better, what do you think?

@viettrung9012
Copy link

Yes, that would be more suitable for displaying dynamic data.

@JohannesLichtenberger
Copy link
Member Author

You'd like to work on this? For now you can simply use the dummy JSON data, maybe.

Or try to get the HTTP-Server up and running: #14

There you can scroll down a bit where I added some links.

@Rackar
Copy link
Contributor

Rackar commented Oct 5, 2019

OK, I saw the ts changes. I am not good at it, I will try.
Infinite scroll is a better option for mobile.
I think pagination is good enough to jump, but before page it, I need another API to get the total count (maybe most-recent-revision-number in this case).
We must choose one of them.

@JohannesLichtenberger
Copy link
Member Author

JohannesLichtenberger commented Oct 5, 2019

As of now there's no specific endpoint, but it's an easy query:

sdb:revision(sdb:doc('database','resource'))

That can be sent with a POST HTTP request to https://localhost:9433 for instance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest https://hacktoberfest.digitalocean.com/ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants