selection

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CREATE_FROM_SAMPLE = "<CREATE_FROM_SAMPLE>"

Variables

View Source
var (
	CheckoutDefault = CheckoutOption{Title: "Clone the default branch", Id: "default"}
	CheckoutBranch  = CheckoutOption{Title: "Branches", Id: "branch"}
	CheckoutPR      = CheckoutOption{Title: "Pull/Merge requests", Id: "pullrequest"}
)
View Source
var BlankWorkspaceIdentifier = "<BLANK_WORKSPACE>"
View Source
var CustomRepoIdentifier = "<CUSTOM_REPO>"
View Source
var DoneConfiguring = apiclient.CreateWorkspaceDTO{
	Name: doneConfiguringName,
}
View Source
var NewGitProviderConfigIdentifier = "<NEW_GIT_PROVIDER_CONFIG>"
View Source
var NewWorkspaceTemplateIdentifier = "<NEW_WORKSPACE_TEMPLATE>"
View Source
var NoneGitProviderConfigIdentifier = "<NONE>"

Functions

func AddLoadMoreOptionToList

func AddLoadMoreOptionToList(items []list.Item) []list.Item

Adds 'Load more' option to a selection list for efficient pagination totalItems count is exclusive of pagination options.

func GetBranchFromPrompt

func GetBranchFromPrompt(branches []apiclient.GitBranch, workspaceOrder int, selectionListOptions views.SelectionListOptions) (*apiclient.GitBranch, string)

func GetBuildFromPrompt

func GetBuildFromPrompt(builds []apiclient.BuildDTO, actionVerb string) *apiclient.BuildDTO

func GetGitProviderConfigFromPrompt

func GetGitProviderConfigFromPrompt(params GetGitProviderConfigParams) *apiclient.GitProvider

func GetNamespaceIdFromPrompt

func GetNamespaceIdFromPrompt(namespaces []apiclient.GitNamespace, workspaceOrder int, selectionListOptions views.SelectionListOptions) (string, string)

func GetPrebuildFromPrompt

func GetPrebuildFromPrompt(prebuilds []apiclient.PrebuildDTO, actionVerb string) *apiclient.PrebuildDTO

func GetProviderIdFromPrompt

func GetProviderIdFromPrompt(gitProviders []gitprovider_view.GitProviderView, workspaceOrder int, samplesEnabled bool) string

func GetPullRequestFromPrompt

func GetPullRequestFromPrompt(pullRequests []apiclient.GitPullRequest, workspaceOrder int, selectionListOptions views.SelectionListOptions) (*apiclient.GitPullRequest, string)

func GetRepositoryFromPrompt

func GetRepositoryFromPrompt(repositories []apiclient.GitRepository, workspaceOrder int, selectedRepos map[string]int, selectionListOptions views.SelectionListOptions) (*apiclient.GitRepository, string)

func GetSampleFromPrompt

func GetSampleFromPrompt(samples []apiclient.Sample) *apiclient.Sample

func GetWorkspaceRequestFromPrompt

func GetWorkspaceRequestFromPrompt(workspaces *[]apiclient.CreateWorkspaceDTO) *apiclient.CreateWorkspaceDTO

func GetWorkspaceTemplateFromPrompt

func GetWorkspaceTemplateFromPrompt(workspaceTemplates []apiclient.WorkspaceTemplate, workspaceOrder int, showBlankOption, withNewWorkspaceTemplate bool, actionVerb string) *apiclient.WorkspaceTemplate

Types

type CheckoutOption

type CheckoutOption struct {
	Title string
	Id    string
}

func GetCheckoutOptionFromPrompt

func GetCheckoutOptionFromPrompt(workspaceOrder int, checkoutOptions []CheckoutOption, parentIdentifier string) CheckoutOption

type GetGitProviderConfigParams

type GetGitProviderConfigParams struct {
	GitProviderConfigs       []apiclient.GitProvider
	WithNewGitProviderConfig bool
	WithNoneOption           bool
	ActionVerb               string
	PreselectedGitProviderId *string
}

type ItemDelegate

type ItemDelegate[T any] struct {
}

func (ItemDelegate[T]) Height

func (d ItemDelegate[T]) Height() int

func (ItemDelegate[T]) Render

func (d ItemDelegate[T]) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (ItemDelegate[T]) Spacing

func (d ItemDelegate[T]) Spacing() int

func (ItemDelegate[T]) Update

func (d ItemDelegate[T]) Update(msg tea.Msg, m *list.Model) tea.Cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL