-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow plugins to specify dashboard pages
- Loading branch information
Showing
6 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Joi = require("joi") | ||
import { joiArray } from "./common" | ||
|
||
export interface DashboardPage { | ||
title: string | ||
description: string | ||
url: string | ||
newWindow: boolean | ||
// TODO: allow nested sections | ||
// children: DashboardPage[] | ||
} | ||
|
||
export const dashboardPageSchema = Joi.object() | ||
.keys({ | ||
title: Joi.string() | ||
.length(32) | ||
.required() | ||
.description("The link title to show in the menu bar (max length 32)."), | ||
description: Joi.string() | ||
.required() | ||
.description("A description to show when hovering over the link."), | ||
url: Joi.string() | ||
.uri() | ||
.required() | ||
.description("The URL to open in the dashboard pane when clicking the link."), | ||
newWindow: Joi.boolean() | ||
.default(false) | ||
.description("Set to true if the link should open in a new browser tab/window."), | ||
}) | ||
|
||
export const dashboardPagesSchema = joiArray(dashboardPageSchema) | ||
.description("One or more pages to add to the Garden dashboard.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters