Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for searching for network proposal by name #1192

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

csillag
Copy link
Contributor

@csillag csillag commented Jan 27, 2024

The searching happens on the client side, since Nexus has no support for it.

Copy link

github-actions bot commented Jan 27, 2024

Deployed to Cloudflare Pages

Latest commit: dfbdc42b21418a2d5ddd359a5e33a2bd63ca9761
Status:✅ Deploy successful!
Preview URL: https://642854e8.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/search-for-proposal-name branch from fbd459d to 8c93b63 Compare January 28, 2024 01:03
@csillag
Copy link
Contributor Author

csillag commented Jan 29, 2024

We decided to create the proposal details page first, so that we can link to them. When it's ready, I will revisit this one.

@csillag
Copy link
Contributor Author

csillag commented Jan 30, 2024

We decided to create the proposal details page first, so that we can link to them. When it's ready, I will revisit this one.

Proposal details page coming at #1202. So This PR is now waiting for that one.

@csillag csillag force-pushed the csillag/search-for-proposal-name branch from 8c93b63 to f47d7c6 Compare January 30, 2024 02:18
src/app/components/Search/search-utils.ts Outdated Show resolved Hide resolved
src/app/pages/SearchResultsPage/ResultsGroupByType.tsx Outdated Show resolved Hide resolved
src/oasis-nexus/api.ts Show resolved Hide resolved
src/app/pages/SearchResultsPage/hooks.ts Outdated Show resolved Hide resolved
@csillag csillag marked this pull request as ready for review January 30, 2024 03:32
@csillag csillag force-pushed the csillag/search-for-proposal-name branch 3 times, most recently from 82737b8 to 5ad87c1 Compare January 30, 2024 05:07
@csillag
Copy link
Contributor Author

csillag commented Jan 30, 2024

Rebased on top of the merged proposal details page; so we can not link and redirect to proposals from search results.

@csillag csillag requested a review from lukaw3d January 30, 2024 05:11
@csillag csillag force-pushed the csillag/search-for-proposal-name branch from 5ad87c1 to dfbdc42 Compare January 30, 2024 15:21
@csillag csillag merged commit 4380a11 into master Jan 30, 2024
8 checks passed
@csillag csillag deleted the csillag/search-for-proposal-name branch January 30, 2024 15:57
@@ -854,6 +855,23 @@ export const useGetConsensusProposalsProposalId: typeof generated.useGetConsensu
})
}

export const useGetConsensusProposalsByName = (network: Network, nameFragment: string | undefined) => {
const query = useGetConsensusProposals(network, {}, { query: { enabled: !!nameFragment } })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(related: #226)

@buberdds
Copy link
Contributor

buberdds commented Jan 31, 2024

Are we Ok with releasing this on prod when Consensus layer is not enabled? Should we disabled this type of search results?

@csillag
Copy link
Contributor Author

csillag commented Jan 31, 2024

Are we Ok with releasing this on prod when Consensus layer is not enabled? Should we disabled this type of search results?

That shouldn't be an issue, since we are launching the search for proposals like this:

const queries = RouteUtils.getEnabledNetworks()
.filter(network => RouteUtils.getEnabledLayersForNetwork(network).includes(Layer.consensus))
.map(network =>
// eslint-disable-next-line react-hooks/rules-of-hooks
useGetConsensusProposalsByName(network, nameFragment),
)

In other words, we will only search networks where the consensus layer is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants