Support bundles: small UX improvements (#63277)

support bundle ux improvements
This commit is contained in:
Ieva 2023-02-11 08:31:03 +00:00 committed by GitHub
parent d4cfbd9fd3
commit 229f8b6e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 17 deletions

View File

@ -51,7 +51,7 @@ func basicCollector(cfg *setting.Cfg) supportbundles.Collector {
loc, _ := time.LoadLocation("UTC")
now := collectionDate.In(loc)
data, err := json.Marshal(basicInfo{
info := basicInfo{
Version: cfg.BuildVersion,
Commit: cfg.BuildCommit,
CollectionDate: now,
@ -69,7 +69,8 @@ func basicCollector(cfg *setting.Cfg) supportbundles.Collector {
GoOS: runtime.GOOS,
GoArch: runtime.GOARCH,
GoCompiler: runtime.Compiler,
})
}
data, err := json.MarshalIndent(info, "", " ")
if err != nil {
return nil, err
}
@ -91,7 +92,7 @@ func settingsCollector(settings setting.Provider) supportbundles.Collector {
Default: true,
Fn: func(ctx context.Context) (*supportbundles.SupportItem, error) {
current := settings.Current()
data, err := json.Marshal(current)
data, err := json.MarshalIndent(current, "", " ")
if err != nil {
return nil, err
}

View File

@ -66,20 +66,22 @@ export const SupportBundlesCreateUnconnected = ({
{({ register, errors }) => {
return (
<>
{collectors.map((component) => {
return (
<Field key={component.uid}>
<Checkbox
{...register(component.uid)}
label={component.displayName}
id={component.uid}
description={component.description}
defaultChecked={component.default}
disabled={component.includedByDefault}
/>
</Field>
);
})}
{[...collectors]
.sort((a, b) => a.displayName.localeCompare(b.displayName))
.map((component) => {
return (
<Field key={component.uid}>
<Checkbox
{...register(component.uid)}
label={component.displayName}
id={component.uid}
description={component.description}
defaultChecked={component.default}
disabled={component.includedByDefault}
/>
</Field>
);
})}
<HorizontalGroup>
<Button type="submit">Create</Button>
<LinkButton href="/support-bundles" variant="secondary">