Update scenes to v5.23.1 (#95951)

* Update scenes to v5.23.1

* Fix e2e tests

* Fix unit tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bogdan Matei <bogdan.matei@grafana.com>
This commit is contained in:
renovate[bot] 2024-11-06 19:20:27 +02:00 committed by GitHub
parent fbbb4463f8
commit 70c21a2e4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 16 deletions

View File

@ -9,6 +9,9 @@ describe('Dashboard templating', () => {
// Open dashboard global variables and interpolation // Open dashboard global variables and interpolation
e2e.flows.openDashboard({ uid: 'HYaGDGIMk' }); e2e.flows.openDashboard({ uid: 'HYaGDGIMk' });
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const example = `Example: from=now-6h&to=now&timezone=${encodeURIComponent(timeZone)}`;
const items: string[] = []; const items: string[] = [];
const expectedItems: string[] = [ const expectedItems: string[] = [
'__dashboard = Templating - Global variables and interpolation', '__dashboard = Templating - Global variables and interpolation',
@ -36,7 +39,7 @@ describe('Dashboard templating', () => {
`Server:text = All`, `Server:text = All`,
`Server:queryparam = var-Server=$__all`, `Server:queryparam = var-Server=$__all`,
`1 < 2`, `1 < 2`,
`Example: from=now-6h&to=now`, example,
]; ];
cy.get('.markdown-html li') cy.get('.markdown-html li')
@ -51,10 +54,10 @@ describe('Dashboard templating', () => {
}); });
// Check link interpolation is working correctly // Check link interpolation is working correctly
cy.contains('a', 'Example: from=now-6h&to=now').should( cy.contains('a', example).should(
'have.attr', 'have.attr',
'href', 'href',
'https://example.com/?from=now-6h&to=now' `https://example.com/?from=now-6h&to=now&timezone=${encodeURIComponent(timeZone)}`
); );
}); });
}); });

View File

@ -268,8 +268,8 @@
"@grafana/prometheus": "workspace:*", "@grafana/prometheus": "workspace:*",
"@grafana/runtime": "workspace:*", "@grafana/runtime": "workspace:*",
"@grafana/saga-icons": "workspace:*", "@grafana/saga-icons": "workspace:*",
"@grafana/scenes": "5.22.1", "@grafana/scenes": "5.23.1",
"@grafana/scenes-react": "5.22.1", "@grafana/scenes-react": "5.23.1",
"@grafana/schema": "workspace:*", "@grafana/schema": "workspace:*",
"@grafana/sql": "workspace:*", "@grafana/sql": "workspace:*",
"@grafana/ui": "workspace:*", "@grafana/ui": "workspace:*",

View File

@ -55,11 +55,14 @@ describe('TrailStore', () => {
}); });
describe('Initialize store with one recent trail with final current step', () => { describe('Initialize store with one recent trail with final current step', () => {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const history: SerializedTrail['history'] = [ const history: SerializedTrail['history'] = [
{ {
urlValues: { urlValues: {
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6', 'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -73,6 +76,7 @@ describe('TrailStore', () => {
metric: 'access_permissions_duration_count', metric: 'access_permissions_duration_count',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6', 'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -153,6 +157,7 @@ describe('TrailStore', () => {
['metric', 'different_metric'], ['metric', 'different_metric'],
['from', 'now-1y'], ['from', 'now-1y'],
['to', 'now-30m'], ['to', 'now-30m'],
['timezone', 'utc'],
['var-ds', 'ds'], ['var-ds', 'ds'],
['var-groupby', 'job'], ['var-groupby', 'job'],
['var-filters', 'cluster|=|dev-eu-west-2'], ['var-filters', 'cluster|=|dev-eu-west-2'],
@ -212,11 +217,14 @@ describe('TrailStore', () => {
}); });
describe('Initialize store with one recent trail with non final current step', () => { describe('Initialize store with one recent trail with non final current step', () => {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const history: SerializedTrail['history'] = [ const history: SerializedTrail['history'] = [
{ {
urlValues: { urlValues: {
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'ds', 'var-ds': 'ds',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -230,6 +238,7 @@ describe('TrailStore', () => {
metric: 'current_metric', metric: 'current_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'ds', 'var-ds': 'ds',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -243,6 +252,7 @@ describe('TrailStore', () => {
metric: 'final_metric', metric: 'final_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'ds', 'var-ds': 'ds',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -450,6 +460,7 @@ describe('TrailStore', () => {
['metric', 'different_metric'], ['metric', 'different_metric'],
['from', 'now-1y'], ['from', 'now-1y'],
['to', 'now-30m'], ['to', 'now-30m'],
['timezone', 'utc'],
['var-ds', 'different'], ['var-ds', 'different'],
['var-groupby', 'job'], ['var-groupby', 'job'],
['var-filters', 'cluster|=|dev-eu-west-2'], ['var-filters', 'cluster|=|dev-eu-west-2'],
@ -485,6 +496,8 @@ describe('TrailStore', () => {
}); });
describe('Initialize store with one bookmark trail but no recent trails', () => { describe('Initialize store with one bookmark trail but no recent trails', () => {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
beforeEach(() => { beforeEach(() => {
localStorage.clear(); localStorage.clear();
localStorage.setItem( localStorage.setItem(
@ -495,6 +508,7 @@ describe('TrailStore', () => {
metric: 'bookmarked_metric', metric: 'bookmarked_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'prom-mock', 'var-ds': 'prom-mock',
'var-deployment_environment': ['undefined'], 'var-deployment_environment': ['undefined'],
'var-otel_resources': [''], 'var-otel_resources': [''],
@ -571,6 +585,8 @@ describe('TrailStore', () => {
}); });
describe('Initialize store with one legacy bookmark trail', () => { describe('Initialize store with one legacy bookmark trail', () => {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
beforeEach(() => { beforeEach(() => {
localStorage.clear(); localStorage.clear();
localStorage.setItem( localStorage.setItem(
@ -582,6 +598,7 @@ describe('TrailStore', () => {
urlValues: { urlValues: {
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6', 'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -594,6 +611,7 @@ describe('TrailStore', () => {
metric: 'access_permissions_duration_count', metric: 'access_permissions_duration_count',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6', 'var-ds': 'cb3a3391-700f-4cc6-81be-a122488e93e6',
'var-filters': [], 'var-filters': [],
refresh: '', refresh: '',
@ -683,6 +701,8 @@ describe('TrailStore', () => {
}); });
describe('Initialize store with one bookmark matching recent trail not on final step', () => { describe('Initialize store with one bookmark matching recent trail not on final step', () => {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
beforeEach(() => { beforeEach(() => {
localStorage.clear(); localStorage.clear();
localStorage.setItem( localStorage.setItem(
@ -694,6 +714,7 @@ describe('TrailStore', () => {
urlValues: { urlValues: {
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'prom-mock', 'var-ds': 'prom-mock',
'var-deployment_environment': ['undefined'], 'var-deployment_environment': ['undefined'],
'var-otel_resources': [''], 'var-otel_resources': [''],
@ -707,6 +728,7 @@ describe('TrailStore', () => {
metric: 'bookmarked_metric', metric: 'bookmarked_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'prom-mock', 'var-ds': 'prom-mock',
'var-deployment_environment': ['undefined'], 'var-deployment_environment': ['undefined'],
'var-otel_resources': [''], 'var-otel_resources': [''],
@ -720,6 +742,7 @@ describe('TrailStore', () => {
metric: 'some_other_metric', metric: 'some_other_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'prom-mock', 'var-ds': 'prom-mock',
'var-deployment_environment': ['undefined'], 'var-deployment_environment': ['undefined'],
'var-otel_resources': [''], 'var-otel_resources': [''],
@ -741,6 +764,7 @@ describe('TrailStore', () => {
metric: 'bookmarked_metric', metric: 'bookmarked_metric',
from: 'now-1h', from: 'now-1h',
to: 'now', to: 'now',
timezone,
'var-ds': 'prom-mock', 'var-ds': 'prom-mock',
'var-deployment_environment': ['undefined'], 'var-deployment_environment': ['undefined'],
'var-otel_resources': [''], 'var-otel_resources': [''],

View File

@ -4025,12 +4025,12 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@grafana/scenes-react@npm:5.22.1": "@grafana/scenes-react@npm:5.23.1":
version: 5.22.1 version: 5.23.1
resolution: "@grafana/scenes-react@npm:5.22.1" resolution: "@grafana/scenes-react@npm:5.23.1"
dependencies: dependencies:
"@grafana/e2e-selectors": "npm:^11.0.0" "@grafana/e2e-selectors": "npm:^11.0.0"
"@grafana/scenes": "npm:5.22.1" "@grafana/scenes": "npm:5.23.1"
react-use: "npm:17.4.0" react-use: "npm:17.4.0"
peerDependencies: peerDependencies:
"@grafana/data": ^11.0.0 "@grafana/data": ^11.0.0
@ -4039,13 +4039,13 @@ __metadata:
"@grafana/ui": ^11.0.0 "@grafana/ui": ^11.0.0
react: ^18.0.0 react: ^18.0.0
react-dom: ^18.0.0 react-dom: ^18.0.0
checksum: 10/7ef272c760bb8d92a9d91a5497996a4bef44915eb83f2807d3a8b19075b401ee90d31ea665f3bf60333d2d909e488cd88e54dc93ae2dd88e925045dc5c79f650 checksum: 10/83a17169e3382fa6d6e83ec3aec619b3591602fe8ab45bea883c293fc8460f1869596efe1f90758e364319c143345e3ef19015e684224c3325bf503d8ddeca6a
languageName: node languageName: node
linkType: hard linkType: hard
"@grafana/scenes@npm:5.22.1": "@grafana/scenes@npm:5.23.1":
version: 5.22.1 version: 5.23.1
resolution: "@grafana/scenes@npm:5.22.1" resolution: "@grafana/scenes@npm:5.23.1"
dependencies: dependencies:
"@floating-ui/react": "npm:0.26.16" "@floating-ui/react": "npm:0.26.16"
"@grafana/e2e-selectors": "npm:^11.0.0" "@grafana/e2e-selectors": "npm:^11.0.0"
@ -4062,7 +4062,7 @@ __metadata:
"@grafana/ui": ">=10.4" "@grafana/ui": ">=10.4"
react: ^18.0.0 react: ^18.0.0
react-dom: ^18.0.0 react-dom: ^18.0.0
checksum: 10/ebb5f887ee94ad9fa1f9d4bd7f9503502875e940380362c0f476e042eb421881585c122a1252b0567508b0e1415d78b928ba22a04adb5b93882f601b86105f76 checksum: 10/74cc74cc42102638ab3388e910242f3f641b325da5e42a2ab9bd18d9e6d14e55adbc93f25dcfad594ecc97003f1920c27b2e166e73e1a5f17459e0573615a1fd
languageName: node languageName: node
linkType: hard linkType: hard
@ -18932,8 +18932,8 @@ __metadata:
"@grafana/prometheus": "workspace:*" "@grafana/prometheus": "workspace:*"
"@grafana/runtime": "workspace:*" "@grafana/runtime": "workspace:*"
"@grafana/saga-icons": "workspace:*" "@grafana/saga-icons": "workspace:*"
"@grafana/scenes": "npm:5.22.1" "@grafana/scenes": "npm:5.23.1"
"@grafana/scenes-react": "npm:5.22.1" "@grafana/scenes-react": "npm:5.23.1"
"@grafana/schema": "workspace:*" "@grafana/schema": "workspace:*"
"@grafana/sql": "workspace:*" "@grafana/sql": "workspace:*"
"@grafana/tsconfig": "npm:^2.0.0" "@grafana/tsconfig": "npm:^2.0.0"