Merge "Default dashboard timezone to UTC"
This commit is contained in:
commit
2295d4df87
@ -21,6 +21,7 @@ class Dashboard(object):
|
||||
|
||||
def get_schema(self):
|
||||
dashboard = {
|
||||
v.Required('timezone', default='utc'): v.Any('browser', 'utc'),
|
||||
v.Required('title'): v.All(str, v.Length(min=1)),
|
||||
v.Optional('id'): int,
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
"dashboard": {
|
||||
"new-dashboard": {
|
||||
"rows": [],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,7 @@
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
"title": "bar"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
|
9
tests/schema/fixtures/dashboard-0008.json
Normal file
9
tests/schema/fixtures/dashboard-0008.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"new-dashboard": {
|
||||
"rows": [],
|
||||
"timezone": "browser",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
}
|
3
tests/schema/fixtures/dashboard-0008.yaml
Normal file
3
tests/schema/fixtures/dashboard-0008.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
dashboard:
|
||||
timezone: browser
|
||||
title: New dashboard
|
@ -33,8 +33,16 @@ class TestCaseParser(TestCase):
|
||||
os.path.dirname(__file__), 'fixtures/parser/dashboard-0001.yaml')
|
||||
self.parser.parse(path)
|
||||
dashboard = {
|
||||
'foobar': {'rows': [], 'title': 'foobar'},
|
||||
'new-dashboard': {'rows': [], 'title': 'New dashboard'},
|
||||
'foobar': {
|
||||
'rows': [],
|
||||
'timezone': 'utc',
|
||||
'title': 'foobar',
|
||||
},
|
||||
'new-dashboard': {
|
||||
'rows': [],
|
||||
'timezone': 'utc',
|
||||
'title': 'New dashboard',
|
||||
},
|
||||
}
|
||||
|
||||
# Get parsed dashboard
|
||||
@ -61,7 +69,11 @@ class TestCaseParser(TestCase):
|
||||
os.path.dirname(__file__), 'fixtures/parser/dashboard-0001.yaml')
|
||||
self.parser.parse(path)
|
||||
dashboard = {
|
||||
'new-dashboard': {'rows': [], 'title': 'New dashboard'},
|
||||
'new-dashboard': {
|
||||
'rows': [],
|
||||
'timezone': 'utc',
|
||||
'title': 'New dashboard',
|
||||
},
|
||||
}
|
||||
|
||||
# Get parsed dashboard
|
||||
|
Loading…
x
Reference in New Issue
Block a user