{/* My delegation */}
- {myDrep && (
+ {myDrep && !inProgressDelegation && (
@@ -123,6 +126,14 @@ export const DRepDirectoryContent: FC = ({
/>
)}
+ {inProgressDelegation && inProgressDelegationDRepData && (
+
+ )}
{/* Automated voting options */}
{isConnected && (
@@ -204,7 +215,10 @@ export const DRepDirectoryContent: FC = ({
)}
{dRepListToDisplay?.map((dRep) => {
- if (isSameDRep(dRep, myDrep?.view)) {
+ if (
+ isSameDRep(dRep, myDrep?.view) ||
+ isSameDRep(dRep, inProgressDelegation)
+ ) {
return null;
}
return (
@@ -212,7 +226,6 @@ export const DRepDirectoryContent: FC = ({
delegate(dRep.drepId)}
/>
diff --git a/govtool/frontend/src/services/requests/getNetworkMetrics.ts b/govtool/frontend/src/services/requests/getNetworkMetrics.ts
new file mode 100644
index 000000000..59fd0c674
--- /dev/null
+++ b/govtool/frontend/src/services/requests/getNetworkMetrics.ts
@@ -0,0 +1,7 @@
+import { API } from "../API";
+
+export const getNetworkMetrics = async () => {
+ const response = await API.get("/network/metrics");
+
+ return response.data;
+};
diff --git a/govtool/frontend/src/services/requests/index.ts b/govtool/frontend/src/services/requests/index.ts
index 3121e4c5c..f6721175a 100644
--- a/govtool/frontend/src/services/requests/index.ts
+++ b/govtool/frontend/src/services/requests/index.ts
@@ -18,3 +18,4 @@ export * from "./postDRepRemoveVote";
export * from "./postDRepRetire";
export * from "./postDRepVote";
export * from "./metadataValidation";
+export * from "./getNetworkMetrics";
diff --git a/govtool/frontend/src/utils/dRep.ts b/govtool/frontend/src/utils/dRep.ts
index 7743a017e..1521fda5d 100644
--- a/govtool/frontend/src/utils/dRep.ts
+++ b/govtool/frontend/src/utils/dRep.ts
@@ -2,7 +2,7 @@ import { DRepData } from "@/models";
export const isSameDRep = (
{ drepId, view }: DRepData,
- dRepIdOrView: string | undefined,
+ dRepIdOrView: string | undefined | null,
) => {
if (!dRepIdOrView) {
return false;
diff --git a/govtool/frontend/vite.config.ts b/govtool/frontend/vite.config.ts
index 4316c151e..0442b81a1 100644
--- a/govtool/frontend/vite.config.ts
+++ b/govtool/frontend/vite.config.ts
@@ -51,7 +51,11 @@ const vitestConfig = defineVitestConfig({
setupFiles: "./src/setupTests.ts",
globals: true,
environment: "jsdom",
- reporters: ["verbose", "junit"],
+ reporters: ["default","junit"],
+ outputFile: {
+ junit: './junit-report.xml',
+ json: './json-report.json',
+ },
coverage: {
include: [
"src/components/**/*",
@@ -62,7 +66,8 @@ const vitestConfig = defineVitestConfig({
"src/utils/**/*",
],
provider: "v8",
- reporter: ["json-summary"],
+ reporter: ["json-summary","lcov"],
+ reportOnFailure: true,
enabled: true,
},
},
diff --git a/scripts/govtool/.envrc b/scripts/govtool/.envrc
index 0e49e3cbd..fa6f7d8f1 100644
--- a/scripts/govtool/.envrc
+++ b/scripts/govtool/.envrc
@@ -1,4 +1,16 @@
source_up
-env_vars_required ENVIRONMENT AWS_PROFILE CARDANO_NETWORK DBSYNC_POSTGRES_USER DBSYNC_POSTGRES_PASSWORD DBSYNC_POSTGRES_DB TRAEFIK_LE_EMAIL GTM_ID SENTRY_DSN_BACKEND SENTRY_DSN SENTRY_ENVIRONMENT GRAFANA_ADMIN_PASSWORD GRAFANA_SLACK_RECIPIENT NGINX_BASIC_AUTH GRAFANA_SLACK_OAUTH_TOKEN IP_ADDRESS_BYPASSING_BASIC_AUTH1 IP_ADDRESS_BYPASSING_BASIC_AUTH2
+env_vars_required ENVIRONMENT AWS_PROFILE CARDANO_NETWORK DBSYNC_POSTGRES_USER DBSYNC_POSTGRES_PASSWORD DBSYNC_POSTGRES_DB TRAEFIK_LE_EMAIL GTM_ID SENTRY_DSN_BACKEND SENTRY_DSN SENTRY_ENVIRONMENT GRAFANA_ADMIN_PASSWORD GRAFANA_SLACK_RECIPIENT GRAFANA_SLACK_OAUTH_TOKEN IP_ADDRESS_BYPASSING_BASIC_AUTH1 IP_ADDRESS_BYPASSING_BASIC_AUTH2
+
+case "$ENVIRONMENT" in
+ "dev")
+ env_vars_required DEV_NGINX_BASIC_AUTH
+ ;;
+ "test")
+ env_vars_required TEST_NGINX_BASIC_AUTH
+ ;;
+ "staging")
+ env_vars_required STAGING_NGINX_BASIC_AUTH
+ ;;
+esac
use flake --extra-experimental-features nix-command --extra-experimental-features flakes ../..#scripts
diff --git a/scripts/govtool/config.mk b/scripts/govtool/config.mk
index 2a7c4b770..439d75495 100644
--- a/scripts/govtool/config.mk
+++ b/scripts/govtool/config.mk
@@ -112,9 +112,9 @@ $(target_config_dir)/nginx/auth.conf: $(target_config_dir)/nginx/
fi
$(target_config_dir)/nginx/govtool.htpasswd: $(target_config_dir)/nginx/
- @:$(call check_defined, domain)
- if [[ "$(domain)" == *"sanchonet.govtool.byron.network"* ]]; then \
- echo "$${NGINX_BASIC_AUTH}" > $@; \
+ @:$(call check_defined, env)
+ if [[ "$(env)" != "beta" ]]; then \
+ echo "$${$(shell echo $(env) | tr a-z A-Z)_NGINX_BASIC_AUTH}" > $@; \
else \
echo > $@; \
fi
diff --git a/scripts/govtool/config/templates/backend-config.json.tpl b/scripts/govtool/config/templates/backend-config.json.tpl
index c3851bbe1..9ff9f2f11 100644
--- a/scripts/govtool/config/templates/backend-config.json.tpl
+++ b/scripts/govtool/config/templates/backend-config.json.tpl
@@ -9,5 +9,7 @@
"port" : 9876,
"host" : "0.0.0.0",
"cachedurationseconds": 20,
- "sentrydsn": ""
+ "sentrydsn": "",
+ "metadatavalidationhost": "http://metadata-validation",
+ "metadatavalidationport": "3000"
}
diff --git a/scripts/govtool/config/templates/docker-compose.yml.tpl b/scripts/govtool/config/templates/docker-compose.yml.tpl
index 42c09f083..975895d30 100644
--- a/scripts/govtool/config/templates/docker-compose.yml.tpl
+++ b/scripts/govtool/config/templates/docker-compose.yml.tpl
@@ -244,7 +244,7 @@ services:
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.backend-stripprefix.stripprefix.prefixes=/api"
- - "traefik.http.middlewares.backend-cors.headers.accesscontrolallowmethods=GET,HEAD,OPTIONS"
+ - "traefik.http.middlewares.backend-cors.headers.accesscontrolallowmethods=GET,POST,HEAD,OPTIONS"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolallowheaders=*"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolalloworiginlist=https://"
- "traefik.http.middlewares.backend-cors.headers.accesscontrolmaxage=100"
diff --git a/scripts/govtool/frontend.mk b/scripts/govtool/frontend.mk
index 97caf9bef..fb74d798b 100644
--- a/scripts/govtool/frontend.mk
+++ b/scripts/govtool/frontend.mk
@@ -15,7 +15,7 @@ build-frontend: docker-login
if [[ "$(cardano_network)" = "mainnet" ]]; then NETWORK_FLAG=1; else NETWORK_FLAG=0; fi; \
$(call check_image_on_ecr,frontend,$(frontend_image_tag)) || \
$(docker) build --tag "$(repo_url)/frontend:$(frontend_image_tag)" \
- --build-arg VITE_BASE_URL="https://$(domain)" \
+ --build-arg VITE_BASE_URL="https://$(domain)/api" \
--build-arg VITE_GTM_ID="$${GTM_ID}" \
--build-arg VITE_NETWORK_FLAG="$$NETWORK_FLAG" \
--build-arg VITE_SENTRY_DSN="$${SENTRY_DSN}" \