-
Notifications
You must be signed in to change notification settings - Fork 22
List and download Support Bundles #3311
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
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
f527b62
First stab at support bundles in console
charliepark 382ed47
Dropped size column
charliepark aa89f60
Add ereports to mock data
charliepark c744fcf
Remove sidemodal; other UI improvements
charliepark a406be1
simplify e2e test
charliepark 6653f25
copy change
charliepark b6a34ee
pre-review tweaks
charliepark 8a6c945
Support bundle detail modal (#3324)
benjaminleonard 8b6d9ad
merge main
charliepark af2a545
use exhaustive matching on bundle states
charliepark ff4ce4d
remove experimental from URL
charliepark e3b7bb1
small cleanup
charliepark 6469d3f
Merge branch 'main' into support-bundles
charliepark 6b5e1ef
RefreshButton; fixed test
charliepark f5aa807
Remove unused supportBundleDownload from MSW
charliepark d7182e4
refactor
charliepark 0ceea8a
Merge branch 'main' into support-bundles
charliepark 104a1c5
a bit more refactoring
charliepark 77dcedb
follow polling precedent
charliepark 4ed126f
simplify fetching
charliepark 8b79647
Merge main and resolve conflicts
charliepark 65114e4
prevent modal button weirdness on successful submission
charliepark 22ab81e
Use folder icon for now
charliepark e863a9f
actually: flag icon (for now)
charliepark 7a3b0d4
merge main
david-crespo 65e2b18
Fix ProjectAccessPage tsc error by typing rows explicitly
david-crespo bf36665
tweak docs popover copy
david-crespo 5351dae
Drop file count from bundle detail
david-crespo e3edd2d
Replace AsyncValue with a BundleSize component
david-crespo 3160e72
Reorder system sidebar and quick actions
david-crespo 9d3a69a
Drop redundant View details row action
david-crespo 94b1202
Per-state download disabled reasons, document polling logic
david-crespo 0b38d87
Copy tweaks: Creation reason, sentence-case link, refresh tip
david-crespo 53c6df8
Bump design system, use Archive icon for support bundles
david-crespo 4ca8bb3
Use 16 icon for empty state
benjaminleonard af1e3f2
Switch to 24 for consistency ...
benjaminleonard 534dd07
Test collection failure and comment byte limit
david-crespo 9ac206c
Fix comments, use real FM reason format in mock
david-crespo 723f1a7
Test bundle download from row action and modal
david-crespo bc8a479
last code review tweaks
david-crespo 7982878
Serve empty zip for bundle download in mock mode
david-crespo 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
| * | ||
| * Copyright Oxide Computer Company | ||
| */ | ||
| import type { Control } from 'react-hook-form' | ||
|
|
||
| import { MAX_BUNDLE_COMMENT_BYTES, utf8ByteLength } from '@oxide/api' | ||
|
|
||
| import { TextField } from './TextField' | ||
|
|
||
| /** Support bundle comment textarea, shared by the create and edit forms */ | ||
| export function BundleCommentField({ | ||
| control, | ||
| }: { | ||
| control: Control<{ userComment: string }> | ||
| }) { | ||
| return ( | ||
| <TextField | ||
| as="textarea" | ||
| name="userComment" | ||
| label="Comment" | ||
| rows={4} | ||
| control={control} | ||
| validate={(value) => | ||
| utf8ByteLength(value) > MAX_BUNDLE_COMMENT_BYTES | ||
| ? `Comment cannot exceed ${MAX_BUNDLE_COMMENT_BYTES} bytes` | ||
| : true | ||
| } | ||
| /> | ||
| ) | ||
| } |
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,56 @@ | ||
| /* | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
| * | ||
| * Copyright Oxide Computer Company | ||
| */ | ||
| import { useForm } from 'react-hook-form' | ||
| import { useNavigate } from 'react-router' | ||
|
|
||
| import { api, queryClient, useApiMutation } from '@oxide/api' | ||
|
|
||
| import { BundleCommentField } from '~/components/form/fields/BundleCommentField' | ||
| import { SideModalForm } from '~/components/form/SideModalForm' | ||
| import { titleCrumb } from '~/hooks/use-crumbs' | ||
| import { addToast } from '~/stores/toast' | ||
| import { Message } from '~/ui/lib/Message' | ||
| import { pb } from '~/util/path-builder' | ||
|
|
||
| const defaultValues = { userComment: '' } | ||
|
|
||
| export const handle = titleCrumb('New support bundle') | ||
|
|
||
| export default function CreateSupportBundleSideModalForm() { | ||
| const navigate = useNavigate() | ||
|
|
||
| const createBundle = useApiMutation(api.supportBundleCreate, { | ||
| onSuccess() { | ||
| queryClient.invalidateEndpoint('supportBundleList') | ||
| addToast('Support bundle created') | ||
| navigate(pb.supportBundles()) | ||
| }, | ||
| }) | ||
|
|
||
| const form = useForm({ defaultValues }) | ||
|
|
||
| return ( | ||
| <SideModalForm | ||
| form={form} | ||
| formType="create" | ||
| resourceName="support bundle" | ||
| onDismiss={() => navigate(pb.supportBundles())} | ||
| onSubmit={({ userComment }) => { | ||
| createBundle.mutate({ body: { userComment: userComment.trim() || null } }) | ||
| }} | ||
| loading={createBundle.isPending || createBundle.isSuccess} | ||
| submitError={createBundle.error} | ||
| > | ||
| <Message | ||
| variant="info" | ||
| content="Bundle collection runs in the background and can take several minutes. The bundle can be downloaded once collection is complete." | ||
| /> | ||
| <BundleCommentField control={form.control} /> | ||
| </SideModalForm> | ||
| ) | ||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was made necessary by a rather obscure TypeScript bug interacting with React Table. When I merged main into this branch, the
satisfiesversion started failing typechecking. Claude was able to repro the issue on main by adding a single line that doesn't look like it should do anything.microsoft/typescript-go#3973
microsoft/typescript-go#4827