Skip to content

Commit 343afaa

Browse files
Ievasourcegraph-bot
authored andcommitted
grafana: Support bundles: small UX improvements (#63277)
Commit: 229f8b6e6d3256b905d2f30d95b08660a05a1139
1 parent 833ca90 commit 343afaa

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

grafana/pkg/services/supportbundles/supportbundlesimpl/collectors.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func basicCollector(cfg *setting.Cfg) supportbundles.Collector {
5151
loc, _ := time.LoadLocation("UTC")
5252
now := collectionDate.In(loc)
5353

54-
data, err := json.Marshal(basicInfo{
54+
info := basicInfo{
5555
Version: cfg.BuildVersion,
5656
Commit: cfg.BuildCommit,
5757
CollectionDate: now,
@@ -69,7 +69,8 @@ func basicCollector(cfg *setting.Cfg) supportbundles.Collector {
6969
GoOS: runtime.GOOS,
7070
GoArch: runtime.GOARCH,
7171
GoCompiler: runtime.Compiler,
72-
})
72+
}
73+
data, err := json.MarshalIndent(info, "", " ")
7374
if err != nil {
7475
return nil, err
7576
}
@@ -91,7 +92,7 @@ func settingsCollector(settings setting.Provider) supportbundles.Collector {
9192
Default: true,
9293
Fn: func(ctx context.Context) (*supportbundles.SupportItem, error) {
9394
current := settings.Current()
94-
data, err := json.Marshal(current)
95+
data, err := json.MarshalIndent(current, "", " ")
9596
if err != nil {
9697
return nil, err
9798
}

grafana/public/app/features/support-bundles/SupportBundlesCreate.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,22 @@ export const SupportBundlesCreateUnconnected = ({
6666
{({ register, errors }) => {
6767
return (
6868
<>
69-
{collectors.map((component) => {
70-
return (
71-
<Field key={component.uid}>
72-
<Checkbox
73-
{...register(component.uid)}
74-
label={component.displayName}
75-
id={component.uid}
76-
description={component.description}
77-
defaultChecked={component.default}
78-
disabled={component.includedByDefault}
79-
/>
80-
</Field>
81-
);
82-
})}
69+
{[...collectors]
70+
.sort((a, b) => a.displayName.localeCompare(b.displayName))
71+
.map((component) => {
72+
return (
73+
<Field key={component.uid}>
74+
<Checkbox
75+
{...register(component.uid)}
76+
label={component.displayName}
77+
id={component.uid}
78+
description={component.description}
79+
defaultChecked={component.default}
80+
disabled={component.includedByDefault}
81+
/>
82+
</Field>
83+
);
84+
})}
8385
<HorizontalGroup>
8486
<Button type="submit">Create</Button>
8587
<LinkButton href="/support-bundles" variant="secondary">

0 commit comments

Comments
 (0)