Skip to content

Commit 07c1028

Browse files
authored
Merge pull request #77 from SentriusLLC/copilot/fix-72
Modernize integrations page with intuitive design and expanded integration options
2 parents a83ea7e + 72a1089 commit 07c1028

File tree

7 files changed

+671
-183
lines changed

7 files changed

+671
-183
lines changed

api/src/main/java/io/sentrius/sso/controllers/api/IntegrationApiController.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ protected IntegrationApiController(
5353
this.cryptoService = cryptoService;
5454
}
5555

56+
@PostMapping("/github/add")
57+
public ResponseEntity<ExternalIntegrationDTO> addGitHubIntegration(HttpServletRequest request,
58+
HttpServletResponse response,
59+
ExternalIntegrationDTO integrationDTO)
60+
throws JsonProcessingException, GeneralSecurityException {
61+
62+
var json = JsonUtil.MAPPER.writeValueAsString(integrationDTO);
63+
IntegrationSecurityToken token = IntegrationSecurityToken.builder()
64+
.connectionType("github")
65+
.name(integrationDTO.getName())
66+
.connectionInfo(json)
67+
.build();
68+
69+
token = integrationService.save(token);
70+
71+
// excludes the access token
72+
return ResponseEntity.ok(new ExternalIntegrationDTO(token));
73+
}
74+
5675
@PostMapping("/jira/add")
5776
public ResponseEntity<ExternalIntegrationDTO> addJiraIntegration(HttpServletRequest request, HttpServletResponse response,
5877
ExternalIntegrationDTO integrationDTO)

api/src/main/java/io/sentrius/sso/controllers/view/IntegrationController.java

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,52 @@ public String getIntegrationDashboard(Model model) {
3535
List<Map<String, String>> integrations = List.of(
3636
Map.of(
3737
"name", "GitHub",
38-
"description", "Configure GitHub integration settings",
39-
"icon", "fa-brands fa-github", // CSS class for GitHub icon
40-
"href", "/sso/v1/integrations/github"
38+
"description", "Connect your repositories and manage code integration workflows",
39+
"icon", "fa-brands fa-github",
40+
"href", "/sso/v1/integrations/github",
41+
"badge", "Popular",
42+
"badgeType", "popular"
4143
),
4244
Map.of(
4345
"name", "JIRA",
44-
"description", "Set up JIRA project management integration",
45-
"icon", "fa-brands fa-jira", // CSS class for JIRA icon
46-
"href", "/sso/v1/integrations/jira"
46+
"description", "Streamline project management and issue tracking workflows",
47+
"icon", "fa-brands fa-jira",
48+
"href", "/sso/v1/integrations/jira",
49+
"badge", "Popular",
50+
"badgeType", "popular"
4751
),
4852
Map.of(
4953
"name", "OpenAI",
50-
"description", "OpenAI connector",
51-
"icon", "fa-solid fa-robot", // CSS class for Slack icon
52-
"href", "/sso/v1/integrations/openai"
53-
)
54-
/*
54+
"description", "Integrate AI capabilities and natural language processing",
55+
"icon", "fa-solid fa-robot",
56+
"href", "/sso/v1/integrations/openai",
57+
"badge", "AI",
58+
"badgeType", "new"
59+
),
60+
Map.of(
61+
"name", "Slack",
62+
"description", "Enable team communication and notification workflows",
63+
"icon", "fa-brands fa-slack",
64+
"href", "/sso/v1/integrations/slack",
65+
"badge", "Coming Soon",
66+
"badgeType", ""
67+
),
5568
Map.of(
5669
"name", "Database",
57-
"description", "Configure database connections",
58-
"icon", "fa-solid fa-database", // CSS class for database icon
59-
"href", "/sso/v1/integrations/database"
60-
)*/
70+
"description", "Connect to databases for data integration and analytics",
71+
"icon", "fa-solid fa-database",
72+
"href", "/sso/v1/integrations/database",
73+
"badge", "Coming Soon",
74+
"badgeType", ""
75+
),
76+
Map.of(
77+
"name", "Microsoft Teams",
78+
"description", "Integrate with Microsoft Teams for collaboration workflows",
79+
"icon", "fa-brands fa-microsoft",
80+
"href", "/sso/v1/integrations/teams",
81+
"badge", "Coming Soon",
82+
"badgeType", ""
83+
)
6184
);
6285
List<ExternalIntegrationDTO> existingIntegrations = new ArrayList<>();
6386
integrationService.findAll().forEach(token -> {
@@ -72,6 +95,13 @@ public String getIntegrationDashboard(Model model) {
7295
return "sso/integrations/add_dashboard";
7396
}
7497

98+
@GetMapping("/github")
99+
public String createGitHubIntegration(Model model, @RequestParam(name = "id", required = false) Long id) {
100+
ExternalIntegrationDTO integration = new ExternalIntegrationDTO();
101+
model.addAttribute("githubIntegration", integration);
102+
return "sso/integrations/add_github";
103+
}
104+
75105
@GetMapping("/jira")
76106
public String createJiraIntegration(Model model, @RequestParam(name = "id", required = false) Long id) {
77107
ExternalIntegrationDTO integration = new ExternalIntegrationDTO();
@@ -86,4 +116,19 @@ public String createOpenAIIntegration(Model model, @RequestParam(name = "id", re
86116
return "sso/integrations/add_openai";
87117
}
88118

119+
@GetMapping("/slack")
120+
public String createSlackIntegration(Model model) {
121+
return getIntegrationDashboard(model);
122+
}
123+
124+
@GetMapping("/database")
125+
public String createDatabaseIntegration(Model model) {
126+
return getIntegrationDashboard(model);
127+
}
128+
129+
@GetMapping("/teams")
130+
public String createTeamsIntegration(Model model) {
131+
return getIntegrationDashboard(model);
132+
}
133+
89134
}

0 commit comments

Comments
 (0)