Skip to content

feat: Portal setup, theming and initial page scaffolding #76

Merged
alexbouchardd merged 23 commits into
mainfrom
feat/portal-setup
Dec 10, 2024
Merged

feat: Portal setup, theming and initial page scaffolding #76
alexbouchardd merged 23 commits into
mainfrom
feat/portal-setup

Conversation

@alexbouchardd

@alexbouchardd alexbouchardd commented Nov 19, 2024

Copy link
Copy Markdown
Contributor

Important

Introduces portal setup with theming, initial page scaffolding, and updates to configuration, routing, and UI components.

  • Portal Setup:
    • Added portal configuration options in .env.example and config.go.
    • New portal routes added in router.go and tenant_handlers.go.
    • JWT expiration extended to 24 hours in jwt.go and jwt_test.go.
  • Frontend Components:
    • Added SearchInput, Table, Toast, Tooltip, and TopicPicker components with corresponding styles.
    • Implemented Destination, DestinationSettings, Events, and DestinationList components for portal UI.
    • Configured favicon and document title in main.tsx based on CONFIGS.
  • Styling and Theming:
    • Introduced global styles in global.scss for consistent theming.
    • Added SCSS files for new components and scenes for styling.
  • Build and Deployment:
    • Updated vite.config.ts to include Sentry plugin for production builds.
    • Added Sentry configuration file to .gitignore.

This description was created by Ellipsis for 447ea57. It will automatically update as commits are pushed.

@alexbouchardd alexbouchardd marked this pull request as draft November 19, 2024 16:12
@alexbouchardd alexbouchardd changed the title Feat/portal setup feat: Portal setup, theming and initial page scaffolding Nov 19, 2024
@alexbouchardd alexbouchardd marked this pull request as ready for review December 10, 2024 19:39
Copilot AI review requested due to automatic review settings December 10, 2024 19:39
@alexbouchardd alexbouchardd merged commit 5cbfa7f into main Dec 10, 2024
@alexbouchardd alexbouchardd deleted the feat/portal-setup branch December 10, 2024 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot reviewed 39 out of 54 changed files in this pull request and generated 2 suggestions.

Files not reviewed (15)
  • .env.example: Language not supported
  • build/dev/portal/Dockerfile: Language not supported
  • internal/portal/.gitignore: Language not supported
  • internal/portal/index.html: Language not supported
  • internal/portal/package.json: Language not supported
  • internal/portal/src/app.scss: Language not supported
  • internal/portal/src/common/Badge/Badge.scss: Language not supported
  • internal/portal/src/common/Button/Button.scss: Language not supported
  • internal/portal/src/common/Checkbox/Checkbox.scss: Language not supported
  • internal/portal/src/common/CopyButton/CopyButton.scss: Language not supported
  • build/dev/compose.yml: Evaluated as low risk
  • docs/contributing/portal.md: Evaluated as low risk
  • internal/config/config.go: Evaluated as low risk
  • internal/portal/embed.go: Evaluated as low risk
  • internal/portal/src/Sentry.tsx: Evaluated as low risk
Comments skipped due to low confidence (4)

internal/portal/src/common/CopyButton/CopyButton.tsx:41

  • [nitpick] The class name 'unstyled-button' is ambiguous. It should be renamed to something more specific like 'copy-button'.
className="unstyled-button"

internal/portal/src/common/Button/Button.tsx:25

  • The className concatenation might result in an extra space if className is not provided. Consider using a template literal with conditional checks.
  } ${className}`;

internal/portal/src/app.tsx:139

  • The error message 'Invalid token' should be capitalized for consistency.
console.error("Invalid token");

internal/portal/src/app.tsx:183

  • There is no check to ensure CONFIGS.FORCE_THEME is a valid theme value. This could lead to unexpected behavior. Consider adding a check to ensure CONFIGS.FORCE_THEME is either 'dark' or 'light'.
const queryTheme = CONFIGS.FORCE_THEME || searchParams.get("theme");

<Link
to={to}
className={className}
{...(disabled && { onClick: (e) => e.preventDefault() })}

Copilot AI Dec 10, 2024

Copy link

Choose a reason for hiding this comment

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

The onClick prop is not being passed to the Link component when disabled is false. Ensure the onClick prop is passed correctly.

Suggested change
{...(disabled && { onClick: (e) => e.preventDefault() })}
{...(disabled ? { onClick: (e) => e.preventDefault() } : { onClick })}

Copilot uses AI. Check for mistakes.
}, []);

if (!token) {
window.location.replace(CONFIGS.REFERER_URL);

Copilot AI Dec 10, 2024

Copy link

Choose a reason for hiding this comment

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

If the token is not found, the function calls window.location.replace(CONFIGS.REFERER_URL) and then returns undefined. This could lead to unexpected behavior if the component tries to use the token after this point. Consider adding a return statement after the redirect.

Suggested change
window.location.replace(CONFIGS.REFERER_URL);
return null;

Copilot uses AI. Check for mistakes.

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 447ea57 in 1 minute and 49 seconds

More details
  • Looked at 3686 lines of code in 50 files
  • Skipped 4 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. internal/services/api/jwt.go:23
  • Draft comment:
    The JWT expiration time has been increased to 24 hours. Ensure this aligns with your security requirements, as it increases the window for potential misuse if a token is compromised.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In jwt.go, the expiration time for JWT tokens has been changed from 1 hour to 24 hours. This change should be carefully considered as it increases the window of opportunity for token misuse if a token is compromised. It's important to ensure that this change aligns with the security requirements of the application.
2. internal/services/api/jwt_test.go:52
  • Draft comment:
    The JWT expiration time in tests has been updated to 24 hours. Ensure this change is consistent with your security policies.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In jwt_test.go, the expiration time for JWT tokens has been updated to 24 hours to match the change in jwt.go. This is consistent with the code change, but the same security considerations apply as mentioned in the jwt.go comment.
3. internal/services/api/jwt_test.go:70
  • Draft comment:
    The JWT expiration time in tests has been updated to 24 hours. Ensure this change is consistent with your security policies.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In jwt_test.go, the expiration time for JWT tokens has been updated to 24 hours to match the change in jwt.go. This is consistent with the code change, but the same security considerations apply as mentioned in the jwt.go comment.
4. internal/services/api/jwt_test.go:88
  • Draft comment:
    The JWT expiration time in tests has been updated to 24 hours. Ensure this change is consistent with your security policies.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In jwt_test.go, the expiration time for JWT tokens has been updated to 24 hours to match the change in jwt.go. This is consistent with the code change, but the same security considerations apply as mentioned in the jwt.go comment.

Workflow ID: wflow_2gCSHNcO1Usvo5T1


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

if (mode === "production") {
plugins.push(
sentryVitePlugin({
authToken: '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',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid hardcoding sensitive information like the Sentry auth token. Use environment variables to manage such sensitive data.

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.

2 participants