mirror of https://github.com/grafana/grafana
drclau/unistor/namespace_authorizer
commit
8f4df8973d
@ -0,0 +1,82 @@ |
||||
import testDashboard from '../dashboards/TestRestoreDashboard.json'; |
||||
import { e2e } from '../utils'; |
||||
|
||||
describe('Dashboard restore', () => { |
||||
beforeEach(() => { |
||||
e2e.flows.login(Cypress.env('USERNAME'), Cypress.env('PASSWORD')); |
||||
}); |
||||
|
||||
it('Should delete, restore and permanently delete from the Dashboards page', () => { |
||||
e2e.flows.importDashboard(testDashboard, 1000, true); |
||||
|
||||
e2e.pages.Dashboards.visit(); |
||||
|
||||
// Delete dashboard
|
||||
e2e.pages.BrowseDashboards.table |
||||
.row('E2E Test - Restore Dashboard') |
||||
.find('[type="checkbox"]') |
||||
.click({ force: true }); |
||||
deleteDashboard('Delete'); |
||||
|
||||
// Dashboard should appear in Recently Deleted
|
||||
e2e.pages.RecentlyDeleted.visit(); |
||||
e2e.pages.Search.table.row('E2E Test - Restore Dashboard').should('exist'); |
||||
|
||||
// Restore dashboard
|
||||
e2e.pages.Search.table.row('E2E Test - Restore Dashboard').find('[type="checkbox"]').click({ force: true }); |
||||
cy.contains('button', 'Restore').click(); |
||||
cy.contains('p', 'This action will restore 1 dashboard.').should('be.visible'); |
||||
e2e.pages.ConfirmModal.delete().click(); |
||||
e2e.components.Alert.alertV2('success').contains('Dashboard E2E Test - Restore Dashboard restored').should('exist'); |
||||
|
||||
// Dashboard should appear in Browse
|
||||
e2e.pages.Dashboards.visit(); |
||||
e2e.pages.BrowseDashboards.table.row('E2E Test - Restore Dashboard').should('exist'); |
||||
|
||||
// Delete dashboard
|
||||
e2e.pages.BrowseDashboards.table |
||||
.row('E2E Test - Restore Dashboard') |
||||
.find('[type="checkbox"]') |
||||
.click({ force: true }); |
||||
deleteDashboard('Delete'); |
||||
|
||||
// Permanently delete dashboard
|
||||
permanentlyDeleteDashboard(); |
||||
}); |
||||
|
||||
it('Should delete, restore and permanently delete from the Dashboard settings', () => { |
||||
e2e.flows.importDashboard(testDashboard, 1000, true); |
||||
|
||||
e2e.flows.openDashboard({ uid: '355ac6c2-8a12-4469-8b99-4750eb8d0966' }); |
||||
e2e.pages.Dashboard.DashNav.settingsButton().click(); |
||||
deleteDashboard('Delete dashboard'); |
||||
|
||||
// Permanently delete dashboard
|
||||
permanentlyDeleteDashboard(); |
||||
}); |
||||
}); |
||||
|
||||
const deleteDashboard = (buttonName: string) => { |
||||
cy.contains('button', buttonName).click(); |
||||
e2e.flows.confirmDelete(); |
||||
e2e.components.Alert.alertV2('success') |
||||
.contains('Dashboard E2E Test - Restore Dashboard moved to Recently deleted') |
||||
.should('exist'); |
||||
e2e.pages.BrowseDashboards.table.row('E2E Test - Restore Dashboard').should('not.exist'); |
||||
}; |
||||
|
||||
const permanentlyDeleteDashboard = () => { |
||||
// Permanently delete dashboard
|
||||
e2e.pages.RecentlyDeleted.visit(); |
||||
e2e.pages.Search.table.row('E2E Test - Restore Dashboard').find('[type="checkbox"]').click({ force: true }); |
||||
cy.contains('button', 'Delete permanently').click(); |
||||
cy.contains('p', 'This action will delete 1 dashboard.').should('be.visible'); |
||||
e2e.flows.confirmDelete(); |
||||
e2e.components.Alert.alertV2('success').contains('Dashboard E2E Test - Restore Dashboard deleted').should('exist'); |
||||
|
||||
// Dashboard should not appear in Recently Deleted or Browse
|
||||
e2e.pages.Search.table.row('E2E Test - Restore Dashboard').should('not.exist'); |
||||
|
||||
e2e.pages.Dashboards.visit(); |
||||
e2e.pages.BrowseDashboards.table.row('E2E Test - Restore Dashboard').should('not.exist'); |
||||
}; |
@ -0,0 +1,209 @@ |
||||
{ |
||||
"annotations": { |
||||
"list": [ |
||||
{ |
||||
"builtIn": 1, |
||||
"datasource": "-- Grafana --", |
||||
"enable": true, |
||||
"hide": true, |
||||
"iconColor": "rgba(0, 211, 255, 1)", |
||||
"name": "Annotations & Alerts", |
||||
"target": { |
||||
"limit": 100, |
||||
"matchAny": false, |
||||
"tags": [], |
||||
"type": "dashboard" |
||||
}, |
||||
"type": "dashboard" |
||||
} |
||||
] |
||||
}, |
||||
"editable": true, |
||||
"gnetId": null, |
||||
"graphTooltip": 0, |
||||
"id": 322, |
||||
"links": [], |
||||
"liveNow": false, |
||||
"panels": [ |
||||
{ |
||||
"datasource": null, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "thresholds" |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green", |
||||
"value": null |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 0 |
||||
}, |
||||
"id": 6, |
||||
"options": { |
||||
"reduceOptions": { |
||||
"calcs": ["lastNotNull"], |
||||
"fields": "", |
||||
"values": false |
||||
}, |
||||
"showThresholdLabels": false, |
||||
"showThresholdMarkers": true, |
||||
"text": {} |
||||
}, |
||||
"pluginVersion": "8.3.0-pre", |
||||
"title": "Gauge Example", |
||||
"type": "gauge" |
||||
}, |
||||
{ |
||||
"datasource": null, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "thresholds" |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green", |
||||
"value": null |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 8, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 8 |
||||
}, |
||||
"id": 4, |
||||
"options": { |
||||
"colorMode": "value", |
||||
"graphMode": "area", |
||||
"justifyMode": "auto", |
||||
"orientation": "auto", |
||||
"reduceOptions": { |
||||
"calcs": ["lastNotNull"], |
||||
"fields": "", |
||||
"values": false |
||||
}, |
||||
"text": {}, |
||||
"textMode": "auto" |
||||
}, |
||||
"pluginVersion": "8.3.0-pre", |
||||
"title": "Stat", |
||||
"type": "stat" |
||||
}, |
||||
{ |
||||
"datasource": null, |
||||
"fieldConfig": { |
||||
"defaults": { |
||||
"color": { |
||||
"mode": "palette-classic" |
||||
}, |
||||
"custom": { |
||||
"axisLabel": "", |
||||
"axisPlacement": "auto", |
||||
"barAlignment": 0, |
||||
"drawStyle": "line", |
||||
"fillOpacity": 0, |
||||
"gradientMode": "none", |
||||
"hideFrom": { |
||||
"legend": false, |
||||
"tooltip": false, |
||||
"viz": false |
||||
}, |
||||
"lineInterpolation": "linear", |
||||
"lineWidth": 1, |
||||
"pointSize": 5, |
||||
"scaleDistribution": { |
||||
"type": "linear" |
||||
}, |
||||
"showPoints": "auto", |
||||
"spanNulls": false, |
||||
"stacking": { |
||||
"group": "A", |
||||
"mode": "none" |
||||
}, |
||||
"thresholdsStyle": { |
||||
"mode": "off" |
||||
} |
||||
}, |
||||
"mappings": [], |
||||
"thresholds": { |
||||
"mode": "absolute", |
||||
"steps": [ |
||||
{ |
||||
"color": "green", |
||||
"value": null |
||||
}, |
||||
{ |
||||
"color": "red", |
||||
"value": 80 |
||||
} |
||||
] |
||||
} |
||||
}, |
||||
"overrides": [] |
||||
}, |
||||
"gridPos": { |
||||
"h": 9, |
||||
"w": 12, |
||||
"x": 0, |
||||
"y": 16 |
||||
}, |
||||
"id": 2, |
||||
"options": { |
||||
"legend": { |
||||
"calcs": [], |
||||
"displayMode": "list", |
||||
"placement": "bottom" |
||||
}, |
||||
"tooltip": { |
||||
"mode": "single" |
||||
} |
||||
}, |
||||
"title": "Time series example", |
||||
"type": "timeseries" |
||||
} |
||||
], |
||||
"refresh": false, |
||||
"schemaVersion": 31, |
||||
"tags": [], |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"time": { |
||||
"from": "2021-09-01T04:00:00.000Z", |
||||
"to": "2021-09-15T04:00:00.000Z" |
||||
}, |
||||
"timepicker": {}, |
||||
"timezone": "", |
||||
"title": "E2E Test - Restore Dashboard", |
||||
"uid": "355ac6c2-8a12-4469-8b99-4750eb8d0966", |
||||
"version": 4 |
||||
} |
@ -1,6 +1,6 @@ |
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +groupName=identity.grafana.app
|
||||
// +groupName=iam.grafana.app
|
||||
|
||||
package v0alpha1 // import "github.com/grafana/grafana/pkg/apis/identity/v0alpha1"
|
||||
package v0alpha1 // import "github.com/grafana/grafana/pkg/apis/iam/v0alpha1"
|
@ -1,3 +1,3 @@ |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,TeamBindingSpec,Subjects |
||||
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,IdentityDisplay,IdentityType |
||||
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/identity/v0alpha1,IdentityDisplay,InternalID |
||||
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,TeamBindingSpec,Subjects |
||||
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,IdentityDisplay,IdentityType |
||||
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/iam/v0alpha1,IdentityDisplay,InternalID |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue