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

ATLAS-126: Created RSS feed of updates to Atlas data #86

Merged
merged 1 commit into from Jul 11, 2019

Conversation

@HelioStrike
Copy link
Collaborator

commented Jul 7, 2019

JIRA ticket: https://issues.openmrs.org/browse/ATLAS-126

I'm not entirely sure what an RSS feed should look like, and what some of those terms mean, so I will need some help here with the schema. :|

I created an SQL table called rss, seeing how some blogs (shared by @cintiadr !) used the database to store the feed entries.
Links to said blogs: https://davidwalsh.name/rss-express, http://programmerblog.net/how-to-generate-rss-feed-using-nodejs/

Here, every call to GET '/rss' uses the database and generates the feed again. Would it be better to use some 'last_cached' variable, so that we can create the feed only once in a given period?

Here's the readme of the module I used, and the generated RSS feed.

Screenshot from 2019-07-07 23-50-18

@HelioStrike HelioStrike requested review from bmamlin and cintiadr Jul 7, 2019

@bmamlin
Copy link
Member

left a comment

I was thinking that we'd track changes in memory. But I think you're database table approach is more robust!

routes/rss.js Outdated Show resolved Hide resolved
routes/rss.js Outdated Show resolved Hide resolved
routes/rss.js Outdated Show resolved Hide resolved
routes/rss.js Outdated Show resolved Hide resolved
db/rsstable.sql Show resolved Hide resolved
@bmamlin

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

If we could support a link to a specific marker (e.g., /?marker={ID}) that would open up Atlas with the given marker centered and its bubble opened, that would be the perfect link to include for an RSS entry. So, someone reading the feed would see "Foobar site joins the OpenMRS Atlas!", click the link, and be looking at the Foobar site's marker.

routes/markers.js Outdated Show resolved Hide resolved
routes/markers.js Outdated Show resolved Hide resolved
routes/markers.js Outdated Show resolved Hide resolved
routes/markers.js Outdated Show resolved Hide resolved
utils.js Outdated Show resolved Hide resolved

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-126 branch from 7a064c3 to 733edaa Jul 11, 2019

@HelioStrike

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 11, 2019

@bmamlin I implemented the requested changes. When we click on a marker link I wanted to not only open the marker window, but also set it as center and zoom in, but it doesn't seem to be working. It zooms in for a split-second, and then zooms out to cover the whole map. I couldn't find the code responsible for it, but I'll keep looking.

@HelioStrike HelioStrike requested a review from bmamlin Jul 11, 2019

@HelioStrike HelioStrike force-pushed the HelioStrike:ATLAS-126 branch from 733edaa to 06a84c6 Jul 11, 2019

@bmamlin

This comment has been minimized.

Copy link
Member

commented Jul 11, 2019

@HelioStrike, if you see the desired behavior but then the map "resets" to full screen, it's possible your code is working, but is executing before Google Maps has finished setting up... so Google Maps goes to its default state after you've zoomed in.

Try delaying your code – e.g., setTimeout(focusOnMarker, 5000) – and see if it works properly after the delay. If that works, then what you need to find is the event/notification that Google Maps has finished loading and execute your code when that event/trigger fires. I found this tip, which might help.

@bmamlin bmamlin merged commit 0f1e5f7 into openmrs:master Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.