backstrokeapp / dashboard

The backstroke dashboard is a frontend dashboard to the backstroke service
https://app.backstroke.co
6 stars 8 forks source link

Add a button to refresh the last synced time #3

Closed 1egoman closed 7 years ago

1egoman commented 7 years ago

The Backstroke dashboard currently doesn't have a way to update the last-synced time of a link without reloading the page. Ideally, there'd be a refresh button next to the text added in https://github.com/backstrokeapp/dashboard/pull/2 that refreshes the state of the link that's currently visible, pulling in a new refresh time from the server.

screen shot 2017-10-08 at 3 06 31 pm

This application uses redux for state management. There's an action named COLLECTION_LINKS_PUSH that merges new server state into the links collection (link to action and the section of the links reducer that handles the action).

When the user clicks the refresh button, you'll need to dispatch an action that fetches the data for the currently selected link (the id of the selected link is available in the link-detail component as link.id), and call the COLLECTIONS_LINKS_PUSH action mentioned above with that data. The http request required to fetch this data is GET https://api.backstroke.co/v1/links/:id.

If you'd like to see an example of an action that does something very similar, check out this action. It's used to fetch all links when initially loading the link-list page (the list view) of the dashboard.

If you'd like clarification on the structure of the application, I'l more than willing to help or answer questions. Thanks!

Jeffrey-Chang commented 7 years ago

@1egoman Would you mind if I tried to pick this one up?

1egoman commented 7 years ago

@Jeffrey-Chang Go for it!

It's a bit dependent on https://github.com/backstrokeapp/dashboard/issues/1, but I think you should be able to implement the refresh button separately and bring in the last synced label once complete. Would you agree?

Thanks for helping out with Backstroke!

Jeffrey-Chang commented 7 years ago

@1egoman Yes, I can complete this separately

1egoman commented 7 years ago

I was able to close https://github.com/backstrokeapp/dashboard/issues/1.