diff --git a/ee/desktop/user/menu/menu_template.go b/ee/desktop/user/menu/menu_template.go index 73b885919..8ae356bc2 100644 --- a/ee/desktop/user/menu/menu_template.go +++ b/ee/desktop/user/menu/menu_template.go @@ -15,6 +15,7 @@ const ( funcRelativeTime = "relativeTime" errorlessTemplateVars = "errorlessTemplateVars" // capability to evaluate undefined template vars without failing errorlessActions = "errorlessActions" // capability to evaluate undefined menu item actions without failing + circleDot = "circleDot" // capability to use circle-dot icon // TemplateData keys LauncherVersion string = "LauncherVersion" @@ -56,6 +57,8 @@ func (tp *templateParser) Parse(text string) (string, error) { return true case errorlessActions: return true + case circleDot: + return true } return false }, diff --git a/ee/desktop/user/menu/menu_template_test.go b/ee/desktop/user/menu/menu_template_test.go index 10914696b..9ea62bb2c 100644 --- a/ee/desktop/user/menu/menu_template_test.go +++ b/ee/desktop/user/menu/menu_template_test.go @@ -43,6 +43,18 @@ func Test_Parse(t *testing.T) { text: "This capability is {{if hasCapability `bad capability`}}supported{{else}}unsupported{{end}}.", output: "This capability is unsupported.", }, + { + name: "circleDot capability", + td: &TemplateData{}, + text: "\"icon\":\"{{if not (hasCapability `circleDot`)}}triangle-exclamation{{else}}circle-dot{{end}}\"", + output: "\"icon\":\"circle-dot\"", + }, + { + name: "icon fallback capability", + td: &TemplateData{}, + text: "\"icon\":\"{{if not (hasCapability `asOfYetUnknownIconType`)}}triangle-exclamation{{else}}new-icon-type{{end}}\"", + output: "\"icon\":\"triangle-exclamation\"", + }, { name: "relativeTime 2 hours ago", td: &TemplateData{LastMenuUpdateTime: time.Now().Add(-2 * time.Hour).Unix()},