mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor(issue): share the prompt policy check of issue forms
issue create, issue edit and comment prompts ask canPrompt, like the milestone and label forms, instead of loading the settings themselves. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
3 files changed
+10
-12
No files matched your search
@@ -244,11 +244,11 @@ $ tea issue create --title "Idea" --web`, Args: argsExact(0), RunE: func(cmd *co
|
||||
return err
|
||||
}
|
||||
}
|
||||
snapshot, err := a.deps.Settings.Load()
|
||||
prompt, err := a.canPrompt()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !localFlagsChanged(cmd) && a.policy(snapshot).CanPrompt(a.deps.Streams) && a.deps.IssueForm != nil {
|
||||
if !localFlagsChanged(cmd) && prompt && a.deps.IssueForm != nil {
|
||||
return a.createIssueInteractively(cmd)
|
||||
}
|
||||
var target target
|
||||
|
||||
Reference in new issue
Block a user