-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Add auto create step in UI #10
Conversation
This pull request has been linked to Shortcut Story #236003: create stubbed out screen to auto-create project, environment, flag. |
* 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
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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
internal/setup/autoCreate.go
Outdated
func NewAutoCreate() autoCreateModel { | ||
choices := []choice{ | ||
{ | ||
Key: "yes", |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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/autoCreate.go
Outdated
@@ -0,0 +1,116 @@ | |||
package setup |
There was a problem hiding this comment.
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?
Auto Create is now the initial step.
The steps are the following:
Screenshot:
Video:
https://share.cleanshot.com/bdhRcswf