From 39be438b73b9303172517a867ff7ddeeed57250b Mon Sep 17 00:00:00 2001 From: MGJamJam Date: Wed, 24 Jul 2024 15:15:47 -0300 Subject: [PATCH] format --- .github/workflows/ci.yml | 2 +- README.md | 30 +++++++++++----------- example_dashboard.json | 40 ++++++++--------------------- src/README.md | 28 ++++++++++---------- src/components/FilterRow.tsx | 2 +- src/components/GroupByRow.tsx | 2 +- src/components/OrderByRow.tsx | 2 +- src/components/QueryFilterInput.tsx | 3 +++ src/plugin.json | 10 ++++++-- 9 files changed, 54 insertions(+), 65 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dbcb60..7e9cf53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [ push ] +on: [push] permissions: read-all diff --git a/README.md b/README.md index 618aaaf..66af0a6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Add the plugin and acquire your Bitmovin Analytics API key from the [bitmovin da Configure the datasource: | Setting | Value | -|--------------|----------------------------------------------------------| +| ------------ | -------------------------------------------------------- | | URL | `https://api.bitmovin.com/v1` | | API Key | Your API key | | Ad Analytics | If checked, the datasource is switched to query ads data | @@ -27,18 +27,18 @@ See the [example_dashboard.json](example_dashboard.json) for a demo. Configure t Add a new panel and select the bitmovin analytics datasource. Configure the metric with following settings: -| Setting | Description | -|------------------------|------------------------------------------------------------------------------------------| -| License* | Your analytics license | -| Metric* | Aggregation method to use, e.g. `count`, `sum` | -| Dimension* | Dimension to aggregate over | -| Filter | Apply filters to the query | -| Format as time series* | Check the switch to see time series data | -| Group By | Group query by dimension and plot as individual time series | -| Order By | Order query ascending or descending by dimension | -| Limit | Limit the result to given number | -| Interval* | Time granularity of queries, select `AUTO` to automatically adapt to selected time range | -| Alias By | Set the name of series (only visible with multiple queries in one Graph) | +| Setting | Description | +| ----------------------- | ---------------------------------------------------------------------------------------- | +| License\* | Your analytics license | +| Metric\* | Aggregation method to use, e.g. `count`, `sum` | +| Dimension\* | Dimension to aggregate over | +| Filter | Apply filters to the query | +| Format as time series\* | Check the switch to see time series data | +| Group By | Group query by dimension and plot as individual time series | +| Order By | Order query ascending or descending by dimension | +| Limit | Limit the result to given number | +| Interval\* | Time granularity of queries, select `AUTO` to automatically adapt to selected time range | +| Alias By | Set the name of series (only visible with multiple queries in one Graph) | Settings marked with `*` are required for the time series graph. @@ -52,7 +52,7 @@ Configure the metric as described in [Time Series Graph](#time-series-graph) but ## Gauges -Configure the Gauge's `Value Options`, depending on your query. +Configure the Gauge's `Value Options`, depending on your query. - For table data (`Format as time series` option **unchecked**) for the `Show` option select `All Values`. - For time series data (`Format as time series` option **checked**) for the `Show` option select `Calculate` and choose a reducer function. @@ -61,7 +61,7 @@ Configure the Gauge's `Value Options`, depending on your query. Please refer to our [Documentation](https://developer.bitmovin.com/playback/docs/integrating-bitmovin-analytics-with-grafana) and [Analytics Api Reference](https://developer.bitmovin.com/playback/reference/overview) for more information or reach out to us at [bitmovin.com](https://bitmovin.com/contact-bitmovin/). ------ +--- ## Development diff --git a/example_dashboard.json b/example_dashboard.json index e06ddec..fc14ed2 100644 --- a/example_dashboard.json +++ b/example_dashboard.json @@ -621,9 +621,7 @@ "value": "0" } ], - "groupBy": [ - "BROWSER" - ], + "groupBy": ["BROWSER"], "interval": "AUTO", "license": "", "metric": "count", @@ -723,9 +721,7 @@ "value": "0" } ], - "groupBy": [ - "COUNTRY" - ], + "groupBy": ["COUNTRY"], "interval": "AUTO", "license": "", "metric": "count", @@ -781,9 +777,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true @@ -800,9 +794,7 @@ "value": "0" } ], - "groupBy": [ - "PLAYER_TECH" - ], + "groupBy": ["PLAYER_TECH"], "interval": "AUTO", "license": "", "metric": "count", @@ -863,9 +855,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true @@ -882,9 +872,7 @@ "value": "0" } ], - "groupBy": [ - "OPERATINGSYSTEM" - ], + "groupBy": ["OPERATINGSYSTEM"], "interval": "AUTO", "license": "", "limit": 10, @@ -946,9 +934,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true @@ -959,9 +945,7 @@ "datasource": {}, "dimension": "IMPRESSION_ID", "filter": [], - "groupBy": [ - "BROWSER" - ], + "groupBy": ["BROWSER"], "interval": "AUTO", "license": "", "limit": 10, @@ -1023,9 +1007,7 @@ "footer": { "countRows": false, "fields": "", - "reducer": [ - "sum" - ], + "reducer": ["sum"], "show": false }, "showHeader": true @@ -1036,9 +1018,7 @@ "datasource": {}, "dimension": "IMPRESSION_ID", "filter": [], - "groupBy": [ - "COUNTRY" - ], + "groupBy": ["COUNTRY"], "interval": "AUTO", "license": "", "limit": 10, diff --git a/src/README.md b/src/README.md index 7cbe264..55009f2 100644 --- a/src/README.md +++ b/src/README.md @@ -11,7 +11,7 @@ Add the plugin and acquire your Bitmovin Analytics API key from the [bitmovin da Configure the datasource: | Setting | Value | -|--------------|----------------------------------------------------------| +| ------------ | -------------------------------------------------------- | | URL | `https://api.bitmovin.com/v1` | | API Key | Your API key | | Ad Analytics | If checked, the datasource is switched to query ads data | @@ -27,18 +27,18 @@ See the [example_dashboard.json](example_dashboard.json) for a demo. Configure t Add a new panel and select the bitmovin analytics datasource. Configure the metric with following settings: -| Setting | Description | -|------------------------|------------------------------------------------------------------------------------------| -| License* | Your analytics license | -| Metric* | Aggregation method to use, e.g. `count`, `sum` | -| Dimension* | Dimension to aggregate over | -| Filter | Apply filters to the query | -| Format as time series* | Check the switch to see time series data | -| Group By | Group query by dimension and plot as individual time series | -| Order By | Order query ascending or descending by dimension | -| Limit | Limit the result to given number | -| Interval* | Time granularity of queries, select `AUTO` to automatically adapt to selected time range | -| Alias By | Set the name of series (only visible with multiple queries in one Graph) | +| Setting | Description | +| ----------------------- | ---------------------------------------------------------------------------------------- | +| License\* | Your analytics license | +| Metric\* | Aggregation method to use, e.g. `count`, `sum` | +| Dimension\* | Dimension to aggregate over | +| Filter | Apply filters to the query | +| Format as time series\* | Check the switch to see time series data | +| Group By | Group query by dimension and plot as individual time series | +| Order By | Order query ascending or descending by dimension | +| Limit | Limit the result to given number | +| Interval\* | Time granularity of queries, select `AUTO` to automatically adapt to selected time range | +| Alias By | Set the name of series (only visible with multiple queries in one Graph) | Settings marked with `*` are required for the time series graph. @@ -52,7 +52,7 @@ Configure the metric as described in [Time Series Graph](#time-series-graph) but ## Gauges -Configure the Gauge's `Value Options`, depending on your query. +Configure the Gauge's `Value Options`, depending on your query. - For table data (`Format as time series` option **unchecked**) for the `Show` option select `All Values`. - For time series data (`Format as time series` option **checked**) for the `Show` option select `Calculate` and choose a reducer function. diff --git a/src/components/FilterRow.tsx b/src/components/FilterRow.tsx index 1a085e6..f7ec5b2 100644 --- a/src/components/FilterRow.tsx +++ b/src/components/FilterRow.tsx @@ -17,7 +17,7 @@ type Props = { export function FilterRow(props: Props) { const [hasNewQueryFilter, setHasNewQueryFilter] = useState(false); - const paddingTop= props.filters.length === 0 ? 4 : 0 + const paddingTop = props.filters.length === 0 ? 4 : 0; function handleQueryFilterDelete(queryFilterIndex: number) { const newQueryFilters = [...props.filters]; diff --git a/src/components/GroupByRow.tsx b/src/components/GroupByRow.tsx index f0516c8..f6f5da9 100644 --- a/src/components/GroupByRow.tsx +++ b/src/components/GroupByRow.tsx @@ -44,7 +44,7 @@ type Props = { }; export function GroupByRow(props: Props) { - const paddingTop= props.groupBys.length === 0 ? 4 : 0 + const paddingTop = props.groupBys.length === 0 ? 4 : 0; const deleteGroupByInput = (index: number) => { const newSelectedGroupBys = [...props.groupBys]; newSelectedGroupBys.splice(index, 1); diff --git a/src/components/OrderByRow.tsx b/src/components/OrderByRow.tsx index cad605e..6e67169 100644 --- a/src/components/OrderByRow.tsx +++ b/src/components/OrderByRow.tsx @@ -46,7 +46,7 @@ type Props = { }; export function OrderByRow(props: Props) { - const paddingTop= props.orderBys.length === 0 ? 4 : 0 + const paddingTop = props.orderBys.length === 0 ? 4 : 0; const deleteOrderByInput = (index: number) => { const newOrderBys = [...props.orderBys]; newOrderBys.splice(index, 1); diff --git a/src/components/QueryFilterInput.tsx b/src/components/QueryFilterInput.tsx index 187dccc..d48f60c 100644 --- a/src/components/QueryFilterInput.tsx +++ b/src/components/QueryFilterInput.tsx @@ -10,8 +10,11 @@ import { convertFilterValueToProperType } from 'utils/filterUtils'; interface QueryFilterInputProps { /** `undefined` when component is used to create new filter (no values yet) */ value: undefined | QueryFilter; + onChange(queryFilter: QueryFilter): void; + onDelete(): void; + isAdAnalytics: boolean; /** Selected query filters are used to filter out used values from attribute select options */ selectedQueryFilters: QueryFilter[]; diff --git a/src/plugin.json b/src/plugin.json index a7be010..cba2910 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -16,8 +16,14 @@ "large": "img/logo.svg" }, "links": [ - {"name": "Project site", "url": "https://github.com/bitmovin/analytics-grafana-datasource"}, - {"name": "Apache License", "url": "https://github.com/bitmovin/analytics-grafana-datasource/blob/main/LICENSE"} + { + "name": "Project site", + "url": "https://github.com/bitmovin/analytics-grafana-datasource" + }, + { + "name": "Apache License", + "url": "https://github.com/bitmovin/analytics-grafana-datasource/blob/main/LICENSE" + } ], "screenshots": [], "version": "%VERSION%",