Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 852e1ace7e | |||
| cc3cfbfdc1 | |||
| d0ba4056d6 | |||
| c81a5ac002 | |||
| 93a8e2a9bf | |||
| 83d5cc9bf4 | |||
| 9a5ce73dfd | |||
| af51ab3f71 | |||
| 0e37c572f0 | |||
| d57e8efff2 | |||
| c4c4355a54 | |||
| aaef36a5d7 | |||
| 062f4911e1 | |||
| 59e4567342 | |||
| de2b106568 | |||
| 60ab58998d | |||
| 60264486fd |
@@ -13,13 +13,19 @@ on:
|
||||
jobs:
|
||||
check-schema:
|
||||
name: Generate and check schema
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: custom-runner-linux
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
|
||||
- name: Generate the schema
|
||||
run: make contract-schema
|
||||
|
||||
- name: Check for diff
|
||||
run: git diff --exit-code
|
||||
run: git diff --exit-code -- contracts/*/schema
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
name: CI dev-portal
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches-ignore: master
|
||||
paths:
|
||||
|
||||
@@ -4,6 +4,18 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.1.27] (2023-08-16)
|
||||
|
||||
- fix serialisation of contract types ([#3752])
|
||||
- Investigate spending credentials from the main API (coconut enabled to a gateway) from feature/ephemera branch ([#3741])
|
||||
- NymConnect UI stuck in showing "Gateway has issues" ([#3594])
|
||||
- [UPDATE] Update MiniBolt community-applications-and-guides dev docs ([#3754])
|
||||
|
||||
[#3752]: https://github.com/nymtech/nym/issues/3752
|
||||
[#3741]: https://github.com/nymtech/nym/issues/3741
|
||||
[#3594]: https://github.com/nymtech/nym/issues/3594
|
||||
[#3754]: https://github.com/nymtech/nym/pull/3754
|
||||
|
||||
## [v1.1.24] (2023-08-08)
|
||||
|
||||
- Latency based gateway selection is serial and slow ([#3710])
|
||||
|
||||
Generated
+9
-9
@@ -1896,7 +1896,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
||||
|
||||
[[package]]
|
||||
name = "explorer-api"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap 4.2.7",
|
||||
@@ -3530,7 +3530,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-api"
|
||||
version = "1.1.25"
|
||||
version = "1.1.26"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -3667,7 +3667,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-cli"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.13.1",
|
||||
@@ -3733,7 +3733,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-client"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"clap 4.2.7",
|
||||
"dirs 4.0.0",
|
||||
@@ -4021,7 +4021,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-gateway"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -4176,7 +4176,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-mixnode"
|
||||
version = "1.1.25"
|
||||
version = "1.1.26"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bs58 0.4.0",
|
||||
@@ -4293,7 +4293,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-requester"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-file-watcher",
|
||||
@@ -4340,7 +4340,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-statistics"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"dirs 4.0.0",
|
||||
"log",
|
||||
@@ -4497,7 +4497,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
dependencies = [
|
||||
"clap 4.2.7",
|
||||
"lazy_static",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-client"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
description = "Implementation of the Nym Client"
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
||||
description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address"
|
||||
edition = "2021"
|
||||
|
||||
@@ -28,6 +28,7 @@ use cosmrs::proto::cosmwasm::wasm::v1::{
|
||||
};
|
||||
use cosmrs::tendermint::{block, chain, Hash};
|
||||
use cosmrs::{AccountId, Coin as CosmosCoin, Tx};
|
||||
use log::trace;
|
||||
use prost::Message;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::convert::TryFrom;
|
||||
@@ -69,6 +70,9 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
Req: Message,
|
||||
Res: Message + Default,
|
||||
{
|
||||
if let Some(ref abci_path) = path {
|
||||
trace!("performing query on abci path {abci_path}")
|
||||
}
|
||||
let mut buf = Vec::with_capacity(req.encoded_len());
|
||||
req.encode(&mut buf)?;
|
||||
|
||||
@@ -477,6 +481,7 @@ pub trait CosmWasmClient: TendermintClient {
|
||||
.make_abci_query::<_, QuerySmartContractStateResponse>(path, req)
|
||||
.await?;
|
||||
|
||||
trace!("raw query response: {}", String::from_utf8_lossy(&res.data));
|
||||
Ok(serde_json::from_slice(&res.data)?)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,9 @@ impl SpendCredentialData {
|
||||
#[cw_serde]
|
||||
#[derive(Copy)]
|
||||
pub enum SpendCredentialStatus {
|
||||
#[serde(alias = "InProgress")]
|
||||
InProgress,
|
||||
#[serde(alias = "Spent")]
|
||||
Spent,
|
||||
}
|
||||
|
||||
|
||||
@@ -159,10 +159,12 @@ impl EpochStatus {
|
||||
pub enum EpochState {
|
||||
/// Represents the state of an epoch that's in progress (well, duh.)
|
||||
/// All actions are allowed to be issued.
|
||||
#[serde(alias = "InProgress")]
|
||||
InProgress,
|
||||
|
||||
/// Represents the state of an epoch when the rewarding entity has been decided on,
|
||||
/// and the mixnodes are in the process of being rewarded for their work in this epoch.
|
||||
#[serde(alias = "Rewarding")]
|
||||
Rewarding {
|
||||
/// The id of the last node that has already received its rewards.
|
||||
last_rewarded: MixId,
|
||||
@@ -174,10 +176,12 @@ pub enum EpochState {
|
||||
|
||||
/// Represents the state of an epoch when all mixnodes have already been rewarded for their work in this epoch
|
||||
/// and all issued actions should now get resolved before being allowed to advance into the next epoch.
|
||||
#[serde(alias = "ReconcilingEvents")]
|
||||
ReconcilingEvents,
|
||||
|
||||
/// Represents the state of an epoch when all mixnodes have already been rewarded for their work in this epoch,
|
||||
/// all issued actions got resolved and the epoch should now be advanced whilst assigning new rewarded set.
|
||||
#[serde(alias = "AdvancingEpoch")]
|
||||
AdvancingEpoch,
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,11 @@ use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
#[derive(Copy)]
|
||||
pub enum RewardedSetNodeStatus {
|
||||
/// Node that is currently active, i.e. is expected to be used by clients for mixing packets.
|
||||
#[serde(alias = "Active")]
|
||||
Active,
|
||||
|
||||
/// Node that is currently in standby, i.e. it's present in the rewarded set but is not active.
|
||||
#[serde(alias = "Standby")]
|
||||
Standby,
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ pub enum PendingEpochEventKind {
|
||||
// `cumulative_reward_ratio` ahead of time
|
||||
/// Request to create a delegation towards particular mixnode.
|
||||
/// Note that if such delegation already exists, it will get updated with the provided token amount.
|
||||
#[serde(alias = "Delegate")]
|
||||
Delegate {
|
||||
/// The address of the owner of the delegation.
|
||||
owner: Addr,
|
||||
@@ -53,6 +54,7 @@ pub enum PendingEpochEventKind {
|
||||
},
|
||||
|
||||
/// Request to remove delegation from particular mixnode.
|
||||
#[serde(alias = "Undelegate")]
|
||||
Undelegate {
|
||||
/// The address of the owner of the delegation.
|
||||
owner: Addr,
|
||||
@@ -66,6 +68,7 @@ pub enum PendingEpochEventKind {
|
||||
},
|
||||
|
||||
/// Request to pledge more tokens (by the node operator) towards its node.
|
||||
#[serde(alias = "PledgeMore")]
|
||||
PledgeMore {
|
||||
/// The id of the mixnode that will have its pledge updated.
|
||||
mix_id: MixId,
|
||||
@@ -75,6 +78,7 @@ pub enum PendingEpochEventKind {
|
||||
},
|
||||
|
||||
/// Request to decrease amount of pledged tokens (by the node operator) from its node.
|
||||
#[serde(alias = "DecreasePledge")]
|
||||
DecreasePledge {
|
||||
/// The id of the mixnode that will have its pledge updated.
|
||||
mix_id: MixId,
|
||||
@@ -84,12 +88,14 @@ pub enum PendingEpochEventKind {
|
||||
},
|
||||
|
||||
/// Request to unbond a mixnode and completely remove it from the network.
|
||||
#[serde(alias = "UnbondMixnode")]
|
||||
UnbondMixnode {
|
||||
/// The id of the mixnode that will get unbonded.
|
||||
mix_id: MixId,
|
||||
},
|
||||
|
||||
/// Request to update the current size of the active set.
|
||||
#[serde(alias = "UpdateActiveSetSize")]
|
||||
UpdateActiveSetSize {
|
||||
/// The new desired size of the active set.
|
||||
new_size: u32,
|
||||
@@ -138,6 +144,7 @@ pub struct PendingIntervalEventData {
|
||||
#[cw_serde]
|
||||
pub enum PendingIntervalEventKind {
|
||||
/// Request to update cost parameters of given mixnode.
|
||||
#[serde(alias = "PendingIntervalEventKind")]
|
||||
ChangeMixCostParams {
|
||||
/// The id of the mixnode that will have its cost parameters updated.
|
||||
mix_id: MixId,
|
||||
@@ -147,12 +154,14 @@ pub enum PendingIntervalEventKind {
|
||||
},
|
||||
|
||||
/// Request to update the underlying rewarding parameters used by the system
|
||||
#[serde(alias = "UpdateRewardingParams")]
|
||||
UpdateRewardingParams {
|
||||
/// The detailed specification of the update.
|
||||
update: IntervalRewardingParamsUpdate,
|
||||
},
|
||||
|
||||
/// Request to change the next interval configuration.
|
||||
#[serde(alias = "UpdateIntervalConfig")]
|
||||
UpdateIntervalConfig {
|
||||
/// The new number of epochs in intervals.
|
||||
epochs_in_interval: u32,
|
||||
|
||||
@@ -16,12 +16,15 @@ use std::str::FromStr;
|
||||
/// The vesting period.
|
||||
pub enum Period {
|
||||
/// Defines a pre-vesting period.
|
||||
#[serde(alias = "Before")]
|
||||
Before,
|
||||
|
||||
/// Defines currently active vesting period.
|
||||
#[serde(alias = "In")]
|
||||
In(usize),
|
||||
|
||||
/// Defines a post-vesting period.
|
||||
#[serde(alias = "After")]
|
||||
After,
|
||||
}
|
||||
|
||||
@@ -53,9 +56,11 @@ impl PledgeData {
|
||||
#[cw_serde]
|
||||
pub enum PledgeCap {
|
||||
/// Specifies a percent-based pledge cap, i.e. only given % of tokens could be pledged/staked.
|
||||
#[serde(alias = "Percent")]
|
||||
Percent(Percent),
|
||||
|
||||
/// Specifies an absolute pledge cap, i.e. an explicit value that could be pledged/staked.
|
||||
#[serde(alias = "Absolute")]
|
||||
Absolute(Uint128), // This has to be in unym
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## [Unreleased]
|
||||
|
||||
## [v1.5.0] (2023-08-16)
|
||||
- Generate json schema for all used contracts #3693 ([#3693])
|
||||
|
||||
[#3233]: https://github.com/nymtech/nym/pull/3693
|
||||
|
||||
|
||||
## [v1.4.0] (2023-04-25)
|
||||
- Allow mixnode operators to decrease their bond amount without having to rebond (will require a lot of testing EXACT reward values to make sure the "unit delegation" isn't broken afterwards) ([#3233])
|
||||
|
||||
Generated
+2
-8
@@ -290,12 +290,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crunchy"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.4.9"
|
||||
@@ -1278,7 +1272,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-mixnet-contract"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
dependencies = [
|
||||
"bs58",
|
||||
"cosmwasm-derive",
|
||||
@@ -1426,7 +1420,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-vesting-contract"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
dependencies = [
|
||||
"base64 0.21.0",
|
||||
"cosmwasm-crypto",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-mixnet-contract"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
description = "Nym mixnet contract"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"contract_name": "nym-mixnet-contract",
|
||||
"contract_version": "1.4.0",
|
||||
"contract_version": "1.5.0",
|
||||
"idl_version": "1.0.0",
|
||||
"instantiate": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-vesting-contract"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
description = "Nym vesting contract"
|
||||
edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"contract_name": "nym-vesting-contract",
|
||||
"contract_version": "1.4.0",
|
||||
"contract_version": "1.5.0",
|
||||
"idl_version": "1.0.0",
|
||||
"instantiate": {
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
|
||||
@@ -17,7 +17,7 @@ src = "src"
|
||||
# - run `mdbook build`: this will rebuild the `./theme` directory
|
||||
# - change value of `turn-off` back to `true`
|
||||
[preprocessor.theme]
|
||||
pagetoc = true
|
||||
pagetoc = true
|
||||
# some variables related (defined in theme/css/variables.css)
|
||||
# `content-max-width` + `pagetoc-width` = 95% seems the best
|
||||
pagetoc-width = "13%"
|
||||
@@ -37,7 +37,7 @@ nav-chapters-min-width = "auto"
|
||||
chapter-line-height = "2em"
|
||||
section-line-height = "1.5em"
|
||||
|
||||
# if true, never read and touch the files in theme dir
|
||||
# # if true, never read and touch the files in theme dir
|
||||
turn-off = false
|
||||
|
||||
[preprocessor.admonish]
|
||||
@@ -77,7 +77,7 @@ curly-quotes = true
|
||||
# mathjax-support = false # useful if we want to pull equations in ?
|
||||
copy-fonts = true
|
||||
no-section-label = false
|
||||
additional-css = ["theme/pagetoc.css", "././mdbook-admonish.css", "custom.css"]
|
||||
additional-css = ["theme/pagetoc.css", "././mdbook-admonish.css", "last-changed.css"]
|
||||
additional-js = ["theme/pagetoc.js"]
|
||||
git-repository-url = "https://github.com/nymtech/nym"
|
||||
git-repository-icon = "fa-github"
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
:root {
|
||||
--mono-font: "Open Sans", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono",
|
||||
monospace, monospace;
|
||||
}
|
||||
.coal {
|
||||
--bg: #121726;
|
||||
--fg: #f2f2f2;
|
||||
|
||||
--sidebar-bg: #121726;
|
||||
--sidebar-fg: #f2f2f2;
|
||||
--sidebar-active: #fb6e4e;
|
||||
|
||||
--icons: #f2f2f2;
|
||||
--icons-hover: #fb6e4e;
|
||||
|
||||
--links: #fb6e4e;
|
||||
}
|
||||
|
||||
.light {
|
||||
--bg: #f4f6f8;
|
||||
--fg: #121726;
|
||||
|
||||
--sidebar-bg: #f4f6f8;
|
||||
--sidebar-fg: #121726;
|
||||
--sidebar-active: #fb6e4e;
|
||||
|
||||
--icons: #121726;
|
||||
--icons-hover: #fb6e4e;
|
||||
|
||||
--links: #fb6e4e;
|
||||
}
|
||||
|
||||
footer {
|
||||
font-size: 0.8em;
|
||||
text-align: center;
|
||||
border-top: 1px solid black;
|
||||
padding: 5px 0;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
footer {
|
||||
font-size: 0.8em;
|
||||
text-align: center;
|
||||
border-top: 1px solid black;
|
||||
padding: 5px 0;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
}
|
||||
|
||||
@media only screen and (max-width:1439px) {
|
||||
:root{
|
||||
:root{
|
||||
--content-max-width: 98%;
|
||||
}
|
||||
}
|
||||
@@ -290,4 +290,4 @@
|
||||
--searchresults-li-bg: #2b2b2f;
|
||||
--search-mark-bg: #355c7d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "explorer-api"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-gateway"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
@@ -118,8 +118,15 @@ impl CoconutVerifier {
|
||||
revoke_fee.clone(),
|
||||
)
|
||||
.await?;
|
||||
if !ret?.verification_result {
|
||||
debug!("Validator {} didn't accept the credential. It will probably vote No on the spending proposal", client.api_client.nym_api_client.current_url());
|
||||
match ret {
|
||||
Ok(res) => {
|
||||
if !res.verification_result {
|
||||
debug!("Validator {} didn't accept the credential. It will probably vote No on the spending proposal", client.api_client.nym_api_client.current_url());
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
warn!("Validator {} could not be reached. There might be a problem with the coconut endpoint - {:?}", client.api_client.nym_api_client.current_url(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-mixnode"
|
||||
version = "1.1.25"
|
||||
version = "1.1.26"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-api"
|
||||
version = "1.1.25"
|
||||
version = "1.1.26"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
Generated
+30
-30
@@ -103,9 +103,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/core/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
@@ -158,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
@@ -2883,9 +2883,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/istanbul-lib-instrument/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
@@ -3653,9 +3653,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
@@ -4273,9 +4273,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
@@ -4918,9 +4918,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -4962,9 +4962,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -6970,9 +6970,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -7559,9 +7559,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"version": "6.3.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
@@ -7984,9 +7984,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
|
||||
@@ -2566,16 +2566,16 @@ safe-buffer@~5.1.1:
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
semver@7.x, semver@^7.3.5, semver@^7.3.7:
|
||||
version "7.3.7"
|
||||
resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz"
|
||||
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
|
||||
version "7.5.4"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
|
||||
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
semver@^6.0.0, semver@^6.3.0:
|
||||
version "6.3.0"
|
||||
resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz"
|
||||
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
|
||||
version "6.3.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
|
||||
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
|
||||
|
||||
shebang-command@^2.0.0:
|
||||
version "2.0.0"
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.1.27] (2023-08-16)
|
||||
|
||||
- Add a "Send us your feedback" section in NC (on the main screen) to collect user feedback using Sentry ([#3619])
|
||||
- NC native android - deploy on FDroid ([#3483])
|
||||
|
||||
[#3619]: https://github.com/nymtech/nym/issues/3619
|
||||
[#3483]: https://github.com/nymtech/nym/issues/3483
|
||||
|
||||
## [v1.1.16] (2023-08-08)
|
||||
|
||||
- Uncouple network-requester <-> gateway in nym-connect and harbourmaster ([#3472])
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nym/nym-connect",
|
||||
"version": "1.1.16",
|
||||
"version": "1.1.17",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
@@ -47,7 +47,7 @@
|
||||
"react-markdown": "^8.0.4",
|
||||
"react-router-dom": "^6.7.0",
|
||||
"semver": "^6.3.0",
|
||||
"yup": "^0.32.9"
|
||||
"yup": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-connect"
|
||||
version = "1.1.16"
|
||||
version = "1.1.17"
|
||||
description = "nym-connect"
|
||||
authors = ["Nym Technologies SA"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"package": {
|
||||
"productName": "nym-connect",
|
||||
"version": "1.1.16"
|
||||
"version": "1.1.17"
|
||||
},
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
|
||||
@@ -33,6 +33,7 @@ export type TClientContext = {
|
||||
userDefinedSPAddress: UserDefinedSPAddress;
|
||||
serviceProviders?: ServiceProvider[];
|
||||
gateways?: Gateway[];
|
||||
showFeedbackNote: boolean;
|
||||
setMode: (mode: ModeType) => void;
|
||||
clearError: () => void;
|
||||
setConnectionStatus: (connectionStatus: ConnectionStatusKind) => void;
|
||||
@@ -47,6 +48,7 @@ export type TClientContext = {
|
||||
setUserDefinedSPAddress: React.Dispatch<React.SetStateAction<UserDefinedSPAddress>>;
|
||||
setMonitoring: (value: boolean) => Promise<void>;
|
||||
setPrivacyLevel: (value: PrivacyLevel) => Promise<void>;
|
||||
setShowFeedbackNote: (value: boolean) => void;
|
||||
};
|
||||
|
||||
function getRandomFromList<T>(items: T[]): T {
|
||||
@@ -77,6 +79,7 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
address: undefined,
|
||||
});
|
||||
const [userData, setUserData] = useState<UserData>();
|
||||
const [showFeedbackNote, setShowFeedbackNote] = useState(true);
|
||||
|
||||
const getAppVersion = async () => {
|
||||
const version = await getVersion();
|
||||
@@ -161,9 +164,15 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const afterDisconnection = useCallback(async () => {
|
||||
setGatewayPerformance('Good');
|
||||
setConnectedSince(undefined);
|
||||
}, []);
|
||||
|
||||
const startDisconnecting = useCallback(async () => {
|
||||
try {
|
||||
await invoke('start_disconnecting');
|
||||
afterDisconnection();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
Sentry.captureException(e);
|
||||
@@ -240,6 +249,7 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
serviceProviders,
|
||||
connectedSince,
|
||||
userData,
|
||||
showFeedbackNote,
|
||||
setConnectedSince,
|
||||
setServiceProvider,
|
||||
setGateway,
|
||||
@@ -253,6 +263,7 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
setUserDefinedSPAddress,
|
||||
setMonitoring,
|
||||
setPrivacyLevel,
|
||||
setShowFeedbackNote,
|
||||
}),
|
||||
[
|
||||
mode,
|
||||
@@ -270,6 +281,7 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
userDefinedGateway,
|
||||
userDefinedSPAddress,
|
||||
userData,
|
||||
showFeedbackNote,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ const mockValues: TClientContext = {
|
||||
userDefinedGateway: { isActive: false, gateway: '' },
|
||||
userDefinedSPAddress: { isActive: false, address: '' },
|
||||
userData: { monitoring: false, privacy_level: 'High' },
|
||||
showFeedbackNote: false,
|
||||
setShowInfoModal: () => {},
|
||||
setMode: () => {},
|
||||
clearError: () => {},
|
||||
@@ -26,6 +27,7 @@ const mockValues: TClientContext = {
|
||||
setUserDefinedSPAddress: () => {},
|
||||
setMonitoring: async () => {},
|
||||
setPrivacyLevel: async () => {},
|
||||
setShowFeedbackNote: () => {},
|
||||
};
|
||||
|
||||
export const MockProvider: FCWithChildren<{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Stack, Typography } from '@mui/material';
|
||||
import { Alert, Link, Stack, Typography } from '@mui/material';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { ConnectionStatus } from 'src/components/ConnectionStatus';
|
||||
import { ConnectionTimer } from 'src/components/ConntectionTimer';
|
||||
import { InfoModal } from 'src/components/InfoModal';
|
||||
@@ -10,6 +11,7 @@ import { ConnectionStatusKind } from 'src/types';
|
||||
import { PowerButton } from 'src/components/PowerButton/PowerButton';
|
||||
import { Box } from '@mui/system';
|
||||
import { ConnectionLayout } from 'src/layouts/ConnectionLayout';
|
||||
import { useClientContext } from '../../context/main';
|
||||
|
||||
export const Disconnected: FCWithChildren<{
|
||||
error?: Error;
|
||||
@@ -20,32 +22,53 @@ export const Disconnected: FCWithChildren<{
|
||||
serviceProvider?: ServiceProvider;
|
||||
clearError: () => void;
|
||||
onConnectClick: (status: ConnectionStatusKind) => void;
|
||||
}> = ({ status, error, onConnectClick, clearError }) => (
|
||||
<>
|
||||
{error && <InfoModal show title={error.title} description={error.message} onClose={clearError} />}
|
||||
<ConnectionLayout
|
||||
TopContent={
|
||||
<Box>
|
||||
<ConnectionStatus status={ConnectionStatusKind.disconnected} gatewayPerformance="Good" />
|
||||
<ConnectionTimer />
|
||||
</Box>
|
||||
}
|
||||
ConnectButton={<PowerButton onClick={onConnectClick} status={status} disabled={status === 'connecting'} />}
|
||||
BottomContent={
|
||||
<Stack justifyContent="space-between" pt={1}>
|
||||
<Typography
|
||||
fontWeight={600}
|
||||
textTransform="uppercase"
|
||||
textAlign="center"
|
||||
fontSize="12px"
|
||||
sx={{ wordSpacing: 1.5, letterSpacing: 1.5 }}
|
||||
color="warning.main"
|
||||
>
|
||||
You are not protected
|
||||
</Typography>
|
||||
<ExperimentalWarning />
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}> = ({ status, error, onConnectClick, clearError }) => {
|
||||
const { showFeedbackNote, setShowFeedbackNote } = useClientContext();
|
||||
|
||||
return (
|
||||
<>
|
||||
{error && <InfoModal show title={error.title} description={error.message} onClose={clearError} />}
|
||||
<ConnectionLayout
|
||||
TopContent={
|
||||
<Box>
|
||||
<ConnectionStatus status={ConnectionStatusKind.disconnected} gatewayPerformance="Good" />
|
||||
<ConnectionTimer />
|
||||
</Box>
|
||||
}
|
||||
ConnectButton={<PowerButton onClick={onConnectClick} status={status} disabled={status === 'connecting'} />}
|
||||
BottomContent={
|
||||
<Stack justifyContent="space-between" pt={1}>
|
||||
<Typography
|
||||
fontWeight={600}
|
||||
textTransform="uppercase"
|
||||
textAlign="center"
|
||||
fontSize="12px"
|
||||
sx={{ wordSpacing: 1.5, letterSpacing: 1.5 }}
|
||||
color="warning.main"
|
||||
>
|
||||
You are not protected
|
||||
</Typography>
|
||||
|
||||
{showFeedbackNote ? (
|
||||
<Alert variant="outlined" icon={false} onClose={() => setShowFeedbackNote(false)}>
|
||||
Help improve NymConnect
|
||||
<br />
|
||||
<Link
|
||||
to="/menu/reporting/user-feedback"
|
||||
onClick={() => setShowFeedbackNote(false)}
|
||||
component={RouterLink}
|
||||
color="secondary"
|
||||
underline="hover"
|
||||
>
|
||||
Send feedback
|
||||
</Link>
|
||||
</Alert>
|
||||
) : (
|
||||
<ExperimentalWarning />
|
||||
)}
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import React, { ChangeEvent, useState } from 'react';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { Box, FormControl, FormControlLabel, FormHelperText, Stack, Switch, Typography } from '@mui/material';
|
||||
import { useClientContext } from 'src/context/main';
|
||||
import { useClientContext } from '../../context/main';
|
||||
|
||||
export const PrivacyLevelSettings = () => {
|
||||
const { userData, setPrivacyLevel } = useClientContext();
|
||||
@@ -8,8 +8,8 @@ const menuSchema = [
|
||||
{ title: 'Supported apps', icon: Apps, path: 'apps' },
|
||||
{ title: 'How to connect guide', icon: HelpOutline, path: 'guide' },
|
||||
{ title: 'Privacy level', icon: PrivacyTip, path: 'privacy-level' },
|
||||
{ title: 'Please help us improve the app', icon: BugReport, path: 'monitoring' },
|
||||
{ title: 'Settings', icon: Settings, path: 'settings' },
|
||||
{ title: 'Help improve the app', icon: BugReport, path: 'reporting' },
|
||||
];
|
||||
|
||||
export const Menu = () => (
|
||||
|
||||
+10
-14
@@ -1,9 +1,8 @@
|
||||
import React, { ChangeEvent, useState } from 'react';
|
||||
import { Warning as WarningIcon } from '@mui/icons-material';
|
||||
import { Box, FormControl, FormControlLabel, FormHelperText, Stack, Switch, Typography } from '@mui/material';
|
||||
import { useClientContext } from 'src/context/main';
|
||||
import { useClientContext } from '../../../context/main';
|
||||
|
||||
export const MonitoringSettings = () => {
|
||||
export const ErrorReporting = () => {
|
||||
const { userData, setMonitoring } = useClientContext();
|
||||
const [enabled, setEnabled] = useState(userData?.monitoring || false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -20,7 +19,7 @@ export const MonitoringSettings = () => {
|
||||
<Stack justifyContent="space-between" height="100%">
|
||||
<Box>
|
||||
<Typography fontWeight="bold" variant="body2" mb={2}>
|
||||
Error reporting and performance monitoring
|
||||
Turn on error reporting and performance monitoring
|
||||
</Typography>
|
||||
<FormControl fullWidth>
|
||||
<FormControlLabel
|
||||
@@ -33,20 +32,17 @@ export const MonitoringSettings = () => {
|
||||
sx={{ ml: 1, mr: 1 }}
|
||||
/>
|
||||
}
|
||||
label="Enable"
|
||||
label={enabled ? 'On' : 'Off'}
|
||||
/>
|
||||
<FormHelperText sx={{ m: 0, my: 2 }}>
|
||||
Help Nym developers to fix errors, crashes and improve the application by enabling this option. If errors
|
||||
occur or if the app crashes, it will automatically send a report. Also it tracks various performance
|
||||
metrics. We use sentry.io service to handle this.
|
||||
Help Nym developers fix errors, crashes and improve the application by enabling this option. If errors
|
||||
occur or if the app crashes, it will automatically send a report. It also tracks various performance
|
||||
metrics. We use Sentry.io service to handle this.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
<Stack direction="row" gap={1} alignItems="center">
|
||||
<WarningIcon color="warning" fontSize="small" />
|
||||
<Typography variant="caption" color="warning.main">
|
||||
You must restart the application for the change to take effect.
|
||||
</Typography>
|
||||
</Stack>
|
||||
<Typography variant="caption" color="warning.main" fontWeight="bold">
|
||||
You must restart the application for the change to take effect.
|
||||
</Typography>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
@@ -0,0 +1,124 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { Alert, Box, Button, FormControl, Link, Snackbar, Stack, TextField, Typography } from '@mui/material';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { Controller, SubmitHandler, useForm } from 'react-hook-form';
|
||||
import { object, string } from 'yup';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { useClientContext } from '../../../context/main';
|
||||
|
||||
type FormValues = {
|
||||
email?: string;
|
||||
feedback: string;
|
||||
};
|
||||
|
||||
const schema = object({
|
||||
email: string().email(),
|
||||
feedback: string().required().min(20).max(512),
|
||||
}).required();
|
||||
|
||||
export const UserFeedback = () => {
|
||||
const [isBusy, setIsBusy] = useState(false);
|
||||
const { userData } = useClientContext();
|
||||
|
||||
const {
|
||||
handleSubmit,
|
||||
control,
|
||||
formState: { errors },
|
||||
reset,
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
email: '',
|
||||
feedback: '',
|
||||
},
|
||||
// inferred type is fucked, so use `any` to make TS happy
|
||||
resolver: yupResolver(schema as any),
|
||||
});
|
||||
|
||||
const onSubmit: SubmitHandler<FormValues> = (data) => {
|
||||
const eventId = Sentry.captureMessage('user feedback');
|
||||
Sentry.captureUserFeedback({
|
||||
event_id: eventId,
|
||||
name: 'nym',
|
||||
email: data.email,
|
||||
comments: data.feedback,
|
||||
});
|
||||
setIsBusy(true);
|
||||
reset();
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setIsBusy(false);
|
||||
};
|
||||
|
||||
if (!userData?.monitoring) {
|
||||
return (
|
||||
<Stack mt={3}>
|
||||
<Typography variant="caption" color="warning.main" fontWeight="bold">
|
||||
The error reporting option must be enabled in order to report feedback. Turn it on{' '}
|
||||
<Link to="/menu/reporting/error-reporting" component={RouterLink} color="secondary" underline="hover">
|
||||
here
|
||||
</Link>
|
||||
.
|
||||
</Typography>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Box height="100%">
|
||||
<Snackbar open={isBusy} autoHideDuration={6000} onClose={handleClose}>
|
||||
<Alert onClose={handleClose} severity="success" sx={{ width: '100%' }}>
|
||||
Feedback sent successfuly
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
<Stack justifyContent="space-between" height="100%">
|
||||
<Box>
|
||||
<Typography fontWeight="bold" variant="body2">
|
||||
Send us your feedback about the app
|
||||
</Typography>
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<FormControl sx={{ mt: 2 }} fullWidth>
|
||||
<Controller
|
||||
render={({ field }) => (
|
||||
<TextField
|
||||
size="small"
|
||||
placeholder="E-mail address (optional)"
|
||||
error={Boolean(errors.email)}
|
||||
helperText={errors.email && errors.email.message}
|
||||
{...field}
|
||||
/>
|
||||
)}
|
||||
name="email"
|
||||
control={control}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormControl sx={{ mt: 2 }} fullWidth>
|
||||
<Controller
|
||||
render={({ field }) => (
|
||||
<TextField
|
||||
size="small"
|
||||
placeholder="Feedback text"
|
||||
rows={8}
|
||||
multiline
|
||||
required
|
||||
error={Boolean(errors.feedback)}
|
||||
helperText={errors.feedback && errors.feedback.message}
|
||||
{...field}
|
||||
/>
|
||||
)}
|
||||
name="feedback"
|
||||
control={control}
|
||||
/>
|
||||
</FormControl>
|
||||
<Stack>
|
||||
<Button color="primary" variant="contained" size="medium" type="submit" sx={{ mt: 2 }} disabled={isBusy}>
|
||||
Send
|
||||
</Button>
|
||||
</Stack>
|
||||
</form>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { Link, List, ListItem, ListItemButton, ListItemText, Stack } from '@mui/material';
|
||||
import { AppVersion } from 'src/components/AppVersion';
|
||||
|
||||
const menuSchema = [
|
||||
{ title: 'Turn on error reporting', path: 'error-reporting' },
|
||||
{ title: 'Send us your feedback', path: 'user-feedback' },
|
||||
];
|
||||
|
||||
export const ReportingMenu = () => (
|
||||
<Stack justifyContent="space-between" height="100%">
|
||||
<List dense disablePadding>
|
||||
{menuSchema.map((item) => (
|
||||
<Link component={RouterLink} to={item.path} underline="none" color="white" key={item.title}>
|
||||
<ListItem disablePadding>
|
||||
<ListItemButton>
|
||||
<ListItemText>{item.title}</ListItemText>
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
</Link>
|
||||
))}
|
||||
</List>
|
||||
<AppVersion />
|
||||
</Stack>
|
||||
);
|
||||
@@ -8,9 +8,11 @@ import { HelpGuide } from 'src/pages/menu/Guide';
|
||||
import { SettingsMenu } from 'src/pages/menu/settings';
|
||||
import { GatewaySettings } from 'src/pages/menu/settings/GatewaySettings';
|
||||
import { ServiceProviderSettings } from 'src/pages/menu/settings/ServiceProviderSettings';
|
||||
import { MonitoringSettings } from '../pages/menu/settings/MonitoringSettings';
|
||||
import { PrivacyLevelSettings } from '../pages/menu/settings/PrivacyLevelSettings';
|
||||
import { ErrorReporting } from '../pages/menu/reporting/ErrorReporting';
|
||||
import { PrivacyLevelSettings } from '../pages/menu/PrivacyLevelSettings';
|
||||
import { useClientContext } from '../context/main';
|
||||
import { ReportingMenu } from '../pages/menu/reporting';
|
||||
import { UserFeedback } from '../pages/menu/reporting/UserFeedback';
|
||||
|
||||
const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes);
|
||||
|
||||
@@ -27,12 +29,16 @@ export const AppRoutes = () => {
|
||||
<Route path="apps" element={<CompatibleApps />} />
|
||||
<Route path="guide" element={<HelpGuide />} />
|
||||
<Route path="privacy-level" element={<PrivacyLevelSettings />} />
|
||||
<Route path="monitoring" element={<MonitoringSettings />} />
|
||||
<Route path="settings">
|
||||
<Route index element={<SettingsMenu />} />
|
||||
<Route path="gateway" element={<GatewaySettings />} />
|
||||
<Route path="service-provider" element={<ServiceProviderSettings />} />
|
||||
</Route>
|
||||
<Route path="reporting">
|
||||
<Route index element={<ReportingMenu />} />
|
||||
<Route path="error-reporting" element={<ErrorReporting />} />
|
||||
<Route path="user-feedback" element={<UserFeedback />} />
|
||||
</Route>
|
||||
</Route>
|
||||
</RoutesContainer>
|
||||
);
|
||||
|
||||
@@ -116,9 +116,15 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const afterDisconnection = useCallback(async () => {
|
||||
setGatewayPerformance('Good');
|
||||
setConnectedSince(undefined);
|
||||
}, []);
|
||||
|
||||
const startDisconnecting = useCallback(async () => {
|
||||
try {
|
||||
await invoke('start_disconnecting');
|
||||
afterDisconnection();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-network-requester"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version = "1.65"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-network-statistics"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-cli"
|
||||
version = "1.1.24"
|
||||
version = "1.1.25"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -17413,7 +17413,7 @@ prop-types@^15.0.0, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2,
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.13.1"
|
||||
|
||||
property-expr@^2.0.4:
|
||||
property-expr@^2.0.4, property-expr@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.5.tgz#278bdb15308ae16af3e3b9640024524f4dc02cb4"
|
||||
integrity sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA==
|
||||
@@ -20018,6 +20018,11 @@ timers-ext@^0.1.7:
|
||||
es5-ext "~0.10.46"
|
||||
next-tick "1"
|
||||
|
||||
tiny-case@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/tiny-case/-/tiny-case-1.0.3.tgz#d980d66bc72b5d5a9ca86fb7c9ffdb9c898ddd03"
|
||||
integrity sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==
|
||||
|
||||
tiny-warning@^1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
|
||||
@@ -21786,6 +21791,16 @@ yup@^0.32.9:
|
||||
property-expr "^2.0.4"
|
||||
toposort "^2.0.2"
|
||||
|
||||
yup@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/yup/-/yup-1.2.0.tgz#9e51af0c63bdfc9be0fdc6c10aa0710899d8aff6"
|
||||
integrity sha512-PPqYKSAXjpRCgLgLKVGPA33v5c/WgEx3wi6NFjIiegz90zSwyMpvTFp/uGcVnnbx6to28pgnzp/q8ih3QRjLMQ==
|
||||
dependencies:
|
||||
property-expr "^2.0.5"
|
||||
tiny-case "^1.0.3"
|
||||
toposort "^2.0.2"
|
||||
type-fest "^2.19.0"
|
||||
|
||||
zod@^3.21.4:
|
||||
version "3.21.4"
|
||||
resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
|
||||
|
||||
Reference in New Issue
Block a user