IO-1140 Added release notes integration.

This commit is contained in:
Patrick Fic
2021-06-03 10:02:04 -07:00
parent 786d76bb73
commit 95ba0e1f8a
10 changed files with 142 additions and 54 deletions

View File

@@ -1,6 +1,6 @@
import { AlertOutlined } from "@ant-design/icons";
import * as Sentry from "@sentry/react";
import { Button, notification } from "antd";
import { Button, notification, Space } from "antd";
//import "antd/dist/antd.css";
import "antd/dist/antd.less";
import Dinero from "dinero.js";
@@ -26,8 +26,7 @@ Dinero.globalRoundingMode = "HALF_EVEN";
if (process.env.NODE_ENV !== "development") {
Sentry.init({
dsn:
"https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
dsn: "https://fd7e89369b6b4bdc9c6c4c9f22fa4ee4@o492140.ingest.sentry.io/5651027",
integrations: [
// new Integrations.BrowserTracing(),
// new Sentry.Integrations.Breadcrumbs({ console: true }),
@@ -57,21 +56,30 @@ const onServiceWorkerUpdate = (registration) => {
console.log("onServiceWorkerUpdate", registration);
const btn = (
<Button
type="primary"
onClick={async () => {
if (registration && registration.waiting) {
await registration.unregister();
// Makes Workbox call skipWaiting()
registration.waiting.postMessage({ type: "SKIP_WAITING" });
// Once the service worker is unregistered, we can reload the page to let
// the browser download a fresh copy of our app (invalidating the cache)
window.location.reload();
}
}}
>
{i18n.t("general.actions.refresh")}
</Button>
<Space flex>
<Button
onClick={async () => {
window.open("https://imex-online.noticeable.news/", "_blank");
}}
>
{i18n.t("general.actions.viewreleasenotes")}
</Button>
<Button
type="primary"
onClick={async () => {
if (registration && registration.waiting) {
await registration.unregister();
// Makes Workbox call skipWaiting()
registration.waiting.postMessage({ type: "SKIP_WAITING" });
// Once the service worker is unregistered, we can reload the page to let
// the browser download a fresh copy of our app (invalidating the cache)
window.location.reload();
}
}}
>
{i18n.t("general.actions.refresh")}
</Button>
</Space>
);
notification.open({
icon: <AlertOutlined />,