From 35c14d71e313bf1b19c32b7973b55c4d0757f16f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Sza=C5=82owski?=
Date: Tue, 6 Aug 2024 12:53:44 +0200
Subject: [PATCH] feat: replace hardcoded sanchonet with the network from
network metrics
---
CHANGELOG.md | 4 +-
README.md | 9 +-
docs/operations/README.md | 45 +-
govtool/frontend/.storybook/preview.tsx | 52 +-
govtool/frontend/index.html | 2 +-
govtool/frontend/maintenance-page/index.html | 10 +-
.../molecules/AutomatedVotingCard.tsx | 5 +-
.../molecules/DashboardActionCard.tsx | 4 +-
.../molecules/GovernanceActionCardMyVote.tsx | 6 +-
.../WhatRetirementMeans.tsx | 5 +-
.../organisms/RegisterAsDirectVoterBox.tsx | 5 +-
govtool/frontend/src/consts/images.ts | 2 +-
govtool/frontend/src/consts/index.ts | 12 +
govtool/frontend/src/context/appContext.tsx | 68 +
.../frontend/src/context/contextProviders.tsx | 25 +-
govtool/frontend/src/context/index.ts | 1 +
govtool/frontend/src/context/wallet.tsx | 31 +-
.../forms/useCreateGovernanceActionForm.ts | 5 +-
.../src/hooks/forms/useEditDRepInfoForm.ts | 5 +-
.../src/hooks/forms/useRegisterAsdRepForm.tsx | 5 +-
.../src/hooks/queries/useGetNetworkMetrics.ts | 4 -
govtool/frontend/src/i18n/locales/en.ts | 10 +-
.../src/pages/RegisterAsDirectVoter.tsx | 5 +-
.../src/pages/RetireAsDirectVoter.tsx | 5 +-
govtool/frontend/src/utils/localStorage.ts | 2 +-
govtool/frontend/yarn.lock | 10111 +++++++++++-----
govtool/metadata-validation/src/main.ts | 1 +
27 files changed, 7595 insertions(+), 2844 deletions(-)
create mode 100644 govtool/frontend/src/context/appContext.tsx
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7b2fca089..a3d75643e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,7 +12,8 @@ changes.
### Added
--
+- Unsancho GovTool [Issue 1637](https://github.com/IntersectMBO/govtool/issues/1637)
+- Add network metrics model to frontend service
### Fixed
@@ -27,7 +28,6 @@ changes.
### Added
- Add network name to GET /network/metrics [Issue 1644](https://github.com/IntersectMBO/govtool/issues/1644)
-- Add network metrics model to frontend service
### Fixed
diff --git a/README.md b/README.md
index 71c40ecb1..ee04c954d 100644
--- a/README.md
+++ b/README.md
@@ -3,15 +3,14 @@
- Monorepo containing SanchoNet GovTool and supporting utilities
+ Monorepo containing Voltaire GovTool and supporting utilities
[![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/npm) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
-
-[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=ncloc)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=coverage)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=sqale_index)](https://sonarcloud.io/summary/overall?id=intersect-govtool)
+[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=ncloc)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=coverage)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=sqale_index)](https://sonarcloud.io/summary/overall?id=intersect-govtool)
@@ -19,8 +18,8 @@
## 🌄 Purpose
-The SanchoNet GovTool enables ada holders to experience some of the governance features described in [CIP-1694](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1694/README.md) and to test governance features on [SanchoNet](https://sancho.network/) through a guided and straightforward experience.
-The SanchoNet GovTool is currently open for beta testing and can be accessed at [sanchogov.tools](https://sanchogov.tools/).
+The Voltaire GovTool enables ada holders to experience some of the governance features described in [CIP-1694](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1694/README.md) and to test governance features.
+The Voltaire GovTool is currently open for preview testing and can be accessed at [preview.gov.tools](https://preview.gov.tools/).
Learn more; [docs.sanchogov.tools](https://docs.sanchogov.tools/).
diff --git a/docs/operations/README.md b/docs/operations/README.md
index 4b6ab139f..f14769304 100644
--- a/docs/operations/README.md
+++ b/docs/operations/README.md
@@ -1,12 +1,13 @@
# Overview
The application is setup with the following tools:
-* Terraform - for creating infrastructure in AWS for each environment
-* Docker - to build and run application components
-* Docker Compose - to connect the application components together and deploy them as a stack
-* make - to simplify operations tasks
-* Prometheus - to gather metrics from application host and Docker containers
-* Grafana - to visualize metrics gathered from Prometheus and handle alerting
+
+- Terraform - for creating infrastructure in AWS for each environment
+- Docker - to build and run application components
+- Docker Compose - to connect the application components together and deploy them as a stack
+- make - to simplify operations tasks
+- Prometheus - to gather metrics from application host and Docker containers
+- Grafana - to visualize metrics gathered from Prometheus and handle alerting
# Environments
@@ -14,11 +15,11 @@ The application is hosted on AWS, there are several application environments, ea
Each environment consists of:
-* VPC network (with subnets, route tables, IGW)
-* Security Groups
-* EC2 instance
-* Elastic IPs associated with EC2 instance
-* Route 53 record (only for environments using `govtool.byron.network` domain)
+- VPC network (with subnets, route tables, IGW)
+- Security Groups
+- EC2 instance
+- Elastic IPs associated with EC2 instance
+- Route 53 record (only for environments using `govtool.byron.network` domain)
For each environment, the frontend is hosted at root and the backend is at `/api`.
@@ -26,25 +27,27 @@ For each environment, the frontend is hosted at root and the backend is at `/api
### beta
-A beta environment connected to `sanchonet` Cardano network.
+A beta environment connected to `preview` Cardano network.
-Available at https://sanchogov.tools/. The DNS record for this domain is created manually.
+Available at https://preview.gov.tools/. The DNS record for this domain is created manually.
# Deployment
Deployment is performed via GitHub Actions workflow (`.github/workflows/build-and-deploy.yml`).
The workflow performs the following steps:
-* check if the environment is defined in Terraform (to avoid deployment attempt to inexistant environment)
-* build of frontend app
-* build of backend app
-* generate configuration files and upload them (over SSH) to the target environment
-* setup the application compoments with Docker Compose on the target environment
+
+- check if the environment is defined in Terraform (to avoid deployment attempt to inexistant environment)
+- build of frontend app
+- build of backend app
+- generate configuration files and upload them (over SSH) to the target environment
+- setup the application compoments with Docker Compose on the target environment
The workflow can be triggered directly from GitHub Actions panel. When ruuning the workflow, you need to specify:
-* Cardano network to be used
-* environment name
-* optionally skip the build process (frontend and backend) - useful when there are plain configuration changes that do not require the application to be rebuild
+
+- Cardano network to be used
+- environment name
+- optionally skip the build process (frontend and backend) - useful when there are plain configuration changes that do not require the application to be rebuild
# Monitoring
diff --git a/govtool/frontend/.storybook/preview.tsx b/govtool/frontend/.storybook/preview.tsx
index 87b01a7d2..9ee56bf7b 100644
--- a/govtool/frontend/.storybook/preview.tsx
+++ b/govtool/frontend/.storybook/preview.tsx
@@ -4,6 +4,8 @@ import React from "react";
import { I18nextProvider } from "react-i18next";
import { QueryClient, QueryClientProvider } from "react-query";
import { MemoryRouter, Route, Routes } from "react-router-dom";
+
+import { AppContextProvider } from "../src/context/appContext";
import { ModalProvider } from "../src/context/modal";
import i18n from "../src/i18n";
import { theme } from "../src/theme";
@@ -23,30 +25,32 @@ const preview: Preview = {
decorators: [
(Story) => (
-
-
-
-
-
-
-
-
- }
- />
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ }
+ />
+
+
+
+
+
+
),
],
diff --git a/govtool/frontend/index.html b/govtool/frontend/index.html
index 9fa7c8404..e3ff67282 100644
--- a/govtool/frontend/index.html
+++ b/govtool/frontend/index.html
@@ -10,7 +10,7 @@
rel="stylesheet"
/>
- SanchoNet Govtool
+ Voltaire Govtool