mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user