mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refactoring: changed name on compare command to make properties more explainatory
This commit is contained in:
@@ -30,17 +30,17 @@ func init() {
|
||||
// CompareDashboardVersionsCommand computes the JSON diff of two versions,
|
||||
// assigning the delta of the diff to the `Delta` field.
|
||||
func CompareDashboardVersionsCommand(cmd *m.CompareDashboardVersionsCommand) error {
|
||||
original, err := getDashboardVersion(cmd.DashboardId, cmd.Original)
|
||||
baseVersion, err := getDashboardVersion(cmd.DashboardId, cmd.BaseVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
newDashboard, err := getDashboardVersion(cmd.DashboardId, cmd.New)
|
||||
newVersion, err := getDashboardVersion(cmd.DashboardId, cmd.NewVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
left, jsonDiff, err := getDiff(original, newDashboard)
|
||||
left, jsonDiff, err := getDiff(baseVersion, newVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -117,8 +117,8 @@ func TestCompareDashboardVersions(t *testing.T) {
|
||||
|
||||
cmd := m.CompareDashboardVersionsCommand{
|
||||
DashboardId: savedDash.Id,
|
||||
Original: query.Result[0].Version,
|
||||
New: query.Result[1].Version,
|
||||
BaseVersion: query.Result[0].Version,
|
||||
NewVersion: query.Result[1].Version,
|
||||
DiffType: m.DiffDelta,
|
||||
}
|
||||
|
||||
@@ -130,8 +130,8 @@ func TestCompareDashboardVersions(t *testing.T) {
|
||||
Convey("Compare two versions that are the same", func() {
|
||||
cmd := m.CompareDashboardVersionsCommand{
|
||||
DashboardId: savedDash.Id,
|
||||
Original: savedDash.Version,
|
||||
New: savedDash.Version,
|
||||
BaseVersion: savedDash.Version,
|
||||
NewVersion: savedDash.Version,
|
||||
DiffType: m.DiffDelta,
|
||||
}
|
||||
|
||||
@@ -143,8 +143,8 @@ func TestCompareDashboardVersions(t *testing.T) {
|
||||
Convey("Compare two versions that don't exist", func() {
|
||||
cmd := m.CompareDashboardVersionsCommand{
|
||||
DashboardId: savedDash.Id,
|
||||
Original: 123,
|
||||
New: 456,
|
||||
BaseVersion: 123,
|
||||
NewVersion: 456,
|
||||
DiffType: m.DiffDelta,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user