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

Changes auto-update option added #368

Merged
merged 1 commit into from
Apr 14, 2015
Merged

Conversation

benkeen
Copy link
Member

@benkeen benkeen commented Apr 9, 2015

This PR adds a "Auto-update changes list" option on the Changes
page, within the Filters tab. When enabled, it will automatically
update the page with whatever changes occur on the database.

<input
type="checkbox"
id="changes-toggle-polling"
checked={this.state.pollingEnabled ? 'checked="checked"': null}
Copy link
Member

Choose a reason for hiding this comment

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

i think this can be: checked={this.state.pollingEnabled}

https://facebook.github.io/jest/docs/tutorial-react.html

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooh nice, thanks!

@michellephung
Copy link
Member

+1

@benkeen benkeen force-pushed the changes-auto-update branch 2 times, most recently from f1ecef7 to b50d027 Compare April 10, 2015 17:53
getLatestChanges: function () {
var params = {};

var lastSeqNum = changesStore.getLastSeqNum();
Copy link
Member

Choose a reason for hiding this comment

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

Instead of default value for getLastSeqNum of null rather make it return now. Changes supports the now parameter. Then you don't need to do the if statement and instead just set the since, feed and timeout.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried this, but for the initial request it can't be a longpoll or I don't ever get the first batch of data returned; 'now' as a default only works for future changes - for the first request I need the last N results in the past. But I refactored the code a bit to only set it to longpoll once currentRequest has been set, and removed the else. I think it's a bit better now. [Will commit in a moment]

@garrensmith
Copy link
Member

@benkeen this is very cool. Could you add a small notification for each new change that is added. Maybe something like it changes colour slightly just so a user notices that a new set of changes have come through.

@benkeen
Copy link
Member Author

benkeen commented Apr 13, 2015

@garrensmith that's a good idea, will do.

@benkeen benkeen force-pushed the changes-auto-update branch 2 times, most recently from 4ff778e to 75e1a7b Compare April 13, 2015 19:43
@garrensmith
Copy link
Member

@benkeen this looks great. I'm getting a strange behaviour if I view changes. Then make a few changes to the db and then click on the filter and check auto update. It then does a lot of updating.

If I view the changes page, then check auto update and then make a few changes to the db I don't get as many updates.

@benkeen
Copy link
Member Author

benkeen commented Apr 14, 2015

Ah, drat. Good catch. What's happening is that the first time you check the auto update feature it'll show all changes that have occurred since the page was originally loaded, rather than from that moment on which is what you'd expect. I'll fix it.

@benkeen benkeen force-pushed the changes-auto-update branch 2 times, most recently from 7930b3e to a34579a Compare April 14, 2015 20:09
@asfgit asfgit merged commit a34579a into apache:master Apr 14, 2015
@benkeen
Copy link
Member Author

benkeen commented Apr 14, 2015

Squashed & merged.

This PR adds a "Auto-update changes list" option on the Changes
page, within the Filters tab. When enabled, it will automatically
update the page with whatever changes occur on the database.
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.

None yet

4 participants