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

feat: Added extra check for already waitlisted users and created toast message for them #491

Conversation

poswalsameer
Copy link
Contributor

@poswalsameer poswalsameer commented Oct 15, 2024

User description

Description

This PR solves the issue by showing an error/warning toast message to already existing users on the waitlist. Before this PR, every user with a single email was getting the success toast message multiple times. Ideally, this should not happen, every user should be able to join the waitlist one time through one email. This PR fixes this problem.

Fixes #463

Dependencies

No extra package used.

Screenshots of relevant screens

Screenshot (94)

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

  • Added a check for already waitlisted users and displayed a toast notification to prevent multiple entries with the same email.
  • Improved code readability and consistency by refactoring and adjusting code formatting across multiple files.
  • Used const for immutable variables in workspace-membership.ts.
  • Refactored method calls and destructuring assignments for better readability.

Changes walkthrough 📝

Relevant files
Formatting
60 files
grafana.ts
Code formatting improvements for better readability.         

packages/secret-scan/src/rules/grafana.ts

  • Fixed formatting issues by adjusting indentation.
  • Ensured consistent spacing in the grafana function and testcase array.

  • +82/-75 
    authress.ts
    Code formatting adjustments for consistency.                         

    packages/secret-scan/src/rules/authress.ts

  • Improved code formatting by adjusting indentation.
  • Ensured consistent spacing in the authress function and testcase
    array.
  • +95/-85 
    cloudflare.ts
    Improved code formatting for clarity.                                       

    packages/secret-scan/src/rules/cloudflare.ts

  • Enhanced code readability by fixing indentation.
  • Maintained consistent spacing in the cloudflare function and testcase
    array.
  • +62/-59 
    bitbucket.ts
    Code formatting enhancements for readability.                       

    packages/secret-scan/src/rules/bitbucket.ts

  • Adjusted indentation for better code readability.
  • Ensured consistent spacing in the bitbucket function and testcase
    array.
  • +24/-18 
    facebook.ts
    Code formatting corrections for uniformity.                           

    packages/secret-scan/src/rules/facebook.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the facebook function and testcase
    array.
  • +44/-42 
    confluent.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/confluent.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the confluent function and testcase
    array.
  • +50/-46 
    atlassian.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/atlassian.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the atlassian function and testcase
    array.
  • +56/-56 
    shopify.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/shopify.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the shopify function and testcase array.

  • +44/-44 
    harness.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/harness.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the harness function and testcase array.

  • +46/-42 
    planetscale.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/planetscale.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the planetscale function and testcase
    array.
  • +35/-34 
    dropbox.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/dropbox.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the dropbox function and testcase array.

  • +36/-35 
    dynatrace.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/dynatrace.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the dynatrace function and testcase
    array.
  • +36/-33 
    digitalocean.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/digitalocean.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the digitalocean function and
    testcase array.
  • +38/-35 
    definednetworking.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/definednetworking.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the definednetworking function and
    testcase array.
  • +37/-34 
    sidekiq.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/sidekiq.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the sidekiq function and testcase array.

  • +25/-24 
    intra42.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/intra42.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the intra42 function and testcase
    array.
  • +33/-30 
    huggingface.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/huggingface.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the huggingface function and testcase
    array.
  • +32/-32 
    gitlab.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/gitlab.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the gitlab function and testcase array.
  • +39/-39 
    heroku.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/heroku.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the heroku function and testcase
    array.
  • +30/-30 
    coinbase.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/coinbase.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the coinbase function and testcase
    array.
  • +30/-29 
    frameio.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/frameio.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the frameio function and testcase array.

  • +36/-33 
    hubspot.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/hubspot.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the hubspot function and testcase
    array.
  • +30/-30 
    easypost.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/easypost.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the easypost function and testcase
    array.
  • +34/-34 
    clojars.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/clojars.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the clojars function and testcase array.

  • +32/-29 
    flutterwave.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/flutterwave.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the flutterwave function and testcase
    array.
  • +31/-31 
    contentful.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/contentful.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the contentful function and testcase
    array.
  • +30/-30 
    beamer.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/beamer.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the beamer function and testcase array.
  • +29/-29 
    doppler.ts
    Improved code formatting for better readability.                 

    packages/secret-scan/src/rules/doppler.ts

  • Enhanced code readability by adjusting indentation.
  • Maintained consistent spacing in the doppler function and testcase
    array.
  • +33/-33 
    duffel.ts
    Code formatting corrections for clarity.                                 

    packages/secret-scan/src/rules/duffel.ts

  • Corrected formatting by adjusting indentation.
  • Ensured consistent spacing in the duffel function and testcase array.
  • +33/-33 
    datadog.ts
    Code formatting improvements for consistency.                       

    packages/secret-scan/src/rules/datadog.ts

  • Improved code formatting by fixing indentation.
  • Ensured consistent spacing in the datadog function and testcase array.

  • +30/-30 
    lob.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/lob.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +30/-30 
    sendinblue.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/sendinblue.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +24/-22 
    hashicorp.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/hashicorp.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +20/-18 
    databricks.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/databricks.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +30/-30 
    index.ts
    Uniform import statement quotation style                                 

    packages/secret-scan/src/rules/index.ts

    • Changed double quotes to single quotes in import statements.
    +21/-21 
    age.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/age.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +7/-5     
    readme.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/readme.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +24/-22 
    postman.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/postman.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    scalingo.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/scalingo.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    linear.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/linear.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    infracost.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/infracost.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    rubygems.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/rubygems.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    asana.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/asana.ts

    • Fixed formatting issues by replacing tabs with spaces.
    +24/-24 
    prefect.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/prefect.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    pulumi.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/pulumi.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    shippo.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/shippo.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +22/-22 
    update.role.ts
    Logger message quotation style update                                       

    apps/cli/src/commands/workspace/role/update.role.ts

    • Changed double quotes to single quotes in Logger messages.
    +4/-4     
    list.environment.ts
    Improved readability of destructuring assignments               

    apps/cli/src/commands/environment/list.environment.ts

    • Reformatted destructuring assignment for better readability.
    +9/-7     
    get.role.ts
    Logger message quotation style update                                       

    apps/cli/src/commands/workspace/role/get.role.ts

    • Changed double quotes to single quotes in Logger messages.
    +3/-3     
    codecov.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/codecov.ts

  • Fixed formatting issues by replacing tabs with spaces.
  • Added missing space in import statement.
  • +6/-6     
    page.tsx
    Improved readability of import statements                               

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

    • Reformatted import statements for better readability.
    +6/-1     
    delete.environment.ts
    Improved readability of destructuring assignments               

    apps/cli/src/commands/environment/delete.environment.ts

    • Reformatted destructuring assignment for better readability.
    +5/-6     
    list.workspace.ts
    Consistent use of `type` keyword in imports                           

    apps/cli/src/commands/workspace/list.workspace.ts

    • Added type keyword to import statements for consistency.
    +4/-1     
    bittrex.ts
    Code formatting improvements for consistency                         

    packages/secret-scan/src/rules/bittrex.ts

    • Fixed formatting issues by replacing tabs with spaces.
    +4/-4     
    update.environment.ts
    Improved readability of destructuring assignments               

    apps/cli/src/commands/environment/update.environment.ts

    • Reformatted destructuring assignment for better readability.
    +2/-4     
    get.environment.ts
    Improved readability of destructuring assignments               

    apps/cli/src/commands/environment/get.environment.ts

    • Reformatted destructuring assignment for better readability.
    +1/-3     
    list.role.ts
    Consistent use of `type` keyword in imports                           

    apps/cli/src/commands/workspace/role/list.role.ts

    • Added type keyword to import statements for consistency.
    +1/-1     
    page.tsx
    Consistent import statement ordering                                         

    apps/web/src/app/(main)/career/page.tsx

    • Moved import statement for ColorBGSVG for consistency.
    +1/-1     
    airtable.ts
    Ensure newline at end of file                                                       

    packages/secret-scan/src/rules/airtable.ts

    • Added newline at end of file.
    +1/-1     
    pagination-options.ts
    Consistent use of `type` keyword in imports                           

    apps/cli/src/util/pagination-options.ts

    • Added type keyword to import statement for consistency.
    +1/-1     
    Enhancement
    3 files
    index.tsx
    Added waitlist check and toast notification for users.     

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

  • Added a new state variable _waitListData to manage waitlisted emails.
  • Implemented logic to check if an email is already waitlisted.
  • Displayed a toast message for already waitlisted users.
  • Updated local storage with new waitlisted emails.
  • +26/-2   
    create.environment.ts
    Refactored method call for better readability.                     

    apps/cli/src/commands/environment/create.environment.ts

  • Refactored createEnvironment method call for improved readability.
  • Removed unnecessary line breaks in the method call.
  • +2/-4     
    workspace-membership.ts
    Use of `const` for immutable variables                                     

    packages/api-client/src/controllers/workspace-membership.ts

    • Changed let to const for variable declaration.
    +1/-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:

    🎫 Ticket compliance analysis 🔶

    463 - Partially compliant

    Fully compliant requirements:

    • Clear the text field after adding the user to the waitlist
    • Check if user has already been whitelisted

    Not compliant requirements:

    • Perform validation on the email field
    • Only show toast when the whitelist response is successful
    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Email Validation
    The PR adds a check for already waitlisted users but doesn't implement proper email validation as required by the ticket.

    Toast Handling
    The PR doesn't address the requirement to show toast only when the whitelist response is successful. The toast is shown for already waitlisted users, but not for successful additions.

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Add negative test cases for invalid Shopify token patterns

    Consider adding negative test cases for inputs that partially match the Shopify
    token patterns but are invalid. This will help ensure the regex doesn't produce
    false positives.

    packages/secret-scan/src/rules/shopify.ts [20-53]

     const testcase: TestCase[] = [
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
       },
       {
         input: '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',
         expected: true
    +  },
    +  {
    +    input: 'shpss_invalidtoken',
    +    expected: false
    +  },
    +  {
    +    input: 'shpat_tooshort',
    +    expected: false
    +  },
    +  {
    +    input: 'shpca_INVALIDCHARS!@#',
    +    expected: false
    +  },
    +  {
    +    input: 'shppa_toolong0123456789abcdef0123456789abcdef0123456789abcdef',
    +    expected: false
       }
     ]
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Including negative test cases for invalid Shopify token patterns is valuable for ensuring the regex does not produce false positives, thus improving the reliability and accuracy of the tests.

    8
    Add a test case for an input with an invalid prefix to ensure correct token identification

    Consider adding a test case for an input that matches the pattern but has an invalid
    prefix (not 'pat', 'sat', or 'shppa'). This will help ensure the regex is correctly
    identifying only valid Harness tokens.

    packages/secret-scan/src/rules/harness.ts [11-53]

     const testcase: TestCase[] = [
       {
         input: 'sat.tbD3t0UTVxnDsJjXtA7yFg.Ses0cii322QyNVAWsGCAtbPG.cL64ShIGlxlB55eB2YSw',
         expected: true
       },
       {
         input: 'sat.D5rQDqdpmAy8RCFrGOjBXu.8YSoWK1thmC6eTbWDLSg4SiK.OnKZVW9IytuKh9HFhhKG',
         expected: true
       },
       {
         input: 'pat.GRDSyUuWR5EA2jwP2LDXEv.WqO2w3p1vb8QBvif7r0ilHTS.8T9HF4wdkNw1SxJTcoB3',
         expected: true
       },
       {
         input: 'pat.t9KDTZ3Z4y1LZx2lwLTx5Y.VHA8Fd6wMD8Lc5yZ1aruadYC.v56fG64UhjmwgkoY5ugl\n',
         expected: true
       },
       {
         input: 'const = HARNESS_PERSONAL_ACCESS_TOKEN',
         expected: false
       },
       {
         input: 'const = HARNESS_SERVICE_ACCOUNT_TOKEN',
         expected: false
       },
       {
         input: 'HARNESS',
         expected: false
       },
       {
         input: 'pat.',
         expected: false
       },
       {
         input: 'sat.',
         expected: false
    +  },
    +  {
    +    input: 'invalid.GRDSyUuWR5EA2jwP2LDXEv.WqO2w3p1vb8QBvif7r0ilHTS.8T9HF4wdkNw1SxJTcoB3',
    +    expected: false
       }
     ]
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Adding a test case for an input with an invalid prefix helps verify that the regex correctly identifies only valid tokens, enhancing the accuracy and robustness of the test suite.

    8
    Add a negative test case for input that partially matches the pattern

    Consider adding a negative test case for an input that starts with 'atlassian',
    'confluence', or 'jira' but doesn't meet the length requirement of 24 characters.

    packages/secret-scan/src/rules/atlassian.ts [11-63]

     const testcase: TestCase[] = [
       {
         input: 'atlassian',
         expected: false
       },
       {
         input: 'confluence',
         expected: false
       },
       {
         input: 'jira',
         expected: false
    +  },
    +  {
    +    input: 'atlassianABCDEFGHIJKLMNOPQRST',
    +    expected: false
       }
     ]
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Adding a negative test case for inputs that partially match the pattern but do not meet the length requirement enhances the robustness of the test suite by ensuring the regex correctly identifies invalid inputs.

    7
    Performance
    Use a Set for more efficient email lookup in the waitlist

    Consider using a Set instead of an array for waitListedEmails to improve lookup
    performance when checking if an email is already waitlisted.

    apps/web/src/components/hero/index.tsx [28-33]

    -const waitListedEmails: string[] = dataInStorage
    -  ? (JSON.parse(dataInStorage) as string[])
    -  : []
    +const waitListedEmails: Set<string> = dataInStorage
    +  ? new Set(JSON.parse(dataInStorage) as string[])
    +  : new Set()
     
     // actual logic where we are checking if this email is already in waitlisted users or not
    -if (waitListedEmails.includes(email)) {
    +if (waitListedEmails.has(email)) {
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Using a Set instead of an array for storing waitlisted emails improves lookup performance, which is beneficial for checking if an email is already waitlisted. This change enhances the efficiency of the code without altering its functionality.

    8
    Best practice
    Refactor localStorage operations into a separate function for better code organization

    Move the localStorage operations into a separate function to improve code
    organization and reusability.

    apps/web/src/components/hero/index.tsx [27-43]

    -const dataInStorage: string | null = localStorage.getItem('waitListData')
    -const waitListedEmails: string[] = dataInStorage
    -  ? (JSON.parse(dataInStorage) as string[])
    -  : []
    +const getWaitlistedEmails = (): string[] => {
    +  const dataInStorage: string | null = localStorage.getItem('waitListData')
    +  return dataInStorage ? JSON.parse(dataInStorage) as string[] : []
    +}
     
    -// actual logic where we are checking if this email is already in waitlisted users or not
    +const waitListedEmails = getWaitlistedEmails()
    +
     if (waitListedEmails.includes(email)) {
       toast.custom(() => (
         <div className="text-brandBlue border-brandBlue/20 w-[90vw] rounded-lg border bg-[#852b2c] p-2 shadow-2xl backdrop-blur-3xl md:w-[20vw]">
           <p className="text-sm">
             You have been already added to the waitlist. We will notify you once
             we launch.{' '}
           </p>
         </div>
       ))
       return
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Moving localStorage operations into a separate function improves code organization and reusability. This refactor enhances maintainability by encapsulating related logic, making the codebase cleaner and more modular.

    7
    Use a more descriptive variable name for test cases

    Consider using a more descriptive variable name instead of testcase. For example,
    grafanaTestCases would be more specific and align with the function name.

    packages/secret-scan/src/rules/grafana.ts [12]

    -const testcase: TestCase[] = [
    +const grafanaTestCases: TestCase[] = [
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: The suggestion to rename testcase to grafanaTestCases improves code readability and clarity by providing a more descriptive variable name that aligns with the function's purpose.

    6
    Use a more descriptive variable name for test cases

    Consider using a more descriptive variable name instead of testcase. For example,
    facebookTestCases would be more specific and easier to understand in the context of
    this file.

    packages/secret-scan/src/rules/facebook.ts [11]

    -const testcase: TestCase[] = [
    +const facebookTestCases: TestCase[] = [
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: The suggestion to use a more descriptive variable name improves code readability and maintainability, but it is not critical to the functionality of the code.

    5
    Maintainability
    Extract toast message into a separate component for better code organization

    Extract the toast message into a separate component to improve code readability and
    maintainability.

    apps/web/src/components/hero/index.tsx [34-41]

    -toast.custom(() => (
    +const AlreadyWaitlistedToast = () => (
       <div className="text-brandBlue border-brandBlue/20 w-[90vw] rounded-lg border bg-[#852b2c] p-2 shadow-2xl backdrop-blur-3xl md:w-[20vw]">
         <p className="text-sm">
           You have been already added to the waitlist. We will notify you once
           we launch.{' '}
         </p>
       </div>
    -))
    +);
     
    +toast.custom(() => <AlreadyWaitlistedToast />)
    +
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Extracting the toast message into a separate component improves code readability and maintainability. This change makes the code more organized and easier to manage, especially if the toast message needs to be reused or modified in the future.

    6

    💡 Need additional feedback ? start a PR chat

    @poswalsameer poswalsameer deleted the feat/added-check-for-waitlisted-users branch October 15, 2024 13:21
    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.

    WEB: suggesting changes while adding waitlist
    1 participant