Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ protected IntegrationApiController(
this.cryptoService = cryptoService;
}

@PostMapping("/github/add")
public ResponseEntity<ExternalIntegrationDTO> addGitHubIntegration(HttpServletRequest request,
HttpServletResponse response,
ExternalIntegrationDTO integrationDTO)
throws JsonProcessingException, GeneralSecurityException {

var json = JsonUtil.MAPPER.writeValueAsString(integrationDTO);
IntegrationSecurityToken token = IntegrationSecurityToken.builder()
.connectionType("github")
.name(integrationDTO.getName())
.connectionInfo(json)
.build();

token = integrationService.save(token);

// excludes the access token
return ResponseEntity.ok(new ExternalIntegrationDTO(token));
}

@PostMapping("/jira/add")
public ResponseEntity<ExternalIntegrationDTO> addJiraIntegration(HttpServletRequest request, HttpServletResponse response,
ExternalIntegrationDTO integrationDTO)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,52 @@ public String getIntegrationDashboard(Model model) {
List<Map<String, String>> integrations = List.of(
Map.of(
"name", "GitHub",
"description", "Configure GitHub integration settings",
"icon", "fa-brands fa-github", // CSS class for GitHub icon
"href", "/sso/v1/integrations/github"
"description", "Connect your repositories and manage code integration workflows",
"icon", "fa-brands fa-github",
"href", "/sso/v1/integrations/github",
"badge", "Popular",
"badgeType", "popular"
),
Map.of(
"name", "JIRA",
"description", "Set up JIRA project management integration",
"icon", "fa-brands fa-jira", // CSS class for JIRA icon
"href", "/sso/v1/integrations/jira"
"description", "Streamline project management and issue tracking workflows",
"icon", "fa-brands fa-jira",
"href", "/sso/v1/integrations/jira",
"badge", "Popular",
"badgeType", "popular"
),
Map.of(
"name", "OpenAI",
"description", "OpenAI connector",
"icon", "fa-solid fa-robot", // CSS class for Slack icon
"href", "/sso/v1/integrations/openai"
)
/*
"description", "Integrate AI capabilities and natural language processing",
"icon", "fa-solid fa-robot",
"href", "/sso/v1/integrations/openai",
"badge", "AI",
"badgeType", "new"
),
Map.of(
"name", "Slack",
"description", "Enable team communication and notification workflows",
"icon", "fa-brands fa-slack",
"href", "/sso/v1/integrations/slack",
"badge", "Coming Soon",
"badgeType", ""
),
Map.of(
"name", "Database",
"description", "Configure database connections",
"icon", "fa-solid fa-database", // CSS class for database icon
"href", "/sso/v1/integrations/database"
)*/
"description", "Connect to databases for data integration and analytics",
"icon", "fa-solid fa-database",
"href", "/sso/v1/integrations/database",
"badge", "Coming Soon",
"badgeType", ""
),
Map.of(
"name", "Microsoft Teams",
"description", "Integrate with Microsoft Teams for collaboration workflows",
"icon", "fa-brands fa-microsoft",
"href", "/sso/v1/integrations/teams",
"badge", "Coming Soon",
"badgeType", ""
)
);
List<ExternalIntegrationDTO> existingIntegrations = new ArrayList<>();
integrationService.findAll().forEach(token -> {
Expand All @@ -72,6 +95,13 @@ public String getIntegrationDashboard(Model model) {
return "sso/integrations/add_dashboard";
}

@GetMapping("/github")
public String createGitHubIntegration(Model model, @RequestParam(name = "id", required = false) Long id) {
ExternalIntegrationDTO integration = new ExternalIntegrationDTO();
model.addAttribute("githubIntegration", integration);
return "sso/integrations/add_github";
}

@GetMapping("/jira")
public String createJiraIntegration(Model model, @RequestParam(name = "id", required = false) Long id) {
ExternalIntegrationDTO integration = new ExternalIntegrationDTO();
Expand All @@ -86,4 +116,19 @@ public String createOpenAIIntegration(Model model, @RequestParam(name = "id", re
return "sso/integrations/add_openai";
}

@GetMapping("/slack")
public String createSlackIntegration(Model model) {
return getIntegrationDashboard(model);
}

@GetMapping("/database")
public String createDatabaseIntegration(Model model) {
return getIntegrationDashboard(model);
}

@GetMapping("/teams")
public String createTeamsIntegration(Model model) {
return getIntegrationDashboard(model);
}

}
Loading