use of edu.stanford.bmir.protege.web.shared.projectsettings.SlackIntegrationSettings in project webprotege by protegeproject.
the class ProjectDetailsManagerImpl method getProjectSettings.
@Override
public ProjectSettings getProjectSettings(ProjectId projectId) throws UnknownProjectException {
List<SlackWebhook> projectWebhooks = slackWebhookRepository.getWebhooks(projectId);
String slackPayloadUrl = projectWebhooks.stream().findFirst().map(SlackWebhook::getPayloadUrl).orElse("");
List<WebhookSetting> webhookSettings = webhookRepository.getProjectWebhooks(projectId).stream().map(wh -> new WebhookSetting(wh.getPayloadUrl(), new LinkedHashSet<ProjectWebhookEventType>(wh.getSubscribedToEvents()))).collect(toList());
ProjectDetails projectDetails = getProjectDetails(projectId);
return new ProjectSettings(projectId, projectDetails.getDisplayName(), projectDetails.getDescription(), new SlackIntegrationSettings(slackPayloadUrl), new WebhookSettings(webhookSettings));
}
Aggregations