Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
7f7f080a
Commit
7f7f080a
authored
Nov 29, 2016
by
Pavlos Daoglou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5443] Check if title is empty before save a new dashboard
parent
f7e8e9c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
pkg/api/dashboard.go
+4
-0
pkg/models/dashboards.go
+1
-0
No files found.
pkg/api/dashboard.go
View file @
7f7f080a
...
@@ -121,6 +121,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
...
@@ -121,6 +121,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
}
}
dash
:=
cmd
.
GetDashboardModel
()
dash
:=
cmd
.
GetDashboardModel
()
// Check if Title is empty
if
dash
.
Title
==
""
{
return
ApiError
(
400
,
m
.
ErrDashboardTitleEmpty
.
Error
(),
nil
)
}
if
dash
.
Id
==
0
{
if
dash
.
Id
==
0
{
limitReached
,
err
:=
middleware
.
QuotaReached
(
c
,
"dashboard"
)
limitReached
,
err
:=
middleware
.
QuotaReached
(
c
,
"dashboard"
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/models/dashboards.go
View file @
7f7f080a
...
@@ -15,6 +15,7 @@ var (
...
@@ -15,6 +15,7 @@ var (
ErrDashboardSnapshotNotFound
=
errors
.
New
(
"Dashboard snapshot not found"
)
ErrDashboardSnapshotNotFound
=
errors
.
New
(
"Dashboard snapshot not found"
)
ErrDashboardWithSameNameExists
=
errors
.
New
(
"A dashboard with the same name already exists"
)
ErrDashboardWithSameNameExists
=
errors
.
New
(
"A dashboard with the same name already exists"
)
ErrDashboardVersionMismatch
=
errors
.
New
(
"The dashboard has been changed by someone else"
)
ErrDashboardVersionMismatch
=
errors
.
New
(
"The dashboard has been changed by someone else"
)
ErrDashboardTitleEmpty
=
errors
.
New
(
"Dashboard title cannot be empty"
)
)
)
type
UpdatePluginDashboardError
struct
{
type
UpdatePluginDashboardError
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment