Sfoglia il codice sorgente

add team name to slack integration

Alexander Belanger 4 anni fa
parent
commit
c337377e3f

+ 6 - 2
docker-compose.dev-secure.yaml

@@ -59,8 +59,12 @@ services:
     ports:
       - 443:443
     volumes:
-      - ./docker/localhost.crt:/etc/ssl/localhost.crt
-      - ./docker/localhost.key:/etc/ssl/localhost.key
+      - type: bind
+        source: ./docker/localhost.crt
+        target: /etc/ssl/localhost.crt
+      - type: bind
+        source: ./docker/localhost.key
+        target: /etc/ssl/localhost.key
       - ./docker/nginx_local_secure.conf:/etc/nginx/nginx.conf:ro
     depends_on:
       - porter

+ 1 - 0
internal/integrations/slack/slack.go

@@ -28,6 +28,7 @@ func TokenToSlackIntegration(token *oauth2.Token) (*integrations.SlackIntegratio
 			AccessToken: []byte(token.AccessToken),
 		},
 		TeamID:           teamInfo.Team.ID,
+		TeamName:         teamInfo.Team.Name,
 		TeamIconURL:      teamInfo.Team.Icon.Image132,
 		Channel:          webhookConfig["channel"].(string),
 		ChannelID:        webhookConfig["channel_id"].(string),

+ 16 - 5
internal/models/integrations/slack.go

@@ -19,6 +19,9 @@ type SlackIntegration struct {
 	// The ID for the Slack team
 	TeamID string
 
+	// The name of the Slack team
+	TeamName string
+
 	// The icon url for the Slack team
 	TeamIconURL string
 
@@ -49,21 +52,29 @@ type SlackIntegrationExternal struct {
 	// The ID for the Slack team
 	TeamID string `json:"team_id"`
 
+	// The name of the Slack team
+	TeamName string `json:"team_name"`
+
 	// The icon url for the Slack team
 	TeamIconURL string `json:"team_icon_url"`
 
 	// The channel name that the Slack app is installed in
 	Channel string `json:"channel"`
+
+	// The URL for configuring the workspace app instance
+	ConfigurationURL string `json:"configuration_url"`
 }
 
 // Externalize generates an external SlackIntegration to be shared over
 // rest
 func (s *SlackIntegration) Externalize() *SlackIntegrationExternal {
 	return &SlackIntegrationExternal{
-		ID:          s.ID,
-		ProjectID:   s.ProjectID,
-		TeamID:      s.TeamID,
-		TeamIconURL: s.TeamIconURL,
-		Channel:     s.Channel,
+		ID:               s.ID,
+		ProjectID:        s.ProjectID,
+		TeamID:           s.TeamID,
+		TeamName:         s.TeamName,
+		TeamIconURL:      s.TeamIconURL,
+		Channel:          s.Channel,
+		ConfigurationURL: s.ConfigurationURL,
 	}
 }