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: Add auto create step in UI #10

Merged

Conversation

sunnyguduru
Copy link
Contributor

@sunnyguduru sunnyguduru commented Mar 12, 2024

Auto Create is now the initial step.
The steps are the following:

  • Auto Create (can skip to display selected values)
  • Project Select
  • Environment Select
  • Flag Select
  • Display selected values

Screenshot:
CleanShot 2024-03-13 at 15 01 54

Video:
https://share.cleanshot.com/bdhRcswf

Copy link

internal/setup/wizard.go Outdated Show resolved Hide resolved
@sunnyguduru sunnyguduru changed the title Bubble Tea: Add Fork Step feat: Add fork step in UI Mar 12, 2024
internal/setup/fork.go Outdated Show resolved Hide resolved
internal/setup/fork.go Outdated Show resolved Hide resolved
internal/setup/fork.go Outdated Show resolved Hide resolved
internal/setup/fork.go Outdated Show resolved Hide resolved
internal/setup/wizard.go Outdated Show resolved Hide resolved
internal/setup/wizard.go Outdated Show resolved Hide resolved
k3llymariee and others added 14 commits March 13, 2024 14:23
* ci: add publish action to release-please workflow

* feat: add required go-versions

* remove unnecessary setup steps, go-versions
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: uncomment conditional for release-ldcli
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: Update release-please.yml to dry-run: false
This reverts commit ea3c089.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
`ldcli projects list` returns list of projects in JSON
@sunnyguduru sunnyguduru changed the title feat: Add fork step in UI feat: Add auto create step in UI Mar 13, 2024
if m.currStep > flagsStep {
return fmt.Sprintf("envKey is %s, projKey is %s, flagKey is %s", m.currEnvironmentKey, m.currProjectKey, m.currFlagKey)
}

return fmt.Sprintf("\nstep %d of %d\n"+m.steps[m.currStep-1].View(), m.currStep, len(m.steps))
return fmt.Sprintf("\nstep %d of %d\n"+m.steps[m.currStep].View(), m.currStep+1, len(m.steps))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got a little confused here. But basically we're rendering the current step's view. While showing what step we're on in the header out of the total number of steps.
Was able to use currStep instead of currStep-1 since I got rid of the initial step.

case projectsStep:
projModel, _ := m.steps[m.currStep-1].Update(msg)
projModel, _ := m.steps[projectsStep].Update(msg)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it makes sense to just directly use projectsStep here. Since the case is already ensuring we're on projectsStep. Same for the other cases

func NewAutoCreate() autoCreateModel {
choices := []choice{
{
Key: "yes",
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably only need the name here and the check later on could be for "Yes" instead of "yes".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Works for me

internal/setup/wizard.go Outdated Show resolved Hide resolved
@@ -0,0 +1,116 @@
package setup
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you rename the file auto_create.go to be more idiomatic?

@sunnyguduru sunnyguduru merged commit fb2fb5c into main Mar 13, 2024
2 checks passed
@sunnyguduru sunnyguduru deleted the sunny/sc-236003/create-stubbed-out-screen-to-auto-create branch March 13, 2024 23:14
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.

3 participants