Skip to content

Commit

Permalink
Update to Grafana 9.4.7 (#34)
Browse files Browse the repository at this point in the history
* Update CI and Release workflows

* Update to Grafana 9.4.7

* Update README.md
  • Loading branch information
mikhail-vl authored Mar 24, 2023
1 parent 2a49fa2 commit b7fcf3e
Show file tree
Hide file tree
Showing 7 changed files with 1,149 additions and 1,040 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

### Features / Enhancements

- Update CI and Release workflows (#32)
- Update CI and Release workflows (#33)
- Update to Grafana 9.4.7 (#34)

## 2.1.0 (2022-12-29)

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

![Screenshot](https://github.com/volkovlabs/volkovlabs-static-datasource/raw/main/src/img/dark.png)

[![Grafana 9](https://img.shields.io/badge/Grafana-9.3.2-orange)](https://www.grafana.com)
[![YouTube](https://img.shields.io/badge/YouTube-Playlist-red)](https://youtube.com/playlist?list=PLPow72ygztmSOuCRtS85zolztwDMpCsIV)
[![Documentation](https://img.shields.io/badge/Documentation-blue)](https://volkovlabs.io/plugins/volkovlabs-static-datasource/)
[![Grafana 9](https://img.shields.io/badge/Grafana-9.4.7-orange)](https://www.grafana.com)
![CI](https://github.com/volkovlabs/volkovlabs-static-datasource/workflows/CI/badge.svg)
[![codecov](https://codecov.io/gh/VolkovLabs/volkovlabs-static-datasource/branch/main/graph/badge.svg?token=0m6f0ktUar)](https://codecov.io/gh/VolkovLabs/volkovlabs-static-datasource)
[![CodeQL](https://github.com/VolkovLabs/volkovlabs-static-datasource/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/VolkovLabs/volkovlabs-static-datasource/actions/workflows/codeql-analysis.yml)

## Introduction

The Static Data Source is a plugin for Grafana that allows to store and emulate your data.
The Static Data Source is a plugin for Grafana that allows storing and emulating your data.

[![Static data source for Grafana | Mimic any data source | Tutorial and examples](https://raw.githubusercontent.com/volkovlabs/volkovlabs-static-datasource/main/img/video.png)](https://youtu.be/QOV8ECOUjWs)

### Requirements
## Requirements

- **Grafana 8.5+**, **Grafana 9.0+** is required for version 2.X.
- **Grafana 7.3+** is required for version 1.X.
- **Grafana 8.5+**, **Grafana 9.0+** is required for major version 2.
- **Grafana 7.3+** is required for major version 1.

## Getting Started

The Static Data Source can be installed from the [Grafana Catalog](https://grafana.com/grafana/plugins/marcusolsson-static-datasource/) or use the `grafana-cli` tool to install from the command line:
The Static Data Source can be installed from the [Grafana Catalog](https://grafana.com/grafana/plugins/marcusolsson-static-datasource/) or utilizing the Grafana command line tool.

For the latter, use the following command.

```bash
grafana-cli plugins install marcusolsson-static-datasource
Expand All @@ -36,7 +36,7 @@ grafana-cli plugins install marcusolsson-static-datasource
- Supports variables in the text fields.
- Uses Number input for Number, Date Time Picker for Time fields.
- Uses Text Area for String inputs with more than 100 symbols.
- Allows to temporary hide values for specific fields.
- Allows to temporarily hide values for specific fields.

## Documentation

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"author": "Volkov Labs",
"description": "Static Data Source for Grafana",
"devDependencies": {
"@grafana/data": "9.3.2",
"@grafana/runtime": "9.3.2",
"@grafana/toolkit": "9.3.2",
"@grafana/ui": "9.3.2",
"@grafana/data": "9.4.7",
"@grafana/runtime": "9.4.7",
"@grafana/toolkit": "9.4.7",
"@grafana/ui": "9.4.7",
"@types/enzyme": "^3.10.12",
"@types/enzyme-adapter-react-16": "^1.0.6",
"enzyme": "^3.11.0",
Expand Down
9 changes: 4 additions & 5 deletions src/components/ValueInput/ValueInput.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useState } from 'react';
import { DateTime, dateTime, FieldType } from '@grafana/data';
import { DateTimePicker, Icon, InlineField, Input, TextArea, useTheme2 } from '@grafana/ui';
import { DateTimePicker, Icon, InlineField, Input, TextArea, useStyles2 } from '@grafana/ui';
import { TextAreaLength } from '../../constants';
import { getStyles } from '../../styles';
import { Styles } from '../../styles';
import { NullableString } from '../../types';
import { verifyFieldValue } from '../../utils';

Expand Down Expand Up @@ -42,10 +42,9 @@ interface Props {
*/
export const ValueInput: React.FC<Props> = ({ onChange, value, type, label }) => {
/**
* Styles and Theme
* Styles
*/
const theme = useTheme2();
const styles = getStyles(theme);
const styles = useStyles2(Styles);

/**
* Save the last value so we can toggle between null.
Expand Down
4 changes: 0 additions & 4 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
{
"name": "GitHub",
"url": "https://github.com/volkovlabs/volkovlabs-static-datasource"
},
{
"name": "YouTube Playlist",
"url": "https://youtube.com/playlist?list=PLPow72ygztmSOuCRtS85zolztwDMpCsIV"
}
],
"logos": {
Expand Down
2 changes: 1 addition & 1 deletion src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GrafanaTheme2 } from '@grafana/data';
/**
* Styles
*/
export const getStyles = (theme: GrafanaTheme2) => ({
export const Styles = (theme: GrafanaTheme2) => ({
suffixElement: css`
&:hover {
cursor: pointer;
Expand Down
Loading

0 comments on commit b7fcf3e

Please sign in to comment.