| 629 | } |
| 630 | |
| 631 | func (c *cli) unDeployedActionPickerOptions(ctx context.Context) (pickerOptions, error) { |
| 632 | list, err := c.api.Action.List(ctx, management.Parameter("deployed", "false")) |
| 633 | if err != nil { |
| 634 | return nil, fmt.Errorf("failed to list actions: %w", err) |
| 635 | } |
| 636 | |
| 637 | var opts pickerOptions |
| 638 | for _, r := range list.Actions { |
| 639 | label := fmt.Sprintf("%s %s", r.GetName(), ansi.Faint("("+r.GetID()+")")) |
| 640 | |
| 641 | opts = append(opts, pickerOption{value: r.GetID(), label: label}) |
| 642 | } |
| 643 | |
| 644 | if len(opts) == 0 { |
| 645 | return nil, errors.New("there are currently no actions to deploy") |
| 646 | } |
| 647 | |
| 648 | return opts, nil |
| 649 | } |
| 650 | |
| 651 | func (c *cli) actionEditorHint() { |
| 652 | c.renderer.Infof("%s Once you close the editor, the action will be saved. To cancel, press CTRL+C.", ansi.Faint("Hint:")) |