MM-12843 Add interactive dialogs (#9816)

* Add interactive dialogs

* Fix unit test

* Updates per feedback

* Fix typo

* Updates per feedback, add icon_url and error returns

* Updates per feedback

* Update per feedback
This commit is contained in:
Joram Wilander
2018-11-19 15:27:17 -05:00
committed by GitHub
parent 7a6f957638
commit 8cfca681b0
23 changed files with 1286 additions and 516 deletions

View File

@@ -2870,6 +2870,34 @@ func (s *apiRPCServer) UploadFile(args *Z_UploadFileArgs, returns *Z_UploadFileR
return nil
}
type Z_OpenInteractiveDialogArgs struct {
A model.OpenDialogRequest
}
type Z_OpenInteractiveDialogReturns struct {
A *model.AppError
}
func (g *apiRPCClient) OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError {
_args := &Z_OpenInteractiveDialogArgs{dialog}
_returns := &Z_OpenInteractiveDialogReturns{}
if err := g.client.Call("Plugin.OpenInteractiveDialog", _args, _returns); err != nil {
log.Printf("RPC call to OpenInteractiveDialog API failed: %s", err.Error())
}
return _returns.A
}
func (s *apiRPCServer) OpenInteractiveDialog(args *Z_OpenInteractiveDialogArgs, returns *Z_OpenInteractiveDialogReturns) error {
if hook, ok := s.impl.(interface {
OpenInteractiveDialog(dialog model.OpenDialogRequest) *model.AppError
}); ok {
returns.A = hook.OpenInteractiveDialog(args.A)
} else {
return encodableError(fmt.Errorf("API OpenInteractiveDialog called but not implemented."))
}
return nil
}
type Z_GetPluginsArgs struct {
}