MM-27493 Shared channels (MVP) (#17301)
Remote Cluster Service - provides ability for multiple Mattermost cluster instances to create a trusted connection with each other and exchange messages - trusted connections are managed via slash commands (for now) - facilitates features requiring inter-cluster communication, such as Shared Channels Shared Channels Service - provides ability to shared channels between one or more Mattermost cluster instances (using trusted connection) - sharing/unsharing of channels is managed via slash commands (for now)
Этот коммит содержится в:
@@ -617,7 +617,7 @@ func TestDynamicListArgsForBuiltin(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
provider := &testProvider{}
|
||||
provider := &testCommandProvider{}
|
||||
RegisterCommandProvider(provider)
|
||||
|
||||
command := provider.GetCommand(th.App, nil)
|
||||
@@ -633,18 +633,18 @@ func TestDynamicListArgsForBuiltin(t *testing.T) {
|
||||
|
||||
t.Run("GetAutoCompleteListItems bad arg", func(t *testing.T) {
|
||||
suggestions := th.App.getSuggestions(emptyCmdArgs, []*model.AutocompleteData{command.AutocompleteData}, "", "bogus --badArg ", model.SYSTEM_ADMIN_ROLE_ID)
|
||||
assert.Len(t, suggestions, 0)
|
||||
assert.Empty(t, suggestions)
|
||||
})
|
||||
}
|
||||
|
||||
type testProvider struct {
|
||||
type testCommandProvider struct {
|
||||
}
|
||||
|
||||
func (p *testProvider) GetTrigger() string {
|
||||
func (p *testCommandProvider) GetTrigger() string {
|
||||
return "bogus"
|
||||
}
|
||||
|
||||
func (p *testProvider) GetCommand(a *App, T i18n.TranslateFunc) *model.Command {
|
||||
func (p *testCommandProvider) GetCommand(a *App, T i18n.TranslateFunc) *model.Command {
|
||||
top := model.NewAutocompleteData(p.GetTrigger(), "[command]", "Just a test.")
|
||||
top.AddNamedDynamicListArgument("dynaArg", "A dynamic list", "builtin:bogus", true)
|
||||
|
||||
@@ -658,14 +658,14 @@ func (p *testProvider) GetCommand(a *App, T i18n.TranslateFunc) *model.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *testProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
func (p *testCommandProvider) DoCommand(a *App, args *model.CommandArgs, message string) *model.CommandResponse {
|
||||
return &model.CommandResponse{
|
||||
Text: "I do nothing!",
|
||||
ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL,
|
||||
}
|
||||
}
|
||||
|
||||
func (p *testProvider) GetAutoCompleteListItems(a *App, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) ([]model.AutocompleteListItem, error) {
|
||||
func (p *testCommandProvider) GetAutoCompleteListItems(a *App, commandArgs *model.CommandArgs, arg *model.AutocompleteArg, parsed, toBeParsed string) ([]model.AutocompleteListItem, error) {
|
||||
if arg.Name == "dynaArg" {
|
||||
return []model.AutocompleteListItem{
|
||||
{Item: "item1", Hint: "this is hint 1", HelpText: "This is help text 1."},
|
||||
|
||||
Ссылка в новой задаче
Block a user