Commit Graph

22 Commits

Author SHA1 Message Date
Johannes Schill
2ad4c30bc6 ux: POC - Update "Add permissions" design and add a fancy animation #10676 2018-01-31 14:19:07 +01:00
Torkel Ödegaard
908b6c8d0b tech: ran prettier on all scss files 2017-12-19 16:22:41 +01:00
Johannes Schill
01e9053625 ux: Update ui of login buttons via third parties and add link to sign up page (#9879) 2017-12-12 15:00:04 +01:00
Johannes Schill
f77d34f7c9 ux: wip - Push pixels for new login, remove inline styling, change so we use media queries using min-width instead of max-width and make sure it looks ok across all screen sizes (#9879) 2017-12-11 16:31:50 +01:00
Torkel Ödegaard
16fbefbbc5 Merge branch 'develop' into develop-light-theme 2017-12-05 13:31:05 +01:00
Patrick O'Carroll
df5fd3cd1d fixed grey colors in light-theme, added new variables, played a bit with blue 2017-12-05 12:48:16 +01:00
Johannes Schill
ba3a81aba5 ux: Add CTA for empty lists 2017-12-04 16:18:46 +01:00
Torkel Ödegaard
21a7f57248 ux: changed cta button style 2017-08-20 21:16:40 +02:00
Torkel Ödegaard
56b3c4a3a0 dasboard_history: fixed disabled attribute so it works both by disabling and fixing style, no need for disabled class and disabled attribute 2017-06-07 13:46:36 +02:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
9c2809a1a4 ux(): button style tweaks, align with grafana.net styles more 2016-03-20 10:31:50 +01:00
Matt
ab4957684f Merged with master, I think 2016-02-20 10:13:18 -05:00
Torkel Ödegaard
a685e46fb6 ux(): minor tweaks 2016-02-20 11:05:06 +01:00
Trent White
6721cec73f created secondary button style, added a couple of variables, played with the plugins page to get the underline in place. Worth a look, but check that I was building everything properly :) 2016-02-19 18:22:24 -05:00
Torkel Ödegaard
4a062b6d00 ux(): colors refactoring 2016-02-19 14:24:19 +01:00
Torkel Ödegaard
e24e34619a ux(): began long on tiresome work on color refactors, polished button styles, added buttons to styleguide 2016-02-18 20:41:23 +01:00
Torkel Ödegaard
cae975cb39 ux(): fixed login, signup, signup step2 and invite views 2016-02-18 14:44:36 +01:00
Torkel Ödegaard
3003a8cb6e ux(sass): a lot of polish on headings and margins, ONLY USE bottom margins, othewise margin collapse causes issues 2016-02-18 12:16:47 +01:00
Torkel Ödegaard
7c917156ee ux(sass): variable refactoring 2016-02-16 10:42:06 +01:00
Torkel Ödegaard
febad7b1d7 ux(saas): variable renaming 2016-02-16 09:42:46 +01:00
Torkel Ödegaard
058c905432 ux(sass): variable renaming 2016-02-16 08:17:08 +01:00
Torkel Ödegaard
9045be0c12 ux(sass): rename less folder to sass 2016-02-15 18:17:06 +01:00