Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited1f623

Browse files
committed
Remove diffs for the cli, moving to another branch
1 parentc4d45ce commited1f623

File tree

5 files changed

+9
-37
lines changed

5 files changed

+9
-37
lines changed

‎cli/cliui/parameter.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ func RichParameter(inv *serpent.Invocation, templateVersionParameter codersdk.Te
4343
return"",err
4444
}
4545

46-
values,err:=MultiSelect(inv,MultiSelectOptions{
47-
Options:options,
48-
Defaults:options,
49-
})
46+
values,err:=MultiSelect(inv,options)
5047
iferr==nil {
5148
v,err:=json.Marshal(&values)
5249
iferr!=nil {

‎cli/cliui/select.go

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func init() {
2121
{{- .CurrentOpt.Value}}
2222
{{- color "reset"}}
2323
{{end}}
24-
{{- if .Message }}{{- color "default+hb"}}{{ .Message }}{{ .FilterMessage }}{{color "reset"}}{{ end }}
24+
2525
{{- if not .ShowAnswer }}
2626
{{- if .Config.Icons.Help.Text }}
2727
{{- if .FilterMessage }}{{ "Search:" }}{{ .FilterMessage }}
@@ -44,20 +44,18 @@ func init() {
4444
{{- " "}}{{- .CurrentOpt.Value}}
4545
{{end}}
4646
{{- if .ShowHelp }}{{- color .Config.Icons.Help.Format }}{{ .Config.Icons.Help.Text }} {{ .Help }}{{color "reset"}}{{"\n"}}{{end}}
47-
{{- if .Message }}{{- color "default+hb"}}{{ .Message }}{{ .FilterMessage }}{{color "reset"}}{{ end }}
4847
{{- if not .ShowAnswer }}
4948
{{- "\n"}}
5049
{{- range $ix, $option := .PageEntries}}
5150
{{- template "option" $.IterateOption $ix $option}}
5251
{{- end}}
53-
{{- end}}`
52+
{{- end}}`
5453
}
5554

5655
typeSelectOptionsstruct {
5756
Options []string
5857
// Default will be highlighted first if it's a valid option.
5958
Defaultstring
60-
Messagestring
6159
Sizeint
6260
HideSearchbool
6361
}
@@ -124,7 +122,6 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
124122
Options:opts.Options,
125123
Default:defaultOption,
126124
PageSize:opts.Size,
127-
Message:opts.Message,
128125
},&value,survey.WithIcons(func(is*survey.IconSet) {
129126
is.Help.Text="Type to search"
130127
ifopts.HideSearch {
@@ -141,22 +138,15 @@ func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
141138
returnvalue,err
142139
}
143140

144-
typeMultiSelectOptionsstruct {
145-
Messagestring
146-
Options []string
147-
Defaults []string
148-
}
149-
150-
funcMultiSelect(inv*serpent.Invocation,optsMultiSelectOptions) ([]string,error) {
141+
funcMultiSelect(inv*serpent.Invocation,items []string) ([]string,error) {
151142
// Similar hack is applied to Select()
152143
ifflag.Lookup("test.v")!=nil {
153-
returnopts.Defaults,nil
144+
returnitems,nil
154145
}
155146

156147
prompt:=&survey.MultiSelect{
157-
Message:opts.Message,
158-
Options:opts.Options,
159-
Default:opts.Defaults,
148+
Options:items,
149+
Default:items,
160150
}
161151

162152
varvalues []string

‎cli/cliui/select_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ func newMultiSelect(ptty *ptytest.PTY, items []string) ([]string, error) {
107107
varvalues []string
108108
cmd:=&serpent.Command{
109109
Handler:func(inv*serpent.Invocation)error {
110-
selectedItems,err:=cliui.MultiSelect(inv, cliui.MultiSelectOptions{
111-
Options:items,
112-
Defaults:items,
113-
})
110+
selectedItems,err:=cliui.MultiSelect(inv,items)
114111
iferr==nil {
115112
values=selectedItems
116113
}

‎enterprise/coderd/roles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func TestCustomOrganizationRole(t *testing.T) {
166166
newRole.SitePermissions=nil
167167
newRole.OrganizationPermissions=nil
168168
newRole.UserPermissions=nil
169-
role,err=owner.PatchOrganizationRole(ctx,first.OrganizationID,newRole)
169+
_,err=owner.PatchOrganizationRole(ctx,first.OrganizationID,newRole)
170170
require.NoError(t,err,"upsert role with override")
171171

172172
// The role should no longer have template perms

‎scripts/rbacgen/codersdk.gotmpl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,3 @@ const (
1616
{{ $element.Enum }} RBACAction = "{{ $element.Value }}"
1717
{{- end }}
1818
)
19-
20-
// RBACResourceActions is the mapping of resources to which actions are valid for
21-
// said resource type.
22-
var RBACResourceActions = map[RBACResource][]RBACAction{
23-
{{- range $element := . }}
24-
Resource{{ pascalCaseName $element.FunctionName }}: []RBACAction{
25-
{{- range $actionValue, $_ := $element.Actions }}
26-
{{- actionEnum $actionValue -}},
27-
{{- end -}}
28-
},
29-
{{- end }}
30-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp