Skip to content

Commit 318ba9c

Browse files
author
Mattia Moretti
authored
Regex fix (#262)
* excepion when not set full vars * v5.1.1
1 parent 234d828 commit 318ba9c

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "oci-metrics-datasource",
33
"private": true,
4-
"version": "5.1.0",
4+
"version": "5.1.1",
55
"description": "Oracle Cloud Infrastructure Metrics Data Source for Grafana",
66
"scripts": {
77
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",

src/datasource.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,18 @@ export class OCIDataSource extends DataSourceWithBackend<OCIQuery, OCIDataSource
111111
interpolateProps<T extends Record<string, any>>(object: T, scopedVars: ScopedVars = {}): T {
112112
const templateSrv = getTemplateSrv();
113113
return Object.entries(object).reduce((acc, [key, value]) => {
114-
return {
115-
...acc,
116-
[key]: value && isString(value) ? templateSrv.replace(value, scopedVars) : value,
117-
};
114+
if (key === "compartment"){
115+
return {
116+
...acc,
117+
[key]: value && isString(value) ? templateSrv.replace(value, scopedVars, this.compartmentFormatter) : value,
118+
};
119+
} else {
120+
return {
121+
...acc,
122+
[key]: value && isString(value) ? templateSrv.replace(value, scopedVars) : value,
123+
};
124+
}
125+
118126
}, {} as T);
119127
}
120128

src/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
},
2424
{ "name": "UPL", "url": "https://oss.oracle.com/licenses/upl" }
2525
],
26-
"version": "5.1.0",
27-
"updated": "2024-03-07",
26+
"version": "5.1.1",
27+
"updated": "2024-03-08",
2828
"screenshots":[
2929
{
3030
"name":"OCI Metrics Dashboard",

0 commit comments

Comments
 (0)