Skip to content

Feature/discourse integration#890

Merged
garrrikkotua merged 37 commits intomainfrom
feature/discourse-integration
May 29, 2023
Merged

Feature/discourse integration#890
garrrikkotua merged 37 commits intomainfrom
feature/discourse-integration

Conversation

@garrrikkotua
Copy link
Copy Markdown
Contributor

@garrrikkotua garrrikkotua commented May 22, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 6868584

This pull request adds support for Discourse integration to the backend. It implements new API routes, functions, and classes to handle the connection, validation, webhook, and data fetching logic for Discourse. It also updates the integration processor, the grid system, the member attributes, and the incoming webhook repository to accommodate the Discourse integration. It modifies the files backend/src/serverless/integrations/services/integrationProcessor.ts, backend/src/api/integration/index.ts, backend/src/api/webhooks/index.ts, backend/src/database/attributes/member/discourse.ts, backend/src/database/repositories/incomingWebhookRepository.ts, backend/src/serverless/integrations/grid/discordGrid.ts, and backend/src/services/integrationService.ts, and adds several new files under backend/src/api/integration/helpers, backend/src/api/webhooks, backend/src/serverless/integrations/grid, and backend/src/serverless/integrations/usecases/discourse.

🤖 Generated by Copilot at 6868584

Sing, O Muse, of the mighty deeds of the code warriors
Who forged the link between the forum of Discourse and the platform of node
With skillful hands they crafted many routes and functions
To handle the requests and responses of the API

Why

How

🤖 Generated by Copilot at 6868584

  • Add four new API functions to handle Discourse integration requests: discourseCreateOrUpdate, discourseSoftConnect, discourseTestWebhook, and discourseValidator (link, link, link, link)
  • Register the new API functions as routes in the integration API index file backend/src/api/integration/index.ts (link)
  • Add a new API function to handle incoming webhooks from Discourse: discourse (link)
  • Register the new API function as a route in the webhooks API index file backend/src/api/webhooks/index.ts (link)
  • Add a new class to define the score and contribution flag for different event types from Discourse: DiscourseGrid (link)
  • Add a new property to the discord grid class to define the score and contribution flag for the topic event type from Discord: topic (link)
  • Add a new instance of the DiscourseIntegrationService class to the array of integration services in the IntegrationProcessor class (link, link)
  • Add a new method to the incoming webhook repository class to check if there are any webhooks for a given integration id: checkWebhooksExistForIntegration (link)
  • Add an array of member attributes that are specific to Discourse integration: URL, BIO, and AVATAR_URL (link)
  • Add two new methods to the integration service class to create or update and soft-connect a Discourse integration: discourseConnectOrUpdate and discourseSoftConnect (link)
  • Add several new functions to make GET requests to the Discourse API and fetch data for categories, topics, posts, and users: getDiscourseCategories, getDiscourseTopics, getDiscoursePostsByIds, getDiscoursePostsFromTopic, and getDiscourseUserByUsername (link, link, link, link, link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@garrrikkotua garrrikkotua marked this pull request as ready for review May 26, 2023 09:50
Copy link
Copy Markdown
Contributor

@joanagmaia joanagmaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!
Just left one request to change a button style and also noticed that you are missing to add discourse svg icon to frontend/public/icons/crowd-icons.svg (in some components we render the platform as svg)

Could you update those 2 things?

Comment thread frontend/src/integrations/discourse/components/discourse-connect-drawer.vue Outdated
Comment thread backend/src/database/repositories/incomingWebhookRepository.ts Outdated
@garrrikkotua garrrikkotua merged commit 770ab4d into main May 29, 2023
@garrrikkotua garrrikkotua deleted the feature/discourse-integration branch May 29, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants