Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic integrations catalog #444

Closed
wants to merge 5 commits into from

Conversation

mit-27
Copy link
Contributor

@mit-27 mit-27 commented May 20, 2024

Copy link

changeset-bot bot commented May 20, 2024

⚠️ No Changeset found

Latest commit: c0db0d6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 20, 2024

@mit-27 is attempting to deploy a commit to the Panora Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

socket-security bot commented May 20, 2024

Copy link

socket-security bot commented May 20, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Protestware/Troll package npm/[email protected]
  • Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale
Install scripts npm/[email protected]
  • Install script: postinstall
  • Source: node -e "try{require('./_postinstall')}catch(e){}" || exit 0

View full report↗︎

Next steps

What is protestware?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package my come along with functionality unrelated to its primary purpose.

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

Copy link
Contributor

coderabbitai bot commented May 20, 2024

Walkthrough

The changes introduce dynamic integration capabilities to the catalog system. Users can now select and manage integration options through a new React component, MainCatalog, and an integration card component, PanoraIntegrationCard. The backend has been updated to support these features with new API endpoints and a database schema to store catalog options.

Changes

Files/Groups Change Summary
apps/embedded-catalog/react/src/components/PanoraDynamicCatalog.tsx Added MainCatalog component, DynamicCardProp interface, and DataState type to fetch data dynamically and allow user selection of providers and categories.
apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx Introduced PanoraIntegrationCard component to facilitate integration with providers and handle OAuth authentication.
apps/embedded-catalog/react/src/index.tsx Updated imports and exports to include PanoraIntegrationCard and PanoraDynamicCatalogCard components.
packages/api/prisma/schema.prisma Added a new catalog_options model with fields id_catalog_option, id_user, selected_catalog, and a relation to users.
packages/api/scripts/init.sql Added SQL script to create catalog_options table with columns id_catalog_option, id_user, selected_catalog.
packages/api/src/@core/catalog-options/catalog-options.controller.ts Updated CatalogOptionsController to handle API operations for adding, updating, and retrieving catalog options by project ID or user ID.
packages/api/src/@core/catalog-options/catalog-options.module.ts Introduced CatalogOptionsModule with providers CatalogOptionsService, LoggerService, and PrismaService, and a controller CatalogOptionsController.
packages/api/src/@core/catalog-options/catalog-options.service.ts Added methods in CatalogOptionsService for creating and retrieving catalog options by user and project IDs.
packages/api/src/@core/catalog-options/dto/catalog-options.dto.ts Introduced CreateCatalogOptionsDto class with properties id_user and selected_catalog, annotated with @ApiProperty.
packages/api/src/@core/core.module.ts Imported and exported CatalogOptionsModule in the CoreModule.

Assessment against linked issues

Objective (Issue #432) Addressed Explanation
Customers must be able to opt in/out of integrations
Reflected when they use the embedded catalog in the frontend
Dynamic fetching based on project ID

🐇 In the code's new light, integrations take flight,
With dynamic flair, users select with care.
Catalogs now dance, in the user's glance,
Options in store, like never before! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 1ce71bd and e41ac61.
Files ignored due to path filters (2)
  • apps/embedded-catalog/react/yarn.lock is excluded by !**/*.lock, !**/*.lock
  • packages/api/swagger/swagger-spec.json is excluded by !**/*.json
Files selected for processing (10)
  • apps/embedded-catalog/react/src/components/PanoraDynamicCatalog.tsx (1 hunks)
  • apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx (1 hunks)
  • apps/embedded-catalog/react/src/index.tsx (3 hunks)
  • packages/api/prisma/schema.prisma (2 hunks)
  • packages/api/scripts/init.sql (2 hunks)
  • packages/api/src/@core/catalog-options/catalog-options.controller.ts (1 hunks)
  • packages/api/src/@core/catalog-options/catalog-options.module.ts (1 hunks)
  • packages/api/src/@core/catalog-options/catalog-options.service.ts (1 hunks)
  • packages/api/src/@core/catalog-options/dto/catalog-options.dto.ts (1 hunks)
  • packages/api/src/@core/core.module.ts (3 hunks)
Files not reviewed due to errors (3)
  • packages/api/src/@core/catalog-options/catalog-options.service.ts (no review received)
  • apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx (no review received)
  • apps/embedded-catalog/react/src/components/PanoraDynamicCatalog.tsx (no review received)
Additional Context Used
GitHub Check Runs (1)
Build and Test (18.x) success (15)

packages/api/src/@core/catalog-options/catalog-options.controller.ts: [warning] 8-8:
'Request' is defined but never used

Additional comments not posted (7)
packages/api/src/@core/catalog-options/dto/catalog-options.dto.ts (1)

1-8: The DTO structure is well-defined and aligns with the requirements for dynamic catalog options.

packages/api/src/@core/catalog-options/catalog-options.module.ts (1)

1-11: The module setup is correct and includes all necessary providers and controllers for the catalog options functionality.

apps/embedded-catalog/react/src/index.tsx (1)

Line range hint 2-45: Ensure that all necessary properties in the interfaces are uncommented and used if they are required for the components to function correctly.

#!/bin/bash
# Description: Verify that the commented properties in interfaces are not used elsewhere in the project.

# Test: Search for usage of commented properties. Expect: No occurrences.
rg --type typescript $'name|vertical'
packages/api/src/@core/core.module.ts (1)

Line range hint 1-53: The integration of CatalogOptionsModule into the core module is correctly implemented, enhancing the backend's functionality as intended.

packages/api/src/@core/catalog-options/catalog-options.controller.ts (1)

1-69: Remove the unused import Request to clean up the code.

- import { Request } from '@nestjs/common';

Also, ensure that the public API methods (getLinkedUser) do not require authentication, as intended.

#!/bin/bash
# Description: Verify that the `getLinkedUser` method does not require authentication.

# Test: Search for usage of `UseGuards` in relation to `getLinkedUser`. Expect: No occurrences.
rg --type typescript $'getLinkedUser' -A 10 | rg 'UseGuards'
packages/api/scripts/init.sql (1)

95-102: The SQL for creating the catalog_options table and its constraints is correctly implemented.

packages/api/prisma/schema.prisma (1)

644-649: The catalog_options model is well-defined and aligns with the PR objectives to enable dynamic integrations catalog.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between e41ac61 and 6390536.
Files selected for processing (2)
  • apps/embedded-catalog/react/src/components/PanoraDynamicCatalog.tsx (1 hunks)
  • apps/embedded-catalog/react/src/global.css (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/embedded-catalog/react/src/global.css
Files skipped from review as they are similar to previous changes (1)
  • apps/embedded-catalog/react/src/components/PanoraDynamicCatalog.tsx

@naelob naelob closed this May 23, 2024
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.

feat: Dynamic Integrations Catalog
2 participants