-
Notifications
You must be signed in to change notification settings - Fork 116
update support ticket to support categories, project, and target options #6689
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
Open
egoodwinx
wants to merge
28
commits into
graphql-hive:main
Choose a base branch
from
egoodwinx:support-ticket-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3be1fcf
update support ticket to support categories, project, and target options
5bcf8e6
Merge branch 'main' into support-ticket-updates
egoodwinx a34b349
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx 23c28a4
address comments
a40fdbf
Merge branch 'main' into support-ticket-updates
egoodwinx 4feb3ff
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx c0cce7b
added resolver logic
24677e8
Merge branch 'main' into support-ticket-updates
jdolle c88dd7b
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx edf992c
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx 35326cf
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx e41ece0
Merge branch 'graphql-hive:main' into support-ticket-updates
egoodwinx 5f0d6ac
update ticket message and optional category metadata
d6217f5
remove category, project, target from schema since its in the body, u…
fbf0c63
Merge branch 'main' into support-ticket-updates
jdolle 9c8bf4a
update to fix lint errors
e76a0b1
Merge branch 'main' into support-ticket-updates
jdolle 9a162e5
fix SupportCategoryType typecheck errors
f5f1438
Merge branch 'main' into support-ticket-updates
egoodwinx a08864a
Merge branch 'main' into support-ticket-updates
egoodwinx 1bd9716
Merge branch 'main' into support-ticket-updates
jdolle d412ed0
Merge branch 'main' into support-ticket-updates
egoodwinx 24bf245
pnpm prettier and lint fixes
a2e5a12
fix merge issues
fc84dea
Merge branch 'main' into support-ticket-updates
jdolle f979a00
fix typecheck
539a7d2
fix lint issue
63b812a
fix prettier
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
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,6 @@ | ||||||||
import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select'; | ||||||||
import { FragmentType, graphql, useFragment } from '@/gql'; | ||||||||
import { SelectValue } from '@radix-ui/react-select'; | ||||||||
import { Link, useRouter } from '@tanstack/react-router'; | ||||||||
|
||||||||
const ProjectSelector_OrganizationConnectionFragment = graphql(` | ||||||||
|
@@ -21,7 +22,15 @@ export function ProjectSelector(props: { | |||||||
currentOrganizationSlug: string; | ||||||||
currentProjectSlug: string; | ||||||||
organizations: FragmentType<typeof ProjectSelector_OrganizationConnectionFragment> | null; | ||||||||
onValueChange?: Function; | ||||||||
optional?: boolean; | ||||||||
showOrganization?: boolean; | ||||||||
}) { | ||||||||
const optional = typeof props.optional !== 'undefined' ? props.optional : false; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would be shorted when using nullish coalescing
Suggested change
|
||||||||
const showOrganization = | ||||||||
typeof props.showOrganization !== 'undefined' ? props.showOrganization : true; | ||||||||
Comment on lines
+33
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
const onValueChangeFunc = | ||||||||
typeof props.onValueChange !== undefined ? props.onValueChange : undefined; | ||||||||
const router = useRouter(); | ||||||||
|
||||||||
const organizations = useFragment( | ||||||||
|
@@ -38,47 +47,74 @@ export function ProjectSelector(props: { | |||||||
|
||||||||
return ( | ||||||||
<> | ||||||||
{currentOrganization ? ( | ||||||||
<Link | ||||||||
to="/$organizationSlug" | ||||||||
params={{ organizationSlug: props.currentOrganizationSlug }} | ||||||||
className="max-w-[200px] shrink-0 truncate font-medium" | ||||||||
> | ||||||||
{currentOrganization.slug} | ||||||||
</Link> | ||||||||
{showOrganization ? ( | ||||||||
currentOrganization ? ( | ||||||||
<Link | ||||||||
to="/$organizationSlug" | ||||||||
params={{ organizationSlug: props.currentOrganizationSlug }} | ||||||||
className="max-w-[200px] shrink-0 truncate font-medium" | ||||||||
> | ||||||||
{currentOrganization.slug} | ||||||||
</Link> | ||||||||
) : ( | ||||||||
<div className="h-5 w-48 max-w-[200px] animate-pulse rounded-full bg-gray-800" /> | ||||||||
) | ||||||||
) : ( | ||||||||
<div className="h-5 w-48 max-w-[200px] animate-pulse rounded-full bg-gray-800" /> | ||||||||
'' | ||||||||
)} | ||||||||
{projects?.length && currentProject ? ( | ||||||||
|
||||||||
{(projects?.length && currentProject) || optional ? ( | ||||||||
<> | ||||||||
<div className="italic text-gray-500">/</div> | ||||||||
{showOrganization ? <div className="italic text-gray-500">/</div> : <></>} | ||||||||
jdolle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
<Select | ||||||||
value={props.currentProjectSlug} | ||||||||
onValueChange={id => { | ||||||||
void router.navigate({ | ||||||||
to: '/$organizationSlug/$projectSlug', | ||||||||
params: { | ||||||||
organizationSlug: props.currentOrganizationSlug, | ||||||||
projectSlug: id, | ||||||||
}, | ||||||||
}); | ||||||||
}} | ||||||||
onValueChange={ | ||||||||
onValueChangeFunc | ||||||||
? id => { | ||||||||
onValueChangeFunc(id); | ||||||||
jdolle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
} | ||||||||
: id => { | ||||||||
void router.navigate({ | ||||||||
to: '/$organizationSlug/$projectSlug', | ||||||||
params: { | ||||||||
organizationSlug: props.currentOrganizationSlug, | ||||||||
projectSlug: id, | ||||||||
}, | ||||||||
}); | ||||||||
} | ||||||||
} | ||||||||
> | ||||||||
<SelectTrigger variant="default" data-cy="project-picker-trigger"> | ||||||||
<div className="font-medium" data-cy="project-picker-current"> | ||||||||
{currentProject.slug} | ||||||||
{optional ? <SelectValue placeholder="Pick an option" /> : ''} | ||||||||
jdolle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
{currentProject && !optional ? currentProject.slug : ''} | ||||||||
</div> | ||||||||
</SelectTrigger> | ||||||||
<SelectContent> | ||||||||
{projects.map(project => ( | ||||||||
{optional ? ( | ||||||||
<SelectItem | ||||||||
key={project.slug} | ||||||||
value={project.slug} | ||||||||
data-cy={`project-picker-option-${project.slug}`} | ||||||||
key={'empty'} | ||||||||
value={'empty'} | ||||||||
data-cy={`project-picker-option-Unassigned`} | ||||||||
> | ||||||||
{project.slug} | ||||||||
Unassigned | ||||||||
</SelectItem> | ||||||||
))} | ||||||||
) : ( | ||||||||
<></> | ||||||||
jdolle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
)} | ||||||||
{projects ? ( | ||||||||
projects.map(project => ( | ||||||||
<SelectItem | ||||||||
key={project.slug} | ||||||||
value={project.slug} | ||||||||
data-cy={`project-picker-option-${project.slug}`} | ||||||||
> | ||||||||
{project.slug} | ||||||||
</SelectItem> | ||||||||
)) | ||||||||
) : ( | ||||||||
<></> | ||||||||
jdolle marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||
)} | ||||||||
</SelectContent> | ||||||||
</Select> | ||||||||
</> | ||||||||
|
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
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.