Plugins: Renamed parts of the UI extension APIs (#63070)

* Renamed target -> id and href -> path after feedback.

* fixed type issues in test page.

* chore(pluginschemajson): update extensions props target -> id

* this is the final.

* fixed typings...again...

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Marcus Andersson
2023-02-08 05:33:28 -05:00
committed by GitHub
co-authored by Jack Westbrook
parent b88206d98f
commit f46f8bdd3a
13 changed files with 46 additions and 46 deletions
+2 -2
View File
@@ -502,14 +502,14 @@ func TestLoader_Load(t *testing.T) {
},
Extensions: []*plugindef.ExtensionsLink{
{
Target: "plugins/grafana-slo-app/slo-breach",
Placement: "plugins/grafana-slo-app/slo-breach",
Title: "Declare incident",
Type: plugindef.ExtensionsLinkTypeLink,
Description: "Declares a new incident",
Path: "/incidents/declare",
},
{
Target: "plugins/grafana-slo-app/slo-breach",
Placement: "plugins/grafana-slo-app/slo-breach",
Title: "Declare incident",
Type: plugindef.ExtensionsLinkTypeLink,
Description: "Declares a new incident (path without backslash)",
@@ -36,14 +36,14 @@
],
"extensions": [
{
"target": "plugins/grafana-slo-app/slo-breach",
"placement": "plugins/grafana-slo-app/slo-breach",
"type": "link",
"title": "Declare incident",
"description": "Declares a new incident",
"path": "/incidents/declare"
},
{
"target": "plugins/grafana-slo-app/slo-breach",
"placement": "plugins/grafana-slo-app/slo-breach",
"type": "link",
"title": "Declare incident",
"description": "Declares a new incident (path without backslash)",
+2 -2
View File
@@ -101,7 +101,7 @@ seqs: [
component?: string
// The minimum role a user must have to see this page in the navigation menu.
role?: "Admin" | "Editor" | "Viewer"
role?: "Admin" | "Editor" | "Viewer"
// RBAC action the user must have to access the route
action?: string
@@ -124,7 +124,7 @@ seqs: [
#ExtensionsLink: {
// Target where the link will be rendered
target: =~"^(plugins|grafana)\/[a-z-/0-9]*$"
placement: =~"^(plugins|grafana)\/[a-z-/0-9]*$"
// Type of extension
type: "link"
// Title that will be displayed for the rendered link
+1 -1
View File
@@ -162,7 +162,7 @@ type ExtensionsLink struct {
Path string `json:"path"`
// Target where the link will be rendered
Target string `json:"target"`
Placement string `json:"placement"`
// Title that will be displayed for the rendered link
Title string `json:"title"`