DashboardSettings: Migrates history diff view from angular to react (#31997)

* chore(dashboardsettings): introduce deep-diff for diffing dashboard models

* feat(dashboardsettings): initial commit of diff comparision react migration

* feat(dashboardsettings): wip - use json-source-map and monaco editor

* chore(deps): add react-diff-viewer to package.json

* feat(dashboardsettings): take the simplistic road for diff view

* refactor(dashboardsettings): clean up Version Settings components

* chore: delete angular historyListCtrl code

* refactor(dashboardsettings): styling fixes

* Small color tweaks

* refactor(versionhistory): fix issues around summary text. write tests

* test(versionhistory): add test for jsonDiff

* refactor(versionhistory): cleanup utils and reduce dom elements

* test(versionsettings): add tests for comparision view

* test(versionsettings): finialise tests for version history comparison view

* test(versionsettings): remove debug

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
Jack Westbrook
2021-03-25 11:51:09 +01:00
committed by GitHub
parent 405f54565a
commit c9eff1892e
19 changed files with 916 additions and 451 deletions

View File

@@ -7,7 +7,7 @@ export const versions = [
version: 11,
created: '2021-01-15T14:44:44+01:00',
createdBy: 'admin',
message: 'Another day another change...',
message: 'testing changes...',
},
{
id: 247,
@@ -110,3 +110,96 @@ export const versions = [
message: '',
},
];
export const diffs = {
lhs: {
data: {
annotations: {
list: [
{
builtIn: 1,
datasource: '-- Grafana --',
enable: true,
hide: true,
iconColor: 'rgba(0, 211, 255, 1)',
name: 'Annotations & Alerts',
type: 'dashboard',
},
],
},
editable: true,
gnetId: null,
graphTooltip: 0,
id: 141,
links: [],
panels: [
{
type: 'graph',
id: 4,
},
],
schemaVersion: 27,
style: 'dark',
tags: ['the tag'],
templating: {
list: [],
},
time: {
from: 'now-6h',
to: 'now',
},
timepicker: {},
timezone: '',
title: 'test dashboard',
uid: '_U4zObQMz',
version: 2,
},
},
rhs: {
data: {
annotations: {
list: [
{
builtIn: 1,
datasource: '-- Grafana --',
enable: true,
hide: true,
iconColor: 'rgba(0, 211, 255, 1)',
name: 'Annotations & Alerts',
type: 'dashboard',
},
],
},
description: 'The dashboard description',
editable: true,
gnetId: null,
graphTooltip: 0,
id: 141,
links: [],
panels: [
{
type: 'graph',
title: 'panel title',
id: 6,
},
],
schemaVersion: 27,
style: 'dark',
tags: [],
templating: {
list: [],
},
time: {
from: 'now-6h',
to: 'now',
},
timepicker: {
refresh_intervals: ['5s'],
},
timezone: '',
title: 'test dashboard',
uid: '_U4zObQMz',
version: 11,
},
},
};