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

DXCDT-311: Editorializing "hints" #570

Merged
merged 11 commits into from
Dec 21, 2022
2 changes: 1 addition & 1 deletion internal/cli/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (c *cli) actionPickerOptions() (pickerOptions, error) {
}

func (c *cli) actionEditorHint() {
c.renderer.Infof("%s once you close the editor, the action will be saved. To cancel, CTRL+C.", ansi.Faint("Hint:"))
c.renderer.Infof("%s once you close the editor, the action will be saved. To cancel, press CTRL+C.", ansi.Faint("Hint:"))
}

func formatActionDetailsPath(id string) string {
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func useAppCmd(cli *cli) *cobra.Command {
cli.renderer.Infof("Successfully removed the default application")
} else {
cli.renderer.Infof("Successfully set the default application to %s", ansi.Faint(inputs.ID))
cli.renderer.Infof("%s You might wanna try 'auth0 quickstarts download %s'", ansi.Faint("Hint:"), inputs.ID)
cli.renderer.Infof("%s Consider running `auth0 quickstarts download %s`", ansi.Faint("Hint:"), inputs.ID)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/email_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ auth0 email templates update welcome`,
}

func (c *cli) emailTemplateEditorHint() {
c.renderer.Infof("%s once you close the editor, the email template will be saved. To cancel, CTRL+C.", ansi.Faint("Hint:"))
c.renderer.Infof("%s once you close the editor, the email template will be saved. To cancel, press CTRL+C.", ansi.Faint("Hint:"))
}

func (c *cli) emailTemplatePickerOptions() (pickerOptions, error) {
Expand Down
6 changes: 6 additions & 0 deletions internal/cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ auth0 login --scopes "read:client_grants,create:client_grants"`,

cli.tracker.TrackCommandRun(cmd, cli.config.InstallID)

if len(cli.config.Tenants) > 1 {
cli.renderer.Infof("%s switch between authenticated tenants with `auth0 tenants use <TENANT>`",
willvedd marked this conversation as resolved.
Show resolved Hide resolved
ansi.Faint("Hint:"),
)
}

return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/prompts_custom_text.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func fetchEditedBrandingTextContent(
func updateBrandingTextHint(cli *cli) func() {
return func() {
cli.renderer.Infof(
"%s once you close the editor, the custom text will be saved. To cancel, CTRL+C.",
"%s once you close the editor, the custom text will be saved. To cancel, press CTRL+C.",
ansi.Faint("Hint:"),
)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/quickstarts.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func downloadQuickstart(cli *cli, inputs *qsInputs) func(cmd *cobra.Command, arg
return err
}

cli.renderer.Infof("%s Start with 'cd %s'", ansi.Faint("Hint:"), relativeQSSamplePath)
cli.renderer.Infof("%s Start with `cd %s`", ansi.Faint("Hint:"), relativeQSSamplePath)

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,5 +516,5 @@ func (c *cli) rulePickerOptions() (pickerOptions, error) {
}

func (c *cli) ruleEditorHint() {
c.renderer.Infof("%s once you close the editor, the rule will be saved. To cancel, CTRL+C.", ansi.Faint("Hint:"))
c.renderer.Infof("%s once you close the editor, the rule will be saved. To cancel, press CTRL+C.", ansi.Faint("Hint:"))
}
3 changes: 2 additions & 1 deletion internal/cli/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ auth0 test login <client-id> --connection <connection>`,
}

if isFirstRun {
cli.renderer.Infof("%s Login flow is working! Next, try downloading and running a Quickstart: 'auth0 quickstarts download %s'",
cli.renderer.Infof("Login flow is working!")
cli.renderer.Infof("%s Consider downloading and running a quickstart by running `auth0 quickstarts download %s`",
willvedd marked this conversation as resolved.
Show resolved Hide resolved
ansi.Faint("Hint:"), inputs.ClientID)

if err := cli.setFirstCommandRun(inputs.ClientID, commandKey); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/universal_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func (cli *cli) customTemplateEditorPromptWithPreview(cmd *cobra.Command, body *
defer cancel()

onInfo := func() {
cli.renderer.Infof("%s once you close the editor, you'll be prompted to save your changes. To cancel, CTRL+C.", ansi.Faint("Hint:"))
cli.renderer.Infof("%s once you close the editor, you'll be prompted to save your changes. To cancel, press CTRL+C.", ansi.Faint("Hint:"))
willvedd marked this conversation as resolved.
Show resolved Hide resolved
}

onFileCreated := func(filename string) {
Expand Down
4 changes: 2 additions & 2 deletions internal/display/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ func (r *Renderer) ApplicationCreate(client *management.Client, revealSecrets bo
r.Infof("Quickstarts: %s", quickstartsURIFor(client.GetAppType()))

// TODO(cyx): possibly guard this with a --no-hint flag.
r.Infof("%s Test this app's login box with 'auth0 test login %s'",
r.Infof("%s Emulate this app's login flow by running `auth0 test login %s`",
ansi.Faint("Hint:"),
client.GetClientID(),
)
r.Infof("%s You might wanna try 'auth0 quickstarts download %s'",
r.Infof("%s Consider running `auth0 quickstarts download %s`",
ansi.Faint("Hint:"),
client.GetClientID(),
)
Expand Down
4 changes: 2 additions & 2 deletions internal/display/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ func (r *Renderer) RuleCreate(rule *management.Rule) {
r.Newline()

// TODO(cyx): possibly guard this with a --no-hint flag.
r.Infof("%s To edit this rule, do 'auth0 rules update %s'",
r.Infof("%s To edit this rule, run `auth0 rules update %s`",
ansi.Faint("Hint:"),
rule.GetID(),
)

r.Infof("%s You might wanna try 'auth0 test login'",
r.Infof("%s Consider running `auth0 test login` to emulate the login flow",
ansi.Faint("Hint:"),
)
}
Expand Down