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-405: Fix incorrect number rendered in header for auth0 apps list #674

Merged
merged 22 commits into from
Mar 14, 2023
Merged
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fb73785
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Dec 5, 2022
da6a932
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Dec 5, 2022
0d62b4c
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Dec 6, 2022
a4aed9e
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Dec 9, 2022
fc50ba9
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Jan 5, 2023
054ab9e
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Jan 19, 2023
1aa695c
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Jan 20, 2023
da03c9e
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Jan 20, 2023
358f05c
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Jan 25, 2023
edb118a
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Feb 8, 2023
eaba3cc
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Feb 10, 2023
d28a33f
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Mar 6, 2023
6496148
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Mar 7, 2023
f945c87
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Mar 13, 2023
c0c84b9
Merge branch 'main' of https://github.com/auth0/auth0-cli
willvedd Mar 13, 2023
4d4dbc3
Outputtign correct number of applications
willvedd Mar 13, 2023
e3b4f26
Merge branch 'main' into DXCDT-405-apps-list-correct-heading-number
willvedd Mar 13, 2023
55055a2
Changing to exclude via request
willvedd Mar 13, 2023
a6f5fef
Merge branch 'DXCDT-405-apps-list-correct-heading-number' of https://…
willvedd Mar 13, 2023
bb0e926
Reverting some changes to display
willvedd Mar 13, 2023
c1252ad
Merge branch 'main' into DXCDT-405-apps-list-correct-heading-number
sergiught Mar 14, 2023
556aebb
Update internal/cli/apps.go
sergiught Mar 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions internal/display/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,28 @@ func (v *applicationView) Object() interface{} {
func (r *Renderer) ApplicationList(clients []*management.Client, revealSecrets bool) {
resource := "applications"

r.Heading(fmt.Sprintf("%s (%v)", resource, len(clients)))

if len(clients) == 0 {
r.EmptyState(resource)
r.Infof("Use 'auth0 apps create' to add one")
return
}

var res []View
var appsToRender []View
for _, c := range clients {
if auth0.StringValue(c.Name) == deprecatedAppName {
if auth0.StringValue(c.Name) == deprecatedGlobalAppName {
continue
}
sergiught marked this conversation as resolved.
Show resolved Hide resolved

if !revealSecrets {
c.ClientSecret = auth0.String("")
}

res = append(res, makeApplicationView(c, revealSecrets))
appsToRender = append(appsToRender, makeApplicationView(c, revealSecrets))
}

r.Results(res)
if len(clients) == 0 {
r.EmptyState(resource)
r.Infof("Use 'auth0 apps create' to add one")
return
}

r.Heading(fmt.Sprintf("%s (%v)", resource, len(appsToRender)))

r.Results(appsToRender)
}

func (r *Renderer) ApplicationShow(client *management.Client, revealSecrets bool) {
Expand Down Expand Up @@ -185,8 +185,7 @@ func makeApplicationView(client *management.Client, revealSecrets bool) *applica
}
}

// TODO(cyx): determine if there's a better way to filter this out.
const deprecatedAppName = "All Applications"
const deprecatedGlobalAppName = "All Applications" // Comparing on global app name because `global` boolean property is not returned by SDK

func FriendlyAppType(appType string) string {
switch {
Expand Down