Search in sources :

Example 1 with GitHubLabelRetriever

use of org.monarchinitiative.loinc2hpo.github.GitHubLabelRetriever in project loinc2hpo by monarch-initiative.

the class AnnotateTabController method initializeGitHubLabelsIfNecessary.

/**
 * For the GitHub new issues, we want to allow the user to choose a pre-existing label for the issue.
 * For this, we first go to GitHub and retrieve the labels with
 * {@link org.monarchinitiative.loinc2hpo.github.GitHubLabelRetriever}. We only do this
 * once per session though.
 */
private void initializeGitHubLabelsIfNecessary() {
    if (model.hasLabels()) {
        // we only need to retrieve the labels from the server once per session!
        return;
    }
    GitHubLabelRetriever retriever = new GitHubLabelRetriever();
    List<String> labels = retriever.getLabels();
    if (labels == null) {
        labels = new ArrayList<>();
    }
    if (labels.size() == 0) {
        labels.add("new term request");
    }
    model.setGithublabels(labels);
}
Also used : GitHubLabelRetriever(org.monarchinitiative.loinc2hpo.github.GitHubLabelRetriever)

Aggregations

GitHubLabelRetriever (org.monarchinitiative.loinc2hpo.github.GitHubLabelRetriever)1