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

ResponseHighlighter enhancement proposal - hyperlinks and selections #651

Merged
merged 3 commits into from Jul 10, 2017

Conversation

Projects
None yet
3 participants
@eug48
Contributor

eug48 commented May 19, 2017

This adds some JavaScript to the ResponseHighlighterInterceptor that creates hyperlinks for absolute URLs and relative references. There's also a prototype of smarter selections - dateTimes and UUIDs are set to use the "user-select: all" CSS property.

Only the latest Firefox, Chrome and Edge are currently supported. I've only tested using HAPI's CLI interface.

I've also made a userscript version for Greasemonkey (Firefox) and Tampermonkey (Chrome) which makes testing much easier: https://gist.github.com/eug48/eeb15b8d6d6091729af1233efcb19cd0

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 19, 2017

Coverage Status

Coverage increased (+0.008%) to 77.395% when pulling 5bbf868 on eug48:master into 8701e3a on jamesagnew:master.

coveralls commented May 19, 2017

Coverage Status

Coverage increased (+0.008%) to 77.395% when pulling 5bbf868 on eug48:master into 8701e3a on jamesagnew:master.

InputStream jsStream = ResponseHighlighterInterceptor.class.getResourceAsStream("ResponseHighlighter.js");
String jsStr = jsStream != null ? IOUtils.toString(jsStream, "UTF-8") : "console.log('ResponseHighlighterInterceptor: javascript resource not found')";
jsStr = jsStr.replace("FHIR_BASE", theRequestDetails.getServerBaseForRequest());

This comment has been minimized.

@jamesagnew

jamesagnew Jun 8, 2017

Owner

This is quite a neat proposal. The one thing I don't get is what this FHIR_BASE string is. Where would this be expected to be in the generated source?

@jamesagnew

jamesagnew Jun 8, 2017

Owner

This is quite a neat proposal. The one thing I don't get is what this FHIR_BASE string is. Where would this be expected to be in the generated source?

This comment has been minimized.

@eug48

eug48 Jun 8, 2017

Contributor

It's a bit of a hack - FHIR_BASE is prepended by the generated javascript to FHIR relative URIs to make them absolute for use in generated hyperlinks. If it were to use relative URIs as they are, a link from "http://.../Encounter/34" to "Patient/12" would take the browser to "http://.../Encounter/Patient/12".

@eug48

eug48 Jun 8, 2017

Contributor

It's a bit of a hack - FHIR_BASE is prepended by the generated javascript to FHIR relative URIs to make them absolute for use in generated hyperlinks. If it were to use relative URIs as they are, a link from "http://.../Encounter/34" to "Patient/12" would take the browser to "http://.../Encounter/Patient/12".

@jamesagnew jamesagnew merged commit f1f7298 into jamesagnew:master Jul 10, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.008%) to 77.395%
Details

jamesagnew added a commit that referenced this pull request Jul 10, 2017

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Jul 10, 2017

Owner

This has been merged. Thanks for the contribution!

Please let me know if you'd like your attribution in our developer list to read something other than @eug48

Owner

jamesagnew commented Jul 10, 2017

This has been merged. Thanks for the contribution!

Please let me know if you'd like your attribution in our developer list to read something other than @eug48

@eug48

This comment has been minimized.

Show comment
Hide comment
@eug48

eug48 Jul 11, 2017

Contributor

Thanks James! Sure, you can write in Eugene Lubarsky.

Contributor

eug48 commented Jul 11, 2017

Thanks James! Sure, you can write in Eugene Lubarsky.

jamesagnew added a commit that referenced this pull request Jul 11, 2017

eug48 added a commit to eug48/hapi-fhir that referenced this pull request Jul 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment