Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/subspace-frontend' into muhammad…
Browse files Browse the repository at this point in the history
…/frontend
  • Loading branch information
DaMandal0rian committed May 6, 2024
2 parents cf22262 + 84af34a commit 84c9827
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 193 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/deploy-subspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ env:
# cancel-in-progress: true

jobs:
make_slug:
name: Make GitHub reference slug
publish_image:
name: Publish Docker image
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.4.1
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down Expand Up @@ -55,5 +55,3 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
60 changes: 53 additions & 7 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,61 @@ on:
workflow_dispatch:
workflow_call:

# concurrency:
# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }}
# cancel-in-progress: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish_image:
name: Publish Docker image
uses: './.github/workflows/publish-image.yml'
secrets: inherit
runs-on: ubuntu-latest
outputs:
shortSha: ${{ steps.output-step.outputs.short-sha }}
tags: ${{ steps.meta.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.4.1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/blockscout/frontend

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Add outputs
run: |
echo "::set-output name=short-sha::${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}"
id: output-step

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
cache-from: type=gha
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
deploy_e2e:
name: Deploy E2E instance
Expand All @@ -37,7 +83,7 @@ jobs:
with:
owner: blockscout
repo: deployment-values
github_token: ${{ env.WORKFLOW_TRIGGER_TOKEN }}
github_token: ${{env.WORKFLOW_TRIGGER_TOKEN}}
workflow_file_name: deploy_blockscout.yaml
ref: main
wait_interval: 30
Expand All @@ -47,4 +93,4 @@ jobs:
name: Run tests
needs: deploy_e2e
uses: blockscout/blockscout-ci-cd/.github/workflows/e2e_new.yaml@master
secrets: inherit
secrets: inherit
84 changes: 0 additions & 84 deletions .github/workflows/publish-image.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/upload-source-maps.yml

This file was deleted.

1 change: 1 addition & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from 'react';
import logRequestFromBot from 'nextjs/utils/logRequestFromBot';
import * as serverTiming from 'nextjs/utils/serverTiming';

import config from 'configs/app';
import theme from 'theme';
import * as svgSprite from 'ui/shared/IconSvg';

Expand Down
4 changes: 2 additions & 2 deletions ui/pages/NameDomain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
import { ENS_DOMAIN } from 'stubs/ENS';
import NameDomainDetails from 'ui/nameDomain/NameDomainDetails';
import NameDomainHistory from 'ui/nameDomain/NameDomainHistory';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import EnsEntity from 'ui/shared/entities/ens/EnsEntity';
import IconSvg from 'ui/shared/IconSvg';
Expand Down Expand Up @@ -84,7 +84,7 @@ const NameDomain = () => {

return (
<>
<TextAd mb={ 6 }/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle title="Name details" secondRow={ titleSecondRow }/>
{ infoQuery.isPlaceholderData ? (
<>
Expand Down
4 changes: 2 additions & 2 deletions ui/pages/UserOp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import throwOnAbsentParamError from 'lib/errors/throwOnAbsentParamError';
import throwOnResourceLoadError from 'lib/errors/throwOnResourceLoadError';
import getQueryParamString from 'lib/router/getQueryParamString';
import { USER_OP } from 'stubs/userOps';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from 'ui/shared/ad/TextAd';
import PageTitle from 'ui/shared/Page/PageTitle';
import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
import TabsSkeleton from 'ui/shared/Tabs/TabsSkeleton';
Expand Down Expand Up @@ -94,7 +94,7 @@ const UserOp = () => {

return (
<>
<TextAd mb={ 6 }/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle
title="User operation details"
backLink={ backLink }
Expand Down
57 changes: 40 additions & 17 deletions ui/pages/ZkEvmL2TxnBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import getQueryParamString from 'lib/router/getQueryParamString';
import { TX_ZKEVM_L2 } from 'stubs/tx';
import { generateListStub } from 'stubs/utils';
import { ZKEVM_L2_TXN_BATCH } from 'stubs/zkEvmL2';
import TextAd from 'ui/shared/ad/TextAd';
//import TextAd from "ui/shared/ad/TextAd";
import PageTitle from 'ui/shared/Page/PageTitle';
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
import RoutedTabs from 'ui/shared/Tabs/RoutedTabs';
Expand All @@ -37,22 +37,48 @@ const ZkEvmL2TxnBatch = () => {
resourceName: 'zkevm_l2_txn_batch_txs',
pathParams: { number },
options: {
enabled: Boolean(!batchQuery.isPlaceholderData && batchQuery.data?.number && tab === 'txs'),
enabled: Boolean(
!batchQuery.isPlaceholderData &&
batchQuery.data?.number &&
tab === 'txs',
),
// there is no pagination in zkevm_l2_txn_batch_txs
placeholderData: generateListStub<'zkevm_l2_txn_batch_txs'>(TX_ZKEVM_L2, 50, { next_page_params: null }),
placeholderData: generateListStub<'zkevm_l2_txn_batch_txs'>(
TX_ZKEVM_L2,
50,
{ next_page_params: null },
),
},
});

throwOnAbsentParamError(number);
throwOnResourceLoadError(batchQuery);

const tabs: Array<RoutedTab> = React.useMemo(() => ([
{ id: 'index', title: 'Details', component: <ZkEvmL2TxnBatchDetails query={ batchQuery }/> },
{ id: 'txs', title: 'Transactions', component: <TxsWithFrontendSorting query={ batchTxsQuery } showSocketInfo={ false }/> },
].filter(Boolean)), [ batchQuery, batchTxsQuery ]);
const tabs: Array<RoutedTab> = React.useMemo(
() =>
[
{
id: 'index',
title: 'Details',
component: <ZkEvmL2TxnBatchDetails query={ batchQuery }/>,
},
{
id: 'txs',
title: 'Transactions',
component: (
<TxsWithFrontendSorting
query={ batchTxsQuery }
showSocketInfo={ false }
/>
),
},
].filter(Boolean),
[ batchQuery, batchTxsQuery ],
);

const backLink = React.useMemo(() => {
const hasGoBackLink = appProps.referrer && appProps.referrer.includes('/zkevm_l2_txn_batches');
const hasGoBackLink =
appProps.referrer && appProps.referrer.includes('/zkevm_l2_txn_batches');

if (!hasGoBackLink) {
return;
Expand All @@ -66,15 +92,12 @@ const ZkEvmL2TxnBatch = () => {

return (
<>
<TextAd mb={ 6 }/>
<PageTitle
title={ `Tx batch #${ number }` }
backLink={ backLink }
/>
{ batchQuery.isPlaceholderData ? <TabsSkeleton tabs={ tabs }/> : (
<RoutedTabs
tabs={ tabs }
/>
{ /* <TextAd mb={ 6 }/> */ }
<PageTitle title={ `Tx batch #${ number }` } backLink={ backLink }/>
{ batchQuery.isPlaceholderData ? (
<TabsSkeleton tabs={ tabs }/>
) : (
<RoutedTabs tabs={ tabs }/>
) }
</>
);
Expand Down
2 changes: 1 addition & 1 deletion ui/shared/Page/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const PageTitle = ({ title, contentAfter, withTextAd, backLink, className, isLoa
{ afterTitle }
</Flex>
{ contentAfter }
{ withTextAd && <TextAd order={{ base: -1, lg: 100 }} mb={{ base: 6, lg: 0 }} ml="auto" w={{ base: '100%', lg: 'auto' }}/> }
{ /* { withTextAd && <TextAd order={{ base: -1, lg: 100 }} mb={{ base: 6, lg: 0 }} ml="auto" w={{ base: '100%', lg: 'auto' }}/> } */ }
</Flex>
{ secondRow && (
<Flex alignItems="center" minH={ 10 } overflow="hidden" _empty={{ display: 'none' }}>
Expand Down
Loading

0 comments on commit 84c9827

Please sign in to comment.