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

refactor: Changed the text in the hero section of the web application #578

Conversation

poswalsameer
Copy link
Contributor

@poswalsameer poswalsameer commented Dec 5, 2024

User description

Description

This PR changes the hero text that can be seen on the web application.

Dependencies

No dependencies

Future Improvements

Mentions

Screenshots of relevant screens

Screenshot 2024-12-05 194342

Developer's checklist

  • My PR follows the style guidelines of this project
  • I have performed a self-check on my work

If changes are made in the code:

  • I have followed the coding guidelines
  • My changes in code generate no new warnings
  • My changes are breaking another fix/feature of the project
  • I have added test cases to show that my feature works
  • I have added relevant screenshots in my PR
  • There are no UI/UX issues

Documentation Update

  • This PR requires an update to the documentation at docs.keyshade.xyz
  • I have made the necessary updates to the documentation, or no documentation changes are required.

PR Type

Enhancement, Other


Description

  • Refactored project management to use a new API client and updated UI components.
  • Introduced a new Select component using the Radix UI library.
  • Updated the hero section text for improved messaging.
  • Made headers parameter optional in ProjectController methods.
  • Updated schemas for projects and environments with new fields.
  • Added @radix-ui/react-select to project dependencies.
  • Updated TypeScript configuration for module resolution and JSX.
  • Updated dependencies to include @swc/helpers and added new packages.
  • Minor formatting change for code readability.

Changes walkthrough 📝

Relevant files
Enhancement
7 files
page.tsx
Refactor project management with new API client and UI updates.

apps/platform/src/app/(main)/page.tsx

  • Updated imports to use types and controllers from @keyshade/schema and
    @keyshade/api-client.
  • Added a new function createNewProject to handle project creation.
  • Modified the dialog for creating projects with additional fields and
    styling.
  • Replaced the project fetching logic with a new method using
    ProjectController.
  • +208/-73
    select.tsx
    Add new Select component using Radix UI library.                 

    apps/platform/src/components/ui/select.tsx

  • Introduced a new Select component using @radix-ui/react-select.
  • Implemented various sub-components like SelectTrigger, SelectContent,
    and SelectItem.
  • Styled the select components with custom classes.
  • +158/-0 
    project.ts
    Update ProjectController to make headers optional.             

    packages/api-client/src/controllers/project.ts

  • Made headers parameter optional in several methods of
    ProjectController.
  • +9/-9     
    combobox.tsx
    Update combobox component to use new workspace schema.     

    apps/platform/src/components/ui/combobox.tsx

  • Updated import statements to use Workspace type from @keyshade/schema.
  • Modified getAllWorkspace function to handle new response structure.
  • +35/-11 
    index.tsx
    Update hero section text for improved messaging.                 

    apps/web/src/components/hero/index.tsx

    • Updated hero section text to a new format with two paragraphs.
    +3/-3     
    index.ts
    Update project and environment schemas with new fields.   

    apps/platform/src/types/index.ts

  • Updated zEnvironment and zNewProject schemas with new fields and
    types.
  • +8/-3     
    workspace-storage.ts
    Update workspace storage to use new schema type.                 

    apps/platform/src/lib/workspace-storage.ts

    • Updated import to use Workspace type from @keyshade/schema.
    +2/-1     
    Formatting
    1 files
    page.tsx
    Minor formatting change for readability.                                 

    apps/platform/src/app/auth/page.tsx

    • Added a newline for better code readability.
    +1/-0     
    Dependencies
    2 files
    package.json
    Add Radix UI Select to project dependencies.                         

    apps/platform/package.json

    • Added @radix-ui/react-select as a new dependency.
    +1/-0     
    pnpm-lock.yaml
    Update dependencies to include @swc/helpers and add new packages

    pnpm-lock.yaml

  • Updated several package versions to include @swc/[email protected].
  • Added new packages such as @radix-ui/react-context,
    @radix-ui/react-dismissable-layer, @radix-ui/react-focus-guards,
    @radix-ui/react-portal, and react-remove-scroll.
  • Modified dependencies and peer dependencies for existing packages to
    reflect the inclusion of @swc/helpers.
  • +385/-102
    Configuration changes
    1 files
    tsconfig.json
    Update TypeScript configuration for module resolution and JSX.

    apps/platform/tsconfig.json

  • Updated TypeScript configuration with new options for JSX and module
    resolution.
  • +7/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Error Handling
    The createNewProject function lacks proper error handling and user feedback when project creation fails

    Code Smell
    Commented out validation code for workspace data parsing could lead to runtime errors if invalid data is received

    Type Safety
    Usage of @ts-ignore comment suggests potential type safety issues that should be properly addressed

    @poswalsameer poswalsameer deleted the refactor/changed-hero-text-in-web-app branch December 5, 2024 14:18
    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Add proper error handling for API calls to improve user experience

    Add error handling for the project creation API call. If the request fails, handle
    the error appropriately and notify the user.

    apps/platform/src/app/(main)/page.tsx [83-86]

    -const response = await projectController.createProject(request, {})
    -const data = response.data as CreateProjectResponse;
    +const { success, error, data } = await projectController.createProject(request, {})
    +if (success && data) {
    +  setIsDialogOpen(false);
    +  toast.success('Project created successfully');
    +} else {
    +  toast.error(error?.message || 'Failed to create project');
    +}
     
    -setIsDialogOpen(false);
    -
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a critical issue by adding proper error handling and user feedback for API calls, which is essential for production-ready code and good user experience.

    8
    Connect UI controls to state management to ensure data consistency

    Connect the Switch component to the storePrivateKey state value to properly track
    and submit this setting.

    apps/platform/src/app/(main)/page.tsx [283]

    -<Switch className="h-[1.25rem] w-[2.25rem] " />
    +<Switch 
    +  className="h-[1.25rem] w-[2.25rem]"
    +  checked={newProjectData.storePrivateKey}
    +  onCheckedChange={(checked) => 
    +    setNewProjectData(prev => ({...prev, storePrivateKey: checked}))
    +  }
    +/>
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The suggestion fixes a critical functionality issue by properly connecting the Switch component to the state management, ensuring the storePrivateKey setting is correctly tracked and submitted.

    8
    Initialize environment fields with default values to prevent undefined data

    Initialize the environment name and description in the project creation request to
    avoid sending undefined values.

    apps/platform/src/app/(main)/page.tsx [58-64]

     environments: [
       {
    -    name: '',
    +    name: newProjectData.envName || 'Default',
         projectId: '',
    -    description: ''
    +    description: newProjectData.envDescription || 'Default environment'
       }
     ],
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion prevents potential issues with undefined values in the API request by providing sensible default values for environment fields.

    7

    💡 Need additional feedback ? start a PR chat

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants