Page MenuHomePhabricator

Simplify ExternalData parsing in Kartographer
Closed, ResolvedPublic

Description

In order to reuse the same code in both JS and Node, the code that parses ExternalData geojson should be as simple as possible, especially since we always get that data from the trusted PHP parser.

  • php should normalize service and href variants into an HREF
  • URL should always contain proper protocol and domain, e.g. https://maps.wikimedia.org/geoshape?...
  • there should always be a service tag to simplify post-processing of the request

This way the JS code can always expect these two fields:

"ExternalData": {
    "service": "geoshape",
    "href": "https://maps.wikimedia.org/geoshape?ids=Q30"
}

Event Timeline

Yurik created this task.Oct 1 2016, 11:02 PM
Restricted Application added a project: Discovery. · View Herald TranscriptOct 1 2016, 11:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
MaxSem claimed this task.Oct 1 2016, 11:40 PM

Is service really needed when it's duplicated in href?

Yurik added a comment.Oct 1 2016, 11:42 PM

@MaxSem it's not duplicated, href should use the real protocol to avoid complex parsing

MaxSem moved this task from Backlog to In progress on the Maps-Sprint board.Oct 3 2016, 6:42 PM

Change 314147 had a related patch set uploaded (by MaxSem):
Normalize ExternalData

https://gerrit.wikimedia.org/r/314147

Yurik moved this task from Unsorted to General on the Maps (Kartographer) board.Oct 6 2016, 8:32 PM

Change 314147 merged by jenkins-bot:
Normalize ExternalData

https://gerrit.wikimedia.org/r/314147

Yurik closed this task as Resolved.Oct 11 2016, 4:46 PM