Skip to content

Commit 4db880d

Browse files
authored
feat: update the manifest model to include the setting for work objects (#247)
1 parent 43ccd3e commit 4db880d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

internal/shared/types/app_manifest.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ type AppFeatures struct {
7676
ManifestShortcutsItems []ManifestShortcutsItem `json:"shortcuts,omitempty" yaml:"shortcuts,flow,omitempty"`
7777
ManifestSlashCommandsItems []ManifestSlashCommandsItem `json:"slash_commands,omitempty" yaml:"slash_commands,flow,omitempty"`
7878
Search *Search `json:"search,omitempty" yaml:"search,flow,omitempty"`
79+
RichPreviews *RichPreviews `json:"rich_previews,omitempty" yaml:"rich_previews,flow,omitempty"`
80+
}
81+
82+
type RichPreviews struct {
83+
EntityTypes []string `json:"entity_types,omitempty" yaml:"entity_types,flow,omitempty"`
84+
IsActive bool `json:"is_active,omitempty" yaml:"is_active,flow,omitempty"`
7985
}
8086

8187
type AssistantView struct {

internal/shared/types/app_manifest_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ func Test_AppManifest_AppFeatures(t *testing.T) {
179179
},
180180
want: `{"app_home":{},"bot_user":{"display_name":"kubrick"},"search":{"search_function_callback_id":"movie_search","search_filters_function_callback_id":"movie_filters","enable_ai_answers":true}}`,
181181
},
182+
"includes Work Objects settings when provided": {
183+
features: AppFeatures{
184+
BotUser: BotUser{
185+
DisplayName: "business_bot",
186+
},
187+
RichPreviews: &RichPreviews{
188+
EntityTypes: []string{"slack#/entities/file"},
189+
},
190+
},
191+
want: `{"app_home":{},"bot_user":{"display_name":"business_bot"},"rich_previews":{"entity_types":["slack#/entities/file"]}}`,
192+
},
182193
}
183194
for name, tt := range tests {
184195
t.Run(name, func(t *testing.T) {

0 commit comments

Comments
 (0)