ctfguide-tech / CTFGuideNext

The new in-development client for CTFGuide built with Next.js.
https://ctfguide.com
Other
9 stars 8 forks source link

Sweep: Consolidate the multi page onboarding process into just one page #71

Closed Laphatize closed 1 year ago

Laphatize commented 1 year ago

Consolidate the entire onboarding flow into registration page.

Checklist - [X] `src/pages/register.jsx` ✅ Commit [`e96abac`](https://github.com/ctfguide-tech/CTFGuideNext/commit/e96abacdd28cc387be6f4533f398ad52f29cd6cc)
• Import the onboarding components (`DataAsk`, `DataAskPart2`, `Demo`, etc.) from the `src/components/onboarding/` directory. • Add these components to the registration form. They should be displayed in a logical order that guides the user through the onboarding process. • Remove any logic related to navigating between different onboarding pages.
Sandbox Execution Logs
trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
- [X] `src/components/onboarding/OnboardingFlow.jsx` ✅ Commit [`242c950`](https://github.com/ctfguide-tech/CTFGuideNext/commit/242c950ca503698be024fa27127f5a2feeabb03d)
• Remove the `flowState` state variable and the related logic. The onboarding process will no longer be spread across multiple pages, so this is no longer necessary. • Adjust the component to display all onboarding steps in a single page. This may involve reorganizing the component's layout and styling.
- [X] `src/pages/onboarding.jsx` ✅ Commit [`39b439f`](https://github.com/ctfguide-tech/CTFGuideNext/commit/39b439fa1dd2469d3b2ee5838d66a0ca12b4b92f)
• Remove the `OnboardingFlow` component. The onboarding process will now be handled by the registration page. • Update any logic related to navigating to the onboarding page. Users should now be directed to the registration page instead.
Sandbox Execution Logs
trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
- [X] `src/pages/login.jsx` ✅ Commit [`39b439f`](https://github.com/ctfguide-tech/CTFGuideNext/commit/39b439fa1dd2469d3b2ee5838d66a0ca12b4b92f)
• If the registration form is part of this page, apply the same modifications as described for `src/pages/register.jsx`.
Sandbox Execution Logs
trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
- [X] `src/pages/_app.jsx` ❌ Failed
• Update the routing logic to reflect the changes. Remove any logic related to the `part` query parameter in the URL.
Sandbox Execution Logs
trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/ctfguide-tech/CTFGuideNext/pull/72.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 4 GPT-4 tickets left for the month and 1 for the day. For more GPT-4 tickets, visit our payment portal. To retrigger Sweep, edit the issue.


Step 1: 📍 Planning

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/ctfguide-tech/CTFGuideNext/blob/e96abacdd28cc387be6f4533f398ad52f29cd6cc/src/pages/onboarding.jsx#L1-L24 https://github.com/ctfguide-tech/CTFGuideNext/blob/e96abacdd28cc387be6f4533f398ad52f29cd6cc/src/components/onboarding/OnboardingFlow.jsx#L1-L32 https://github.com/ctfguide-tech/CTFGuideNext/blob/e96abacdd28cc387be6f4533f398ad52f29cd6cc/src/pages/learn/ch2/activity2.jsx#L1-L57 https://github.com/ctfguide-tech/CTFGuideNext/blob/e96abacdd28cc387be6f4533f398ad52f29cd6cc/src/pages/learn/ch1/activity1.jsx#L1-L60 https://github.com/ctfguide-tech/CTFGuideNext/blob/e96abacdd28cc387be6f4533f398ad52f29cd6cc/src/pages/learn/ch3/activity3.jsx#L1-L142

Step 2: ⌨️ Coding

trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io

trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io

trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io

trunk init 1/1 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
⣟ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 12 linters were enabled (.trunk/trunk.yaml)

  checkov 2.4.9 (4 json, 2 yaml files)
  eslint 8.49.0 (126 javascript files)
  git-diff-check (229 files)
  markdownlint 0.36.0 (3 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.3.6 (1 lockfile file)
  oxipng 8.0.0 (62 png files)
  prettier 3.0.3 (1 css, 126 javascript, 4 json, 3 markdown, 2 yaml files)
  svgo 3.0.2 (2 svg files) (created svgo.config.js)
  taplo 0.8.1 (1 toml file)
  trivy 0.45.0 (1 lockfile, 2 yaml files)
  trufflehog 3.55.1 (230 files)
  yamllint 1.32.0 (2 yaml files) (created .yamllint.yaml)

Next Steps

 1. Read documentation
    Our documentation can be found at https://docs.trunk.io

 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io


Step 3: 🔁 Code Review

Here are my self-reviews of my changes at sweep/consolidate-onboarding-flow.

Here is the 1st review

Thanks for your work on this issue. The changes made are in line with the request to consolidate the onboarding process into the registration page. However, there are a few areas that need to be addressed: - In `src/components/onboarding/OnboardingFlow.jsx`, the onboarding steps are now all visible at the same time. This might not be the desired user experience. Consider implementing a way to show one step at a time. - In `src/pages/login.jsx`, the function now does nothing if `parsed.email` is not present. This could potentially lead to a situation where the user is not redirected anywhere after login if they haven't finished onboarding. Consider adding a redirection or a message to inform the user in this case. - In `src/pages/onboarding.jsx`, the page is now empty. If this page is no longer needed, consider removing it from the project. - In `src/pages/register.jsx`, similar to `OnboardingFlow.jsx`, all onboarding steps are now visible at the same time. Consider implementing a way to show one step at a time. Keep up the good work!

I finished incorporating these changes.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord