From f11fd84c8b3de843d07050135689cc80814dbe6a Mon Sep 17 00:00:00 2001
From: Yulia Shanyrova
Date: Tue, 7 Jun 2022 12:10:59 +0200
Subject: [PATCH 1/3] Retry button returned, infobox has been changed
---
.../PluginConfigPage.module.css | 8 +--
.../PluginConfigPage/PluginConfigPage.tsx | 61 +++++++++++++------
2 files changed, 47 insertions(+), 22 deletions(-)
diff --git a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
index 8996189b..2cca3ca5 100644
--- a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
+++ b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
@@ -1,7 +1,7 @@
-.delete_configuration_button {
- margin-top: 20px;
-}
-
.command-line {
width: 100%;
}
+
+.info-block {
+ margin-bottom: 24px;
+}
diff --git a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
index b83170a4..c105fb05 100644
--- a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
+++ b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
@@ -19,6 +19,7 @@ import cn from 'classnames/bind';
import CopyToClipboard from 'react-copy-to-clipboard';
import { OnCallAppSettings } from 'types';
+import Block from 'components/GBlock/Block';
import Text from 'components/Text/Text';
import WithConfirm from 'components/WithConfirm/WithConfirm';
import logo from 'img/logo.svg';
@@ -218,27 +219,31 @@ export const PluginConfigPage = (props: Props) => {
)}
+ {'Plugin <-> backend connection status'}
+
+ {pluginStatusMessage}
+
- {isSelfHostedInstall ? (
-
-
{'Plugin <-> backend connection status:'}
+
+ {/* {'Plugin <-> backend connection status'}
{pluginStatusMessage}
-
+ */}
+ {retrySync && (
+
+ )}
+ {isSelfHostedInstall ? (
-
-
- ) : (
-
- )}
+ ) : (
+
+ )}{' '}
+
>
) : (
@@ -285,6 +290,21 @@ export const PluginConfigPage = (props: Props) => {
+
+
+ Need help?
+
+ 1. Talk to the developers in the #grafana-oncall channel at{' '}
+
+ Slack
+
+
+ 2. Search for issues or create a new one in the{' '}
+
+ GitHub
+
+
+
2. Conect the backend and the plugin
{'Plugin <-> backend connection status:'}
@@ -308,10 +328,15 @@ Seek for such a line: “Your invite token: <> , use it in the Graf
+ It should be rechable from Grafana. Possible options:
+ http://host.docker.internal:8000 (if you run backend in the docker locally)
+
+ http://localhost:8000
+ ...
+
+ }
>
From 36e71acf438c744a382a3452b11c21a85fbafc52 Mon Sep 17 00:00:00 2001
From: Yulia Shanyrova
Date: Thu, 9 Jun 2022 11:56:27 +0200
Subject: [PATCH 2/3] Removed dublicating information
---
.../PluginConfigPage/PluginConfigPage.tsx | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
index c105fb05..4295c72e 100644
--- a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
+++ b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
@@ -249,22 +249,7 @@ export const PluginConfigPage = (props: Props) => {
This page will help you to connect OnCall backend and OnCall Grafana plugin 👋
-
-
- - Talk to the OnCall team in the #grafana-oncall channel at{' '}
-
- Slack
-
-
- Ask questions at{' '}
-
- GitHub Discussions
- {' '}
- or file bugs at{' '}
-
- GitHub Issues
-
-
-
+
1. Launch backend
From 1070fc0bd351eb9d9bf5983c9cb979d3560f25a0 Mon Sep 17 00:00:00 2001
From: Yulia Shanyrova
Date: Fri, 10 Jun 2022 20:05:36 +0200
Subject: [PATCH 3/3] Grafana URL saved at localstorage, confirmation window
deleted
---
.../PluginConfigPage.module.css | 1 +
.../PluginConfigPage/PluginConfigPage.tsx | 44 ++-----------------
2 files changed, 5 insertions(+), 40 deletions(-)
diff --git a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
index 2cca3ca5..d0eafdf8 100644
--- a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
+++ b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.module.css
@@ -4,4 +4,5 @@
.info-block {
margin-bottom: 24px;
+ margin-top: 24px;
}
diff --git a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
index f77c7dc1..a76af84c 100644
--- a/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
+++ b/grafana-plugin/src/containers/PluginConfigPage/PluginConfigPage.tsx
@@ -35,23 +35,20 @@ const cx = cn.bind(styles);
interface Props extends PluginConfigPageProps> {}
export const PluginConfigPage = (props: Props) => {
+ const grafanaUrlDefault = getItem('grafanaUrl') || window.location.origin;
const { plugin } = props;
const [onCallApiUrl, setOnCallApiUrl] = useState(getItem('onCallApiUrl'));
const [onCallInvitationToken, setOnCallInvitationToken] = useState();
- const [grafanaUrl, setGrafanaUrl] = useState(window.location.origin);
+ const [grafanaUrl, setGrafanaUrl] = useState(grafanaUrlDefault);
const [pluginConfigLoading, setPluginConfigLoading] = useState(true);
const [pluginStatusOk, setPluginStatusOk] = useState();
const [pluginStatusMessage, setPluginStatusMessage] = useState();
const [isSelfHostedInstall, setIsSelfHostedInstall] = useState(true);
const [retrySync, setRetrySync] = useState(false);
- const [showConfirmationModal, setShowConfirmationModal] = useState(false);
- const configurePlugin = () => {
- setShowConfirmationModal(true);
- };
const setupPlugin = useCallback(async () => {
setItem('onCallApiUrl', onCallApiUrl);
- setShowConfirmationModal(false);
+ setItem('grafanaUrl', grafanaUrl);
await getBackendSrv().post(`/api/plugins/grafana-oncall-app/settings`, {
enabled: true,
pinned: true,
@@ -258,21 +255,6 @@ export const PluginConfigPage = (props: Props) => {
getting started.
-
- Or run the local one:
-
-
- {
- openNotification('Grafana OnCall command copied');
- }}
- >
-
- {' '}
- docker build -t grafana/amixr-all-in-one -f Dockerfile.all-in-one .
-
-
@@ -329,32 +311,14 @@ Seek for such a line: “Your invite token: <> , use it in the Graf
- {/* */}
Connect
- {/* */}
- {showConfirmationModal && (
- setShowConfirmationModal(false)}
- >
-
-
- Continue
-
- setShowConfirmationModal(false)}>
- Cancel
-
-
-
- )}
)}