From 0431c427c08e62f1f814f04c38e7a9f5b2826b4f Mon Sep 17 00:00:00 2001 From: Kanisorn Thongprapaisaeng Date: Tue, 7 Mar 2023 17:51:17 +0700 Subject: [PATCH 01/12] Merge pull request #229 from alleslabs/fix/disable-sentry-logger Disable Sentry debug to prevent "logger.info is not a function" error --- next.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/next.config.js b/next.config.js index a15e831be..d3c571e65 100644 --- a/next.config.js +++ b/next.config.js @@ -11,6 +11,15 @@ const nextConfig = { eslint: { dirs: ["src"], }, + webpack: (config, { webpack }) => { + config.plugins.push( + new webpack.DefinePlugin({ + __SENTRY_DEBUG__: false, + }) + ); + + return config; + }, async rewrites() { return [ { From e377dcc0ecd8ab8d0baccf1ef84a3372946bbd7e Mon Sep 17 00:00:00 2001 From: evilpeach Date: Thu, 9 Mar 2023 15:39:56 +0700 Subject: [PATCH 02/12] docs: cut release v1.0.2, update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad3d94280..cbf3f5cec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## v1.0.2 + ### Features - [#228](https://github.com/alleslabs/celatone-frontend/pull/228) Add Faucet testnet page From 197118d0db77ab5a280c3aac195dd53f6ac897c7 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Thu, 9 Mar 2023 15:55:00 +0700 Subject: [PATCH 03/12] chore: disable account detail page --- src/lib/app-fns/explorer/index.ts | 17 +++++++++++++++++ src/lib/components/ExplorerLink.tsx | 8 +++----- src/lib/layout/Searchbar.tsx | 6 +++--- src/lib/pages/account-details/index.tsx | 9 +++++++-- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/lib/app-fns/explorer/index.ts b/src/lib/app-fns/explorer/index.ts index bb367e179..3b357736e 100644 --- a/src/lib/app-fns/explorer/index.ts +++ b/src/lib/app-fns/explorer/index.ts @@ -22,6 +22,23 @@ export const getExplorerTxUrl = (chainName: string) => { return `${explorerMap[chainName]}/${pathSuffix}`; }; +export const getExplorerUserAddressUrl = (chainName: string) => { + let pathSuffix = ""; + switch (chainName) { + case "osmosis": + case "osmosistestnet": + pathSuffix = "account"; + break; + case "terra2": + case "terra2testnet": + pathSuffix = "address"; + break; + default: + break; + } + return `${explorerMap[chainName]}/${pathSuffix}`; +}; + export const getExplorerBlockUrl = (chainName: string) => { let pathSuffix = ""; switch (chainName) { diff --git a/src/lib/components/ExplorerLink.tsx b/src/lib/components/ExplorerLink.tsx index 904a3037d..4602fd071 100644 --- a/src/lib/components/ExplorerLink.tsx +++ b/src/lib/components/ExplorerLink.tsx @@ -5,6 +5,7 @@ import { useWallet } from "@cosmos-kit/react"; import { getExplorerBlockUrl, getExplorerTxUrl, + getExplorerUserAddressUrl, getProposalUrl, } from "lib/app-fns/explorer"; import type { AddressReturnType } from "lib/app-provider"; @@ -45,7 +46,7 @@ const getNavigationUrl = ( url = "/contract"; break; case "user_address": - url = "/account"; + url = getExplorerUserAddressUrl(currentChainName); break; case "code_id": url = "/code"; @@ -135,10 +136,7 @@ export const ExplorerLink = ({ ...componentProps }: ExplorerLinkProps) => { const { address, currentChainName } = useWallet(); - const isInternal = - type === "code_id" || - type === "contract_address" || - type === "user_address"; + const isInternal = type === "code_id" || type === "contract_address"; const [hrefLink, textValue] = [ getNavigationUrl(type, currentChainName, copyValue || value), diff --git a/src/lib/layout/Searchbar.tsx b/src/lib/layout/Searchbar.tsx index 06486bc58..c6b17dece 100644 --- a/src/lib/layout/Searchbar.tsx +++ b/src/lib/layout/Searchbar.tsx @@ -40,8 +40,8 @@ const getRoute = (type: SearchResultType) => { return "/code"; case "Contract Address": return "/contract"; - case "Wallet Address": - return "/account"; + // case "Wallet Address": + // return "/account"; default: return null; } @@ -122,7 +122,7 @@ const Searchbar = () => { value={keyword} h="36px" onChange={handleSearchChange} - placeholder="Search by Wallet Address / Contract Address / Code ID" + placeholder="Search by Contract Address / Code ID" focusBorderColor="lilac.main" onFocus={() => setDisplayResults(keyword.length > 0)} onKeyDown={handleOnKeyEnter} diff --git a/src/lib/pages/account-details/index.tsx b/src/lib/pages/account-details/index.tsx index 4e83bd4b2..e2908a7e7 100644 --- a/src/lib/pages/account-details/index.tsx +++ b/src/lib/pages/account-details/index.tsx @@ -10,7 +10,7 @@ import { import { useRouter } from "next/router"; import { useEffect, useState } from "react"; -import { useValidateAddress } from "lib/app-provider"; +import { useInternalNavigate, useValidateAddress } from "lib/app-provider"; import { BackButton } from "lib/components/button"; import { CustomTab } from "lib/components/CustomTab"; import { ExplorerLink } from "lib/components/ExplorerLink"; @@ -245,9 +245,14 @@ const AccountDetails = () => { router.query.accountAddress ) as HumanAddr; + const navigate = useInternalNavigate(); + useEffect(() => { + // remark: disable account detail and redirect to home page + navigate({ pathname: "/" }); + if (router.isReady) AmpTrack(AmpEvent.TO_ACCOUNT_DETAIL); - }, [router.isReady]); + }, [router.isReady, navigate]); return ( From 5c4d1a04e91509032eeba7701ff67850af3fd409 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Thu, 9 Mar 2023 15:57:29 +0700 Subject: [PATCH 04/12] docs: add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf3f5cec..c90ee1768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Features +- [#233](https://github.com/alleslabs/celatone-frontend/pull/233) Disable account detail page - [#228](https://github.com/alleslabs/celatone-frontend/pull/228) Add Faucet testnet page - [#79](https://github.com/alleslabs/celatone-frontend/pull/79) Add dropdown menu and wireup up json attach funds - [#225](https://github.com/alleslabs/celatone-frontend/pull/225) Add assets section in account details page From be655b2f7303a065caa50d5f844b89f89ba307e9 Mon Sep 17 00:00:00 2001 From: Kanisorn Peach Date: Wed, 15 Mar 2023 10:46:04 +0700 Subject: [PATCH 05/12] Merge pull request #238 from alleslabs/fix/sidebar-active-tab Fix incorrect isCurrentPage for overview page --- CHANGELOG.md | 1 + src/lib/layout/navbar/index.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90ee1768..c895cf1a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes +- [#238](https://github.com/alleslabs/celatone-frontend/pull/238) Fix incorrect isCurrentPage for overview page - [#235](https://github.com/alleslabs/celatone-frontend/pull/235) Fix css bugs and aesthetics improvement - [#236](https://github.com/alleslabs/celatone-frontend/pull/236) Add alphabetically sorting to JSON attach funds - [#231](https://github.com/alleslabs/celatone-frontend/pull/231) Fix double slash for endpoint, disable calling endpoint when there is no contract addr in contract details page diff --git a/src/lib/layout/navbar/index.tsx b/src/lib/layout/navbar/index.tsx index 7ae5e2614..8edaad7fe 100644 --- a/src/lib/layout/navbar/index.tsx +++ b/src/lib/layout/navbar/index.tsx @@ -33,7 +33,7 @@ const Navbar = observer(({ isExpand, setIsExpand }: NavbarProps) => { switch (slug) { // handle home page case "/": - return pathName === `${networkPath}`; + return pathName === `${networkPath}` || pathName === "/"; // handle contract list page and public project page case "/contract-list": case "/public-project": From 624253dde4214f9db409088e377f39a0054a3f45 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Wed, 3 May 2023 10:36:13 +0700 Subject: [PATCH 06/12] chore: disable proprosal things --- src/lib/pages/proposal/whitelist/index.tsx | 7 +++++++ src/lib/pages/proposals/index.tsx | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/pages/proposal/whitelist/index.tsx b/src/lib/pages/proposal/whitelist/index.tsx index e2ea3c3e4..da2ec6f72 100644 --- a/src/lib/pages/proposal/whitelist/index.tsx +++ b/src/lib/pages/proposal/whitelist/index.tsx @@ -21,6 +21,7 @@ import { getAlert } from "../utils"; import { useCurrentNetwork, useFabricateFee, + useInternalNavigate, useSimulateFeeQuery, useSubmitProposalTx, } from "lib/app-provider"; @@ -84,6 +85,7 @@ const ProposalToWhitelist = () => { name: "addresses", }); const { isTestnet } = useCurrentNetwork(); + const navigate = useInternalNavigate(); const addressesArray = addresses.map((addressObj) => addressObj.address); const formErrorsKey = Object.keys(formErrors); @@ -184,6 +186,11 @@ const ProposalToWhitelist = () => { submitProposalTx, ]); + useEffect(() => { + // remark: disable proposal whitelist and redirect to home page + navigate({ pathname: "/" }); + }, [navigate]); + useEffect(() => { if (minDeposit) reset({ diff --git a/src/lib/pages/proposals/index.tsx b/src/lib/pages/proposals/index.tsx index 4804096c0..878b51daf 100644 --- a/src/lib/pages/proposals/index.tsx +++ b/src/lib/pages/proposals/index.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/router"; import type { ChangeEvent } from "react"; import { useState, useEffect } from "react"; -import { useChainId } from "lib/app-provider"; +import { useChainId, useInternalNavigate } from "lib/app-provider"; import { NewProposalButton } from "lib/components/button/NewProposalButton"; import InputWithIcon from "lib/components/InputWithIcon"; import PageContainer from "lib/components/PageContainer"; @@ -62,9 +62,14 @@ const Proposals = () => { proposer ); + const navigate = useInternalNavigate(); + useEffect(() => { + // remark: disable proposal and redirect to home page + navigate({ pathname: "/" }); + if (router.isReady) AmpTrack(AmpEvent.TO_PROPOSALS); - }, [router.isReady]); + }, [router.isReady, navigate]); useEffect(() => { setPageSize(10); From fab6a50d57feee5eea0cf965a94baf9e941ebc03 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Wed, 3 May 2023 10:56:11 +0700 Subject: [PATCH 07/12] chore: edit graphql endpoint for osmosis --- src/lib/app-provider/query-client/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/app-provider/query-client/index.ts b/src/lib/app-provider/query-client/index.ts index 2b4359f9e..91d1b7b32 100644 --- a/src/lib/app-provider/query-client/index.ts +++ b/src/lib/app-provider/query-client/index.ts @@ -4,8 +4,8 @@ export const GRAPH_URL: Record = { /** * Revisit graphql for terra2 mainnet and osmosis mainnet */ - osmosis: "https://osmosis-mainnet-graphql2.alleslabs.dev/v1/graphql", - osmosistestnet: "https://osmosis-testnet-graphql2.alleslabs.dev/v1/graphql", + osmosis: "https://osmosis-mainnet-graphql.alleslabs.dev/v1/graphql", + osmosistestnet: "https://osmosis-testnet-graphql.alleslabs.dev/v1/graphql", terra2testnet: "https://terra-testnet-graphql.alleslabs.dev/v1/graphql", }; From f74d26ad4a442beb87317190f0750fbceaea53b8 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Tue, 9 May 2023 16:15:02 +0700 Subject: [PATCH 08/12] docs: cut release v1.0.4 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30f17eab8..399ba344e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes +## v1.0.4 + +### Bug fixes + +- [#316](https://github.com/alleslabs/celatone-frontend/pull/316) Stop propagation when clicking on ContractRowCTA menu + ## v1.0.3 ### Features @@ -95,7 +101,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes -- [#316](https://github.com/alleslabs/celatone-frontend/pull/316) Stop propagation when clicking on ContractRowCTA menu - [#306](https://github.com/alleslabs/celatone-frontend/pull/306) Fix react query function timeout and retries, minor ui bugs - [#307](https://github.com/alleslabs/celatone-frontend/pull/307) Remove minor ui in account detail - [#297](https://github.com/alleslabs/celatone-frontend/pull/297) Fix open new tab on tx modal link clicked From 12035d2954da77bf5889bb8fbf44cb985abbae36 Mon Sep 17 00:00:00 2001 From: evilpeach Date: Tue, 9 May 2023 16:47:45 +0700 Subject: [PATCH 09/12] docs: remove wrong version --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e2f78ee..399ba344e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,8 +37,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -## v1.0.3 - ### Features ### Improvements From 41bb7c2e6ac7d7cc2726dd7b1476f29da5439b8b Mon Sep 17 00:00:00 2001 From: evilpeach Date: Thu, 18 May 2023 19:10:43 +0700 Subject: [PATCH 10/12] docs: cut release v1.0.5 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2afc77c23..8b2c13b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## v1.0.5 + ### Features - [#327](https://github.com/alleslabs/celatone-frontend/pull/327) Update logic to enable upload wasm code From 882d2488ca339b248bd5e8f18f5332c53d14b83c Mon Sep 17 00:00:00 2001 From: poomthiti Date: Fri, 19 May 2023 10:58:42 +0700 Subject: [PATCH 11/12] feat: apply initial condition to my stored codes upload button --- CHANGELOG.md | 1 + .../codes/components/MyStoredCodesSection.tsx | 51 ++++++++++++------- .../pages/codes/components/UploadButton.tsx | 23 ++++++--- 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b2c13b4f..ea517e022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Features +- [#346](https://github.com/alleslabs/celatone-frontend/pull/346) Apply initial condition to my stored codes upload button - [#327](https://github.com/alleslabs/celatone-frontend/pull/327) Update logic to enable upload wasm code - [#317](https://github.com/alleslabs/celatone-frontend/pull/317) Add amplitude for proposal list page and pagination diff --git a/src/lib/pages/codes/components/MyStoredCodesSection.tsx b/src/lib/pages/codes/components/MyStoredCodesSection.tsx index 51c9ccf5c..2747ba98b 100644 --- a/src/lib/pages/codes/components/MyStoredCodesSection.tsx +++ b/src/lib/pages/codes/components/MyStoredCodesSection.tsx @@ -1,7 +1,10 @@ import { Box, Heading, HStack } from "@chakra-ui/react"; +import { useWallet } from "@cosmos-kit/react"; import { MyStoredCodesTable } from "lib/components/table"; -import type { CodeInfo } from "lib/types"; +import { useUploadAccessParams } from "lib/services/proposalService"; +import type { Addr, CodeInfo } from "lib/types"; +import { AccessConfigPermission } from "lib/types"; import { UploadButton } from "./UploadButton"; @@ -19,21 +22,31 @@ export const MyStoredCodesSection = ({ onRowSelect, disconnectedMessage, isSearching, -}: MyStoredCodesSectionProps) => ( - - - - My Stored Codes - - - - - -); +}: MyStoredCodesSectionProps) => { + const { data } = useUploadAccessParams(); + const { address } = useWallet(); + const isAllowed = Boolean(data?.addresses?.includes(address as Addr)); + + const isPermissionedNetwork = + data?.permission !== AccessConfigPermission.EVERYBODY; + + return ( + + + + My Stored Codes + + {/* TODO: overwrite this logic when merging proposal feature */} + + + + + ); +}; diff --git a/src/lib/pages/codes/components/UploadButton.tsx b/src/lib/pages/codes/components/UploadButton.tsx index 2efc0cc78..1fe3784a4 100644 --- a/src/lib/pages/codes/components/UploadButton.tsx +++ b/src/lib/pages/codes/components/UploadButton.tsx @@ -2,15 +2,26 @@ import { Button } from "@chakra-ui/react"; import { useInternalNavigate } from "lib/app-provider"; import { CustomIcon } from "lib/components/icon"; +import { Tooltip } from "lib/components/Tooltip"; -export const UploadButton = () => { +interface UploadButtonProps { + isAllowed: boolean; +} +export const UploadButton = ({ isAllowed }: UploadButtonProps) => { const navigate = useInternalNavigate(); + return ( - + + ); }; From b271699a22ae76699a775f5f4ab88ee299fabceb Mon Sep 17 00:00:00 2001 From: evilpeach Date: Fri, 19 May 2023 11:46:50 +0700 Subject: [PATCH 12/12] docs: remove redundant changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea517e022..4cb48b99b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,7 +95,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Improvements -- [#298](https://github.com/alleslabs/celatone-frontend/pull/298) Show deposit/voting period from gov params and add minimum required alert - [#309](https://github.com/alleslabs/celatone-frontend/pull/309) Add public account name and description in account detail page - [#289](https://github.com/alleslabs/celatone-frontend/pull/289) Add public accounts to public projects - [#308](https://github.com/alleslabs/celatone-frontend/pull/308) Adjust view more button to full width and fix empty state layout in contract history