Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/ylide-forum' into ylide-forum
Browse files Browse the repository at this point in the history
  • Loading branch information
ElKornacio committed Dec 4, 2023
2 parents 5b5ac02 + 47f80b2 commit 9a23f4b
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 117 deletions.
8 changes: 4 additions & 4 deletions deploy/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ releases:
# Deploy front-main
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.3.*
namespace: front-main
labels:
app: front
Expand All @@ -30,7 +30,7 @@ releases:
# Deploy l2-optimism-goerli
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.3.*
namespace: l2-optimism-goerli
labels:
app: l2-optimism-goerli
Expand All @@ -55,7 +55,7 @@ releases:
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.3.*
namespace: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand All @@ -80,7 +80,7 @@ releases:
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout/blockscout-stack
version: 1.2.*
version: 1.3.*
namespace: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand Down
9 changes: 4 additions & 5 deletions deploy/values/review/values.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ frontend:
nginx.ingress.kubernetes.io/proxy-connect-timeout: "15m"
nginx.ingress.kubernetes.io/proxy-send-timeout: "15m"
nginx.ingress.kubernetes.io/proxy-read-timeout: "15m"
nginx.ingress.kubernetes.io/proxy-buffer-size: "128k"
nginx.ingress.kubernetes.io/proxy-buffers-number: "8"
cert-manager.io/cluster-issuer: "zerossl-prod"
hostname: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}.k8s-dev.blockscout.com

Expand All @@ -51,8 +53,8 @@ frontend:
NEXT_PUBLIC_FEATURED_NETWORKS: https://raw.githubusercontent.com/blockscout/frontend-configs/dev/configs/featured-networks/eth-goerli.json
NEXT_PUBLIC_NETWORK_LOGO: https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-logos/goerli.svg
NEXT_PUBLIC_NETWORK_ICON: https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/goerli.svg
NEXT_PUBLIC_API_HOST: etc.blockscout.com
NEXT_PUBLIC_STATS_API_HOST: https://stats-etc.k8s.blockscout.com/
NEXT_PUBLIC_API_HOST: blockscout-main.k8s-dev.blockscout.com
NEXT_PUBLIC_STATS_API_HOST: https://stats-test.k8s-dev.blockscout.com/
NEXT_PUBLIC_VISUALIZE_API_HOST: http://visualizer-svc.visualizer-testing.svc.cluster.local/
NEXT_PUBLIC_CONTRACT_INFO_API_HOST: https://contracts-info-test.k8s-dev.blockscout.com
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST: https://admin-rs-test.k8s-dev.blockscout.com
Expand All @@ -71,9 +73,6 @@ frontend:
NEXT_PUBLIC_VIEWS_TX_ADDITIONAL_FIELDS: "['fee_per_gas']"
NEXT_PUBLIC_USE_NEXT_JS_PROXY: true
NEXT_PUBLIC_VIEWS_NFT_MARKETPLACES: "[{'name':'LooksRare','collection_url':'https://goerli.looksrare.org/collections/{hash}','instance_url':'https://goerli.looksrare.org/collections/{hash}/{id}','logo_url':'https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/nft-marketplace-logos/looks-rare.png'}]"
OTEL_SDK_ENABLED: true
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger-collector.jaeger.svc.cluster.local:4318
NEXT_OTEL_VERBOSE: 1
NEXT_PUBLIC_IS_FORUM_SUPPORTED: true
NEXT_PUBLIC_FORUM_INDEXER_URL: https://forum-blockscout.ylide.io
envFromSecret:
Expand Down
12 changes: 6 additions & 6 deletions lib/api/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ export const SORTING_FIELDS = [ 'sort', 'order' ];
export const RESOURCES = {
// ACCOUNT
csrf: {
path: '/api/account/v1/get_csrf',
path: '/api/account/v2/get_csrf',
},
user_info: {
path: '/api/account/v1/user/info',
path: '/api/account/v2/user/info',
},
email_resend: {
path: '/api/account/v1/email/resend',
path: '/api/account/v2/email/resend',
},
custom_abi: {
path: '/api/account/v1/user/custom_abis/:id?',
path: '/api/account/v2/user/custom_abis/:id?',
pathParams: [ 'id' as const ],
},
watchlist: {
Expand All @@ -95,7 +95,7 @@ export const RESOURCES = {
filterFields: [ ],
},
public_tags: {
path: '/api/account/v1/user/public_tags/:id?',
path: '/api/account/v2/user/public_tags/:id?',
pathParams: [ 'id' as const ],
},
private_tags_address: {
Expand All @@ -109,7 +109,7 @@ export const RESOURCES = {
filterFields: [ ],
},
api_keys: {
path: '/api/account/v1/user/api_keys/:id?',
path: '/api/account/v2/user/api_keys/:id?',
pathParams: [ 'id' as const ],
},

Expand Down
15 changes: 9 additions & 6 deletions lib/sentry/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type * as Sentry from '@sentry/react';
import { BrowserTracing } from '@sentry/tracing';

import appConfig from 'configs/app';

Expand All @@ -10,12 +11,13 @@ export const config: Sentry.BrowserOptions | undefined = (() => {
}

const tracesSampleRate: number | undefined = (() => {
if (feature.environment === 'staging' || feature.environment === 'development') {
return 1;
}

if (feature.environment === 'production') {
return 0.2;
switch (feature.environment) {
case 'development':
return 1;
case 'staging':
return 0.75;
case 'production':
return 0.2;
}
})();

Expand All @@ -25,6 +27,7 @@ export const config: Sentry.BrowserOptions | undefined = (() => {
release: feature.release,
enableTracing: feature.enableTracing,
tracesSampleRate,
integrations: [ new BrowserTracing() ],

// error filtering settings
// were taken from here - https://docs.sentry.io/platforms/node/guides/azure-functions/configuration/filtering/#decluttering-sentry
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"@opentelemetry/sdk-trace-node": "^1.18.0",
"@opentelemetry/semantic-conventions": "^1.18.0",
"@sentry/cli": "^2.21.2",
"@sentry/react": "^7.72.0",
"@sentry/react": "7.24.0",
"@sentry/tracing": "7.24.0",
"@slise/embed-react": "^2.2.0",
"@tanstack/react-query": "^5.4.3",
"@tanstack/react-query-devtools": "^5.4.3",
Expand Down
2 changes: 1 addition & 1 deletion ui/address/contract/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const getNativeCoinValue = (value: string | Array<unknown>) => {
return BigInt(0);
}

return BigInt(Number(_value));
return BigInt(_value);
};

export const addZeroesAllowed = (valueType: string) => {
Expand Down
81 changes: 45 additions & 36 deletions ui/shared/monaco/CodeEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SystemStyleObject } from '@chakra-ui/react';
import { Box, useColorMode, Flex, useToken } from '@chakra-ui/react';
import { Box, useColorMode, Flex, useToken, Center } from '@chakra-ui/react';
import type { EditorProps } from '@monaco-editor/react';
import MonacoEditor from '@monaco-editor/react';
import type * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
Expand All @@ -11,6 +11,7 @@ import type { SmartContractExternalLibrary } from 'types/api/contract';
import useClientRect from 'lib/hooks/useClientRect';
import useIsMobile from 'lib/hooks/useIsMobile';
import isMetaKey from 'lib/isMetaKey';
import ErrorBoundary from 'ui/shared/ErrorBoundary';

import CodeEditorBreadcrumbs from './CodeEditorBreadcrumbs';
import CodeEditorLoading from './CodeEditorLoading';
Expand Down Expand Up @@ -207,6 +208,10 @@ const CodeEditor = ({ data, remappings, libraries, language, mainFile }: Props)
},
}), [ editorWidth, themeColors, borderRadius ]);

const renderErrorScreen = React.useCallback(() => {
return <Center bgColor={ themeColors['editor.background'] } w="100%" borderRadius="md">Oops! Something went wrong!</Center>;
}, [ themeColors ]);

if (data.length === 1) {
const sx = {
...containerSx,
Expand All @@ -220,15 +225,17 @@ const CodeEditor = ({ data, remappings, libraries, language, mainFile }: Props)

return (
<Box height={ `${ EDITOR_HEIGHT }px` } width="100%" sx={ sx } ref={ containerNodeRef }>
<MonacoEditor
className="editor-container"
language={ editorLanguage }
path={ data[index].file_path }
defaultValue={ data[index].source_code }
options={ EDITOR_OPTIONS }
onMount={ handleEditorDidMount }
loading={ <CodeEditorLoading borderRadius="md"/> }
/>
<ErrorBoundary renderErrorScreen={ renderErrorScreen }>
<MonacoEditor
className="editor-container"
language={ editorLanguage }
path={ data[index].file_path }
defaultValue={ data[index].source_code }
options={ EDITOR_OPTIONS }
onMount={ handleEditorDidMount }
loading={ <CodeEditorLoading borderRadius="md"/> }
/>
</ErrorBoundary>
</Box>
);
}
Expand All @@ -247,34 +254,36 @@ const CodeEditor = ({ data, remappings, libraries, language, mainFile }: Props)
onKeyDown={ handleKeyDown }
onKeyUp={ handleKeyUp }
>
<Box flexGrow={ 1 }>
<CodeEditorTabs
tabs={ tabs }
activeTab={ data[index].file_path }
<ErrorBoundary renderErrorScreen={ renderErrorScreen }>
<Box flexGrow={ 1 }>
<CodeEditorTabs
tabs={ tabs }
activeTab={ data[index].file_path }
mainFile={ mainFile }
onTabSelect={ handleTabSelect }
onTabClose={ handleTabClose }
/>
<CodeEditorBreadcrumbs path={ data[index].file_path }/>
<MonacoEditor
className="editor-container"
height={ `${ EDITOR_HEIGHT }px` }
language={ editorLanguage }
path={ data[index].file_path }
defaultValue={ data[index].source_code }
options={ EDITOR_OPTIONS }
onMount={ handleEditorDidMount }
loading={ <CodeEditorLoading borderBottomLeftRadius="md"/> }
/>
</Box>
<CodeEditorSideBar
data={ data }
onFileSelect={ handleSelectFile }
monaco={ instance }
editor={ editor }
selectedFile={ data[index].file_path }
mainFile={ mainFile }
onTabSelect={ handleTabSelect }
onTabClose={ handleTabClose }
/>
<CodeEditorBreadcrumbs path={ data[index].file_path }/>
<MonacoEditor
className="editor-container"
height={ `${ EDITOR_HEIGHT }px` }
language={ editorLanguage }
path={ data[index].file_path }
defaultValue={ data[index].source_code }
options={ EDITOR_OPTIONS }
onMount={ handleEditorDidMount }
loading={ <CodeEditorLoading borderBottomLeftRadius="md"/> }
/>
</Box>
<CodeEditorSideBar
data={ data }
onFileSelect={ handleSelectFile }
monaco={ instance }
editor={ editor }
selectedFile={ data[index].file_path }
mainFile={ mainFile }
/>
</ErrorBoundary>
</Flex>
);
};
Expand Down
Loading

0 comments on commit 9a23f4b

Please sign in to comment.