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

[WEB-2432]fix: project not found state and error page alignment #6095

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

vamsikrishnamathala
Copy link
Collaborator

@vamsikrishnamathala vamsikrishnamathala commented Nov 26, 2024

Problem Statement

  • Project not found state is not consistent with other empty states
  • Error page description is not aligned properly

Summary

  • Fixed Project not found state. Replaced the empty state component with the right error state component. Added new state to empty states
  • Fixed text alignment

Reference

WEB-2432

Summary by CodeRabbit

  • New Features

    • Introduced a new empty state for when a project cannot be found, enhancing user guidance with a "Create Project" option.
    • Updated the EmptyState component to streamline its configuration and improve user experience.
  • Bug Fixes

    • Corrected a typo in the enum value for project not found state.
  • Refactor

    • Improved layout of error messages for better alignment and positioning.
    • Reorganized component imports and updated the rendering conditions for the EmptyState component.

Copy link
Contributor

coderabbitai bot commented Nov 26, 2024

Walkthrough

The pull request introduces several modifications across multiple files. Key changes include an enhancement of the CustomErrorComponent layout in web/app/error.tsx, the addition of a new enum value WORKSPACE_PROJECT_NOT_FOUND in web/core/constants/empty-state.ts, and significant updates to the ProjectAuthWrapper component in web/core/layouts/auth-layout/project-wrapper.tsx. These updates streamline the error handling and user feedback mechanisms while improving the presentation layer and user experience.

Changes

File Path Change Summary
web/app/error.tsx Modified CustomErrorComponent layout: changed class name from space-y-2 to space-y-2 relative flex flex-col justify-center items-center. Error handling logic in handleSignOut remains unchanged.
web/core/constants/empty-state.ts Added new enum value WORKSPACE_PROJECT_NOT_FOUND with a corresponding entry in emptyStateDetails.
web/core/layouts/auth-layout/project-wrapper.tsx Updated import path for EmptyState. Altered properties passed to EmptyState: removed title and description, added type set to EmptyStateType.WORKSPACE_PROJECT_NOT_FOUND, and replaced primaryButton with primaryButtonOnClick.

Possibly related PRs

Suggested labels

🧹chore

Suggested reviewers

  • sriramveeraghanta
  • SatishGandham

🐰 In the meadow, changes bloom,
With layouts brightening every room.
Errors handled, states defined,
A project’s path, now clearly aligned.
Let’s hop along, with joy and cheer,
For every update brings us near! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 44e825e and 434561a.

📒 Files selected for processing (1)
  • web/core/constants/empty-state.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/core/constants/empty-state.ts

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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: 2

🧹 Outside diff range and nitpick comments (2)
web/app/error.tsx (1)

42-42: LGTM! Consider adding role="alert" for accessibility.

The layout changes effectively address the alignment issues mentioned in the PR objectives. The use of flexbox for centering content is a solid approach.

Consider adding role="alert" to improve accessibility:

-          <div className="space-y-2 relative flex flex-col justify-center items-center">
+          <div className="space-y-2 relative flex flex-col justify-center items-center" role="alert">
web/core/layouts/auth-layout/project-wrapper.tsx (1)

Line range hint 1-179: Well-structured component with robust error handling.

The ProjectAuthWrapper component demonstrates good architectural patterns:

  • Clear separation of concerns with distinct handling of loading, unauthorized, and not found states
  • Efficient data fetching with SWR
  • Proper permission checks before rendering content

Consider adding error boundaries to handle potential failures in the data fetching layer for additional resilience.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7469e67 and 44e825e.

📒 Files selected for processing (3)
  • web/app/error.tsx (1 hunks)
  • web/core/constants/empty-state.ts (2 hunks)
  • web/core/layouts/auth-layout/project-wrapper.tsx (2 hunks)
🔇 Additional comments (2)
web/core/layouts/auth-layout/project-wrapper.tsx (1)

10-14: LGTM! Import changes are well-organized.

The imports are properly structured and the new EmptyState and EmptyStateType imports align with the PR objectives.

web/core/constants/empty-state.ts (1)

212-227: LGTM! Empty state configuration is well structured

The configuration for the new empty state follows the established pattern and includes all necessary properties:

  • Appropriate title and description
  • Correct access control settings
  • Well-defined primary button with comic box content

Comment on lines +168 to +172
type={EmptyStateType.WORKSPACE_PROJECT_NOT_FOUND}
layout="screen-detailed"
primaryButtonOnClick={() => {
setTrackElement("Projects page empty state");
toggleCreateProjectModal(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Fix typo in EmptyStateType.WORKSPACE_PROJECT_NOT_FOUND enum value

The enum value is indeed misspelled as "workspave-project-no-found" instead of "workspace-project-not-found". This needs to be corrected for consistency.

  • In web/core/constants/empty-state.ts:
    • Change "workspave-project-no-found" to "workspace-project-not-found"
🔗 Analysis chain

EmptyState implementation looks good, but verify enum spelling.

The EmptyState component implementation aligns well with the PR objectives to fix the project not found state. The layout and click handler are properly configured.

Let's verify the enum value spelling mentioned in the AI summary:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the enum value spelling in empty-state.ts
rg -A 1 "WORKSPACE_PROJECT_NOT_FOUND" web/core/constants/empty-state.ts

Length of output: 343

web/core/constants/empty-state.ts Outdated Show resolved Hide resolved
@pushya22 pushya22 merged commit 32048be into preview Nov 26, 2024
14 of 15 checks passed
@pushya22 pushya22 deleted the fix-empty_pages_alignment branch November 26, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working 🌐frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants