Skip to content

Commit

Permalink
Merge branch 'main' of github.com:blockscout/frontend into tom2drum/i…
Browse files Browse the repository at this point in the history
…ssue-2178
  • Loading branch information
tom2drum committed Aug 23, 2024
2 parents 25bbf5c + eb6a0da commit 5ccca79
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions deploy/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ releases:
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.*.*
namespace: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand All @@ -58,7 +58,7 @@ releases:
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.*.*
namespace: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand Down
3 changes: 1 addition & 2 deletions ui/addresses/AddressesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ const AddressesTable = ({ items, totalSupply, pageStartIndex, top, isLoading }:
<Thead top={ top }>
<Tr>
<Th width="64px">Rank</Th>
<Th width={ hasPercentage ? '30%' : '40%' }>Address</Th>
<Th width="20%" pl={ 10 }>Public tag</Th>
<Th width={ hasPercentage ? '50%' : '60%' }>Address</Th>
<Th width={ hasPercentage ? '20%' : '25%' } isNumeric>{ `Balance ${ currencyUnits.ether }` }</Th>
{ hasPercentage && <Th width="15%" isNumeric>Percentage</Th> }
<Th width="15%" isNumeric>Txn count</Th>
Expand Down
24 changes: 12 additions & 12 deletions ui/addresses/AddressesTableItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tr, Td, Text, Skeleton } from '@chakra-ui/react';
import { Tr, Td, Text, Skeleton, Flex } from '@chakra-ui/react';
import BigNumber from 'bignumber.js';
import React from 'react';

Expand Down Expand Up @@ -35,17 +35,17 @@ const AddressesTableItem = ({
</Skeleton>
</Td>
<Td>
<AddressEntity
address={ item }
isLoading={ isLoading }
fontWeight={ 700 }
my="2px"
/>
</Td>
<Td pl={ 10 }>
{ item.public_tags && item.public_tags.length ? item.public_tags.map(tag => (
<Tag key={ tag.label } isLoading={ isLoading } isTruncated>{ tag.display_name }</Tag>
)) : null }
<Flex alignItems="center" columnGap={ 2 }>
<AddressEntity
address={ item }
isLoading={ isLoading }
fontWeight={ 700 }
my="2px"
/>
{ item.public_tags && item.public_tags.length ? item.public_tags.map(tag => (
<Tag key={ tag.label } isLoading={ isLoading } isTruncated>{ tag.display_name }</Tag>
)) : null }
</Flex>
</Td>
<Td isNumeric>
<Skeleton isLoaded={ !isLoading } display="inline-block" maxW="100%">
Expand Down
2 changes: 1 addition & 1 deletion ui/nameDomain/details/NameDomainDetailsAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {

const NameDomainDetailsAlert = ({ data }: Props) => {

if (!data?.stored_offchain || !data?.resolved_with_wildcard) {
if (!data?.stored_offchain && !data?.resolved_with_wildcard) {
return null;
}

Expand Down
11 changes: 9 additions & 2 deletions ui/pages/Accounts.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ const addresses: AddressesResponse = {
...addressMocks.withName,
tx_count: '1',
coin_balance: '12345678901234567890000',
}, {
},
{
...addressMocks.token,
tx_count: '109123890123',
coin_balance: '22222345678901234567890000',
ens_domain_name: null,
}, {
},
{
...addressMocks.withoutName,
tx_count: '11',
coin_balance: '1000000000000000000',
},
{
...addressMocks.eoa,
tx_count: '420',
coin_balance: '123456',
},
],
total_supply: '25222000',
next_page_params: null,
Expand Down
1 change: 1 addition & 0 deletions ui/pages/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ const AddressPageContent = () => {

const tags: Array<EntityTag> = React.useMemo(() => {
return [
...(addressQuery.data?.public_tags?.map((tag) => ({ slug: tag.label, name: tag.display_name, tagType: 'custom' as const, ordinal: -1 })) || []),
!addressQuery.data?.is_contract ? { slug: 'eoa', name: 'EOA', tagType: 'custom' as const, ordinal: -1 } : undefined,
config.features.validators.isEnabled && addressQuery.data?.has_validated_blocks ?
{ slug: 'validator', name: 'Validator', tagType: 'custom' as const, ordinal: 10 } :
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions ui/shared/entities/address/AddressEntity.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import * as addressMock from 'mocks/address/address';
import * as implementationsMock from 'mocks/address/implementations';
import * as metadataMock from 'mocks/metadata/address';
import { test, expect } from 'playwright/lib';

import AddressEntity from './AddressEntity';
Expand Down Expand Up @@ -100,6 +101,18 @@ test.describe('proxy contract', () => {
await expect(page.getByText('Proxy contract')).toBeVisible();
await expect(page).toHaveScreenshot();
});

test('with name tag', async({ render, page }) => {
const component = await render(
<AddressEntity
address={{ ...addressMock.contract, metadata: { reputation: 1, tags: [ metadataMock.nameTag ] } }}
/>,
);

await component.getByText(/quack/i).hover();
await expect(page.getByText('Proxy contract')).toBeVisible();
await expect(page).toHaveScreenshot();
});
});

test.describe('loading', () => {
Expand Down
6 changes: 4 additions & 2 deletions ui/shared/entities/address/AddressEntityContentProxy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const AddressEntityContentProxy = (props: ContentProps) => {
}

const colNum = Math.min(implementations.length, 3);
const nameTag = props.address.metadata?.tags.find(tag => tag.tagType === 'name')?.name;

const implementationName = implementations.length === 1 && implementations[0].name ? implementations[0].name : undefined;

return (
Expand All @@ -29,8 +31,8 @@ const AddressEntityContentProxy = (props: ContentProps) => {
<Box display="inline-flex" w="100%">
<EntityBase.Content
{ ...props }
truncation={ implementationName || props.address.name ? 'tail' : props.truncation }
text={ implementationName || props.address.name || props.address.hash }
truncation={ nameTag || implementationName || props.address.name ? 'tail' : props.truncation }
text={ nameTag || implementationName || props.address.name || props.address.hash }
isTooltipDisabled
/>
</Box>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5ccca79

Please sign in to comment.