@grafana/scenes 3.13.4--canary.648.8346644660.0 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/esm/components/VizPanel/VizPanelMenu.js +1 -3
- package/dist/esm/components/VizPanel/VizPanelMenu.js.map +1 -1
- package/dist/esm/components/layout/grid/SceneGridRow.js +1 -3
- package/dist/esm/components/layout/grid/SceneGridRow.js.map +1 -1
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/querying/SceneDataTransformer.js +33 -10
- package/dist/esm/querying/SceneDataTransformer.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +8 -4
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +0 -3
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.js +41 -18
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4539,7 +4539,6 @@ function VariableValueSelect({ model }) {
|
|
|
4539
4539
|
tabSelectsValue: false,
|
|
4540
4540
|
onInputChange,
|
|
4541
4541
|
options: model.getOptionsForSelect(),
|
|
4542
|
-
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`),
|
|
4543
4542
|
onChange: (newValue) => {
|
|
4544
4543
|
model.changeValueTo(newValue.value, newValue.label);
|
|
4545
4544
|
}
|
|
@@ -4576,7 +4575,6 @@ function VariableValueSelectMulti({ model }) {
|
|
|
4576
4575
|
onBlur: () => {
|
|
4577
4576
|
model.changeValueTo(uncommittedValue);
|
|
4578
4577
|
},
|
|
4579
|
-
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`),
|
|
4580
4578
|
onChange: (newValue, action) => {
|
|
4581
4579
|
if (action.action === "clear" && noValueOnClear) {
|
|
4582
4580
|
model.changeValueTo([]);
|
|
@@ -5377,10 +5375,14 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
|
5377
5375
|
if (comparer) {
|
|
5378
5376
|
const secondaryTimeRange = comparer.getCompareTimeRange(primaryTimeRange);
|
|
5379
5377
|
if (secondaryTimeRange) {
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5378
|
+
const secondaryTargets = request.targets.filter((query) => query.timeRangeCompare !== false);
|
|
5379
|
+
if (secondaryTargets.length) {
|
|
5380
|
+
secondaryRequest = __spreadProps$b(__spreadValues$l({}, request), {
|
|
5381
|
+
targets: secondaryTargets,
|
|
5382
|
+
range: secondaryTimeRange,
|
|
5383
|
+
requestId: getNextRequestId()
|
|
5384
|
+
});
|
|
5385
|
+
}
|
|
5384
5386
|
request = __spreadProps$b(__spreadValues$l({}, request), {
|
|
5385
5387
|
range: primaryTimeRange
|
|
5386
5388
|
});
|
|
@@ -5856,8 +5858,20 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
|
5856
5858
|
return this._results;
|
|
5857
5859
|
}
|
|
5858
5860
|
transform(data$1) {
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
+
var _a;
|
|
5862
|
+
const seriesTransformations = this.state.transformations.filter((transformation) => {
|
|
5863
|
+
if ("options" in transformation || "topic" in transformation) {
|
|
5864
|
+
return transformation.topic == null || transformation.topic === data.DataTopic.Series;
|
|
5865
|
+
}
|
|
5866
|
+
return true;
|
|
5867
|
+
}).map((transformation) => "operator" in transformation ? transformation.operator : transformation);
|
|
5868
|
+
const annotationsTransformations = this.state.transformations.filter((transformation) => {
|
|
5869
|
+
if ("options" in transformation || "topic" in transformation) {
|
|
5870
|
+
return transformation.topic === data.DataTopic.Annotations;
|
|
5871
|
+
}
|
|
5872
|
+
return false;
|
|
5873
|
+
}).map((transformation) => "operator" in transformation ? transformation.operator : transformation);
|
|
5874
|
+
if (this.state.transformations.length === 0 || !data$1) {
|
|
5861
5875
|
this.setState({ data: data$1 });
|
|
5862
5876
|
if (data$1) {
|
|
5863
5877
|
this._results.next({ origin: this, data: data$1 });
|
|
@@ -5869,16 +5883,27 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
|
5869
5883
|
}
|
|
5870
5884
|
const ctx = {
|
|
5871
5885
|
interpolate: (value) => {
|
|
5872
|
-
var
|
|
5873
|
-
return sceneGraph.interpolate(this, value, (
|
|
5886
|
+
var _a2;
|
|
5887
|
+
return sceneGraph.interpolate(this, value, (_a2 = data$1.request) == null ? void 0 : _a2.scopedVars);
|
|
5874
5888
|
}
|
|
5875
5889
|
};
|
|
5876
|
-
|
|
5877
|
-
|
|
5890
|
+
const seriesStream = data.transformDataFrame(seriesTransformations, data$1.series, ctx);
|
|
5891
|
+
const annotationsStream = data.transformDataFrame(annotationsTransformations, (_a = data$1.annotations) != null ? _a : [], ctx);
|
|
5892
|
+
let transformedData = __spreadValues$j({}, data$1);
|
|
5893
|
+
this._transformSub = rxjs.merge(annotationsStream, seriesStream).pipe(
|
|
5894
|
+
rxjs.map((frames) => {
|
|
5895
|
+
const isAnnotations = frames.some((f) => {
|
|
5896
|
+
var _a2;
|
|
5897
|
+
return ((_a2 = f.meta) == null ? void 0 : _a2.dataTopic) === data.DataTopic.Annotations;
|
|
5898
|
+
});
|
|
5899
|
+
const transformed = isAnnotations ? { annotations: frames } : { series: frames };
|
|
5900
|
+
transformedData = __spreadValues$j(__spreadValues$j({}, transformedData), transformed);
|
|
5901
|
+
return transformedData;
|
|
5902
|
+
}),
|
|
5878
5903
|
rxjs.catchError((err) => {
|
|
5879
|
-
var
|
|
5904
|
+
var _a2;
|
|
5880
5905
|
console.error("Error transforming data: ", err);
|
|
5881
|
-
const sourceErr = ((
|
|
5906
|
+
const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
|
|
5882
5907
|
const transformationError = runtime.toDataQueryError(err);
|
|
5883
5908
|
transformationError.message = `Error transforming data: ${transformationError.message}`;
|
|
5884
5909
|
const result = __spreadProps$9(__spreadValues$j({}, data$1), {
|
|
@@ -7420,8 +7445,7 @@ function VizPanelMenuRenderer({ model }) {
|
|
|
7420
7445
|
childItems: item.subMenu ? renderItems(item.subMenu) : void 0,
|
|
7421
7446
|
url: item.href,
|
|
7422
7447
|
onClick: item.onClick,
|
|
7423
|
-
shortcut: item.shortcut
|
|
7424
|
-
testId: e2eSelectors.selectors.components.Panels.Panel.menuItems(item.text)
|
|
7448
|
+
shortcut: item.shortcut
|
|
7425
7449
|
})
|
|
7426
7450
|
);
|
|
7427
7451
|
};
|
|
@@ -8011,8 +8035,7 @@ function SceneGridRowRenderer({ model }) {
|
|
|
8011
8035
|
}, /* @__PURE__ */ React__default["default"].createElement("button", {
|
|
8012
8036
|
onClick: model.onCollapseToggle,
|
|
8013
8037
|
className: styles.rowTitleButton,
|
|
8014
|
-
"aria-label": isCollapsed ? "Expand row" : "Collapse row"
|
|
8015
|
-
"data-testid": e2eSelectors.selectors.components.DashboardRow.title(sceneGraph.interpolate(model, title, void 0, "text"))
|
|
8038
|
+
"aria-label": isCollapsed ? "Expand row" : "Collapse row"
|
|
8016
8039
|
}, isCollapsible && /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
|
|
8017
8040
|
name: isCollapsed ? "angle-right" : "angle-down"
|
|
8018
8041
|
}), /* @__PURE__ */ React__default["default"].createElement("span", {
|