From ea897c8e7adb43af48d12417888c8bb1084886fd Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Tue, 31 May 2022 11:18:10 +0100 Subject: [PATCH 1/9] Fix edit form validation (#1371) * Fixing logic for showing error messages * Removing unused code * Refactoring * fixing sample file validation * Removing console logs * Minor formatting --- src/components/@shared/FormInput/index.tsx | 25 ++++++++++---- .../Asset/Edit/FormEditMetadata.tsx | 34 ------------------- src/components/Asset/Edit/_constants.ts | 2 +- 3 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/components/@shared/FormInput/index.tsx b/src/components/@shared/FormInput/index.tsx index 4a3aeb98c..1abd886d4 100644 --- a/src/components/@shared/FormInput/index.tsx +++ b/src/components/@shared/FormInput/index.tsx @@ -66,6 +66,24 @@ export interface InputProps { disclaimerValues?: string[] } +function checkError( + form: any, + parsedFieldName: string[], + field: FieldInputProps +) { + if (form?.errors === {}) { + return false + } else if ( + (form?.touched?.[parsedFieldName[0]]?.[parsedFieldName[1]] && + form?.errors?.[parsedFieldName[0]]?.[parsedFieldName[1]]) || + (form?.touched[field.name] && + form?.errors[field.name] && + field.name !== 'links') + ) { + return true + } +} + export default function Input(props: Partial): ReactElement { const { label, @@ -81,17 +99,12 @@ export default function Input(props: Partial): ReactElement { const isFormikField = typeof field !== 'undefined' const isNestedField = field?.name?.includes('.') - // TODO: this feels hacky as it assumes nested `values` store. But we can't use the // `useField()` hook in here to get `meta.error` so we have to match against form?.errors? // handling flat and nested data at same time. const parsedFieldName = isFormikField && (isNestedField ? field?.name.split('.') : [field?.name]) - // const hasFormikError = !!meta?.touched && !!meta?.error - const hasFormikError = - form?.errors !== {} && - form?.touched?.[parsedFieldName[0]]?.[parsedFieldName[1]] && - form?.errors?.[parsedFieldName[0]]?.[parsedFieldName[1]] + const hasFormikError = checkError(form, parsedFieldName, field) const styleClasses = cx({ field: true, diff --git a/src/components/Asset/Edit/FormEditMetadata.tsx b/src/components/Asset/Edit/FormEditMetadata.tsx index 1c4461744..e7e5af8f2 100644 --- a/src/components/Asset/Edit/FormEditMetadata.tsx +++ b/src/components/Asset/Edit/FormEditMetadata.tsx @@ -17,40 +17,6 @@ export function checkIfTimeoutInPredefinedValues( return false } -function handleTimeoutCustomOption( - data: FormFieldContent[], - values: Partial -) { - const timeoutFieldContent = data.filter( - (field) => field.name === 'timeout' - )[0] - const timeoutInputIndex = data.findIndex( - (element) => element.name === 'timeout' - ) - if ( - data[timeoutInputIndex].options.length < 6 && - !checkIfTimeoutInPredefinedValues( - values?.services[0]?.timeout, - timeoutFieldContent.options - ) - ) { - data[timeoutInputIndex].options.push(values?.services[0]?.timeout) - } else if ( - data[timeoutInputIndex].options.length === 6 && - checkIfTimeoutInPredefinedValues( - values?.services[0]?.timeout, - timeoutFieldContent.options - ) - ) { - data[timeoutInputIndex].options.pop() - } else if ( - data[timeoutInputIndex].options.length === 6 && - data[timeoutInputIndex].options[5] !== values?.services[0]?.timeout - ) { - data[timeoutInputIndex].options[5] = values?.services[0]?.timeout - } -} - export default function FormEditMetadata({ data, showPrice, diff --git a/src/components/Asset/Edit/_constants.ts b/src/components/Asset/Edit/_constants.ts index 39d912d80..a03a1416a 100644 --- a/src/components/Asset/Edit/_constants.ts +++ b/src/components/Asset/Edit/_constants.ts @@ -1,5 +1,5 @@ import { Metadata, ServiceComputeOptions } from '@oceanprotocol/lib' -import { mapTimeoutStringToSeconds, secondsToString } from '@utils/ddo' +import { secondsToString } from '@utils/ddo' import * as Yup from 'yup' import { MetadataEditForm } from './_types' From e9a3513cace5ad0e1061df5838986975f3bc89ec Mon Sep 17 00:00:00 2001 From: claudiaHash <49017601+claudiaHash@users.noreply.github.com> Date: Thu, 2 Jun 2022 16:44:09 +0300 Subject: [PATCH 2/9] add error message title (#1473) Co-authored-by: ClaudiaHolhos --- src/components/Publish/Submission/Feedback.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Publish/Submission/Feedback.tsx b/src/components/Publish/Submission/Feedback.tsx index d1e542366..306637726 100644 --- a/src/components/Publish/Submission/Feedback.tsx +++ b/src/components/Publish/Submission/Feedback.tsx @@ -21,7 +21,9 @@ export function Feedback(): ReactElement {

{value.description}

{value.errorMessage && ( - {value.errorMessage} + + {value.errorMessage} + )} )) From e412dc10d6027174df17347a7929d10771a3d829 Mon Sep 17 00:00:00 2001 From: Luca Milanese Date: Mon, 6 Jun 2022 12:25:09 +0200 Subject: [PATCH 3/9] add v3 assets redirect (#1446) * feat: add v3 assets redirect * feat: add fallback return value to checkV3Asset * fix: rename env variables for v3 related uris --- app.config.js | 8 ++++++++ src/@context/Asset.tsx | 6 +++++- src/@utils/aquarius.ts | 24 +++++++++++++++++++++++- src/components/Asset/index.tsx | 12 +++++++++--- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/app.config.js b/app.config.js index 96d263a7b..f26006eef 100644 --- a/app.config.js +++ b/app.config.js @@ -9,6 +9,14 @@ module.exports = { process.env.NEXT_PUBLIC_METADATACACHE_URI || 'https://v4.aquarius.oceanprotocol.com', + v3MetadataCacheUri: + process.env.NEXT_PUBLIC_V3_METADATACACHE_URI || + 'https://aquarius.oceanprotocol.com', + + v3MarketUri: + process.env.NEXT_PUBLIC_V3_MARKET_URI || + 'https://v3.market.oceanprotocol.com', + // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. chainIds: [3, 4, 80001, 1287], diff --git a/src/@context/Asset.tsx b/src/@context/Asset.tsx index c18fb0a60..0eebb77e6 100644 --- a/src/@context/Asset.tsx +++ b/src/@context/Asset.tsx @@ -9,7 +9,7 @@ import React, { } from 'react' import { Config, LoggerInstance, Purgatory } from '@oceanprotocol/lib' import { CancelToken } from 'axios' -import { retrieveAsset } from '@utils/aquarius' +import { checkV3Asset, retrieveAsset } from '@utils/aquarius' import { useWeb3 } from './Web3' import { useCancelToken } from '@hooks/useCancelToken' import { getOceanConfig, getDevelopmentConfig } from '@utils/ocean' @@ -26,6 +26,7 @@ interface AssetProviderValue { owner: string error?: string isAssetNetwork: boolean + isV3Asset: boolean oceanConfig: Config loading: boolean fetchAsset: (token?: CancelToken) => Promise @@ -51,6 +52,7 @@ function AssetProvider({ const [error, setError] = useState() const [loading, setLoading] = useState(false) const [isAssetNetwork, setIsAssetNetwork] = useState() + const [isV3Asset, setIsV3Asset] = useState() const [oceanConfig, setOceanConfig] = useState() const newCancelToken = useCancelToken() @@ -68,6 +70,7 @@ function AssetProvider({ const asset = await retrieveAsset(did, token) if (!asset) { + setIsV3Asset(await checkV3Asset(did, token)) setError( `\`${did}\`` + '\n\nWe could not find an asset for this DID in the cache. If you just published a new asset, wait some seconds and refresh this page.' @@ -168,6 +171,7 @@ function AssetProvider({ loading, fetchAsset, isAssetNetwork, + isV3Asset, oceanConfig } as AssetProviderValue } diff --git a/src/@utils/aquarius.ts b/src/@utils/aquarius.ts index c33a0cc95..4a9319c20 100644 --- a/src/@utils/aquarius.ts +++ b/src/@utils/aquarius.ts @@ -2,7 +2,7 @@ import { Asset, LoggerInstance } from '@oceanprotocol/lib' import { AssetSelectionAsset } from '@shared/FormFields/AssetSelection' import axios, { CancelToken, AxiosResponse } from 'axios' import { OrdersData_orders as OrdersData } from '../@types/subgraph/OrdersData' -import { metadataCacheUri } from '../../app.config' +import { metadataCacheUri, v3MetadataCacheUri } from '../../app.config' import { SortDirectionOptions, SortTermOptions @@ -127,6 +127,28 @@ export async function retrieveAsset( } } +export async function checkV3Asset( + did: string, + cancelToken: CancelToken +): Promise { + try { + const response: AxiosResponse = await axios.get( + `${v3MetadataCacheUri}/api/v1/aquarius/assets/ddo/${did}`, + { cancelToken } + ) + if (!response || response.status !== 200 || !response.data) return false + + return true + } catch (error) { + if (axios.isCancel(error)) { + LoggerInstance.log(error.message) + } else { + LoggerInstance.error(error.message) + } + return false + } +} + export async function getAssetsNames( didList: string[], cancelToken: CancelToken diff --git a/src/components/Asset/index.tsx b/src/components/Asset/index.tsx index d0d57eeca..4bd104cbe 100644 --- a/src/components/Asset/index.tsx +++ b/src/components/Asset/index.tsx @@ -1,27 +1,33 @@ import React, { useState, useEffect, ReactElement } from 'react' +import { useRouter } from 'next/router' import Page from '@shared/Page' import Alert from '@shared/atoms/Alert' import Loader from '@shared/atoms/Loader' import { useAsset } from '@context/Asset' import AssetContent from './AssetContent' +import { v3MarketUri } from 'app.config' export default function AssetDetails({ uri }: { uri: string }): ReactElement { - const { asset, title, error, isInPurgatory, loading } = useAsset() + const router = useRouter() + const { asset, title, error, isInPurgatory, loading, isV3Asset } = useAsset() const [pageTitle, setPageTitle] = useState() useEffect(() => { + if (isV3Asset) { + router.push(`${v3MarketUri}${uri}`) + } if (!asset || error) { setPageTitle('Could not retrieve asset') return } setPageTitle(isInPurgatory ? '' : title) - }, [asset, error, isInPurgatory, title]) + }, [asset, error, isInPurgatory, isV3Asset, router, title, uri]) return asset && pageTitle !== undefined && !loading ? ( - ) : error ? ( + ) : error && isV3Asset === false ? ( From 857409d5ad6c9dcb331a3a1cf2664158618ce05d Mon Sep 17 00:00:00 2001 From: mihaisc Date: Tue, 7 Jun 2022 01:54:10 -0700 Subject: [PATCH 4/9] remove display of dt in setup (#1488) Signed-off-by: mihaisc --- src/components/@shared/PoolTransactions/Title.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/@shared/PoolTransactions/Title.tsx b/src/components/@shared/PoolTransactions/Title.tsx index 4c2de1f05..e827fb792 100644 --- a/src/components/@shared/PoolTransactions/Title.tsx +++ b/src/components/@shared/PoolTransactions/Title.tsx @@ -39,15 +39,10 @@ function getTitle(row: PoolTransaction, locale: string) { case 'SETUP': { const firstToken = row.baseToken const firstTokenSymbol = firstToken?.symbol - const secondToken = row.datatoken - const secondTokenSymbol = secondToken?.symbol title += `Create pool with ${formatPrice( Math.abs(row.baseTokenValue).toString(), locale - )}${firstTokenSymbol} and ${formatPrice( - Math.abs(row.datatokenValue).toString(), - locale - )}${secondTokenSymbol}` + )}${firstTokenSymbol}` break } case 'JOIN': From 57477958ab41fc72f9f947208ab16268e74a186c Mon Sep 17 00:00:00 2001 From: mihaisc Date: Tue, 7 Jun 2022 02:39:32 -0700 Subject: [PATCH 5/9] update package.lock (#1490) Signed-off-by: mihaisc --- package-lock.json | 135 +++++++++++++++++++++------------------------- 1 file changed, 61 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba05d5996..906b5d821 100644 --- a/package-lock.json +++ b/package-lock.json @@ -116,6 +116,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.1.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -223,6 +224,7 @@ "version": "7.17.10", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.10.tgz", "integrity": "sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA==", + "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", @@ -430,6 +432,7 @@ "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", @@ -498,6 +501,7 @@ "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "dev": true, "dependencies": { "@babel/types": "^7.17.0" }, @@ -563,6 +567,7 @@ "version": "7.17.9", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", + "dev": true, "dependencies": { "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.9", @@ -4075,6 +4080,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true, "engines": { "node": ">=6.0.0" } @@ -4096,6 +4102,7 @@ "version": "0.3.10", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz", "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==", + "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -19995,6 +20002,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, "dependencies": { "safe-buffer": "~5.1.1" } @@ -24557,6 +24565,7 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -24964,6 +24973,7 @@ "version": "15.8.0", "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "dev": true, "engines": { "node": ">= 10.x" } @@ -29812,6 +29822,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, "bin": { "json5": "lib/cli.js" }, @@ -41600,6 +41611,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "dev": true, "requires": { "@jridgewell/gen-mapping": "^0.1.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -41619,8 +41631,7 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz", "integrity": "sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==", - "dev": true, - "requires": {} + "dev": true }, "@apollographql/graphql-language-service-interface": { "version": "2.0.2", @@ -41646,8 +41657,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/@apollographql/graphql-language-service-types/-/graphql-language-service-types-2.0.2.tgz", "integrity": "sha512-vE+Dz8pG+Xa1Z2nMl82LoO66lQ6JqBUjaXqLDvS3eMjvA3N4hf+YUDOWfPdNZ0zjhHhHXzUIIZCkax6bXfFbzQ==", - "dev": true, - "requires": {} + "dev": true }, "@apollographql/graphql-language-service-utils": { "version": "2.0.2", @@ -41675,6 +41685,7 @@ "version": "7.17.10", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.10.tgz", "integrity": "sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA==", + "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", "@babel/code-frame": "^7.16.7", @@ -41827,6 +41838,7 @@ "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "dev": true, "requires": { "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-module-imports": "^7.16.7", @@ -41880,6 +41892,7 @@ "version": "7.17.7", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "dev": true, "requires": { "@babel/types": "^7.17.0" } @@ -41927,6 +41940,7 @@ "version": "7.17.9", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.9.tgz", "integrity": "sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q==", + "dev": true, "requires": { "@babel/template": "^7.16.7", "@babel/traverse": "^7.17.9", @@ -43453,8 +43467,7 @@ "@graphql-typed-document-node/core": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.1.tgz", - "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==", - "requires": {} + "integrity": "sha512-NQ17ii0rK1b34VZonlmT2QMJFI70m0TRwbknO/ihlbatXyaktDhN/98vBiUU6kNBPljqGqyIrl2T4nY2RpFANg==" }, "@humanwhocodes/config-array": { "version": "0.9.5", @@ -44471,7 +44484,8 @@ "@jridgewell/resolve-uri": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", - "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==" + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", + "dev": true }, "@jridgewell/set-array": { "version": "1.1.1", @@ -44487,6 +44501,7 @@ "version": "0.3.10", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz", "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==", + "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -45889,8 +45904,7 @@ "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-1.6.22.tgz", "integrity": "sha512-TDoPum4SHdfPiGSAaRBw7ECyI8VaHpK8GJugbJIJuqyh6kzw9ZLJZW3HGL3NNrJGxcAixUvqROm+YuQOo5eXtg==", - "dev": true, - "requires": {} + "dev": true }, "@storybook/addons": { "version": "6.5.4", @@ -47692,8 +47706,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/webpack-filter-warnings-plugin/-/webpack-filter-warnings-plugin-1.2.1.tgz", "integrity": "sha512-Ez6ytc9IseDMLPo0qCuNNYzgtUl8NovOqjIq4uAU8LTD4uoa1w1KpZyyzFtLTEMZpkkOkLfL9eN+KGYdk1Qtwg==", - "dev": true, - "requires": {} + "dev": true }, "y18n": { "version": "4.0.3", @@ -47962,8 +47975,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "requires": {} + "dev": true }, "isobject": { "version": "4.0.0", @@ -47998,8 +48010,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true, - "requires": {} + "dev": true }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -51032,8 +51043,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", - "dev": true, - "requires": {} + "dev": true }, "isobject": { "version": "4.0.0", @@ -51062,8 +51072,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz", "integrity": "sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==", - "dev": true, - "requires": {} + "dev": true }, "postcss-modules-local-by-default": { "version": "4.0.0", @@ -52398,57 +52407,49 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-6.0.0.tgz", "integrity": "sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-remove-jsx-attribute": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-6.0.0.tgz", "integrity": "sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-remove-jsx-empty-expression": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-6.0.0.tgz", "integrity": "sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-replace-jsx-attribute-value": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-6.0.0.tgz", "integrity": "sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-svg-dynamic-title": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-6.0.0.tgz", "integrity": "sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-svg-em-dimensions": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-6.0.0.tgz", "integrity": "sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-transform-react-native-svg": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-6.0.0.tgz", "integrity": "sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-plugin-transform-svg-component": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-6.2.0.tgz", "integrity": "sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==", - "dev": true, - "requires": {} + "dev": true }, "@svgr/babel-preset": { "version": "6.2.0", @@ -53321,8 +53322,7 @@ "@use-it/event-listener": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/@use-it/event-listener/-/event-listener-0.1.7.tgz", - "integrity": "sha512-hgfExDzUU9uTRTPDCpw2s9jWTxcxmpJya3fK5ADpf5VDpSy8WYwY/kh28XE0tUcbsljeP8wfan48QvAQTSSa3Q==", - "requires": {} + "integrity": "sha512-hgfExDzUU9uTRTPDCpw2s9jWTxcxmpJya3fK5ADpf5VDpSy8WYwY/kh28XE0tUcbsljeP8wfan48QvAQTSSa3Q==" }, "@walletconnect/browser-utils": { "version": "1.7.8", @@ -53474,8 +53474,7 @@ "ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", - "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", - "requires": {} + "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==" } } }, @@ -53878,8 +53877,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "7.2.0", @@ -53965,15 +53963,13 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true, - "requires": {} + "dev": true }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} + "dev": true }, "ansi-align": { "version": "3.0.1", @@ -54406,8 +54402,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.5.0.tgz", "integrity": "sha512-lO5oTjgiC3vlVg2RKr3RiXIIQ5pGXBFxYGGUkKDhTud3jMIhs+gel8L8zsEjKaKxkjHhCQAA/bcEfYiKkGQIvA==", - "dev": true, - "requires": {} + "dev": true }, "apollo-utilities": { "version": "1.3.4", @@ -56685,6 +56680,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, "requires": { "safe-buffer": "~5.1.1" } @@ -58308,22 +58304,19 @@ "version": "8.5.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", - "dev": true, - "requires": {} + "dev": true }, "eslint-config-standard": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", - "dev": true, - "requires": {} + "dev": true }, "eslint-config-standard-react": { "version": "11.0.1", "resolved": "https://registry.npmjs.org/eslint-config-standard-react/-/eslint-config-standard-react-11.0.1.tgz", "integrity": "sha512-4WlBynOqBZJRaX81CBcIGDHqUiqxvw4j/DbEIICz8QkMs3xEncoPgAoysiqCSsg71X92uhaBc8sgqB96smaMmg==", - "dev": true, - "requires": {} + "dev": true }, "eslint-import-resolver-node": { "version": "0.3.6", @@ -58630,8 +58623,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-react": { "version": "7.30.0", @@ -58699,8 +58691,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.5.0.tgz", "integrity": "sha512-8k1gRt7D7h03kd+SAAlzXkQwWK22BnK6GKZG+FJA6BAGy22CFvl8kCIXKpVux0cCxMWDQUPqSok0LKaZ0aOcCw==", - "dev": true, - "requires": {} + "dev": true }, "eslint-plugin-security": { "version": "1.5.0", @@ -60345,7 +60336,8 @@ "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true }, "get-caller-file": { "version": "2.0.5", @@ -60669,7 +60661,8 @@ "graphql": { "version": "15.8.0", "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" + "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "dev": true }, "graphql-tag": { "version": "2.12.6", @@ -63164,8 +63157,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true, - "requires": {} + "dev": true }, "jest-regex-util": { "version": "26.0.0", @@ -64384,7 +64376,8 @@ "json5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==" + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true }, "jsonfile": { "version": "6.1.0", @@ -68053,8 +68046,7 @@ "react-chartjs-2": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-4.1.0.tgz", - "integrity": "sha512-AsUihxEp8Jm1oBhbEovE+w50m9PVNhz1sfwEIT4hZduRC0m14gHWHd0cUaxkFDb8HNkdMIGzsNlmVqKiOpU74g==", - "requires": {} + "integrity": "sha512-AsUihxEp8Jm1oBhbEovE+w50m9PVNhz1sfwEIT4hZduRC0m14gHWHd0cUaxkFDb8HNkdMIGzsNlmVqKiOpU74g==" }, "react-clipboard.js": { "version": "2.0.16", @@ -68106,8 +68098,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/react-docgen-typescript/-/react-docgen-typescript-2.2.2.tgz", "integrity": "sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg==", - "dev": true, - "requires": {} + "dev": true }, "react-dom": { "version": "18.1.0", @@ -70704,8 +70695,7 @@ "styled-jsx": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.0.2.tgz", - "integrity": "sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ==", - "requires": {} + "integrity": "sha512-LqPQrbBh3egD57NBcHET4qcgshPks+yblyhPlH2GY8oaDgKs8SK4C3dBh3oSJjgzJ3G5t1SYEZGHkP+QEpX9EQ==" }, "supports-color": { "version": "8.1.1", @@ -70947,8 +70937,7 @@ "swr": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/swr/-/swr-1.3.0.tgz", - "integrity": "sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==", - "requires": {} + "integrity": "sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==" }, "symbol-observable": { "version": "1.2.0", @@ -73231,8 +73220,7 @@ "version": "1.8.0", "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", - "dev": true, - "requires": {} + "dev": true }, "commander": { "version": "2.20.3", @@ -73606,8 +73594,7 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.6.0.tgz", "integrity": "sha512-AzmM3aH3gk0aX7/rZLYvjdvZooofDu3fFOzGqcSnQ1tOcTWwhM/o+q++E8mAyVVIyUdajrkzWUGftaVSDLn1bw==", - "dev": true, - "requires": {} + "dev": true }, "x-default-browser": { "version": "0.4.0", From 6dfeead4fd99f8d4a067abb6bd7a3fbb771866b4 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Wed, 8 Jun 2022 01:46:46 -0700 Subject: [PATCH 6/9] Release (#1492) * update contracts * add version selector * show banner on all pages * show banner on all pages * Announcement/warning messages cleanup * new main announcement message * contextual compute-to-data warnings in publish form & asset action * copy update * change hardcoded URLs * change localStorage key * to prevent user preferences clashes when switching between v3 & v4 * footer stats note changes * move copy into content file * mention external markets * footer stats note copy changes * modified pool widget footer * take out pool reserve display * style & spacing updates for fees Co-authored-by: Matthias Kretschmann --- app.config.js | 4 +- content/footer.json | 5 +- content/site.json | 10 ++-- package-lock.json | 30 +++++------ package.json | 2 +- src/@context/MarketMetadata/_types.ts | 10 ++-- src/@context/UserPreferences.tsx | 2 +- src/components/@shared/atoms/Badge/index.tsx | 4 +- src/components/App/index.tsx | 13 ++--- .../Compute/FormComputeDataset.module.css | 4 ++ .../Compute/FormComputeDataset.tsx | 8 +++ .../Asset/AssetActions/Pool/Add/index.tsx | 2 +- .../Pool/Sections/Update.module.css | 4 +- .../Pool/Sections/index.module.css | 15 ++++++ .../AssetActions/Pool/Sections/index.tsx | 12 +---- src/components/Footer/MarketStats/Tooltip.tsx | 10 ++-- src/components/Header/Menu.module.css | 54 +++++++++++++++++-- src/components/Header/Menu.tsx | 33 ++++++++++-- .../Publish/Metadata/index.module.css | 4 ++ src/components/Publish/Metadata/index.tsx | 11 ++++ src/components/Publish/Services/index.tsx | 26 ++++++--- src/components/Publish/index.module.css | 5 ++ 22 files changed, 191 insertions(+), 77 deletions(-) diff --git a/app.config.js b/app.config.js index f26006eef..284628695 100644 --- a/app.config.js +++ b/app.config.js @@ -19,10 +19,10 @@ module.exports = { // List of chainIds which metadata cache queries will return by default. // This preselects the Chains user preferences. - chainIds: [3, 4, 80001, 1287], + chainIds: [1, 137, 56, 246, 1285], // List of all supported chainIds. Used to populate the Chains user preferences list. - chainIdsSupported: [3, 4, 80001, 1287], + chainIdsSupported: [1, 137, 56, 246, 1285, 3, 4, 80001, 1287], infuraProjectId: process.env.NEXT_PUBLIC_INFURA_PROJECT_ID || 'xxx', diff --git a/content/footer.json b/content/footer.json index d4a89329f..365c2b78b 100644 --- a/content/footer.json +++ b/content/footer.json @@ -12,5 +12,8 @@ "name": "Discord", "url": "https://discord.gg/TnXjkR5" } - ] + ], + "stats": { + "note": "Counted on-chain from our NFT and pool factories. Includes assets in all Ocean Market forks and [purgatory](https://github.com/oceanprotocol/list-purgatory)." + } } diff --git a/content/site.json b/content/site.json index 5e0ce2500..abcd756ea 100644 --- a/content/site.json +++ b/content/site.json @@ -1,7 +1,7 @@ { "siteTitle": "Ocean Market", "siteTagline": "A marketplace to find, publish and trade data sets in the Ocean Network.", - "siteUrl": "https://v4.market.oceanprotocol.com", + "siteUrl": "https://market.oceanprotocol.com", "siteImage": "/share.png", "copyright": "All Rights Reserved. Powered by ", "menu": [ @@ -14,12 +14,8 @@ "link": "/profile" } ], + "announcement": "Data NFTs, One-Sided Staking and more. [Explore OceanONDA V4](https://blog.oceanprotocol.com).", "warning": { - "main": "", - "polygonPublish": "Only republish data sets with a pool from ETH Mainnet into Polygon/Matic if the liquidity is **less than or equal to 1000 OCEAN in the original pool**. Doing otherwise will lead to [purgatory](https://github.com/oceanprotocol/list-purgatory) for the data set in Polygon/Matic." - }, - "announcement": { - "main": "Ocean Market is [available on Polygon](https://blog.oceanprotocol.com/ocean-on-polygon-network-8abad19cbf47).", - "polygon": "Polygon/Matic EVM support is in early stages. [Use the Polygon Bridge](https://docs.oceanprotocol.com/tutorials/polygon-bridge/) to get mOCEAN." + "ctd": "Compute-to-Data is still in a testing phase, please use it only on test networks." } } diff --git a/package-lock.json b/package-lock.json index 906b5d821..4e4c49f00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@coingecko/cryptoformat": "^0.4.4", "@loadable/component": "^5.15.2", "@oceanprotocol/art": "^3.2.0", - "@oceanprotocol/lib": "^1.0.0-next.44", + "@oceanprotocol/lib": "^1.0.0-next.45", "@oceanprotocol/typographies": "^0.1.0", "@portis/web3": "^4.0.7", "@tippyjs/react": "^4.2.6", @@ -4518,16 +4518,16 @@ "integrity": "sha512-aUQtg4m5hJlQ0u8C29O9TXJWcAenO3G9vP+vf6LNFkpTDOCMycN/F0SzHS89VNrvGUha8oTDEg7FAkfZBPv2WA==" }, "node_modules/@oceanprotocol/contracts": { - "version": "1.0.0-alpha.34", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.34.tgz", - "integrity": "sha512-ZhNCakYbUpXrffpS98Hj0r5K70IzzTXNoYKBX4Ks3Qqc2T7mhXIxtakzygkM0lEk038ImWuzS2PAZKTATz+X2w==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0.tgz", + "integrity": "sha512-rDCIooe1WHipLejuGhx2Wv/88SB7bWrN3+XHCWxXyPKTmmSQsgxKZPPzbIVBQ0ESChQZqGSBBJyqErqwwW4eBw==" }, "node_modules/@oceanprotocol/lib": { - "version": "1.0.0-next.44", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-1.0.0-next.44.tgz", - "integrity": "sha512-TXrHvY7+t7WSJXAVkSip0hp5byE8G4citJGirB5qJt34VGA+ujd+CoLU1bB/5gFSYH3eM56K4pcUPfCHZjeN3w==", + "version": "1.0.0-next.45", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-1.0.0-next.45.tgz", + "integrity": "sha512-WsSMZubvS5kVu4p6jQzxeENWitXok7M6yKjuHW0uhYJIYNx8JrZsCgYp9yz0p73a+bEQazSnr1nmvc1jVLU8jQ==", "dependencies": { - "@oceanprotocol/contracts": "^1.0.0-alpha.34", + "@oceanprotocol/contracts": "^1.0.0", "bignumber.js": "^9.0.2", "cross-fetch": "^3.1.5", "crypto-js": "^4.1.1", @@ -44760,16 +44760,16 @@ "integrity": "sha512-aUQtg4m5hJlQ0u8C29O9TXJWcAenO3G9vP+vf6LNFkpTDOCMycN/F0SzHS89VNrvGUha8oTDEg7FAkfZBPv2WA==" }, "@oceanprotocol/contracts": { - "version": "1.0.0-alpha.34", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.34.tgz", - "integrity": "sha512-ZhNCakYbUpXrffpS98Hj0r5K70IzzTXNoYKBX4Ks3Qqc2T7mhXIxtakzygkM0lEk038ImWuzS2PAZKTATz+X2w==" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0.tgz", + "integrity": "sha512-rDCIooe1WHipLejuGhx2Wv/88SB7bWrN3+XHCWxXyPKTmmSQsgxKZPPzbIVBQ0ESChQZqGSBBJyqErqwwW4eBw==" }, "@oceanprotocol/lib": { - "version": "1.0.0-next.44", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-1.0.0-next.44.tgz", - "integrity": "sha512-TXrHvY7+t7WSJXAVkSip0hp5byE8G4citJGirB5qJt34VGA+ujd+CoLU1bB/5gFSYH3eM56K4pcUPfCHZjeN3w==", + "version": "1.0.0-next.45", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-1.0.0-next.45.tgz", + "integrity": "sha512-WsSMZubvS5kVu4p6jQzxeENWitXok7M6yKjuHW0uhYJIYNx8JrZsCgYp9yz0p73a+bEQazSnr1nmvc1jVLU8jQ==", "requires": { - "@oceanprotocol/contracts": "^1.0.0-alpha.34", + "@oceanprotocol/contracts": "^1.0.0", "bignumber.js": "^9.0.2", "cross-fetch": "^3.1.5", "crypto-js": "^4.1.1", diff --git a/package.json b/package.json index 9fced1b7d..bde266e28 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@coingecko/cryptoformat": "^0.4.4", "@loadable/component": "^5.15.2", "@oceanprotocol/art": "^3.2.0", - "@oceanprotocol/lib": "^1.0.0-next.44", + "@oceanprotocol/lib": "^1.0.0-next.45", "@oceanprotocol/typographies": "^0.1.0", "@portis/web3": "^4.0.7", "@tippyjs/react": "^4.2.6", diff --git a/src/@context/MarketMetadata/_types.ts b/src/@context/MarketMetadata/_types.ts index b84adadc5..c51218edc 100644 --- a/src/@context/MarketMetadata/_types.ts +++ b/src/@context/MarketMetadata/_types.ts @@ -29,6 +29,8 @@ export interface AppConfig { classNameLight: string storageKey: string } + v3MetadataCacheUri: string + v3MarketUri: string } export interface SiteContent { siteTitle: string @@ -40,13 +42,9 @@ export interface SiteContent { name: string link: string }[] + announcement: string warning: { - main: string - polygonPublish: string - } - announcement: { - main: string - polygon: string + ctd: string } } diff --git a/src/@context/UserPreferences.tsx b/src/@context/UserPreferences.tsx index 0d963aa21..84618061e 100644 --- a/src/@context/UserPreferences.tsx +++ b/src/@context/UserPreferences.tsx @@ -31,7 +31,7 @@ interface UserPreferencesValue { const UserPreferencesContext = createContext(null) -const localStorageKey = 'ocean-user-preferences' +const localStorageKey = 'ocean-user-preferences-v4' function getLocalStorage(): UserPreferencesValue { const storageParsed = diff --git a/src/components/@shared/atoms/Badge/index.tsx b/src/components/@shared/atoms/Badge/index.tsx index c5e32e4d4..8a6c01018 100644 --- a/src/components/@shared/atoms/Badge/index.tsx +++ b/src/components/@shared/atoms/Badge/index.tsx @@ -1,11 +1,11 @@ -import React, { ReactElement } from 'react' +import React, { ReactElement, ReactNode } from 'react' import styles from './index.module.css' import classNames from 'classnames/bind' const cx = classNames.bind(styles) export interface BadgeProps { - label: string + label: string | ReactNode className?: string } diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index d2ef6dbc4..e9eb4580a 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -8,8 +8,7 @@ import AnnouncementBanner from '@shared/AnnouncementBanner' import PrivacyPreferenceCenter from '../Privacy/PrivacyPreferenceCenter' import styles from './index.module.css' import { ToastContainer } from 'react-toastify' -import { useRouter } from 'next/router' -import content from '../../../content/purgatory.json' +import contentPurgatory from '../../../content/purgatory.json' import { useMarketMetadata } from '@context/MarketMetadata' export default function App({ @@ -17,24 +16,22 @@ export default function App({ }: { children: ReactElement }): ReactElement { - const router = useRouter() - const { siteContent, appConfig } = useMarketMetadata() const { accountId } = useWeb3() const { isInPurgatory, purgatoryData } = useAccountPurgatory(accountId) return (
- {router.pathname === '/' && siteContent?.warning.main !== '' && ( - + {siteContent?.announcement !== '' && ( + )}
{isInPurgatory && ( )} diff --git a/src/components/Asset/AssetActions/Compute/FormComputeDataset.module.css b/src/components/Asset/AssetActions/Compute/FormComputeDataset.module.css index 57936ae3a..a6d5aeb18 100644 --- a/src/components/Asset/AssetActions/Compute/FormComputeDataset.module.css +++ b/src/components/Asset/AssetActions/Compute/FormComputeDataset.module.css @@ -22,3 +22,7 @@ border-right: 0; padding: 0; } + +.warning { + margin-bottom: var(--spacer); +} diff --git a/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx b/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx index 7cb5a84fd..77971b7eb 100644 --- a/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx +++ b/src/components/Asset/AssetActions/Compute/FormComputeDataset.tsx @@ -11,6 +11,8 @@ import { useWeb3 } from '@context/Web3' import content from '../../../../../content/pages/startComputeDataset.json' import { Asset } from '@oceanprotocol/lib' import { AccessDetails } from 'src/@types/Price' +import { useMarketMetadata } from '@context/MarketMetadata' +import Alert from '@shared/atoms/Alert' export default function FormStartCompute({ algorithms, @@ -61,6 +63,7 @@ export default function FormStartCompute({ isConsumable: boolean consumableFeedback: string }): ReactElement { + const { siteContent } = useMarketMetadata() const { isValid, values }: FormikContextType<{ algorithm: string }> = useFormikContext() const { asset, isAssetNetwork } = useAsset() @@ -126,6 +129,11 @@ export default function FormStartCompute({ return (
+ {content.form.data.map((field: FormFieldContent) => (
- + {/* TODO: will be fixed in #1481 */} div { + grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); + text-align: center; +} + +.fees figure { + display: none; +} diff --git a/src/components/Asset/AssetActions/Pool/Sections/index.tsx b/src/components/Asset/AssetActions/Pool/Sections/index.tsx index 50954298e..0a4854014 100644 --- a/src/components/Asset/AssetActions/Pool/Sections/index.tsx +++ b/src/components/Asset/AssetActions/Pool/Sections/index.tsx @@ -110,17 +110,9 @@ export default function PoolSections() { titlePostfixTitle={`Weight of ${poolInfo?.weightBaseToken}% ${poolInfo?.baseTokenSymbol} & ${poolInfo?.weightDt}% ${poolInfo?.datatokenSymbol}`} > - - + + ))} -

- Counted on-chain from our NFT and pool factories. Does not filter out - assets in{' '} - - list-purgatory - -

+ ) } diff --git a/src/components/Header/Menu.module.css b/src/components/Header/Menu.module.css index 834d53e1b..d35de150c 100644 --- a/src/components/Header/Menu.module.css +++ b/src/components/Header/Menu.module.css @@ -7,13 +7,24 @@ flex-wrap: wrap; } -.logo { - order: 1; +.logo, +.badge { white-space: nowrap; display: flex; +} + +.logo { + order: 0; align-items: center; } +.badge { + cursor: pointer; + margin-top: -0.25rem; + position: relative; + padding: calc(var(--spacer) / 5) calc(var(--spacer) / 4); +} + .navigation { order: 3; margin-top: calc(var(--spacer) / 2); @@ -60,10 +71,10 @@ .title { margin: 0; - margin-right: var(--spacer); display: block; color: var(--color-secondary); font-size: var(--font-size-h4); + margin-right: calc(var(--spacer) / 6); } } @@ -115,6 +126,10 @@ padding-right: 0; } +.link[aria-disabled] { + pointer-events: none; +} + .logo svg { margin-right: calc(var(--spacer) / 3); } @@ -122,3 +137,36 @@ .actions button { text-transform: none; } + +.tooltip[aria-expanded='true'] svg { + transform: rotate(180deg); +} + +.caret, +svg.caret { + width: var(--font-size-mini); + height: var(--font-size-mini); + fill: var(--brand-white); + opacity: 0.7; + transition: transform 0.2s ease-out; + vertical-align: middle; + margin-left: calc(var(--spacer) / 12); +} + +@media screen and (min-width: 42rem) { + .caret, + svg.caret { + display: inline-block; + } +} + +.versions { + padding: calc(var(--spacer) / 4); +} + +.versions .link { + display: inline-block; + margin: 0 calc(var(--spacer) / 4); + padding: 0; + font-size: var(--font-size-small); +} diff --git a/src/components/Header/Menu.tsx b/src/components/Header/Menu.tsx index a0fd29948..7e0f090a5 100644 --- a/src/components/Header/Menu.tsx +++ b/src/components/Header/Menu.tsx @@ -9,7 +9,8 @@ import SearchBar from './SearchBar' import styles from './Menu.module.css' import { useRouter } from 'next/router' import { useMarketMetadata } from '@context/MarketMetadata' - +import Tooltip from '@shared/atoms/Tooltip' +import Caret from '@images/caret.svg' const Wallet = loadable(() => import('./Wallet')) declare type MenuItem = { @@ -33,19 +34,41 @@ function MenuLink({ item }: { item: MenuItem }) { } export default function Menu(): ReactElement { - const { siteContent } = useMarketMetadata() + const { appConfig, siteContent } = useMarketMetadata() return (