Skip to content

Commit 4abc7b8

Browse files
committed
updates
1 parent 8affc14 commit 4abc7b8

4 files changed

Lines changed: 19 additions & 17 deletions

File tree

cmd/sandbox/list.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func printSandboxes(cmd *cobra.Command, clients *shared.ClientFactory, token str
104104
clients.IO.PrintInfo(ctx, false, "%s", style.Sectionf(section))
105105

106106
if len(sandboxes) == 0 {
107-
clients.IO.PrintInfo(ctx, false, " %s\n", style.Secondary(fmt.Sprintf("No sandboxes found %s", style.Emoji("ghost"))))
107+
clients.IO.PrintInfo(ctx, false, " %s\n", style.Secondary("No sandboxes found"))
108108
return nil
109109
}
110110

@@ -116,25 +116,25 @@ func printSandboxes(cmd *cobra.Command, clients *shared.ClientFactory, token str
116116
clients.IO.PrintInfo(ctx, false, " %s", style.Secondary(fmt.Sprintf("URL: https://%s.slack.com", s.SandboxDomain)))
117117
}
118118

119-
if s.DateCreated > 0 {
120-
clients.IO.PrintInfo(ctx, false, " %s", style.Secondary(fmt.Sprintf("Created: %s", time.Unix(s.DateCreated, 0).Format(timeFormat))))
121-
}
122-
123119
if s.Status != "" {
124120
status := style.Secondary(fmt.Sprintf("Status: %s", strings.ToTitle(s.Status)))
125121
if strings.EqualFold(s.Status, "archived") {
126-
clients.IO.PrintInfo(ctx, false, " %s %s", style.Emoji("warning"), status)
122+
clients.IO.PrintInfo(ctx, false, " %s", style.Styler().Red(status))
127123
} else {
128-
clients.IO.PrintInfo(ctx, false, " %s%s", style.Emoji("green_circle"), status)
124+
clients.IO.PrintInfo(ctx, false, " %s", style.Styler().Green(status))
129125
}
130126
}
131127

128+
if s.DateCreated > 0 {
129+
clients.IO.PrintInfo(ctx, false, " %s", style.Secondary(fmt.Sprintf("Created: %s", time.Unix(s.DateCreated, 0).Format(timeFormat))))
130+
}
131+
132132
if s.DateArchived > 0 {
133133
archivedTime := time.Unix(s.DateArchived, 0).In(time.Local)
134134
now := time.Now()
135135
archivedDate := time.Date(archivedTime.Year(), archivedTime.Month(), archivedTime.Day(), 0, 0, 0, 0, time.Local)
136136
todayDate := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
137-
label := "Active until:"
137+
label := "Expires:"
138138
if archivedDate.Before(todayDate) {
139139
label = "Archived:"
140140
}

cmd/sandbox/sandbox.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ import (
2929
func NewCommand(clients *shared.ClientFactory) *cobra.Command {
3030
cmd := &cobra.Command{
3131
Use: "sandbox <subcommand> [flags] --experiment=sandboxes",
32-
Short: "Manage your sandboxes",
33-
Long: `Manage your Slack developer sandboxes without leaving your terminal.
32+
Short: "Manage developer sandboxes",
33+
Long: `Manage Slack developer sandboxes without leaving your terminal.
3434
Use the --team flag to select the authentication to use for these commands.
3535
36-
Prefer a UI? Head over to {{LinkText "https://api.slack.com/developer-program/sandboxes"}}
36+
Prefer a UI? Head over to
37+
{{LinkText "https://api.slack.com/developer-program/sandboxes"}}
3738
38-
New to the Developer Program? Sign up at {{LinkText "https://api.slack.com/developer-program/join"}}`,
39+
New to the Developer Program? Sign up at
40+
{{LinkText "https://api.slack.com/developer-program/join"}}`,
3941
Example: style.ExampleCommandsf([]style.ExampleCommand{}),
4042
Aliases: []string{"sandboxes"},
4143
PreRunE: func(cmd *cobra.Command, args []string) error {
@@ -63,7 +65,6 @@ func requireSandboxExperiment(clients *shared.ClientFactory) error {
6365
// getSandboxAuth returns the auth to be used for sandbox management.
6466
// Uses the global --token or --team flag if present, otherwise prompts the user to select a team.
6567
func getSandboxAuth(ctx context.Context, clients *shared.ClientFactory) (*types.SlackAuth, error) {
66-
6768
// Check for the global --token flag
6869
if clients.Config.TokenFlag != "" {
6970
auth, err := clients.Auth().AuthWithToken(ctx, clients.Config.TokenFlag)

docs/reference/experiments.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The following is a list of currently available experiments. We'll remove experim
1010
- `slack create` and `slack init` now set manifest source to "app settings" (remote) for Bolt JS & Bolt Python projects ([PR#96](https://github.com/slackapi/slack-cli/pull/96)).
1111
- `slack run` and `slack install` support creating and installing Bolt Framework apps that have the manifest source set to "app settings (remote)" ([PR#111](https://github.com/slackapi/slack-cli/pull/111), [PR#154](https://github.com/slackapi/slack-cli/pull/154)).
1212
- `charm`: shows beautiful prompts ([PR#348](https://github.com/slackapi/slack-cli/pull/348)).
13+
- `sandboxes`: enables users who have joined the Slack Developer Program to manage their sandboxes ([PR#379](https://github.com/slackapi/slack-cli/pull/379)).
1314

1415
## Experiments changelog
1516

internal/shared/types/sandbox.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ package types
1616

1717
// Sandbox represents a Slack Developer Sandbox from the developer.sandbox.list API.
1818
type Sandbox struct {
19-
SandboxTeamID string `json:"sandbox_team_id"` // Encoded team ID of the developer sandbox
20-
SandboxName string `json:"sandbox_name"` // Name of the developer sandbox
21-
SandboxDomain string `json:"sandbox_domain"` // Domain of the developer sandbox
22-
DateCreated int64 `json:"date_created"` // When the developer sandbox was created, as epoch seconds
2319
DateArchived int64 `json:"date_archived"` // When the developer sandbox is or will be archived, as epoch seconds
20+
DateCreated int64 `json:"date_created"` // When the developer sandbox was created, as epoch seconds
21+
SandboxDomain string `json:"sandbox_domain"` // Domain of the developer sandbox
22+
SandboxName string `json:"sandbox_name"` // Name of the developer sandbox
23+
SandboxTeamID string `json:"sandbox_team_id"` // Encoded team ID of the developer sandbox
2424
Status string `json:"status"` // Status of the developer sandbox: Active or Archived
2525
}

0 commit comments

Comments
 (0)