-
Notifications
You must be signed in to change notification settings - Fork 49
Feat/batch disputes #1982
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
Merged
Merged
Feat/batch disputes #1982
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7cf13b4
feat(web): batch-disputes
tractorss ad34281
feat(web): case-duplication-in-resolver
tractorss 1699758
feat(web): explainer-info-at-sign-in-and-connect-resolver
tractorss 906260b
feat(web): show-policy-once-uploaded-in-resolver
tractorss 8aa0e69
Merge branch 'dev' into feat/batch-disputes
tractorss d39dd2a
chore(web): sonar-cloud-review
tractorss 5c143ef
chore(web): rabbit-review
tractorss d5547dd
Merge branch 'dev' into feat/batch-disputes
jaybuidl 74acb03
Merge branch 'dev' into feat/batch-disputes
tractorss f69d4bb
feat(web): update-creation-page-ui
tractorss a0f1982
fix(web): header-alignment
tractorss 1348f3b
feat(web): update-batch-creation-ui
tractorss a234625
Merge branch 'dev' into feat/batch-disputes
tractorss 2eab4a2
Merge branch 'dev' into feat/batch-disputes
tractorss 9ccf16b
feat(web): fetch-dispute-kit-in-duplication
tractorss 0ea27b4
chore(web): rabbit-feedback
tractorss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
|
||
import { REFETCH_INTERVAL, STALE_TIME } from "consts/index"; | ||
import { useGraphqlBatcher } from "context/GraphqlBatcher"; | ||
|
||
import { graphql } from "src/graphql"; | ||
import { RoundDetailsQuery } from "src/graphql/graphql"; | ||
import { isUndefined } from "src/utils"; | ||
|
||
const roundDetailsQuery = graphql(` | ||
query RoundDetails($roundID: ID!) { | ||
round(id: $roundID) { | ||
court { | ||
id | ||
} | ||
nbVotes | ||
} | ||
} | ||
`); | ||
|
||
export const useRoundDetailsQuery = (disputeId?: string, roundIndex?: number) => { | ||
const isEnabled = !isUndefined(disputeId) && !isUndefined(roundIndex); | ||
const { graphqlBatcher } = useGraphqlBatcher(); | ||
|
||
return useQuery<RoundDetailsQuery>({ | ||
queryKey: [`roundDetailsQuery${disputeId}-${roundIndex}`], | ||
enabled: isEnabled, | ||
refetchInterval: REFETCH_INTERVAL, | ||
staleTime: STALE_TIME, | ||
queryFn: async () => | ||
await graphqlBatcher.fetch({ | ||
id: crypto.randomUUID(), | ||
document: roundDetailsQuery, | ||
variables: { roundID: `${disputeId}-${roundIndex}` }, | ||
}), | ||
}); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React, { lazy, Suspense } from "react"; | ||
import styled from "styled-components"; | ||
|
||
import { useSearchParams } from "react-router-dom"; | ||
|
||
import NewTabIcon from "svgs/icons/new-tab.svg"; | ||
|
||
import { MAX_WIDTH_LANDSCAPE } from "styles/landscapeStyle"; | ||
|
||
import { ExternalLink } from "components/ExternalLink"; | ||
import Loader from "components/Loader"; | ||
|
||
import Header from "./Header"; | ||
|
||
const FileViewer = lazy(() => import("components/FileViewer")); | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
background-color: ${({ theme }) => theme.lightBackground}; | ||
padding: calc(24px + (136 - 24) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
padding-top: calc(32px + (80 - 32) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
padding-bottom: calc(76px + (96 - 76) * (min(max(100vw, 375px), 1250px) - 375px) / 875); | ||
max-width: ${MAX_WIDTH_LANDSCAPE}; | ||
margin: 0 auto; | ||
`; | ||
|
||
const AttachmentContainer = styled.div` | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
`; | ||
|
||
const LoaderContainer = styled.div` | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
`; | ||
|
||
const StyledExternalLink = styled(ExternalLink)` | ||
display: flex; | ||
align-items: center; | ||
align-self: flex-end; | ||
gap: 8px; | ||
`; | ||
|
||
const StyledNewTabIcon = styled(NewTabIcon)` | ||
path { | ||
fill: ${({ theme }) => theme.primaryBlue}; | ||
} | ||
`; | ||
|
||
const AttachmentDisplay: React.FC = () => { | ||
const [searchParams] = useSearchParams(); | ||
|
||
const url = searchParams.get("url"); | ||
const title = searchParams.get("title") ?? "Attachment"; | ||
return ( | ||
<Container> | ||
<AttachmentContainer> | ||
<Header {...{ title }} /> | ||
{url ? ( | ||
<> | ||
<StyledExternalLink to={url} rel="noreferrer" target="_blank"> | ||
Open in new tab <StyledNewTabIcon /> | ||
</StyledExternalLink> | ||
<Suspense | ||
fallback={ | ||
<LoaderContainer> | ||
<Loader width={"48px"} height={"48px"} /> | ||
</LoaderContainer> | ||
} | ||
> | ||
<FileViewer url={url} /> | ||
</Suspense> | ||
</> | ||
) : null} | ||
</AttachmentContainer> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default AttachmentDisplay; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.