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

Fix documentation links #1238

Merged
merged 4 commits into from Jun 17, 2015

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Jun 10, 2015

This is targeted at the master branch. The 68ea4a8 should be cherry-picked into the 1.1 branch to fix #983.

@bernd bernd added this to the 1.2.0 milestone Jun 10, 2015

Add a DocsHelper class that bundles all documentation links.
Use enums instead of hardcoding links all over the code base.

Refs graylog-labs/graylog2-web-interface#1466

@bernd bernd force-pushed the fix-documentation-links branch from 97733a5 to ba4bbe1 Jun 10, 2015

public String toString() {
final String version = Version.CURRENT_CLASSPATH.major + "." + Version.CURRENT_CLASSPATH.minor;

final StringBuffer sb = new StringBuffer(DOCS_URL)

This comment has been minimized.

@joschi

joschi Jun 16, 2015

Contributor

The use of StringBuffer is unnecessary here and could be replace by simple string concatenation. Additionally StringBuffer adds a "tax" for being thread safe and needing to synchronize on write operations like append().

}

public String toLink(String title) {
final StringBuffer sb = new StringBuffer("<a href=\"")

This comment has been minimized.

@joschi

joschi Jun 16, 2015

Contributor

See above.

@joschi joschi self-assigned this Jun 16, 2015

PAGE_SENDING_JSONPATH("sending_data.html#json-path-from-http-api-input"),
PAGE_ES_CONFIGURATION("configuring_es.html");

public static String DOCS_URL = "http://docs.graylog.org/en/";

This comment has been minimized.

@joschi

joschi Jun 16, 2015

Contributor

Missing final keyword and could probably be private.

PAGE_ES_CONFIGURATION("configuring_es.html");

public static String DOCS_URL = "http://docs.graylog.org/en/";
public static final String HELP_DOCS = "http://docs.graylog.org/";

This comment has been minimized.

@joschi

joschi Jun 16, 2015

Contributor

I wouldn't move those three constants into the DocHelper class as they are only used in the UI class and are kind of different from the other documentation links that are being constructed in DocHelper.

Some refactorings for DocsHelper.
- Move back "HELP_*" constants to UI.
- Make DOCS_URL final and private.
- Replace usage of StringBuffer with string concat.
@bernd

This comment has been minimized.

Member

bernd commented Jun 17, 2015

Updated after comments.

@joschi

This comment has been minimized.

Contributor

joschi commented Jun 17, 2015

LGTM. 👍

joschi added a commit that referenced this pull request Jun 17, 2015

@joschi joschi merged commit 7e8e0ab into master Jun 17, 2015

1 check passed

continuous-integration/travis-ci/push The Travis CI build passed
Details

@joschi joschi deleted the fix-documentation-links branch Jun 17, 2015

edmundoa added a commit to graylog-labs/graylog2-web-interface that referenced this pull request Jun 19, 2015

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