From ad474cb0d9305ce9791465169521badff246c3aa Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Tue, 15 Oct 2019 23:25:50 +0200 Subject: [PATCH] [MM-18592] Add IconPath field to plugin manifest (#12189) --- model/manifest.go | 4 ++++ model/manifest_test.go | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/model/manifest.go b/model/manifest.go index 0eb64534a0..92565e2d1f 100644 --- a/model/manifest.go +++ b/model/manifest.go @@ -130,6 +130,10 @@ type Manifest struct { // A description of what your plugin is and does. Description string `json:"description,omitempty" yaml:"description,omitempty"` + // A relative file path in the bundle that points to the plugins svg icon for use with the Plugin Marketplace. + // This should be relative to the root of your bundle and the location of the manifest file. Bitmap image formats are not supported. + IconPath string `json:"icon_path,omitempty" yaml:"icon_path,omitempty"` + // A version number for your plugin. Semantic versioning is recommended: http://semver.org Version string `json:"version" yaml:"version"` diff --git a/model/manifest_test.go b/model/manifest_test.go index 6cec274ec2..53e2370af0 100644 --- a/model/manifest_test.go +++ b/model/manifest_test.go @@ -64,6 +64,7 @@ func TestFindManifest(t *testing.T) { func TestManifestUnmarshal(t *testing.T) { expected := Manifest{ Id: "theid", + IconPath: "assets/icon.svg", MinServerVersion: "5.6.0", Server: &ManifestServer{ Executable: "theexecutable", @@ -102,6 +103,7 @@ func TestManifestUnmarshal(t *testing.T) { var yamlResult Manifest require.NoError(t, yaml.Unmarshal([]byte(` id: theid +icon_path: assets/icon.svg min_server_version: 5.6.0 server: executable: theexecutable @@ -131,7 +133,8 @@ settings_schema: var jsonResult Manifest require.NoError(t, json.Unmarshal([]byte(`{ "id": "theid", - "min_server_version": "5.6.0", + "icon_path": "assets/icon.svg", + "min_server_version": "5.6.0", "server": { "executable": "theexecutable", "executables": {