1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Merge branch 'main' into feature/calica-integration

This commit is contained in:
mihaisc 2022-12-16 12:57:05 +02:00
commit 53dead1874
7 changed files with 33 additions and 30 deletions

View File

@ -39,6 +39,12 @@
The app is a React app built with [Next.js](https://nextjs.org) + TypeScript + CSS modules and will connect to Ocean remote components by default. The app is a React app built with [Next.js](https://nextjs.org) + TypeScript + CSS modules and will connect to Ocean remote components by default.
Prerequisites:
- [Node.js](https://nodejs.org/en/) (required). Check the [.nvmrc](.nvmrc) file to make sure you are using the correct version of Node.js.
- [nvm](https://github.com/nvm-sh/nvm) (recommended). This is the recommend way to manage Node.js versions.
- [Git](https://git-scm.com/) is required to follow the instructions below.
To start local development: To start local development:
```bash ```bash

View File

@ -16,6 +16,6 @@
], ],
"announcement": "[Lock your OCEAN](https://df.oceandao.org/) to get veOCEAN, earn rewards and curate data.", "announcement": "[Lock your OCEAN](https://df.oceandao.org/) to get veOCEAN, earn rewards and curate data.",
"warning": { "warning": {
"ctd": "Compute-to-Data is still in a testing phase, please use it only on test networks." "ctd": "Please note that Compute-to-Data is still in alpha phase."
} }
} }

View File

@ -46,6 +46,7 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
query: any query: any
sort?: { [jsonPath: string]: SortDirectionOptions } sort?: { [jsonPath: string]: SortDirectionOptions }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
aggs?: any aggs?: any
} }
} }

View File

@ -9,8 +9,8 @@ const defaultBaseQueryReturn = {
query: { query: {
bool: { bool: {
filter: [ filter: [
{ terms: { chainId: [1, 3] } },
{ term: { _index: 'aquarius' } }, { term: { _index: 'aquarius' } },
{ terms: { chainId: [1, 3] } },
{ term: { 'purgatory.state': false } }, { term: { 'purgatory.state': false } },
{ bool: { must_not: [{ term: { 'nft.state': 5 } }] } } { bool: { must_not: [{ term: { 'nft.state': 5 } }] } }
] ]

View File

@ -42,6 +42,24 @@ export function getFilterTerm(
export function generateBaseQuery( export function generateBaseQuery(
baseQueryParams: BaseQueryParams baseQueryParams: BaseQueryParams
): SearchQuery { ): SearchQuery {
const filters: unknown[] = [getFilterTerm('_index', 'aquarius')]
baseQueryParams.filters && filters.push(...baseQueryParams.filters)
baseQueryParams.chainIds &&
filters.push(getFilterTerm('chainId', baseQueryParams.chainIds))
!baseQueryParams.ignorePurgatory &&
filters.push(getFilterTerm('purgatory.state', false))
!baseQueryParams.ignoreState &&
filters.push({
bool: {
must_not: [
{
term: {
'nft.state': 5
}
}
]
}
})
const generatedQuery = { const generatedQuery = {
from: baseQueryParams.esPaginationOptions?.from || 0, from: baseQueryParams.esPaginationOptions?.from || 0,
size: size:
@ -51,31 +69,7 @@ export function generateBaseQuery(
query: { query: {
bool: { bool: {
...baseQueryParams.nestedQuery, ...baseQueryParams.nestedQuery,
filter: [ filter: filters
...(baseQueryParams.filters || []),
baseQueryParams.chainIds
? getFilterTerm('chainId', baseQueryParams.chainIds)
: [],
getFilterTerm('_index', 'aquarius'),
...(baseQueryParams.ignorePurgatory
? []
: [getFilterTerm('purgatory.state', false)]),
...(baseQueryParams.ignoreState
? []
: [
{
bool: {
must_not: [
{
term: {
'nft.state': 5
}
}
]
}
}
])
]
} }
} }
} as SearchQuery } as SearchQuery
@ -90,7 +84,6 @@ export function generateBaseQuery(
baseQueryParams.sortOptions.sortDirection || baseQueryParams.sortOptions.sortDirection ||
SortDirectionOptions.Descending SortDirectionOptions.Descending
} }
return generatedQuery return generatedQuery
} }

View File

@ -17,7 +17,6 @@ const getReceipts = gql`
id id
nft { nft {
address address
owner
} }
tx tx
timestamp timestamp

View File

@ -117,7 +117,11 @@ export default function Edit({
{ {
type: values.files[0].type, type: values.files[0].type,
index: 0, index: 0,
url: values.files[0].url, [values.files[0].type === 'ipfs'
? 'hash'
: values.files[0].type === 'arweave'
? 'transactionId'
: 'url']: values.files[0].url,
method: 'GET' method: 'GET'
} }
] ]