Skip to content

Commit

Permalink
[RELEASE] 09/30/2023 (#1714)
Browse files Browse the repository at this point in the history
Co-authored-by: Trung-Tin Pham <[email protected]>
Co-authored-by: vutuanlinh2k2 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pavan Soratur <[email protected]>
  • Loading branch information
5 people authored Sep 29, 2023
1 parent bd5a8cd commit 9c933d3
Show file tree
Hide file tree
Showing 75 changed files with 4,266 additions and 3,991 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -40,7 +40,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -58,7 +58,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Link Checker
uses: lycheeverse/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4.0.0
uses: actions/checkout@v4.1.0
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-bridge-dapp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-stats-dapp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-storybook-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4.0.0
uses: actions/checkout@v4.1.0
with:
persist-credentials: false
- name: Install and Build 🔧
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-tangle-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-webbsite-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
#Check out
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 100

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v4.0.0
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.13
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.14
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.15
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.16
https://github.com/webb-tools/webb-dapp/releases/tag/v0.0.17
https://github.com/webb-tools/webb-dapp/releases/tag/v1.0.0
https://github.com/webb-tools/webb-dapp/releases/tag/v1.0.1
https://github.com/webb-tools/webb-dapp/releases/tag/v1.0.2
https://github.com/webb-tools/webb-dapp/releases/tag/v1.0.3
https://github.com/webb-tools/webb-dapp/releases/tag/v1.0.4
10 changes: 10 additions & 0 deletions apps/bridge-dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed, Changed and Added

- Iterative Improvement For Hubble Bridge ([#1662](https://github.com/webb-tools/webb-dapp/pull/1662))

## [1.0.4] - 2023-09-30

### Fixed, Changed and Added

- Content fixes, spelling fix ([#1685](https://github.com/webb-tools/webb-dapp/pull/1695))
- Updates bridge header dropdown menu items ([#1701](https://github.com/webb-tools/webb-dapp/pull/1701))
- Remove forced goerli connection on wallet reconnect ([#1709](https://github.com/webb-tools/webb-dapp/pull/1709))
- Fix warning badge 0 balance state ([#1715](https://github.com/webb-tools/webb-dapp/pull/1715))
- Sort all non-active chains alphabetically ([#1716](https://github.com/webb-tools/webb-dapp/pull/1716))
2 changes: 1 addition & 1 deletion apps/bridge-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@webb-tools/bridge-dapp",
"version": "1.0.3",
"version": "1.0.4",
"main": "./src/index.js"
}
2 changes: 2 additions & 0 deletions apps/bridge-dapp/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
WEBB_FAUCET_URL,
WEBB_MKT_URL,
SOCIAL_URLS_RECORD,
WEBB_DOCS_URL,
} from '@webb-tools/webb-ui-components/constants';
import { FC, useCallback, useMemo } from 'react';
import { NavLink, useLocation } from 'react-router-dom';
Expand Down Expand Up @@ -110,6 +111,7 @@ export const Header: FC<HeaderProps> = () => {
{/** TODO: Refactor these links into a config file and make the menu items dynamically based on the config */}
<NavigationMenuContent
version={process.env.BRIDGE_VERSION}
onDocsClick={() => window.open(WEBB_DOCS_URL, '_blank')}
onTestnetClick={() =>
window.open(TANGLE_STANDALONE_EXPLORER_URL, '_blank')
}
Expand Down
38 changes: 23 additions & 15 deletions apps/bridge-dapp/src/components/Header/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
useWebbUI,
} from '@webb-tools/webb-ui-components';
import { FC, useCallback, useMemo } from 'react';

import { useConnectWallet } from '../../hooks';
import { getDefaultConnection } from '../../utils';

Expand All @@ -28,21 +27,25 @@ export const WalletModal: FC = () => {

const { notificationApi } = useWebbUI();

const { apiConfig, chains } = useWebContext();
const { apiConfig, chains, activeChain } = useWebContext();

const chainToSwitchTo = useMemo(() => {
if (!activeChain) {
if (!selectedChain) {
return getDefaultConnection(chains);
}

const chain = useMemo(() => {
if (!selectedChain) {
return getDefaultConnection(chains);
return selectedChain;
}

return selectedChain;
}, [chains, selectedChain]);
return activeChain;
}, [activeChain, selectedChain, chains]);

const supportedWalletCfgs = useMemo(() => {
return chain.wallets
return chainToSwitchTo.wallets
.map((walletId) => apiConfig.wallets[walletId])
.filter((w) => !!w);
}, [apiConfig.wallets, chain.wallets]);
}, [apiConfig.wallets, chainToSwitchTo.wallets]);

// Get the current failed or connecting wallet
const getCurrentWallet = useCallback(() => {
Expand All @@ -51,12 +54,17 @@ export const WalletModal: FC = () => {
return undefined;
}

if (!chain.wallets.includes(walletId)) {
if (!chainToSwitchTo.wallets.includes(walletId)) {
return undefined;
}

return apiConfig.wallets[walletId];
}, [failedWalletId, connectingWalletId, chain.wallets, apiConfig.wallets]);
}, [
failedWalletId,
connectingWalletId,
chainToSwitchTo.wallets,
apiConfig.wallets,
]);

const isNotInstalledError = useMemo(() => {
if (!connectError) {
Expand Down Expand Up @@ -103,9 +111,9 @@ export const WalletModal: FC = () => {

const handleWalletSelect = useCallback(
(wallet: WalletConfig) => {
switchWallet(chain, wallet);
switchWallet(chainToSwitchTo, wallet);
},
[chain, switchWallet]
[switchWallet, chainToSwitchTo]
);

const handleDownloadBtnClick = useCallback(() => {
Expand All @@ -132,12 +140,12 @@ export const WalletModal: FC = () => {
return;
}

await switchWallet(chain, selectedWallet);
await switchWallet(chainToSwitchTo, selectedWallet);
}, [
selectedWallet,
isNotInstalledError,
switchWallet,
chain,
chainToSwitchTo,
notificationApi,
handleDownloadBtnClick,
]);
Expand Down
6 changes: 6 additions & 0 deletions apps/bridge-dapp/src/constants/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
WEBB_DOCS_URL,
WEBB_FAUCET_URL,
WEBB_MKT_URL,
WEBB_HUBBLE_STATS_URL,
} from '@webb-tools/webb-ui-components/constants';

const items: SideBarItemProps[] = [
Expand All @@ -27,6 +28,11 @@ const items: SideBarItemProps[] = [
isInternal: true,
href: '/bridge',
},
{
name: 'Explorer',
isInternal: false,
href: WEBB_HUBBLE_STATS_URL,
},
{
name: 'Faucet',
isInternal: false,
Expand Down
6 changes: 2 additions & 4 deletions apps/bridge-dapp/src/constants/signIn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Logging into Webb's Hubble Bridge!
Domain: {domain}
Origin: {origin}
Address: {address}
Chain ID: {chainId}
To access your account and continue your journey, please sign in with your Ethereum account.
Expand All @@ -17,9 +16,8 @@ Your privacy is important to us. We will never store or share your private keys.
By signing in, you acknowledge and agree to our terms of service and privacy policy.
`;

export function createSignInMessage(address: string, chainId: number) {
export function createSignInMessage(address: string) {
return SIGN_IN_MESSAGE.replace('{domain}', domain)
.replace('{origin}', origin)
.replace('{address}', address)
.replace('{chainId}', chainId.toString());
.replace('{address}', address);
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ export const CreateAccountModal: FC<CreateAccountModalProps> = ({
throw WebbError.from(WebbErrorCodes.NoAccountAvailable);
}

const msg = createSignInMessage(
account.address,
await activeApi.getChainId()
);
const msg = createSignInMessage(account.address);

const signedString = await activeApi.sign(msg);

Expand Down
2 changes: 1 addition & 1 deletion apps/bridge-dapp/src/pages/Hubble/Bridge/SelectToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const getBalanceProps = (
balances[currencyCfg.id] &&
(txType !== 'withdraw' || currencyCfg.role !== CurrencyRole.Governable)
? { balance: balances[currencyCfg.id] }
: undefined;
: { balance: 0 };

const getBadgeProps = (
currencyCfg: CurrencyConfig,
Expand Down
6 changes: 5 additions & 1 deletion apps/bridge-dapp/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"],
"types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
],
"target": "ES6",
"strict": true
},
Expand Down
7 changes: 6 additions & 1 deletion apps/bridge-dapp/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": [
"jest",
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
},
"include": [
"jest.config.ts",
Expand Down
31 changes: 3 additions & 28 deletions apps/faucet/next.config.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,18 @@
const { withNx } = require('@nx/next/plugins/with-nx');
const { createSecureHeaders } = require('next-secure-headers');

const securityHeaders = createSecureHeaders({
frameGuard: 'sameorigin',
xssProtection: 'block-rendering',
referrerPolicy: 'no-referrer-when-downgrade',
}).concat([
{
key: 'Content-Security-Policy',
value: 'upgrade-insecure-requests',
},
{
key: 'Permissions-Policy',
value: 'camera=(), microphone=(), geolocation=(), browsing-topics=()',
},
]);
const nextCfgBase = require('../../next.config');

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
...nextCfgBase,

reactStrictMode: true,
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
async headers() {
return [
{
source: '/', // Netlify preview link doesn't work without this
headers: securityHeaders,
},
{
source: '/(.*)',
headers: securityHeaders,
},
];
},
};

module.exports = withNx(nextConfig);
Loading

0 comments on commit 9c933d3

Please sign in to comment.