Skip to content

Commit

Permalink
Merge pull request #122 from GridProtectionAlliance/feature/v4.0.0
Browse files Browse the repository at this point in the history
Feature/v4.0.0
  • Loading branch information
elwills authored May 2, 2023
2 parents 529f29f + 77ee544 commit cde71b2
Show file tree
Hide file tree
Showing 18 changed files with 952 additions and 522 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@
- Improved raw query processing
- Added variable support in raw query
- Fixed annotations support
- Updated to Grafana plugin SDK v9.4.3
- Updated to Grafana plugin SDK v9.4.7
- Fixed PI AF calculation
- Added plugin screenshots
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ Creating an annotation query and use the Event Frame category as the query strin
Color and regex replacement strings for the name are supported.

For example:
![event-frame-setup-1](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/event_frame_setup_1.png)
![event-frame-setup-2](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/event_frame_setup_2.png)
![annotations](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/annotations.png)


# Installation
Expand Down
3 changes: 1 addition & 2 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ Creating an annotation query and use the Event Frame category as the query strin
Color and regex replacement strings for the name are supported.

For example:
![event-frame-setup-1](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/event_frame_setup_1.png)
![event-frame-setup-2](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/event_frame_setup_2.png)
![annotations](https://github.com/GridProtectionAlliance/osisoftpi-grafana/raw/master/docs/img/annotations.png)


# Installation
Expand Down
2 changes: 1 addition & 1 deletion dist/module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/module.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@
"url": "https://www.osisoft.com/pi-system"
}
],
"screenshots": [],
"screenshots": [
{"name": "Query Editor", "path": "img/configurator.png"},
{"name": "Datasource Configuration", "path": "img/configuration.png"},
{"name": "Annotations Editor", "path": "img/annotations.png"}
],
"version": "4.0.0",
"updated": "2023-04-03"
"updated": "2023-05-02"
},
"dependencies": {
"grafanaDependency": ">=8.4.0",
Expand Down
Binary file added docs/img/annotations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/configurator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"author": "GridProtectionAlliance",
"license": "Apache-2.0",
"devDependencies": {
"@grafana/data": "^9.4.3",
"@grafana/runtime": "^9.4.3",
"@grafana/toolkit": "^9.4.3",
"@grafana/ui": "^9.4.3",
"@grafana/data": "^9.4.7",
"@grafana/runtime": "^9.4.7",
"@grafana/toolkit": "^9.4.7",
"@grafana/ui": "^9.4.7",
"@testing-library/jest-dom": "5.4.0",
"@testing-library/react": "^10.0.2",
"@types/lodash": "latest"
Expand Down
4 changes: 2 additions & 2 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ export class PiWebAPIDatasource extends DataSourceApi<PIWebAPIQuery, PIWebAPIDat
): PiwebapTargetRsp[] {
const api = this;
const isSummary: boolean = target.summary && target.summary.types && target.summary.types.length > 0;
if (!target.isPiPoint && !target.display) {
if (!target.isPiPoint && !target.display && content.Path) {
if (api.newFormatConfig) {
name = (noTemplate ? getLastPath(content.Path) : getPath(target.elementPathArray, content.Path)) + '|' + name;
} else {
Expand Down Expand Up @@ -739,7 +739,7 @@ export class PiWebAPIDatasource extends DataSourceApi<PIWebAPIQuery, PIWebAPIDat
results.push(
ds.restGetWebId(target.elementPath, false).then((webidresponse: PiwebapiRsp) => {
return ds
.restPost(url + webidresponse.WebId)
.restPost(url + '&webId=' + webidresponse.WebId)
.then((response: any) =>
ds.processResults(response.data, target, displayName || targetName, false, webidresponse)
)
Expand Down
4 changes: 2 additions & 2 deletions src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ export function getLastPath(path: string): string {
* @returns {string} last item of the element path
*/
export function getPath(elementPathArray: PiwebapiElementPath[], path: string): string {
const splitStr = getLastPath(path);
if (elementPathArray.length === 0) {
if (!path || elementPathArray.length === 0) {
return '';
}
const splitStr = getLastPath(path);
const foundElement = elementPathArray.find((e) => path.indexOf(e.path) >= 0)?.variable;
return foundElement ? foundElement + '|' + splitStr : splitStr;
}
Expand Down
Binary file added src/img/annotations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/configurator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
"url": "https://www.osisoft.com/pi-system"
}
],
"screenshots": [],
"screenshots": [
{"name": "Query Editor", "path": "img/configurator.png"},
{"name": "Datasource Configuration", "path": "img/configuration.png"},
{"name": "Annotations Editor", "path": "img/annotations.png"}
],
"version": "%VERSION%",
"updated": "%TODAY%"
},
Expand Down
2 changes: 1 addition & 1 deletion src/query/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ export class PIWebAPIQueryEditor extends PureComponent<Props, State> {
} else if (isPiPoint && segmentsArray.length > 0) {
this.piServer = segmentsArray;
}
this.updateArray(segmentsArray, attributesArray, summariesArray, true, () => {
this.updateArray(segmentsArray, attributesArray, summariesArray, !!isPiPoint, () => {
this.onChange(query);
});
};
Expand Down
Loading

0 comments on commit cde71b2

Please sign in to comment.