Skip to content

Commit 666d061

Browse files
authored
Merge pull request #137 from auth0/apps-create-ux-improvements
apps: improve UX on create and show screens
2 parents c25aa11 + f50e97d commit 666d061

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

internal/display/apps.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,14 @@ func (r *Renderer) ApplicationCreate(client *management.Client, revealSecrets bo
216216

217217
r.Result(v)
218218

219-
r.Infof("\nQuickstarts: %s", quickstartsURIFor(client.AppType))
219+
r.Newline()
220+
r.Infof("Quickstarts: %s", quickstartsURIFor(client.AppType))
221+
222+
// TODO(cyx): possibly guard this with a --no-hint flag.
223+
r.Infof("%s: You might wanna try `auth0 test login --client-id %s`",
224+
ansi.Faint("Hint"),
225+
client.GetClientID(),
226+
)
220227
}
221228

222229
func (r *Renderer) ApplicationUpdate(client *management.Client, revealSecrets bool) {

internal/display/display.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ func NewRenderer() *Renderer {
3939
}
4040
}
4141

42+
func (r *Renderer) Newline() {
43+
fmt.Fprintln(r.MessageWriter)
44+
}
45+
4246
func (r *Renderer) Infof(format string, a ...interface{}) {
4347
fmt.Fprint(r.MessageWriter, aurora.Green(" ▸ "))
4448
fmt.Fprintf(r.MessageWriter, format+"\n", a...)
@@ -105,7 +109,17 @@ func (r *Renderer) Result(data View) {
105109
// many changes in other places. In the future we should
106110
// enforce `KeyValues` on all `View` types.
107111
if v, ok := data.(interface{ KeyValues() [][]string }); ok {
108-
writeTable(r.ResultWriter, nil, v.KeyValues())
112+
var kvs [][]string
113+
for _, pair := range v.KeyValues() {
114+
k := pair[0]
115+
v := pair[1]
116+
117+
// NOTE(cyx): We can either nuke it or annotate with `<none>`. For now we're choosing to nuke it.
118+
if v != "" {
119+
kvs = append(kvs, []string{k, v})
120+
}
121+
}
122+
writeTable(r.ResultWriter, nil, kvs)
109123
}
110124
}
111125
}

0 commit comments

Comments
 (0)